Skip to content

Commit b875d26

Browse files
authored
Merge pull request #725 from nickcdon/main
⬆️ 前端依赖升级
2 parents 997a743 + 185800d commit b875d26

File tree

42 files changed

+755
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+755
-253
lines changed

web/packages/login/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"react-i18next": "^11.17.3",
4040
"react-redux": "^7.2.5",
4141
"react-router-dom": "^5.3.0",
42-
"tdesign-react": "0.42.3",
42+
"tdesign-react": "0.42.6",
4343
"universal-cookie": "^4.0.4"
4444
},
4545
"devDependencies": {

web/packages/shared/component/notification/useNotification.tsx

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -39,52 +39,56 @@ export interface NotificationProps {
3939
/** 是否开启过期操作 */
4040
useExpireOper?: boolean;
4141
/** 通知其他参数 */
42-
notifyArgs: Omit<ArgsProps, 'key'>
42+
notifyArgs: Omit<ArgsProps, 'key'>;
43+
/** 是否展示,默认展示 */
44+
show?: boolean;
4345
}
4446

4547
/** 通知hooks */
46-
const useNotification = ({ key, type, useExpireOper = false, notifyArgs }: NotificationProps) => {
48+
const useNotification = ({ key, type, show = true, useExpireOper = false, notifyArgs }: NotificationProps) => {
4749
const { btn, ...rest } = notifyArgs;
4850

4951
useEffect(() => {
50-
if (useExpireOper) {
51-
const notifyStorageData = getNotificationDataByLocalStorage(key);
52-
if (notifyStorageData?.neverRemind
53-
|| (notifyStorageData?.expireTimestamp && Moment().valueOf() < notifyStorageData.expireTimestamp)
54-
) {
55-
return;
52+
if (show) {
53+
if (useExpireOper) {
54+
const notifyStorageData = getNotificationDataByLocalStorage(key);
55+
if (notifyStorageData?.neverRemind
56+
|| (notifyStorageData?.expireTimestamp && Moment().valueOf() < notifyStorageData.expireTimestamp)
57+
) {
58+
return;
59+
}
5660
}
57-
}
5861

59-
notification[type]({
60-
duration: null,
61-
btn: useExpireOper ? <Space>
62-
<Button type="primary" size="small" onClick={() => {
63-
// 明日凌点时间戳
64-
const timestamp = Moment().startOf('day')
65-
.add(1, 'day')
66-
.valueOf();
67-
const notifyStorageData: NotifyStorageData = {
68-
neverRemind: false,
69-
expireTimestamp: timestamp,
70-
};
71-
setNotificationDataToLocalStorage(key, notifyStorageData);
72-
notification.close(key);
73-
}}>
74-
今日不再提醒
75-
</Button>
76-
<Button type="secondary" size="small" onClick={() => {
77-
const notifyStorageData: NotifyStorageData = { neverRemind: true };
78-
setNotificationDataToLocalStorage(key, notifyStorageData);
79-
notification.close(key);
80-
}}>
81-
不再提醒
82-
</Button>
83-
</Space> : btn,
84-
...rest,
85-
key,
86-
});
87-
}, []);
62+
notification[type]({
63+
duration: null,
64+
btn: useExpireOper ? <Space>
65+
<Button type="primary" size="small" onClick={() => {
66+
// 明日凌点时间戳
67+
const timestamp = Moment().startOf('day')
68+
.add(1, 'day')
69+
.valueOf();
70+
const notifyStorageData: NotifyStorageData = {
71+
neverRemind: false,
72+
expireTimestamp: timestamp,
73+
};
74+
setNotificationDataToLocalStorage(key, notifyStorageData);
75+
notification.close(key);
76+
}}>
77+
今日不再提醒
78+
</Button>
79+
<Button type="secondary" size="small" onClick={() => {
80+
const notifyStorageData: NotifyStorageData = { neverRemind: true };
81+
setNotificationDataToLocalStorage(key, notifyStorageData);
82+
notification.close(key);
83+
}}>
84+
不再提醒
85+
</Button>
86+
</Space> : btn,
87+
...rest,
88+
key,
89+
});
90+
}
91+
}, [show]);
8892
};
8993

9094
export default useNotification;

web/packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"react-router-dom": "^5.3.0",
4646
"react-copy-to-clipboard": "^5.0.4",
4747
"react-i18next": "^11.17.3",
48-
"tdesign-react": "0.42.3",
48+
"tdesign-react": "0.42.6",
4949
"typescript": "^4.5.5"
5050
}
5151
}

