From c4b73a8fd0a790fbd5844179e06550f39075d11f Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 6 May 2022 00:55:08 +0700 Subject: [PATCH] Fix UI for adding attributes (#1660) Signed-off-by: Andrey Sobolev --- plugins/view-assets/lang/en.json | 2 +- plugins/view-assets/lang/ru.json | 2 +- .../src/components/ClassAttributeBar.svelte | 2 +- .../src/components/CreateAttribute.svelte | 107 ++++++++---------- .../typeEditors/DateTypeEditor.svelte | 16 +-- 5 files changed, 62 insertions(+), 67 deletions(-) diff --git a/plugins/view-assets/lang/en.json b/plugins/view-assets/lang/en.json index 51006077ba..5f66ef05d5 100644 --- a/plugins/view-assets/lang/en.json +++ b/plugins/view-assets/lang/en.json @@ -36,6 +36,6 @@ "Type": "Type", "WithTime": "WithTime", "CreatingAttribute": "Creating an attribute", - "CreatingAttributeConfirm": "Do you want to create an attribute? It will not be possible to change or delete it." + "CreatingAttributeConfirm": "Warning: It will not be possible for now to change or delete created attribute." } } diff --git a/plugins/view-assets/lang/ru.json b/plugins/view-assets/lang/ru.json index ed792a2bf0..772bc57d67 100644 --- a/plugins/view-assets/lang/ru.json +++ b/plugins/view-assets/lang/ru.json @@ -24,7 +24,7 @@ "Type": "Тип", "WithTime": "Со временем", "CreatingAttribute": "Создание атрибута", - "CreatingAttributeConfirm": "Вы хотите создать атрибут? Изменить или удалить его будет невозможно", + "CreatingAttributeConfirm": "Предупреждение: Изменить или удалить аттрибут в текущей версии невозможно.", "MoveLeft": "Переместить влево", "MoveRight": "Переместить вправо", "MoveUp": "Переместить вверх", diff --git a/plugins/view-resources/src/components/ClassAttributeBar.svelte b/plugins/view-resources/src/components/ClassAttributeBar.svelte index 34ef29e48c..bf5ccd4abd 100644 --- a/plugins/view-resources/src/components/ClassAttributeBar.svelte +++ b/plugins/view-resources/src/components/ClassAttributeBar.svelte @@ -48,7 +48,7 @@ icon={IconAdd} size="small" action={() => { - showPopup(view.component.CreateAttribute, { _class: objectClass._id }, undefined, () => { + showPopup(view.component.CreateAttribute, { _class: objectClass._id }, 'top', () => { updateKeys(ignoreKeys) dispatch('update') }) diff --git a/plugins/view-resources/src/components/CreateAttribute.svelte b/plugins/view-resources/src/components/CreateAttribute.svelte index 198f4f9378..2ca408702d 100644 --- a/plugins/view-resources/src/components/CreateAttribute.svelte +++ b/plugins/view-resources/src/components/CreateAttribute.svelte @@ -14,12 +14,12 @@ --> -
+ { + dispatch('close') + }} +>
-
-
+
diff --git a/plugins/view-resources/src/components/typeEditors/DateTypeEditor.svelte b/plugins/view-resources/src/components/typeEditors/DateTypeEditor.svelte index 7b8f59c936..94ca6f9624 100644 --- a/plugins/view-resources/src/components/typeEditors/DateTypeEditor.svelte +++ b/plugins/view-resources/src/components/typeEditors/DateTypeEditor.svelte @@ -28,12 +28,14 @@ }) -
+