Skip to content

Commit

Permalink
Merge pull request #725 from nickcdon/main
Browse files Browse the repository at this point in the history
⬆️ 前端依赖升级
  • Loading branch information
Faberiii committed Nov 30, 2022
2 parents 997a743 + 185800d commit b875d26
Show file tree
Hide file tree
Showing 42 changed files with 755 additions and 253 deletions.
2 changes: 1 addition & 1 deletion web/packages/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"react-i18next": "^11.17.3",
"react-redux": "^7.2.5",
"react-router-dom": "^5.3.0",
"tdesign-react": "0.42.3",
"tdesign-react": "0.42.6",
"universal-cookie": "^4.0.4"
},
"devDependencies": {
Expand Down
80 changes: 42 additions & 38 deletions web/packages/shared/component/notification/useNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,52 +39,56 @@ export interface NotificationProps {
/** 是否开启过期操作 */
useExpireOper?: boolean;
/** 通知其他参数 */
notifyArgs: Omit<ArgsProps, 'key'>
notifyArgs: Omit<ArgsProps, 'key'>;
/** 是否展示,默认展示 */
show?: boolean;
}

/** 通知hooks */
const useNotification = ({ key, type, useExpireOper = false, notifyArgs }: NotificationProps) => {
const useNotification = ({ key, type, show = true, useExpireOper = false, notifyArgs }: NotificationProps) => {
const { btn, ...rest } = notifyArgs;

useEffect(() => {
if (useExpireOper) {
const notifyStorageData = getNotificationDataByLocalStorage(key);
if (notifyStorageData?.neverRemind
|| (notifyStorageData?.expireTimestamp && Moment().valueOf() < notifyStorageData.expireTimestamp)
) {
return;
if (show) {
if (useExpireOper) {
const notifyStorageData = getNotificationDataByLocalStorage(key);
if (notifyStorageData?.neverRemind
|| (notifyStorageData?.expireTimestamp && Moment().valueOf() < notifyStorageData.expireTimestamp)
) {
return;
}
}
}

notification[type]({
duration: null,
btn: useExpireOper ? <Space>
<Button type="primary" size="small" onClick={() => {
// 明日凌点时间戳
const timestamp = Moment().startOf('day')
.add(1, 'day')
.valueOf();
const notifyStorageData: NotifyStorageData = {
neverRemind: false,
expireTimestamp: timestamp,
};
setNotificationDataToLocalStorage(key, notifyStorageData);
notification.close(key);
}}>
今日不再提醒
</Button>
<Button type="secondary" size="small" onClick={() => {
const notifyStorageData: NotifyStorageData = { neverRemind: true };
setNotificationDataToLocalStorage(key, notifyStorageData);
notification.close(key);
}}>
不再提醒
</Button>
</Space> : btn,
...rest,
key,
});
}, []);
notification[type]({
duration: null,
btn: useExpireOper ? <Space>
<Button type="primary" size="small" onClick={() => {
// 明日凌点时间戳
const timestamp = Moment().startOf('day')
.add(1, 'day')
.valueOf();
const notifyStorageData: NotifyStorageData = {
neverRemind: false,
expireTimestamp: timestamp,
};
setNotificationDataToLocalStorage(key, notifyStorageData);
notification.close(key);
}}>
今日不再提醒
</Button>
<Button type="secondary" size="small" onClick={() => {
const notifyStorageData: NotifyStorageData = { neverRemind: true };
setNotificationDataToLocalStorage(key, notifyStorageData);
notification.close(key);
}}>
不再提醒
</Button>
</Space> : btn,
...rest,
key,
});
}
}, [show]);
};

export default useNotification;
2 changes: 1 addition & 1 deletion web/packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"react-router-dom": "^5.3.0",
"react-copy-to-clipboard": "^5.0.4",
"react-i18next": "^11.17.3",
"tdesign-react": "0.42.3",
"tdesign-react": "0.42.6",
"typescript": "^4.5.5"
}
}
4 changes: 2 additions & 2 deletions web/packages/shared/util/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ export class FetchManager {
...custom,
});

