From aa87e0cb44683c8970bfc83b5ab9d164dd191c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Tkaczy=C5=84ski?= Date: Tue, 24 Sep 2024 09:42:09 +0200 Subject: [PATCH] feat: add Advanced settings for offchain spaces. (#789) * feat: add parent and sub-space settings * feat: add terms of services input * feat: add customDomain and isPrivate * feat: add DeleteSpace UI * feat: add support for deleteSpace action * feat: validate parent space * feat: add tooltips * fix: handle initial value validation * fix: validate parent or sub-space is not current space * fix: prevent duplicate sub-spaces * chore: fix typo actions -> action * fix: increase checkbox label gap * fix: use v2 external link icon * fix: remove danger border if button is disabled * chore: capitalize GitHub name * fix: add default values for computedAsync * feat: use inline validation * feat: allow parent and subspaces at the same time * feat: remove description from Advanced settings page * feat: inline Message icon * fix: show errors on customDomain field * feat: add custom message for self-parent * fix: use v-show for advanced To workaround https://github.com/snapshot-labs/sx-monorepo/issues/573 * feat: add basic domain validation * feat: add error when reaching maxmimum number of subspaces * fix: only show child limit error if it's not empty --- .changeset/sweet-papayas-provide.md | 5 + apps/ui/src/assets/icons/switch-disabled.svg | 3 + apps/ui/src/assets/icons/switch-enabled.svg | 3 + apps/ui/src/components/FormSpaceAdvanced.vue | 245 ++++++++++++++++++ apps/ui/src/components/Modal/DeleteSpace.vue | 73 ++++++ apps/ui/src/components/Ui/Checkbox.vue | 26 ++ .../src/components/Ui/ContainerSettings.vue | 13 +- apps/ui/src/components/Ui/InputString.vue | 2 + apps/ui/src/components/Ui/Message.vue | 29 +++ apps/ui/src/components/Ui/Switch.vue | 32 +++ apps/ui/src/components/Ui/WrapperInput.vue | 34 ++- apps/ui/src/composables/useActions.ts | 36 ++- .../composables/useSpaceInputValidation.ts | 60 +++++ apps/ui/src/composables/useSpaceSettings.ts | 79 +++++- apps/ui/src/helpers/validation.ts | 11 + apps/ui/src/networks/evm/actions.ts | 3 + apps/ui/src/networks/offchain/actions.ts | 6 + apps/ui/src/networks/starknet/actions.ts | 9 +- apps/ui/src/networks/types.ts | 1 + apps/ui/src/style.scss | 5 +- apps/ui/src/views/Space/Settings.vue | 43 ++- .../clients/offchain/ethereum-sig/index.ts | 19 ++ .../clients/offchain/ethereum-sig/types.ts | 8 + packages/sx.js/src/clients/offchain/types.ts | 13 + 24 files changed, 718 insertions(+), 40 deletions(-) create mode 100644 .changeset/sweet-papayas-provide.md create mode 100644 apps/ui/src/assets/icons/switch-disabled.svg create mode 100644 apps/ui/src/assets/icons/switch-enabled.svg create mode 100644 apps/ui/src/components/FormSpaceAdvanced.vue create mode 100644 apps/ui/src/components/Modal/DeleteSpace.vue create mode 100644 apps/ui/src/components/Ui/Checkbox.vue create mode 100644 apps/ui/src/components/Ui/Message.vue create mode 100644 apps/ui/src/components/Ui/Switch.vue create mode 100644 apps/ui/src/composables/useSpaceInputValidation.ts diff --git a/.changeset/sweet-papayas-provide.md b/.changeset/sweet-papayas-provide.md new file mode 100644 index 000000000..6d8253cbb --- /dev/null +++ b/.changeset/sweet-papayas-provide.md @@ -0,0 +1,5 @@ +--- +"@snapshot-labs/sx": patch +--- + +add deleteSpace method to offchain ethSig client diff --git a/apps/ui/src/assets/icons/switch-disabled.svg b/apps/ui/src/assets/icons/switch-disabled.svg new file mode 100644 index 000000000..cdd238f02 --- /dev/null +++ b/apps/ui/src/assets/icons/switch-disabled.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ui/src/assets/icons/switch-enabled.svg b/apps/ui/src/assets/icons/switch-enabled.svg new file mode 100644 index 000000000..bc6fe719e --- /dev/null +++ b/apps/ui/src/assets/icons/switch-enabled.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ui/src/components/FormSpaceAdvanced.vue b/apps/ui/src/components/FormSpaceAdvanced.vue new file mode 100644 index 000000000..54cdbfa17 --- /dev/null +++ b/apps/ui/src/components/FormSpaceAdvanced.vue @@ -0,0 +1,245 @@ + + + diff --git a/apps/ui/src/components/Modal/DeleteSpace.vue b/apps/ui/src/components/Modal/DeleteSpace.vue new file mode 100644 index 000000000..33e258b53 --- /dev/null +++ b/apps/ui/src/components/Modal/DeleteSpace.vue @@ -0,0 +1,73 @@ + + + diff --git a/apps/ui/src/components/Ui/Checkbox.vue b/apps/ui/src/components/Ui/Checkbox.vue new file mode 100644 index 000000000..143e6d5e6 --- /dev/null +++ b/apps/ui/src/components/Ui/Checkbox.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/ui/src/components/Ui/ContainerSettings.vue b/apps/ui/src/components/Ui/ContainerSettings.vue index 8c1ac7cc1..01e026c42 100644 --- a/apps/ui/src/components/Ui/ContainerSettings.vue +++ b/apps/ui/src/components/Ui/ContainerSettings.vue @@ -1,14 +1,21 @@