From 45a33a9b8950205debfba1f81630407db48c2083 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 30 Jul 2022 15:52:00 +0530 Subject: [PATCH] refactor(gui-v2): share view link correction and ui updates - icon color - link - toast on copy Signed-off-by: Pranav C --- .../smartsheet-toolbar/ShareView.vue | 20 ++++++++++++------- .../smartsheet-toolbar/SharedViewList.vue | 7 +------ .../nc-gui-v2/composables/useDashboard.ts | 10 ++++++++++ 3 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 packages/nc-gui-v2/composables/useDashboard.ts diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue index 74f6b3c48c..75081e55fe 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue @@ -15,6 +15,7 @@ const { view, $api } = useSmartsheetStoreOrThrow() const { copy } = useClipboard() const toast = useToast() const { $e } = useNuxtApp() +const { dashboardUrl } = useDashboard() let showShareModel = $ref(false) const passwordProtected = $ref(false) @@ -57,7 +58,7 @@ const sharedViewUrl = computed(() => { } // todo: get dashboard url - return `#/nc/${viewType}/${shared.value.uuid}` + return `${dashboardUrl?.value}/nc/${viewType}/${shared.value.uuid}` }) async function saveAllowCSVDownload() { @@ -91,6 +92,11 @@ const saveShareLinkPassword = async () => { $e('a:view:share:enable-pwd') } + +const copyLink = () => { + copy(sharedViewUrl?.value as string) + toast.info('Copied to clipboard') +}