juzhiyuan commented on a change in pull request #1402:
URL: https://github.com/apache/apisix-dashboard/pull/1402#discussion_r568431594
##########
File path: web/src/components/Plugin/PluginDetail.tsx
##########
@@ -174,24 +178,49 @@ const PluginDetail: React.FC<Props> = ({
<Button onClick={onClose} key={1}>
{formatMessage({ id: 'component.global.cancel' })}
</Button>
- <Button
- key={2}
- type="primary"
- onClick={() => {
- try {
- const editorData =
JSON.parse(ref.current?.editor.getValue());
- validateData(name, editorData).then((value) => {
- onChange({ formData: form.getFieldsValue(),
codemirrorData: value });
- });
- } catch (error) {
- notification.error({
- message: 'Invalid JSON data',
+ <Space>
+ <Popconfirm
+ title={formatMessage({ id:
'page.plugin.drawer.popconfirm.title.delete' })}
+ okText={formatMessage({ id: 'component.global.confirm' })}
+ cancelText={formatMessage({ id: 'component.global.cancel' })}
+ onConfirm={() => {
+ const plugins = omit(initialData, [`${name}`]);
Review comment:
```suggestion
const plugins = omit(initialData, name);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]