From aa9ec04cc989ca8fd367043dafb3350b728486f8 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Thu, 18 Feb 2021 16:38:23 +0900 Subject: [PATCH] Divide ConfigCreationForm.vue into small components --- .../settings/ConfigCreationForm.vue | 331 ++++++------------ .../containers/settings/ConfigList.vue | 11 +- .../containers/settings/form/ConfigHeader.vue | 45 +++ .../settings/form/ConfigLabelMapping.vue | 91 +++++ .../settings/form/ConfigParameters.vue | 131 +++++++ .../settings/form/ConfigTemplate.vue | 131 +++++++ .../settings/form/ConfigTemplateName.vue | 71 ++++ .../settings/{ => form}/LabelMapping.vue | 21 +- .../settings/{ => form}/ObjectField.vue | 2 +- frontend/models/config/config-item-list.ts | 25 +- frontend/models/config/config-template.ts | 20 -- frontend/repositories/config/api.ts | 31 +- frontend/repositories/config/interface.ts | 8 +- frontend/rules/index.js | 6 + .../services/application/config.service.ts | 51 ++- 15 files changed, 717 insertions(+), 258 deletions(-) create mode 100644 frontend/components/containers/settings/form/ConfigHeader.vue create mode 100644 frontend/components/containers/settings/form/ConfigLabelMapping.vue create mode 100644 frontend/components/containers/settings/form/ConfigParameters.vue create mode 100644 frontend/components/containers/settings/form/ConfigTemplate.vue create mode 100644 frontend/components/containers/settings/form/ConfigTemplateName.vue rename frontend/components/containers/settings/{ => form}/LabelMapping.vue (92%) rename frontend/components/containers/settings/{ => form}/ObjectField.vue (99%) diff --git a/frontend/components/containers/settings/ConfigCreationForm.vue b/frontend/components/containers/settings/ConfigCreationForm.vue index 366519b7..b6e003ae 100644 --- a/frontend/components/containers/settings/ConfigCreationForm.vue +++ b/frontend/components/containers/settings/ConfigCreationForm.vue @@ -2,246 +2,105 @@ - - - Select a config template - - - - Configure parameters - - - - Test the config - - - - - - - - - -

Select a config template

-

- You can select the template to create the auto-labeling configuration. -

- -
+ + + + + + - -

Set parameters

-

- You can set parameters to fetch API response. -

- + -

Set mapping template

-

- You can set mapping template to convert API response to doccano format. -

- - -

Configure label mappings

-

- Once you fetch the API response, you can convert the label into the defined one. -

- -
- - -

Test the defined config

-

- Before saving the config, you need to test the defined config. - Please input sample text and press the Test button. -

- -

- Response -

- -
{{ JSON.stringify(response, null, 4) }}
-
- - - - {{ error }} - - - -
-
- - - - Prev - - - Next - - - Test - - - Save - - -
+
diff --git a/frontend/components/containers/settings/form/ConfigLabelMapping.vue b/frontend/components/containers/settings/form/ConfigLabelMapping.vue new file mode 100644 index 00000000..b215f44d --- /dev/null +++ b/frontend/components/containers/settings/form/ConfigLabelMapping.vue @@ -0,0 +1,91 @@ + + + diff --git a/frontend/components/containers/settings/form/ConfigParameters.vue b/frontend/components/containers/settings/form/ConfigParameters.vue new file mode 100644 index 00000000..9ade8aec --- /dev/null +++ b/frontend/components/containers/settings/form/ConfigParameters.vue @@ -0,0 +1,131 @@ + + + diff --git a/frontend/components/containers/settings/form/ConfigTemplate.vue b/frontend/components/containers/settings/form/ConfigTemplate.vue new file mode 100644 index 00000000..de26e6eb --- /dev/null +++ b/frontend/components/containers/settings/form/ConfigTemplate.vue @@ -0,0 +1,131 @@ + + + diff --git a/frontend/components/containers/settings/form/ConfigTemplateName.vue b/frontend/components/containers/settings/form/ConfigTemplateName.vue new file mode 100644 index 00000000..4049fcd0 --- /dev/null +++ b/frontend/components/containers/settings/form/ConfigTemplateName.vue @@ -0,0 +1,71 @@ + + + diff --git a/frontend/components/containers/settings/LabelMapping.vue b/frontend/components/containers/settings/form/LabelMapping.vue similarity index 92% rename from frontend/components/containers/settings/LabelMapping.vue rename to frontend/components/containers/settings/form/LabelMapping.vue index 74b392ce..dc7df520 100644 --- a/frontend/components/containers/settings/LabelMapping.vue +++ b/frontend/components/containers/settings/form/LabelMapping.vue @@ -104,7 +104,6 @@