Skip to content

Commit

Permalink
[INLONG-11431][Dashboard] Add copy approval link to my application page
Browse files Browse the repository at this point in the history
  • Loading branch information
wohainilaodou committed Oct 29, 2024
1 parent 79d9430 commit 4d5d1ad
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions inlong-dashboard/src/ui/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@
"pages.Approvals.MyApproval": "我的审批",
"pages.Approvals.Type.Group": "申请数据流组",
"pages.Approvals.Type.Consume": "申请订阅",
"pages.Approvals.Copy": "复制审批地址",
"pages.ConsumeCreate.SubscriptionInformation": "订阅信息",
"pages.ConsumeCreate.Prev": "上一步",
"pages.ConsumeCreate.Next": "下一步",
Expand Down
1 change: 1 addition & 0 deletions inlong-dashboard/src/ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@
"pages.Approvals.MyApproval": "My approval",
"pages.Approvals.Type.Group": "Apply group",
"pages.Approvals.Type.Consume": "Apply subscription",
"pages.Approvals.Copy": "Copy Approval Address",
"pages.ConsumeCreate.SubscriptionInformation": "Subscription information",
"pages.ConsumeCreate.Prev": "Prev",
"pages.ConsumeCreate.Next": "Next",
Expand Down
32 changes: 27 additions & 5 deletions inlong-dashboard/src/ui/pages/Process/Applies/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import i18n from '@/i18n';
import { statusList, genStatusTag } from './status';
import { timestampFormat } from '@/core/utils';
import StatusTag from '@/ui/components/StatusTag';
import { Button } from 'antd';

export const getFilterFormContent = defaultValues => [
{
Expand Down Expand Up @@ -130,11 +131,32 @@ export const getColumns = activedName => [
dataIndex: 'action',
width: 100,
render: (text, record) => (
<Link
to={`/process/${activedName}/${record.id}?inlongGroupMode=${record.showInList?.[0]?.inlongGroupMode}`}
>
{i18n.t('basic.Detail')}
</Link>
<>
<Link
to={`/process/${activedName}/${record.id}?inlongGroupMode=${record.showInList?.[0]?.inlongGroupMode}`}
>
{i18n.t('basic.Detail')}
</Link>
{record.currentTasks.length > 0 && (
<Button
type="link"
onClick={() => {
const baseUrl = window.location.href.split('applies')[0];
const fullUrl =
baseUrl +
'approvals/' +
record?.id +
'/?taskId=' +
record?.currentTasks[0].id +
'&inlongGroupMode=' +
record?.showInList?.[0]?.inlongGroupMode;
setTimeout(() => navigator.clipboard.writeText(fullUrl), 0);
}}
>
{i18n.t('pages.Approvals.Copy')}
</Button>
)}
</>
),
},
];

0 comments on commit 4d5d1ad

Please sign in to comment.