Checkboxes 快速编辑、删除,判断优化 (#1843)

* Checkboxes 快速编辑、删除,判断优化

* snapshot

* fix
This commit is contained in:
RickCole 2021-04-22 10:54:31 +08:00 committed by GitHub
parent 80434a12ec
commit 840e8e8faf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ import Checkbox from '../../components/Checkbox';
import chunk from 'lodash/chunk';
import {Icon} from '../../components/icons';
import {Api} from '../../types';
import {autobind} from '../../utils/helper';
import {autobind, hasAbility} from '../../utils/helper';
/**
*
@ -165,7 +165,7 @@ export default class CheckboxesControl extends React.Component<
description={option.description}
>
{String(option[labelField || 'label'])}
{removable ? (
{removable && hasAbility(option, 'removable') ? (
<a data-tooltip={__('Select.clear')} data-position="left">
<Icon
icon="minus"
@ -174,7 +174,7 @@ export default class CheckboxesControl extends React.Component<
/>
</a>
) : null}
{editable ? (
{editable && hasAbility(option, 'editable') ? (
<a data-tooltip="编辑" data-position="left">
<Icon
icon="pencil"