web/packages/shared/util/fetch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ export class FetchManager {
227227
...custom,
228228
});
229229

230-
postFile = (url: string, data: any, custom?: FetchCustomParams) => fetch(url, {
230+
postFile = (url: string, data?: any, custom?: FetchCustomParams) => fetch(url, {
231231
method: 'POST',
232-
body: JSON.stringify(data),
232+
body: data ? JSON.stringify(data) : null,
233233
}, {
234234
fileHandler: postFileResultHandler,
235235
...this.custom,

web/packages/tca-analysis/src/components/repos/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import CaretDown from 'coding-oa-uikit/lib/icon/CaretDown';
2020
import LinkIcon from 'coding-oa-uikit/lib/icon/Link';
2121
import ConfigIcon from 'coding-oa-uikit/lib/icon/Cog';
2222

23-
import Copy from '@tencent/micro-frontend-shared/component/copy';
23+
// import Copy from '@tencent/micro-frontend-shared/component/copy';
24+
import Copy from '../copy';
2425
import { getRepoName } from '@tencent/micro-frontend-shared/tca/util';
2526
import { getRepos } from '@src/services/common';
2627
import { getReposRouter } from '@src/utils/getRoutePath';
@@ -137,7 +138,7 @@ const Repos = (props: IProps) => {
137138
<CaretDown className={style.icon} />
138139
</div>
139140
</Dropdown>
140-
<Copy text={`点击复制代码库ID:${curRepo.id}`} copyText={curRepo.id}/>
141+
<Copy className={style.iconTipColor} text={`点击复制代码库ID:${curRepo.id}`} copyText={curRepo.id} />
141142
{/* <Copy text={curRepo.scm_url} className={style.copyIcon} /> */}
142143
<Tooltip title={<div style={{ wordBreak: 'break-all' }}>跳转代码库: {curRepo.scm_url}</div>}>
143144
<a className={style.repoLink} target="_blank" href={curRepo.scm_url} rel="noreferrer">

web/packages/tca-analysis/src/components/repos/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
}
4848
}
4949

50+
.icon-tip-color {
51+
color: $grey-7;
52+
}
53+
5054
.repo-link {
5155
color: $grey-7;
5256
margin-left: 10px;

web/packages/tca-analysis/src/modules/schemes/code-lint/compile-modal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
import React from 'react';
1111
import { Modal, Form, Input } from 'coding-oa-uikit';
12+
import CompileTip from '@plat/modules/schemes/compile-tip';
1213

1314
interface CompileConfigProps {
1415
visible: boolean;
@@ -33,6 +34,7 @@ const CompileConfig = ({ visible, data, onOk, onClose }: CompileConfigProps) =>
3334
form.validateFields().then(onFinish);
3435
}}
3536
>
37+
<CompileTip />
3638
<Form
3739
layout="vertical"
3840
form={form}

web/packages/tca-analysis/src/modules/schemes/code-lint/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { getSchemeRouter, getSchemeBlankRouter } from '@src/utils/getRoutePath';
3131

3232
import Filter from '@src/components/filter';
3333
import SelectBorderless from '@src/components/select-borderless';
34-
import CompileConfig from '@plat/modules/schemes/compile-modal';
34+
import CompileConfig from './compile-modal';
3535

3636
import style from './style.scss';
3737

@@ -253,7 +253,6 @@ const CodeLint = (props: CodeLintProps) => {
253253
</div>
254254
<div className={style.footer}>
255255
<a
256-
target="_blank"
257256
href={`${getSchemeBlankRouter(
258257
orgSid,
259258
teamName,

web/packages/tca-analysis/src/modules/template/code-lint/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ const CodeLint = (props: CodeLintProps) => {
288288
</div>
289289
<div className={style.footer}>
290290
<a
291-
target="_blank"
292291
href={`${getTmplBlankRouter(
293292
orgSid,
294293
teamName,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
3+
const CompileTip = () => <></>;
4+
5+
export default CompileTip;

0 commit comments

Comments
 (0)