Skip to content

Commit 0ad2e2d

Browse files
author
tingfuyeh
committed
fix: 如果没有deleteable默认可删除
1 parent d321603 commit 0ad2e2d

File tree

15 files changed

+111
-112
lines changed

15 files changed

+111
-112
lines changed

web/src/polaris/administration/accessLimiting/getColumns.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ export default ({ creators }: AccessLimitingDuck): Column<RateLimit>[] => [
9393
{
9494
id: 'modify',
9595
text: '编辑',
96-
disabled:!x.editable,
96+
disabled: !x.editable,
9797
fn: dispatch => {
9898
dispatch(creators.modify(x))
9999
},
100100
},
101101
{
102102
id: 'remove',
103103
text: '删除',
104-
disabled:!x.deleteable,
104+
disabled: x.deleteable === false,
105105
fn: dispatch => {
106106
dispatch(creators.delete(x))
107107
},

web/src/polaris/administration/breaker/faultDetect/getColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default (props: DuckCmpProps<FaultDetectDuck>): Column<FaultDetectRule>[]
8989
}}
9090
/>
9191
<Action
92-
disabled={!x.deleteable}
92+
disabled={x.deleteable === false}
9393
text={'删除'}
9494
fn={() => {
9595
dispatch(creators.remove(x))

web/src/polaris/administration/breaker/getColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default (props: DuckCmpProps<CircuitBreakerDuck>): Column<CircuitBreakerR
111111
}}
112112
/>
113113
<Action
114-
disabled={!x.deleteable}
114+
disabled={x.deleteable === false}
115115
text={'删除'}
116116
fn={() => {
117117
dispatch(creators.remove(x))

web/src/polaris/administration/dynamicRoute/customRoute/getColumns.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,32 +99,32 @@ export default (
9999
fn: (dispatch?: Dispatch<any>, e?) => void
100100
disabled: boolean
101101
}[] = [
102-
{
103-
id: 'switchStatus',
104-
text: x.enable ? '禁用' : '启用',
105-
fn: dispatch => {
106-
const swtichStatusAction = x.enable ? SwitchStatusAction.disable : SwitchStatusAction.start
107-
dispatch(creators.switchStatus(x.id, x.name, swtichStatusAction))
108-
},
109-
disabled: !x.editable,
102+
{
103+
id: 'switchStatus',
104+
text: x.enable ? '禁用' : '启用',
105+
fn: dispatch => {
106+
const swtichStatusAction = x.enable ? SwitchStatusAction.disable : SwitchStatusAction.start
107+
dispatch(creators.switchStatus(x.id, x.name, swtichStatusAction))
110108
},
111-
{
112-
id: 'modify',
113-
text: '编辑',
114-
fn: dispatch => {
115-
dispatch(creators.modify(x))
116-
},
117-
disabled: !x.editable,
109+
disabled: !x.editable,
110+
},
111+
{
112+
id: 'modify',
113+
text: '编辑',
114+
fn: dispatch => {
115+
dispatch(creators.modify(x))
118116
},
119-
{
120-
id: 'remove',
121-
text: '删除',
122-
fn: dispatch => {
123-
dispatch(creators.delete(x))
124-
},
125-
disabled: !x.deleteable,
117+
disabled: !x.editable,
118+
},
119+
{
120+
id: 'remove',
121+
text: '删除',
122+
fn: dispatch => {
123+
dispatch(creators.delete(x))
126124
},
127-
]
125+
disabled: x.deleteable === false,
126+
},
127+
]
128128
return (
129129
<React.Fragment>
130130
{actions.map(action => (

web/src/polaris/configuration/fileGroup/detail/file/Page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ function renderTree(props, folder, path: string, currPath: string) {
560560
>
561561
{'查看发布历史'}
562562
</List.Item>
563-
<List.Item onClick={() => handlers.delete(obj.name)} disabled={!deleteable}>
563+
<List.Item onClick={() => handlers.delete(obj.name)} disabled={deleteable === false}>
564564
删除
565565
</List.Item>
566566
</List>

web/src/polaris/configuration/fileGroup/detail/version/getColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default ({
6868
<Action fn={dispatch => dispatch(creators.rollback(x))} disabled={!editable || !!x.active}>
6969
{'回滚'}
7070
</Action>
71-
<Action fn={dispatch => dispatch(creators.delete(x))} disabled={!deleteable}>
71+
<Action fn={dispatch => dispatch(creators.delete(x))} disabled={deleteable === false}>
7272
{'删除'}
7373
</Action>
7474
</React.Fragment>

web/src/polaris/configuration/fileGroup/getColumns.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export default ({ duck: { creators } }: DuckCmpProps<ConfigFileGroupDuck>): Colu
6161
</Action>
6262
<Action
6363
fn={dispatch => dispatch(creators.remove(x))}
64-
disabled={!x.deleteable}
65-
tip={!x.deleteable ? '无权限' : '编辑'}
64+
disabled={x.deleteable === false}
65+
tip={x.deleteable === false ? '无权限' : '编辑'}
6666
>
6767
{'删除'}
6868
</Action>

web/src/polaris/namespace/getColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default ({ duck: { creators } }: DuckCmpProps<NamespacePageDuck>): Column
8585
<Action fn={dispatch => dispatch(creators.edit(x))} disabled={!x.editable} tip={'编辑'}>
8686
{'编辑'}
8787
</Action>
88-
<Action fn={dispatch => dispatch(creators.remove(x))} disabled={!x.deleteable} tip={'删除'}>
88+
<Action fn={dispatch => dispatch(creators.remove(x))} disabled={x.deleteable === false} tip={'删除'}>
8989
{'删除'}
9090
</Action>
9191
</React.Fragment>

web/src/polaris/service/detail/circuitBreaker/getColumns.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ export default ({ duck: { creators, selector }, store }: DuckCmpProps<RoutePageD
9696
</Action>
9797
<Action
9898
fn={dispatch => dispatch(creators.remove(x.id))}
99-
disabled={isReadOnly(namespace) || !deleteable}
100-
tip={isReadOnly(namespace) ? '该命名空间为只读的' : !deleteable ? '无写权限' : '删除'}
99+
disabled={isReadOnly(namespace) || deleteable === false}
100+
tip={isReadOnly(namespace) ? '该命名空间为只读的' : deleteable === false ? '无写权限' : '删除'}
101101
>
102102
<Icon type={'delete'}></Icon>
103103
</Action>

web/src/polaris/service/detail/instance/Page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ export default function ServiceInstancePage(props: DuckCmpProps<ServicePageDuck>
213213
style={{ marginRight: 10 }}
214214
button={
215215
<Button
216-
disabled={selection?.length === 0 || !deleteable}
217-
tooltip={selection?.length === 0 ? '请选择实例' : !deleteable ? '无写权限' : ''}
216+
disabled={selection?.length === 0 || deleteable === false}
217+
tooltip={selection?.length === 0 ? '请选择实例' : deleteable === false ? '无写权限' : ''}
218218
>
219219
其他操作
220220
</Button>

0 commit comments

Comments
 (0)