postFile = (url: string, data: any, custom?: FetchCustomParams) => fetch(url, {
postFile = (url: string, data?: any, custom?: FetchCustomParams) => fetch(url, {
method: 'POST',
body: JSON.stringify(data),
body: data ? JSON.stringify(data) : null,
}, {
fileHandler: postFileResultHandler,
...this.custom,
Expand Down
5 changes: 3 additions & 2 deletions web/packages/tca-analysis/src/components/repos/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import CaretDown from 'coding-oa-uikit/lib/icon/CaretDown';
import LinkIcon from 'coding-oa-uikit/lib/icon/Link';
import ConfigIcon from 'coding-oa-uikit/lib/icon/Cog';

import Copy from '@tencent/micro-frontend-shared/component/copy';
// import Copy from '@tencent/micro-frontend-shared/component/copy';
import Copy from '../copy';
import { getRepoName } from '@tencent/micro-frontend-shared/tca/util';
import { getRepos } from '@src/services/common';
import { getReposRouter } from '@src/utils/getRoutePath';
Expand Down Expand Up @@ -137,7 +138,7 @@ const Repos = (props: IProps) => {
<CaretDown className={style.icon} />
</div>
</Dropdown>
<Copy text={`点击复制代码库ID:${curRepo.id}`} copyText={curRepo.id}/>
<Copy className={style.iconTipColor} text={`点击复制代码库ID:${curRepo.id}`} copyText={curRepo.id} />
{/* <Copy text={curRepo.scm_url} className={style.copyIcon} /> */}
<Tooltip title={<div style={{ wordBreak: 'break-all' }}>跳转代码库: {curRepo.scm_url}</div>}>
<a className={style.repoLink} target="_blank" href={curRepo.scm_url} rel="noreferrer">
Expand Down
4 changes: 4 additions & 0 deletions web/packages/tca-analysis/src/components/repos/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
}
}

.icon-tip-color {
color: $grey-7;
}

.repo-link {
color: $grey-7;
margin-left: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
import React from 'react';
import { Modal, Form, Input } from 'coding-oa-uikit';
import CompileTip from '@plat/modules/schemes/compile-tip';

interface CompileConfigProps {
visible: boolean;
Expand All @@ -33,6 +34,7 @@ const CompileConfig = ({ visible, data, onOk, onClose }: CompileConfigProps) =>
form.validateFields().then(onFinish);
}}
>
<CompileTip />
<Form
layout="vertical"
form={form}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getSchemeRouter, getSchemeBlankRouter } from '@src/utils/getRoutePath';

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

import style from './style.scss';

Expand Down Expand Up @@ -253,7 +253,6 @@ const CodeLint = (props: CodeLintProps) => {
</div>
<div className={style.footer}>
<a
target="_blank"
href={`${getSchemeBlankRouter(
orgSid,
teamName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ const CodeLint = (props: CodeLintProps) => {
</div>
<div className={style.footer}>
<a
target="_blank"
href={`${getTmplBlankRouter(
orgSid,
teamName,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const CompileTip = () => <></>;

export default CompileTip;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2021-2022 THL A29 Limited
//
// This source code file is made available under MIT License
// See LICENSE for details
// ==============================================================================

import CompileTip from '@src/plat/common/modules/schemes/compile-tip';

export default CompileTip;
62 changes: 32 additions & 30 deletions web/packages/tca-layout/public/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,50 +66,26 @@
"平台会在1-2个工作日内完成审核,请稍候": "平台会在1-2个工作日内完成审核,请稍候",
"联系电话为必填项": "联系电话为必填项",
"请输入合法的联系电话": "请输入合法的联系电话",
"接入指引": "接入指引",
"工具列表": "工具列表",
"工具依赖": "工具依赖",
"节点列表": "节点列表",
"标签列表": "标签列表",
"已更新节点": "已更新节点",
"更新节点": "更新节点",
"已更新该节点进程配置": "已更新该节点进程配置",
"节点信息": "节点信息",
"节点名称": "节点名称",
"节点名称为必填项": "节点名称为必填项",
"节点标签为必选项": "节点标签为必选项",
"节点可用性为必选项": "节点可用性为必选项",
"管理员为必填项": "管理员为必填项",
"管理员": "管理员",
"负责人": "负责人",
"关注人": "关注人",
"IP 地址": "IP 地址",
"节点状态": "节点状态",
"最近上报心跳": "最近上报心跳",
"所属标签": "所属标签",
"节点状态": "节点状态",
"工具进程": "工具进程",
"任务列表": "任务列表",
"执行任务列表": "执行任务列表",
"任务": "任务",
"子任务": "子任务",
"执行状态": "执行状态",
"已更新该节点进程配置": "已更新该节点进程配置",
"节点信息": "节点信息",
"负责人": "负责人",
"节点配置信息": "节点配置信息",
"可用内存:": "可用内存:",
"可用硬盘:": "可用硬盘:",
"节点工具进程配置": "节点工具进程配置",
"保存节点工具进程配置": "保存节点工具进程配置",
"工具": "工具",
"已更新标签信息": "已更新标签信息",
"已创建标签": "已创建标签",
"更新标签": "更新标签",
"添加标签": "添加标签",
"标签名称": "标签名称",
"展示名称": "展示名称",
"展示名称为必填项": "展示名称为必填项",
"类型": "类型",
"标签类型为必选项": "标签类型为必选项",
"标签描述": "标签描述",
"描述": "描述",
"其他操作": "其他操作",
"团队已禁用!": "团队已禁用!",
"禁用": "禁用",
"团队": "团队",
Expand Down Expand Up @@ -225,5 +201,31 @@
"表示该工具可自定义规则": "表示该工具可自定义规则",
"协同": "协同",
"由本团队创建的工具": "由本团队创建的工具",
"自定义": "自定义"
"自定义": "自定义",
"节点列表1": "节点列表1",
"已更新节点": "已更新节点",
"更新节点": "更新节点",
"节点名称为必填项": "节点名称为必填项",
"节点标签为必选项": "节点标签为必选项",
"节点可用性为必选项": "节点可用性为必选项",
"管理员为必填项": "管理员为必填项",
"管理员": "管理员",
"工具进程": "工具进程",
"任务列表": "任务列表",
"执行任务列表": "执行任务列表",
"任务": "任务",
"子任务": "子任务",
"执行状态": "执行状态",
"已更新标签信息": "已更新标签信息",
"已创建标签": "已创建标签",
"更新标签": "更新标签",
"添加标签": "添加标签",
"标签名称": "标签名称",
"展示名称": "展示名称",
"展示名称为必填项": "展示名称为必填项",
"类型": "类型",
"标签类型为必选项": "标签类型为必选项",
"标签描述": "标签描述",
"描述": "描述",
"其他操作": "其他操作"
}

0 comments on commit b875d26

Please sign in to comment.