Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge 1.0 to develop #219

Merged
merged 49 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0dbf040
label regex fourth change (#137)
hujiahao-hjh May 12, 2021
d2a094c
fix: delete useless nginx config (#139)
laojun May 12, 2021
4eaf98e
fix: show test set after first adding it (#136)
sherotree May 12, 2021
e3ee1c1
fix: modify the propertyType of import source to Select (#140)
sherotree May 12, 2021
dd4c8a4
update the sidebar and menu-head icons with the primary color (#141)
michael8512 May 12, 2021
515c10e
fix: incorrect repo type image path (#142)
daskyrk May 12, 2021
7a5042c
fix: can not fetch error counts during initialization (#143)
licao404 May 12, 2021
cb96b71
fix the sidebar icon problem in addon page (#145)
michael8512 May 12, 2021
431c545
Feature: go to workbench when the user view the public organization b…
sherotree May 12, 2021
c369c1e
fix: clear state of layout before initializing it, to fix sider menu…
sherotree May 13, 2021
0314a61
fix: error handler called twice & my publisher menu permission (#148)
daskyrk May 13, 2021
b598341
feat: replace menu-head icon with iconfont (#149)
michael8512 May 13, 2021
c0ace11
fix: modify the params of runtimeDetailRoot from applicationId to app…
sherotree May 13, 2021
fe83954
fix: fix test case export api with org (#152)
laojun May 13, 2021
9823d72
feat: add commit action 'update' (#153)
daskyrk May 13, 2021
8462c8a
get git address from server (#155)
hujiahao-hjh May 13, 2021
d5334ad
fix: update org after set block network (#154)
laojun May 13, 2021
a1bb827
add prefix to pk-table overwrite style (#157)
daskyrk May 13, 2021
197c9ad
fix sidebar menus error case by initLayout excute twice (#158)
laojun May 13, 2021
a9fc2be
fix: revert api section in test case (#159)
laojun May 13, 2021
09c6ea8
fix: adjust style (#160)
licao404 May 14, 2021
841e6a5
fix: set edit mode when click edit pipeline (#164)
laojun May 14, 2021
f8dd51b
Hotfix: display test set after adding it in first time (#163)
sherotree May 14, 2021
53d7c36
Hotfix: add relationID to queryParam, in order to batch export test c…
sherotree May 17, 2021
cb75a86
feat: add check detail in pipeline log (#166)
laojun May 17, 2021
dc9e82f
fix: fix rds database name regExp rule (#169)
laojun May 17, 2021
5064c8e
fix: fix batch copy test cases (#167)
sherotree May 17, 2021
827539a
feat: keep showing the border of selector which switch issue type (#168)
sherotree May 17, 2021
6345ba9
fix: fix test set menu error (#170)
laojun May 17, 2021
f58ea26
fix some upload problems (#173)
licao404 May 17, 2021
822642d
fix env list error in test case (#172)
laojun May 17, 2021
f0f6458
fix: fix pipeline record list active key (#175)
laojun May 17, 2021
096d69b
fix task status change bug (#174)
hujiahao-hjh May 17, 2021
c636883
fix: prevent import case modal data affected by outer search (#176)
daskyrk May 17, 2021
b281f53
fix: jump to public organization which user doesn't join (#178)
sherotree May 17, 2021
6479c8a
add working state to workflow of bug (#180)
michael8512 May 17, 2021
f6a7597
fix: update auth which from entryWorkBench to workBench) (#182)
sherotree May 17, 2021
a42d00d
fix: update dc (#185)
licao404 May 17, 2021
8ec419a
feat: fix error when estimateTime empty (#184)
Zero-Rock May 17, 2021
31d8bfe
no label add important (#186)
Zero-Rock May 17, 2021
6744890
fix: register module which have router data first (#187)
daskyrk May 18, 2021
9dbdc66
lock the page auth of role EdgeOps (#188)
michael8512 May 18, 2021
2a4bc62
fix: emit route subscriptions after update store (#190)
daskyrk May 18, 2021
9e5f429
fix: display inviteToOrg page (#189)
sherotree May 18, 2021
72d2de3
fix: jump to personal home page after leaving the organization (#191)
sherotree May 18, 2021
b890e13
route init error (#193)
laojun May 18, 2021
9778f0e
Feature: add executor field in execution record (#192)
sherotree May 18, 2021
67d54c1
merge hotfix/release1.0 to release 1.0 (#217)
laojun May 20, 2021
3105c19
feat: merge release 1.0 to develop
laojun May 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17,651 changes: 23 additions & 17,628 deletions core/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@terminus/nusi": "^3.10.79",
"antd": "^3.25.0",
"css-loader": "^5.0.1",
"cube-state": "^1.5.0",
"cube-state": "^1.5.1",
"i18next": "^17.0.13",
"immer": "^3.2.0",
"less": "^3.8.1",
Expand Down
6 changes: 4 additions & 2 deletions core/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { IGetRouter, registRouters } from './framework/regist-router';
import i18n, { initI18n } from './i18n';
import { setConfig } from './config';
import routeInfoStore from './stores/route';
import { emit } from './utils/event-hub';

const holderDractDom = ReactDom; // if not use it, minified build file will cause infinite loop when use ReactDom.render. errMsg: Cannot set property 'getCurrentStack' of undefined
const browserHistory = createBrowserHistory();
Expand All @@ -31,7 +32,7 @@ const App = () => {

React.useEffect(() => {
browserHistory.listen((loc) => {
routeInfoStore.reducers.$_updateRouteInfo(loc);
emit('@routeChange', routeInfoStore.reducers.$_updateRouteInfo(loc));
});
}, []);

Expand Down Expand Up @@ -78,7 +79,8 @@ export const registerModule = ({ key, stores, routers, locales, Root, NotFound }
}
if (routers) {
const routeData = registRouters(key, routers, { Root, NotFound });
routeInfoStore.reducers.$_updateRouteInfo(browserHistory.location, routeData);
const latestRouteInfo = routeInfoStore.reducers.$_updateRouteInfo(browserHistory.location, routeData);
emit('@routeChange', latestRouteInfo);
}

typeof cb === 'function' && cb();
Expand Down
7 changes: 4 additions & 3 deletions core/src/nusi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ import {
Ellipsis,
SelectCategory,
SelectCombo,
Switch as NusiSwitch,
ConfigProvider as NusiConfigProvider,
Tree as NusiTree,
Popover as NusiPopover,
Tree as NusiTree,
Popover as NusiPopover,
Select as NusiSelect,
Icon as NusiIcon,
Empty as NusiEmpty,
Expand Down Expand Up @@ -197,4 +198,4 @@ export {
NusiEmpty,
NusiCascader,
NusiTag,
}
};
1 change: 0 additions & 1 deletion core/src/stores/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ const routeInfoStore = createStore({
isEntering: (level: string) => routeMarks.includes(level) && !prevRouteInfo.routeMarks.includes(level),
isLeaving: (level: string) => !routeMarks.includes(level) && prevRouteInfo.routeMarks.includes(level),
};
emit('@routeChange', routeInfo);
return routeInfo;
},
},
Expand Down
1 change: 1 addition & 0 deletions core/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ module.exports = () => {
'./config': './src/config.ts',
'./stores/route': './src/stores/route.ts',
'./stores/loading': './src/stores/loading.ts',
'./utils/ws': './src/utils/ws.ts',
'./nusi':'./src/nusi/index.tsx',
},
shared: {
Expand Down
21 changes: 0 additions & 21 deletions nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,6 @@ server {
return 302 /-$request_uri;
}

location ^~ /uc {
index index.html;
try_files /static/uc/index.html /index.html =404;
}

location ^~ /api/uc {
proxy_pass http://${KRATOS_ADDR};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $my_scheme;
proxy_set_header Host $http_host;
}

location ^~ /api/uc/private {
proxy_pass http://${KRATOS_PRIVATE_ADDR};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $my_scheme;
proxy_set_header Host $http_host;
}

location /api/dice-env {
default_type application/javascript;
return 200 'window.diceEnv={
Expand Down
15 changes: 8 additions & 7 deletions shell/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ const start = (userData: ILoginUser) => {

const IconConfig = {
...DEFAULT_ICON_CONFIGS,
prefix: 'erda'
prefix: 'erda',
};

startApp().then(async (App) => {
// get the organization info first, or will get org is undefined when need org info (like issueStore)
if (!userData.isSysAdmin) {
const orgName = get(location.pathname.split('/'), '[1]');
await orgStore.effects.getOrgByDomain({ orgName });
}
[
import('layout/entry'),
import('org/entry'),
import('app/org-home/entry'),
import('workBench/entry'),
import('runtime/entry'),
Expand All @@ -60,15 +66,10 @@ const start = (userData: ILoginUser) => {
import('dataCenter/entry'),
import('user/entry'),
import('dcos/entry'),
import('org/entry'),
import('addonPlatform/entry'),
...Object.values(modules),
].forEach((p) => p.then(m => m.default(registerModule)));
userStore.reducers.setLoginUser(userData); // 需要在app start之前初始化用户信息
if (!userData.isSysAdmin) {
const orgName = get(location.pathname.split('/'), '[1]');
await orgStore.effects.getOrgByDomain({ orgName });
}
const Wrap = () => {
const currentLocale = getCurrentLocale();
return (
Expand Down Expand Up @@ -147,7 +148,7 @@ const init = (userData: ILoginUser) => {
window.location.href = lastPath;
return;
}
start({ ...userData })
start({ ...userData });
} else {
// 验证系统管理员相关路由
setSysAdminLocationByAuth({
Expand Down
21 changes: 10 additions & 11 deletions shell/app/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ import { getGlobal } from 'app/global-space';
import { some } from 'lodash';
import errorHandler from './error-handler';

/**
* set accept header
*/

const isExcludeOrgHeaderApi = (url) => {
const excludeApis = ['/api/files'];
Expand All @@ -40,12 +37,9 @@ function handleUrl(req) {

const curOrg = getOrgFromPath();
curOrg && req.set('org', curOrg);
// mf_share导出的模块内部会引用这里的agent,导致use方法被执行两次,添加markedOrg避免多次重复添加
if (!req.markedOrg && !isExcludeOrgHeaderApi(req.url)) {
if (!isExcludeOrgHeaderApi(req.url)) {
req.url = setApiWithOrg(req.url);
req.markedOrg = true;
}
return req;
}

function handleError(req) {
Expand Down Expand Up @@ -130,8 +124,13 @@ const reqKeyList = [];
// }
// }

agent.use(handleUrl);
agent.use(handelPagingNull);
agent.use(handleError);

// mf_share导出的模块内部会引用这里的agent,导致use方法被执行两次
agent.use(req => {
if (!req._marked) {
req._marked = true;
handleUrl(req);
handelPagingNull(req);
handleError(req);
}
});
export default agent;
19 changes: 19 additions & 0 deletions shell/app/common/components/edit-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
opacity: 0;
}

.switch-type-selector {
.ant-select-selection {
margin-right: 4px;
border-color: $color-border;

&:hover {
border-color: $color-active;

.ant-select-arrow-icon {
color: $color-active;
}
}
}

.ant-select-arrow-icon {
opacity: 1;
}
}

.member-selector {
.results {
border: 1px solid transparent;
Expand Down
7 changes: 4 additions & 3 deletions shell/app/common/components/markdown-editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import MdEditor from '@erda-ui/react-markdown-editor-lite';
import { itemInfo } from '@erda-ui/react-markdown-editor-lite/share/var';
import { EditorProps } from '@erda-ui/react-markdown-editor-lite/editor';
import UploadPlugin from './upload-plugin';
import commonStore from 'common/stores/common';
import { uploadFile } from '../../services';
import { convertToFormData } from 'common/utils';
import { getFormatter } from 'charts/utils';
import '@erda-ui/react-markdown-editor-lite/lib/index.css';
Expand All @@ -40,8 +40,9 @@ export const Editor = React.forwardRef((props: Omit<EditorProps, 'renderHTML'>,
newFile = new window.File([file], fileName, { type: file.type });
}
return new Promise(resolve => {
commonStore.effects.uploadFile(convertToFormData({ file: newFile }))
.then(({ size, url }) => {
uploadFile(convertToFormData({ file: newFile }))
.then((res) => {
const { size, url } = res?.data || {};
let imageUrl = imageText;
imageUrl = imageText.replace('{url}', url)
.replace(/\[(.+)\]/, `[${fileName}(${getFormatter('STORAGE', 'B').format(size)})]`);
Expand Down
4 changes: 2 additions & 2 deletions shell/app/common/utils/go-to.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const changeBrowserHistory = throttle((action, _path) => {
action === 'replace' ? history.replace(_path) : history.push(_path);
}, 1000, { trailing: false });

interface IOptions {
export interface IOptions {
[pathName: string]: any;
append?: boolean;
replace?: boolean;
Expand Down Expand Up @@ -97,7 +97,7 @@ const pathFormat = (url: string) => (params: object) => {
const lostArg = filter(necessaryArg, (arg: string) => params[arg] === undefined);
if (lostArg.length) {
// eslint-disable-next-line no-console
console.error('Jump missing parameters:', lostArg);
console.error('Jump missing parameters:', lostArg, `in url: ${url}`);
return undefined;
}
if (!_query) {
Expand Down
12 changes: 9 additions & 3 deletions shell/app/common/utils/query-string.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import queryString from 'query-string';
import { goTo } from './go-to';
import { goTo, IOptions as IGotoOptions } from './go-to';
import { pick } from 'lodash';

// 设置默认option,区分a=b和a[]=b的情况,也为了避免影响依赖中的queryString
Expand Down Expand Up @@ -78,8 +78,14 @@ export function mergeSearch(obj?: { [prop: string]: any }, toString?: boolean, i
* 合并参数并更新到当前url上
* @param obj 需合并的query对象
*/
export function updateSearch(search?: { [prop: string]: any }, opt?: Obj) {
goTo(`${location.pathname}?${mergeSearch(search, true, false, opt)}`);

interface IOpt {
gotoOption?: IGotoOptions;
[pro: string]: any;
}
export function updateSearch(search?: { [prop: string]: any }, opt?: IOpt) {
const { gotoOption = {}, ...rest } = opt || { };
goTo(`${location.pathname}?${mergeSearch(search, true, false, rest)}`, gotoOption);
}

/**
Expand Down
70 changes: 0 additions & 70 deletions shell/app/common/utils/ws.ts

This file was deleted.

2 changes: 1 addition & 1 deletion shell/app/config-page/components/list/list.spec.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ declare namespace CP_LIST {
rowKey?: string;
visible?: boolean;
size?: ISize;
useLoadMore?: boolean;
isLoadMore?: boolean;
alignCenter?: boolean;
noBorder?: boolean;
pageSizeOptions?: string[]
Expand Down
Loading