From 36406971b2697341dca8a6b53714862d33d11868 Mon Sep 17 00:00:00 2001 From: An Phi Date: Wed, 26 Oct 2022 01:00:25 -0400 Subject: [PATCH] studio: make explorer Copy Link point to element in workspace --- .../src/components/editor/side-bar/Explorer.tsx | 8 +++++--- .../src/components/editor/side-bar/ProjectOverview.tsx | 8 +++++--- .../src/stores/editor/StandardEditorMode.ts | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/legend-application-studio/src/components/editor/side-bar/Explorer.tsx b/packages/legend-application-studio/src/components/editor/side-bar/Explorer.tsx index 790f722d62..9c63339f0f 100644 --- a/packages/legend-application-studio/src/components/editor/side-bar/Explorer.tsx +++ b/packages/legend-application-studio/src/components/editor/side-bar/Explorer.tsx @@ -268,7 +268,7 @@ const ExplorerContextMenu = observer( ); } }; - const copyLinkToElementInViewerMode = (): void => { + const copyWorkspaceElementLink = (): void => { if (node) { applicationStore .copyTextToClipboard( @@ -279,7 +279,9 @@ const ExplorerContextMenu = observer( ), ) .then(() => - applicationStore.notifySuccess('Copied element link to clipboard'), + applicationStore.notifySuccess( + 'Copied workspace element link to clipboard', + ), ) .catch(applicationStore.alertUnhandledError); } @@ -333,7 +335,7 @@ const ExplorerContextMenu = observer( View in Project )} - + Copy Link diff --git a/packages/legend-application-studio/src/components/editor/side-bar/ProjectOverview.tsx b/packages/legend-application-studio/src/components/editor/side-bar/ProjectOverview.tsx index 42f0bd1503..9437012c20 100644 --- a/packages/legend-application-studio/src/components/editor/side-bar/ProjectOverview.tsx +++ b/packages/legend-application-studio/src/components/editor/side-bar/ProjectOverview.tsx @@ -71,11 +71,13 @@ const ShareProjectModal = observer( : applicationStore.navigator.generateAddress( generateViewProjectRoute(projectId), ); - const copyProjectLink = (): void => { + const copyProjectElementLink = (): void => { applicationStore .copyTextToClipboard(projectLink) .then(() => - applicationStore.notifySuccess('Copied project link to clipboard'), + applicationStore.notifySuccess( + 'Copied project element link to clipboard', + ), ) .catch(applicationStore.alertUnhandledError) .finally(() => closeModal()); @@ -136,7 +138,7 @@ const ShareProjectModal = observer( diff --git a/packages/legend-application-studio/src/stores/editor/StandardEditorMode.ts b/packages/legend-application-studio/src/stores/editor/StandardEditorMode.ts index dc041284b0..371c058ad5 100644 --- a/packages/legend-application-studio/src/stores/editor/StandardEditorMode.ts +++ b/packages/legend-application-studio/src/stores/editor/StandardEditorMode.ts @@ -15,7 +15,7 @@ */ import type { EditorStore } from '../EditorStore.js'; -import { generateViewEntityRoute } from '../LegendStudioRouter.js'; +import { generateEditorRoute } from '../LegendStudioRouter.js'; import { EditorMode } from './EditorMode.js'; export class StandardEditorMode extends EditorMode { @@ -27,8 +27,10 @@ export class StandardEditorMode extends EditorMode { } generateElementLink(elementPath: string): string { - return generateViewEntityRoute( + return generateEditorRoute( this.editorStore.sdlcState.activeProject.projectId, + this.editorStore.sdlcState.activeWorkspace.workspaceId, + this.editorStore.sdlcState.activeWorkspace.workspaceType, elementPath, ); }