Skip to content

Commit a6d0f4b

Browse files
committed
fix: module form URL field auto-filling
1 parent ffb42f1 commit a6d0f4b

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

ui/src/pages/modules/component/moduleForm/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ModuleForm = ({
2323
form.setFieldsValue({
2424
...formData,
2525
url: `${url?.Scheme}://${url?.Host}${url?.Path}`,
26-
doc: `${docUrl?.Scheme}://${docUrl?.Host}${docUrl?.Path}`,
26+
doc: (!docUrl?.Scheme && (!docUrl?.Host && !docUrl?.Path)) ? '' : `${docUrl?.Scheme}://${docUrl?.Host}${docUrl?.Path}`,
2727
})
2828
}
2929
}, [formData, form])

ui/src/pages/modules/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const ModulePage = () => {
162162
render: (_, record) => {
163163
return (
164164
<Space>
165-
{record?.doc?.Host && record?.doc?.Path ? (
165+
{record?.doc?.Host ? (
166166
<Button style={{ padding: '0px' }} type='link' href={`${record?.doc?.Scheme}://${record?.doc?.Host}${record?.doc?.Path}`} target='_blank'>doc</Button>
167167
) : (
168168
<Button style={{ padding: '0px' }} type='link' disabled>doc</Button>

ui/src/pages/workspaces/components/workspaceCard/index.tsx

+26-11
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,50 @@ const WorkspaceCard = ({ title, desc, nickName, createDate, onClick, onDelete, h
1212
return (
1313
<div className={styles.workspace_card}>
1414
<div className={styles.workspace_card_container}>
15-
<div className={styles.workspace_card_header}>
15+
<div className={styles.workspace_card_header} style={{cursor: 'pointer'}} onClick={onClick}>
1616
<div className={styles.workspace_card_header_left}>
1717
<div className={styles.workspace_card_icon}>
1818
<img src={workspaceSvg} alt="svgIcon" />
1919
</div>
2020
<div className={styles.workspace_card_title}>{title}</div>
2121
</div>
2222
<div>
23-
<Button type='link' onClick={() => handleEdit({
24-
name: title,
25-
description: desc,
26-
})}>
23+
<Button type='link' onClick={(e) => {
24+
e.stopPropagation();
25+
handleEdit({
26+
name: title,
27+
description: desc,
28+
});
29+
}}>
2730
<EditOutlined />
2831
</Button>
2932
<Popconfirm
30-
title="Delete the workspace"
31-
description="Are you sure to delete this workspace?"
33+
title={<span style={{fontSize: '18px'}}>Delete the workspace</span>}
34+
description={<span style={{fontSize: '16px'}}>Are you sure to delete this workspace?</span>}
3235
onConfirm={(event) => {
3336
event.stopPropagation()
3437
onDelete()
3538
}}
36-
okText="Yes"
37-
cancelText="No"
39+
onCancel={(e) => {
40+
e.stopPropagation()
41+
}}
42+
okText={<span style={{fontSize: '16px'}}>Yes</span>}
43+
cancelText={<span style={{fontSize: '16px'}}>No</span>}
44+
overlayStyle={{
45+
width: '330px'
46+
}}
47+
okButtonProps={{
48+
style: {height: '30px', width: '60px'}
49+
}}
50+
cancelButtonProps={{
51+
style: {height: '30px', width: '60px'}
52+
}}
3853
>
39-
<Button type='link' danger><DeleteOutlined /></Button>
54+
<Button type='link' danger onClick={(e) => e.stopPropagation()}><DeleteOutlined /></Button>
4055
</Popconfirm>
4156
</div>
4257
</div>
43-
<div className={styles.workspace_card_content} onClick={onClick}>
58+
<div className={styles.workspace_card_content} onClick={onClick} style={{cursor: 'pointer'}}>
4459
<Tooltip title={desc} placement="topLeft">
4560
<div className={styles.kusion_card_content_desc}>
4661
{desc}

ui/src/pages/workspaces/components/workspaceCard/styles.module.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
width: 20px;
3838
height: 20px;
3939
position: relative;
40-
top: 2px;
40+
top: 2.5px;
4141
}
4242

4343
.workspace_card_title {

0 commit comments

Comments
 (0)