diff --git a/.changeset/happy-ears-cheer.md b/.changeset/happy-ears-cheer.md new file mode 100644 index 0000000000..ebe645ea5b --- /dev/null +++ b/.changeset/happy-ears-cheer.md @@ -0,0 +1,8 @@ +--- +'@finos/legend-extension-store-service-store': patch +'@finos/legend-extension-dsl-persistence': patch +'@finos/legend-extension-dsl-data-space': patch +'@finos/legend-extension-dsl-diagram': patch +'@finos/legend-extension-dsl-mastery': patch +'@finos/legend-extension-dsl-text': patch +--- diff --git a/.changeset/sour-games-retire.md b/.changeset/sour-games-retire.md new file mode 100644 index 0000000000..20e218973e --- /dev/null +++ b/.changeset/sour-games-retire.md @@ -0,0 +1,5 @@ +--- +'@finos/legend-application-studio': minor +--- + +**BREAKING CHANGES** Group new element dropdown by category diff --git a/packages/legend-application-studio/src/components/editor/side-bar/CreateNewElementModal.tsx b/packages/legend-application-studio/src/components/editor/side-bar/CreateNewElementModal.tsx index 58e6b46ada..1b921ac367 100644 --- a/packages/legend-application-studio/src/components/editor/side-bar/CreateNewElementModal.tsx +++ b/packages/legend-application-studio/src/components/editor/side-bar/CreateNewElementModal.tsx @@ -29,7 +29,7 @@ import { } from '../../../stores/editor/NewElementState.js'; import { Dialog, compareLabelFn, CustomSelectorInput } from '@finos/legend-art'; import type { EditorStore } from '../../../stores/editor/EditorStore.js'; -import { prettyCONSTName } from '@finos/legend-shared'; +import { prettyCONSTName, toTitleCase } from '@finos/legend-shared'; import type { DSL_LegendStudioApplicationPlugin_Extension } from '../../../stores/LegendStudioApplicationPlugin.js'; import { useEditorStore } from '../EditorStoreProvider.js'; import { @@ -552,6 +552,7 @@ export const CreateNewElementModal = observer(() => { const applicationStore = useApplicationStore(); const newElementState = editorStore.newElementState; const selectedPackage = newElementState.selectedPackage; + const elementLabel = getElementTypeLabel(editorStore, newElementState.type); // Name const name = newElementState.name; const handleNameChange: React.ChangeEventHandler = ( @@ -615,8 +616,8 @@ export const CreateNewElementModal = observer(() => { className="modal modal--dark search-modal" >
- {`Create a New ${ - getElementTypeLabel(editorStore, newElementState.type) ?? 'element' + {`Create a new ${ + elementLabel ? toTitleCase(elementLabel) : 'element' }`}
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 8bb6f2f135..9ae85bfa54 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 @@ -123,7 +123,10 @@ import { getPackageableElementOptionFormatter, type PackageableElementOption, } from '@finos/legend-lego/graph-editor'; -import { PACKAGEABLE_ELEMENT_TYPE } from '../../../stores/editor/utils/ModelClassifierUtils.js'; +import { + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, + PACKAGEABLE_ELEMENT_TYPE, +} from '../../../stores/editor/utils/ModelClassifierUtils.js'; import { useLegendStudioApplicationStore } from '../../LegendStudioFrameworkProvider.js'; import { queryClass } from '../editor-group/uml-editor/ClassQueryBuilder.js'; import { createViewSDLCProjectHandler } from '../../../stores/editor/DependencyProjectViewerHelper.js'; @@ -498,14 +501,16 @@ const ExplorerContextMenu = observer( ? node.packageableElement : undefined : editorStore.graphManagerState.graph.root; - const elementTypes = ([PACKAGEABLE_ELEMENT_TYPE.PACKAGE] as string[]) - .concat(editorStore.getSupportedElementTypes()) - .filter( - // NOTE: we can only create package in root - (type) => - _package !== editorStore.graphManagerState.graph.root || - type === PACKAGEABLE_ELEMENT_TYPE.PACKAGE, - ); + + const elementTypesWithCategory = + _package === editorStore.graphManagerState.graph.root + ? new Map([ + [ + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.MODEL, + [PACKAGEABLE_ELEMENT_TYPE.PACKAGE], + ], + ]) + : editorStore.supportedElementTypesWithCategory; // actions const buildQuery = editorStore.applicationStore.guardUnhandledError( @@ -795,15 +800,27 @@ const ExplorerContextMenu = observer( if (_package && !isReadOnly) { return ( - {elementTypes.map((type) => ( - - - {getElementTypeIcon(type, editorStore)} - - - New {toTitleCase(getElementTypeLabel(editorStore, type))}... - - + {Array.from(elementTypesWithCategory.entries()).map((entry) => ( +
+
+ {entry[0]} +
+
+ {entry[1].map((type) => ( + + + {getElementTypeIcon(type, editorStore)} + + + {toTitleCase(getElementTypeLabel(editorStore, type))} + + + ))} +
+
))} {node && ( <> @@ -1053,26 +1070,39 @@ const ExplorerDropdownMenu = observer(() => { (): void => editorStore.newElementState.openModal(type, _package); - const elementTypes = ([PACKAGEABLE_ELEMENT_TYPE.PACKAGE] as string[]) - .concat(editorStore.getSupportedElementTypes()) - .filter( - // NOTE: we can only create package in root - (type) => - _package !== editorStore.graphManagerState.graph.root || - type === PACKAGEABLE_ELEMENT_TYPE.PACKAGE, - ); + const elementTypesWithCategory = + _package === editorStore.graphManagerState.graph.root + ? new Map([ + [ + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.MODEL, + [PACKAGEABLE_ELEMENT_TYPE.PACKAGE], + ], + ]) + : editorStore.supportedElementTypesWithCategory; return ( - {elementTypes.map((type) => ( - - - {getElementTypeIcon(type, editorStore)} - - - New {toTitleCase(getElementTypeLabel(editorStore, type))}... - - + {Array.from(elementTypesWithCategory.entries()).map((entry) => ( +
+
+ {entry[0]} +
+
+ {entry[1].map((type) => ( + + + {getElementTypeIcon(type, editorStore)} + + + {toTitleCase(getElementTypeLabel(editorStore, type))} + + + ))} +
+
))}
); diff --git a/packages/legend-application-studio/src/components/editor/side-bar/__tests__/CreateNewElement.test.tsx b/packages/legend-application-studio/src/components/editor/side-bar/__tests__/CreateNewElement.test.tsx index 4a59019b6a..ecaa2f719f 100644 --- a/packages/legend-application-studio/src/components/editor/side-bar/__tests__/CreateNewElement.test.tsx +++ b/packages/legend-application-studio/src/components/editor/side-bar/__tests__/CreateNewElement.test.tsx @@ -40,7 +40,7 @@ const addRootPackage = async ( ): Promise => { fireEvent.click(result.getByTitle('New Element...', { exact: false })); const contextMenu = await waitFor(() => result.getByRole('menu')); - fireEvent.click(getByText(contextMenu, 'New Package...')); + fireEvent.click(getByText(contextMenu, 'Package')); const modal = result.getByTestId(LEGEND_STUDIO_TEST_ID.NEW_ELEMENT_MODAL); const packageInput = getByPlaceholderText(modal, 'Enter a name', { exact: false, @@ -64,7 +64,7 @@ const createNewElementOnRootPackage = async ( fireEvent.contextMenu(pkgContainer); const contextMenu = await waitFor(() => result.getByRole('menu')); fireEvent.click( - getByText(contextMenu, `New ${toTitleCase(elementType.toLowerCase())}...`), + getByText(contextMenu, `${toTitleCase(elementType.toLowerCase())}`), ); const modal = result.getByTestId(LEGEND_STUDIO_TEST_ID.NEW_ELEMENT_MODAL); const elementInput = getByPlaceholderText(modal, 'Enter a name', { diff --git a/packages/legend-application-studio/src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx b/packages/legend-application-studio/src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx index de2fc0202f..d49f8545ea 100644 --- a/packages/legend-application-studio/src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-application-studio/src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx @@ -90,6 +90,7 @@ import type { NewElementState, } from '../../stores/editor/NewElementState.js'; import type { PureGrammarTextSuggestion } from '@finos/legend-lego/code-editor'; +import { PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY } from '../../stores/editor/utils/ModelClassifierUtils.js'; const SCHEMA_SET_ELEMENT_TYPE = 'SCHEMASET'; const SCHEMA_SET_ELEMENT_PROJECT_EXPLORER_DND_TYPE = @@ -148,6 +149,15 @@ export class DSL_ExternalFormat_LegendStudioApplicationPlugin return [SCHEMA_SET_ELEMENT_TYPE, BINDING_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.EXTERNAL_FORMAT, + [SCHEMA_SET_ELEMENT_TYPE, BINDING_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => { diff --git a/packages/legend-application-studio/src/index.ts b/packages/legend-application-studio/src/index.ts index be22ae9cac..685d1e1eb8 100644 --- a/packages/legend-application-studio/src/index.ts +++ b/packages/legend-application-studio/src/index.ts @@ -98,6 +98,7 @@ export { generateServiceManagementUrl } from './stores/editor/editor-state/eleme export { ServicePureExecutionState } from './stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js'; export { NewServiceModal } from './components/editor/editor-group/service-editor/NewServiceModal.js'; export { FileSystem_File as GenerationFile } from './stores/editor/utils/FileSystemTreeUtils.js'; +export { PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY } from './stores/editor/utils/ModelClassifierUtils.js'; export { FileGenerationState, GeneratedFileStructureState, diff --git a/packages/legend-application-studio/src/stores/LegendStudioApplicationPlugin.ts b/packages/legend-application-studio/src/stores/LegendStudioApplicationPlugin.ts index 7b4dadfd83..f8b23cf815 100644 --- a/packages/legend-application-studio/src/stores/LegendStudioApplicationPlugin.ts +++ b/packages/legend-application-studio/src/stores/LegendStudioApplicationPlugin.ts @@ -234,6 +234,11 @@ export interface DSL_LegendStudioApplicationPlugin_Extension */ getExtraSupportedElementTypes?(): string[]; + /** + * Get the Map of the supported packageable element type specifiers with its category. + */ + getExtraSupportedElementTypesWithCategory?(): Map; + /** * Get the list of classifiers for a packageable element. */ diff --git a/packages/legend-application-studio/src/stores/editor/EditorStore.ts b/packages/legend-application-studio/src/stores/editor/EditorStore.ts index 2221f5bae1..4a3adf7449 100644 --- a/packages/legend-application-studio/src/stores/editor/EditorStore.ts +++ b/packages/legend-application-studio/src/stores/editor/EditorStore.ts @@ -93,7 +93,10 @@ import { LEGEND_STUDIO_APP_EVENT } from '../../__lib__/LegendStudioEvent.js'; import type { EditorMode } from './EditorMode.js'; import { StandardEditorMode } from './StandardEditorMode.js'; import { WorkspaceUpdateConflictResolutionState } from './sidebar-state/WorkspaceUpdateConflictResolutionState.js'; -import { PACKAGEABLE_ELEMENT_TYPE } from './utils/ModelClassifierUtils.js'; +import { + PACKAGEABLE_ELEMENT_TYPE, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, +} from './utils/ModelClassifierUtils.js'; import { GlobalTestRunnerState } from './sidebar-state/testable/GlobalTestRunnerState.js'; import type { LegendStudioApplicationStore } from '../LegendStudioBaseStore.js'; import { EmbeddedQueryBuilderState } from './EmbeddedQueryBuilderState.js'; @@ -188,6 +191,7 @@ export class EditorStore implements CommandRegistrar { snap: 150, }); readonly tabManagerState = new EditorTabManagerState(this); + supportedElementTypesWithCategory: Map; constructor( applicationStore: LegendStudioApplicationStore, @@ -285,6 +289,8 @@ export class EditorStore implements CommandRegistrar { ) .map((creator) => creator(this)) .filter(isNonNullable); + this.supportedElementTypesWithCategory = + this.getSupportedElementTypesWithCategory(); } get isInitialized(): boolean { @@ -926,6 +932,133 @@ export class EditorStore implements CommandRegistrar { } } + getSupportedElementTypesWithCategory(): Map { + const elementTypesWithCategoryMap = new Map(); + Object.values(PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY).forEach((value) => { + switch (value) { + case PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.MODEL: { + const elements = [ + PACKAGEABLE_ELEMENT_TYPE.PACKAGE, + PACKAGEABLE_ELEMENT_TYPE.CLASS, + PACKAGEABLE_ELEMENT_TYPE.ASSOCIATION, + PACKAGEABLE_ELEMENT_TYPE.ENUMERATION, + PACKAGEABLE_ELEMENT_TYPE.PROFILE, + PACKAGEABLE_ELEMENT_TYPE.FUNCTION, + PACKAGEABLE_ELEMENT_TYPE.MEASURE, + PACKAGEABLE_ELEMENT_TYPE.DATA, + ] as string[]; + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.MODEL, + elements, + ); + break; + } + case PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.STORE: { + const elements = [ + PACKAGEABLE_ELEMENT_TYPE.DATABASE, + PACKAGEABLE_ELEMENT_TYPE.FLAT_DATA_STORE, + ] as string[]; + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.STORE, + elements, + ); + break; + } + case PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.QUERY: { + const elements = [ + PACKAGEABLE_ELEMENT_TYPE.CONNECTION, + PACKAGEABLE_ELEMENT_TYPE.RUNTIME, + PACKAGEABLE_ELEMENT_TYPE.MAPPING, + PACKAGEABLE_ELEMENT_TYPE.SERVICE, + this.applicationStore.config.options + .TEMPORARY__enableLocalConnectionBuilder + ? PACKAGEABLE_ELEMENT_TYPE.TEMPORARY__LOCAL_CONNECTION + : undefined, + ] as (string | undefined)[]; + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.QUERY, + elements.filter(isNonNullable), + ); + break; + } + // for displaying categories in order + case PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.EXTERNAL_FORMAT: { + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.EXTERNAL_FORMAT, + [], + ); + break; + } + case PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.GENERATION: { + const elements = [ + PACKAGEABLE_ELEMENT_TYPE.FILE_GENERATION, + PACKAGEABLE_ELEMENT_TYPE.GENERATION_SPECIFICATION, + ] as string[]; + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.GENERATION, + elements, + ); + break; + } + // for displaying categories in order + case PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.OTHER: { + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.OTHER, + [], + ); + break; + } + default: + break; + } + }); + const extensions = this.pluginManager + .getApplicationPlugins() + .flatMap( + (plugin) => + ( + plugin as DSL_LegendStudioApplicationPlugin_Extension + ).getExtraSupportedElementTypesWithCategory?.() ?? + new Map(), + ); + const elementTypesWithCategoryMapFromExtensions = new Map< + string, + string[] + >(); + extensions.forEach((typeCategoryMap) => { + Array.from(typeCategoryMap.entries()).forEach((entry) => { + const [key, value] = entry; + elementTypesWithCategoryMapFromExtensions.set( + key, + elementTypesWithCategoryMapFromExtensions.get(key) === undefined + ? [...value] + : [ + ...guaranteeNonNullable( + elementTypesWithCategoryMapFromExtensions.get(key), + ), + ...value, + ], + ); + }); + }); + // sort extensions alphabetically and insert extensions into the base elementTypesWithCategoryMap + Array.from(elementTypesWithCategoryMapFromExtensions.entries()).forEach( + (entry) => { + const [key, value] = entry; + value.sort((a, b) => a.localeCompare(b)); + const existingValues = elementTypesWithCategoryMap.get(key); + elementTypesWithCategoryMap.set( + key, + existingValues === undefined + ? [...value] + : [...guaranteeNonNullable(existingValues), ...value], + ); + }, + ); + + return elementTypesWithCategoryMap; + } + getSupportedElementTypes(): string[] { return ( [ diff --git a/packages/legend-application-studio/src/stores/editor/utils/ModelClassifierUtils.ts b/packages/legend-application-studio/src/stores/editor/utils/ModelClassifierUtils.ts index 4e55b823fc..f7cec42818 100644 --- a/packages/legend-application-studio/src/stores/editor/utils/ModelClassifierUtils.ts +++ b/packages/legend-application-studio/src/stores/editor/utils/ModelClassifierUtils.ts @@ -73,3 +73,12 @@ export enum PACKAGEABLE_ELEMENT_TYPE { TEMPORARY__LOCAL_CONNECTION = 'LOCAL_CONNECTION', INTERNAL__UNKNOWN = 'UNKNOWN', } + +export enum PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY { + MODEL = 'Model', + STORE = 'Store', + QUERY = 'Query', + EXTERNAL_FORMAT = 'External Format', + GENERATION = 'Generation', + OTHER = 'Other', +} diff --git a/packages/legend-application-studio/style/components/editor/_editor-group.scss b/packages/legend-application-studio/style/components/editor/_editor-group.scss index c4abbf62f6..23b20eb981 100644 --- a/packages/legend-application-studio/style/components/editor/_editor-group.scss +++ b/packages/legend-application-studio/style/components/editor/_editor-group.scss @@ -200,6 +200,12 @@ background: var(--color-dark-grey-100); } + &__option__group__options--center { + justify-content: center; + display: flex; + flex-direction: column; + } + &__option { @include flexCenter; diff --git a/packages/legend-extension-dsl-data-space/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx b/packages/legend-extension-dsl-data-space/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx index f0c6afe208..6541ce7111 100644 --- a/packages/legend-extension-dsl-data-space/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-extension-dsl-data-space/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx @@ -34,6 +34,7 @@ import { type ExplorerContextMenuItemRendererConfiguration, type EditorExtensionStateBuilder, type EditorExtensionComponentRendererConfiguration, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio'; import { PackageableElementExplicitReference, @@ -113,6 +114,15 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin return [DATA_SPACE_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.QUERY, + [DATA_SPACE_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => { diff --git a/packages/legend-extension-dsl-diagram/src/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.tsx b/packages/legend-extension-dsl-diagram/src/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.tsx index 0def4c9ed3..f33684255f 100644 --- a/packages/legend-extension-dsl-diagram/src/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-extension-dsl-diagram/src/components/studio/DSL_Diagram_LegendStudioApplicationPlugin.tsx @@ -34,6 +34,7 @@ import { type PureGrammarParserElementDocumentationGetter, type PureGrammarParserKeywordSuggestionGetter, type PureGrammarParserElementSnippetSuggestionsGetter, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio'; import { ShapesIcon } from '@finos/legend-art'; import type { Class, PackageableElement } from '@finos/legend-graph'; @@ -106,6 +107,15 @@ export class DSL_Diagram_LegendStudioApplicationPlugin return [DIAGRAM_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.MODEL, + [DIAGRAM_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => { diff --git a/packages/legend-extension-dsl-mastery/src/components/studio/DSL_Mastery_LegendStudioApplicationPlugin.tsx b/packages/legend-extension-dsl-mastery/src/components/studio/DSL_Mastery_LegendStudioApplicationPlugin.tsx index c2b2d2d4ac..973aa1d026 100644 --- a/packages/legend-extension-dsl-mastery/src/components/studio/DSL_Mastery_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-extension-dsl-mastery/src/components/studio/DSL_Mastery_LegendStudioApplicationPlugin.tsx @@ -31,6 +31,7 @@ import { type ElementTypeLabelGetter, LegendStudioApplicationPlugin, UnsupportedElementEditorState, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio'; import { MasterRecordDefinition } from '../../graph/metamodel/pure/model/packageableElements/mastery/DSL_Mastery_MasterRecordDefinition.js'; import { SIMPLE_MASTER_RECORD_DEFINITION_SNIPPET } from '../../__lib__/studio/DSL_Mastery_LegendStudioCodeSnippet.js'; @@ -59,6 +60,15 @@ export class DSL_Mastery_LegendStudioApplicationPlugin return [MASTERY_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.GENERATION, + [MASTERY_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => { diff --git a/packages/legend-extension-dsl-persistence/src/components/studio/DSL_Persistence_LegendStudioApplicationPlugin.tsx b/packages/legend-extension-dsl-persistence/src/components/studio/DSL_Persistence_LegendStudioApplicationPlugin.tsx index 156609cada..0aefabcedb 100644 --- a/packages/legend-extension-dsl-persistence/src/components/studio/DSL_Persistence_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-extension-dsl-persistence/src/components/studio/DSL_Persistence_LegendStudioApplicationPlugin.tsx @@ -35,6 +35,7 @@ import { type PureGrammarParserElementDocumentationGetter, type PureGrammarParserDocumentationGetter, type ElementTypeLabelGetter, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio'; import { Persistence } from '../../graph/metamodel/pure/model/packageableElements/persistence/DSL_Persistence_Persistence.js'; import { PersistenceContext } from '../../graph/metamodel/pure/model/packageableElements/persistence/DSL_Persistence_PersistenceContext.js'; @@ -85,6 +86,15 @@ export class DSL_Persistence_LegendStudioApplicationPlugin return [PERSISTENCE_ELEMENT_TYPE, PERSISTENCE_CONTEXT_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.OTHER, + [PERSISTENCE_ELEMENT_TYPE, PERSISTENCE_CONTEXT_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => { diff --git a/packages/legend-extension-dsl-text/src/components/studio/DSL_Text_LegendStudioApplicationPlugin.tsx b/packages/legend-extension-dsl-text/src/components/studio/DSL_Text_LegendStudioApplicationPlugin.tsx index 92fb74eb0c..d2b27cf125 100644 --- a/packages/legend-extension-dsl-text/src/components/studio/DSL_Text_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-extension-dsl-text/src/components/studio/DSL_Text_LegendStudioApplicationPlugin.tsx @@ -31,6 +31,7 @@ import { type PureGrammarParserKeywordSuggestionGetter, type PureGrammarParserElementSnippetSuggestionsGetter, type PureGrammarParserElementDocumentationGetter, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio'; import { FileIcon } from '@finos/legend-art'; import { TextEditorState } from '../../stores/studio/TextEditorState.js'; @@ -82,6 +83,15 @@ export class DSL_Text_LegendStudioApplicationPlugin return [TEXT_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.OTHER, + [TEXT_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => { diff --git a/packages/legend-extension-store-service-store/src/components/studio/STO_ServiceStore_LegendStudioApplicationPlugin.tsx b/packages/legend-extension-store-service-store/src/components/studio/STO_ServiceStore_LegendStudioApplicationPlugin.tsx index 01a8babd91..4e41e41671 100644 --- a/packages/legend-extension-store-service-store/src/components/studio/STO_ServiceStore_LegendStudioApplicationPlugin.tsx +++ b/packages/legend-extension-store-service-store/src/components/studio/STO_ServiceStore_LegendStudioApplicationPlugin.tsx @@ -57,6 +57,7 @@ import { type EmbeddedDataTypeFromConnectionMatcher, type StoreTestDataCreators, type EmbeddedDataCloner, + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio'; import { SwaggerIcon } from '@finos/legend-art'; import { @@ -144,6 +145,15 @@ export class STO_ServiceStore_LegendStudioApplicationPlugin return [SERVICE_STORE_ELEMENT_TYPE]; } + getExtraSupportedElementTypesWithCategory?(): Map { + const elementTypesWithCategoryMap = new Map(); + elementTypesWithCategoryMap.set( + PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.STORE, + [SERVICE_STORE_ELEMENT_TYPE], + ); + return elementTypesWithCategoryMap; + } + getExtraElementClassifiers(): ElementClassifier[] { return [ (element: PackageableElement): string | undefined => {