@finos/legend-extension-dsl-data-space 10.1.17 → 10.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -1
 - package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +4 -3
 - package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js.map +1 -1
 - package/lib/components/query/DataSpaceAdvancedSearchModal.d.ts.map +1 -1
 - package/lib/components/query/DataSpaceAdvancedSearchModal.js +7 -2
 - package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
 - package/lib/components/query/DataSpaceQueryBuilder.d.ts +4 -1
 - package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +1 -1
 - package/lib/components/query/DataSpaceQueryBuilder.js +31 -22
 - package/lib/components/query/DataSpaceQueryBuilder.js.map +1 -1
 - package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
 - package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +10 -0
 - package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
 - package/lib/components/studio/DataSpaceQueryAction.d.ts +22 -0
 - package/lib/components/studio/DataSpaceQueryAction.d.ts.map +1 -0
 - package/lib/components/studio/DataSpaceQueryAction.js +29 -0
 - package/lib/components/studio/DataSpaceQueryAction.js.map +1 -0
 - package/lib/index.css +1 -1
 - package/lib/package.json +7 -7
 - package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
 - package/lib/stores/query/DataSpaceAdvancedSearchState.js +12 -9
 - package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
 - package/lib/stores/query/DataSpaceInfo.d.ts +3 -3
 - package/lib/stores/query/DataSpaceInfo.d.ts.map +1 -1
 - package/lib/stores/query/DataSpaceQueryBuilderState.d.ts +12 -7
 - package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +1 -1
 - package/lib/stores/query/DataSpaceQueryBuilderState.js +79 -43
 - package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -1
 - package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +1 -1
 - package/lib/stores/query/DataSpaceQueryCreatorStore.js +8 -7
 - package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
 - package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +2 -2
 - package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +1 -1
 - package/lib/stores/query/DataSpaceQuerySetupStore.js +6 -6
 - package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
 - package/package.json +19 -19
 - package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +18 -7
 - package/src/components/query/DataSpaceAdvancedSearchModal.tsx +23 -26
 - package/src/components/query/DataSpaceQueryBuilder.tsx +82 -48
 - package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +10 -0
 - package/src/components/studio/DataSpaceQueryAction.tsx +34 -0
 - package/src/stores/query/DataSpaceAdvancedSearchState.ts +19 -28
 - package/src/stores/query/DataSpaceInfo.ts +3 -3
 - package/src/stores/query/DataSpaceQueryBuilderState.ts +131 -73
 - package/src/stores/query/DataSpaceQueryCreatorStore.ts +23 -16
 - package/src/stores/query/DataSpaceQuerySetupStore.ts +11 -5
 - package/tsconfig.json +1 -0
 
| 
         @@ -33,7 +33,7 @@ import { 
     | 
|
| 
       33 
33 
     | 
    
         
             
              ModalHeaderActions,
         
     | 
| 
       34 
34 
     | 
    
         
             
            } from '@finos/legend-art';
         
     | 
| 
       35 
35 
     | 
    
         
             
            import { generateGAVCoordinates } from '@finos/legend-storage';
         
     | 
| 
       36 
     | 
    
         
            -
            import { debounce } from '@finos/legend-shared';
         
     | 
| 
      
 36 
     | 
    
         
            +
            import { debounce, guaranteeNonNullable } from '@finos/legend-shared';
         
     | 
| 
       37 
37 
     | 
    
         
             
            import { flowResult } from 'mobx';
         
     | 
| 
       38 
38 
     | 
    
         
             
            import { observer } from 'mobx-react-lite';
         
     | 
| 
       39 
39 
     | 
    
         
             
            import { useEffect, useMemo, useRef, useState } from 'react';
         
     | 
| 
         @@ -81,32 +81,29 @@ export const DataSpaceAdvancedSearchModal = observer( 
     | 
|
| 
       81 
81 
     | 
    
         
             
                };
         
     | 
| 
       82 
82 
     | 
    
         
             
                const formatDataSpaceOptionLabel = (
         
     | 
| 
       83 
83 
     | 
    
         
             
                  option: DataSpaceOption,
         
     | 
| 
       84 
     | 
    
         
            -
                ): React.ReactNode =>  
     | 
| 
       85 
     | 
    
         
            -
                   
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
                     
     | 
| 
       90 
     | 
    
         
            -
                       
     | 
| 
       91 
     | 
    
         
            -
                      option. 
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
       93 
     | 
    
         
            -
             
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
     | 
    
         
            -
                        option.value.artifactId,
         
     | 
| 
       105 
     | 
    
         
            -
                        option.value.versionId,
         
     | 
| 
       106 
     | 
    
         
            -
                      )}
         
     | 
| 
      
 84 
     | 
    
         
            +
                ): React.ReactNode => {
         
     | 
| 
      
 85 
     | 
    
         
            +
                  const groupId = guaranteeNonNullable(option.value.groupId);
         
     | 
| 
      
 86 
     | 
    
         
            +
                  const artifactId = guaranteeNonNullable(option.value.artifactId);
         
     | 
| 
      
 87 
     | 
    
         
            +
                  const versionId = guaranteeNonNullable(option.value.versionId);
         
     | 
| 
      
 88 
     | 
    
         
            +
                  return (
         
     | 
| 
      
 89 
     | 
    
         
            +
                    <div
         
     | 
| 
      
 90 
     | 
    
         
            +
                      className="data-space-advanced-search__dialog__option"
         
     | 
| 
      
 91 
     | 
    
         
            +
                      title={`${option.label} - ${
         
     | 
| 
      
 92 
     | 
    
         
            +
                        option.value.path
         
     | 
| 
      
 93 
     | 
    
         
            +
                      } - ${generateGAVCoordinates(groupId, artifactId, versionId)}`}
         
     | 
| 
      
 94 
     | 
    
         
            +
                    >
         
     | 
| 
      
 95 
     | 
    
         
            +
                      <div className="data-space-advanced-search__dialog__option__label">
         
     | 
| 
      
 96 
     | 
    
         
            +
                        {option.label}
         
     | 
| 
      
 97 
     | 
    
         
            +
                      </div>
         
     | 
| 
      
 98 
     | 
    
         
            +
                      <div className="data-space-advanced-search__dialog__option__path">
         
     | 
| 
      
 99 
     | 
    
         
            +
                        {option.value.path}
         
     | 
| 
      
 100 
     | 
    
         
            +
                      </div>
         
     | 
| 
      
 101 
     | 
    
         
            +
                      <div className="data-space-advanced-search__dialog__option__gav">
         
     | 
| 
      
 102 
     | 
    
         
            +
                        {generateGAVCoordinates(groupId, artifactId, versionId)}
         
     | 
| 
      
 103 
     | 
    
         
            +
                      </div>
         
     | 
| 
       107 
104 
     | 
    
         
             
                    </div>
         
     | 
| 
       108 
     | 
    
         
            -
                   
     | 
| 
       109 
     | 
    
         
            -
                 
     | 
| 
      
 105 
     | 
    
         
            +
                  );
         
     | 
| 
      
 106 
     | 
    
         
            +
                };
         
     | 
| 
       110 
107 
     | 
    
         | 
| 
       111 
108 
     | 
    
         
             
                // search text
         
     | 
| 
       112 
109 
     | 
    
         
             
                const debouncedLoadDataSpaces = useMemo(
         
     | 
| 
         @@ -30,7 +30,10 @@ import { 
     | 
|
| 
       30 
30 
     | 
    
         
             
            } from '@finos/legend-art';
         
     | 
| 
       31 
31 
     | 
    
         
             
            import { observer } from 'mobx-react-lite';
         
     | 
| 
       32 
32 
     | 
    
         
             
            import { useApplicationStore } from '@finos/legend-application';
         
     | 
| 
       33 
     | 
    
         
            -
            import  
     | 
| 
      
 33 
     | 
    
         
            +
            import {
         
     | 
| 
      
 34 
     | 
    
         
            +
              DataSpaceQueryBuilderState,
         
     | 
| 
      
 35 
     | 
    
         
            +
              resolveUsableDataSpaceClasses,
         
     | 
| 
      
 36 
     | 
    
         
            +
            } from '../../stores/query/DataSpaceQueryBuilderState.js';
         
     | 
| 
       34 
37 
     | 
    
         
             
            import {
         
     | 
| 
       35 
38 
     | 
    
         
             
              buildRuntimeValueOption,
         
     | 
| 
       36 
39 
     | 
    
         
             
              getRuntimeOptionFormatter,
         
     | 
| 
         @@ -38,32 +41,22 @@ import { 
     | 
|
| 
       38 
41 
     | 
    
         
             
            } from '@finos/legend-query-builder';
         
     | 
| 
       39 
42 
     | 
    
         
             
            import {
         
     | 
| 
       40 
43 
     | 
    
         
             
              type Runtime,
         
     | 
| 
       41 
     | 
    
         
            -
              type GraphManagerState,
         
     | 
| 
       42 
     | 
    
         
            -
              type Mapping,
         
     | 
| 
       43 
     | 
    
         
            -
              getMappingCompatibleClasses,
         
     | 
| 
       44 
44 
     | 
    
         
             
              getMappingCompatibleRuntimes,
         
     | 
| 
       45 
45 
     | 
    
         
             
              PackageableElementExplicitReference,
         
     | 
| 
       46 
46 
     | 
    
         
             
              RuntimePointer,
         
     | 
| 
       47 
     | 
    
         
            -
              Class,
         
     | 
| 
       48 
     | 
    
         
            -
              Package,
         
     | 
| 
       49 
     | 
    
         
            -
              getDescendantsOfPackage,
         
     | 
| 
       50 
47 
     | 
    
         
             
            } from '@finos/legend-graph';
         
     | 
| 
       51 
48 
     | 
    
         
             
            import type { DataSpaceInfo } from '../../stores/query/DataSpaceInfo.js';
         
     | 
| 
       52 
49 
     | 
    
         
             
            import { generateGAVCoordinates } from '@finos/legend-storage';
         
     | 
| 
       53 
50 
     | 
    
         
             
            import { useEffect, useMemo, useState } from 'react';
         
     | 
| 
       54 
     | 
    
         
            -
            import {
         
     | 
| 
       55 
     | 
    
         
            -
              debounce,
         
     | 
| 
       56 
     | 
    
         
            -
              filterByType,
         
     | 
| 
       57 
     | 
    
         
            -
              guaranteeType,
         
     | 
| 
       58 
     | 
    
         
            -
              uniq,
         
     | 
| 
       59 
     | 
    
         
            -
            } from '@finos/legend-shared';
         
     | 
| 
      
 51 
     | 
    
         
            +
            import { debounce, guaranteeType } from '@finos/legend-shared';
         
     | 
| 
       60 
52 
     | 
    
         
             
            import { flowResult } from 'mobx';
         
     | 
| 
       61 
     | 
    
         
            -
            import  
     | 
| 
      
 53 
     | 
    
         
            +
            import {
         
     | 
| 
       62 
54 
     | 
    
         
             
              DataSpace,
         
     | 
| 
       63 
     | 
    
         
            -
              DataSpaceExecutionContext,
         
     | 
| 
      
 55 
     | 
    
         
            +
              type DataSpaceExecutionContext,
         
     | 
| 
       64 
56 
     | 
    
         
             
            } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
         
     | 
| 
       65 
57 
     | 
    
         
             
            import { DataSpaceIcon } from '../DSL_DataSpace_Icon.js';
         
     | 
| 
       66 
58 
     | 
    
         
             
            import { DataSpaceAdvancedSearchModal } from './DataSpaceAdvancedSearchModal.js';
         
     | 
| 
      
 59 
     | 
    
         
            +
            import type { EditorStore } from '@finos/legend-application-studio';
         
     | 
| 
       67 
60 
     | 
    
         | 
| 
       68 
61 
     | 
    
         
             
            export type DataSpaceOption = {
         
     | 
| 
       69 
62 
     | 
    
         
             
              label: string;
         
     | 
| 
         @@ -80,11 +73,15 @@ export const formatDataSpaceOptionLabel = ( 
     | 
|
| 
       80 
73 
     | 
    
         
             
            ): React.ReactNode => (
         
     | 
| 
       81 
74 
     | 
    
         
             
              <div
         
     | 
| 
       82 
75 
     | 
    
         
             
                className="query-builder__setup__data-space__option"
         
     | 
| 
       83 
     | 
    
         
            -
                title={`${option.label} - ${option.value.path} - ${ 
     | 
| 
       84 
     | 
    
         
            -
                  option.value.groupId 
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
      
 76 
     | 
    
         
            +
                title={`${option.label} - ${option.value.path} - ${
         
     | 
| 
      
 77 
     | 
    
         
            +
                  option.value.groupId && option.value.artifactId && option.value.versionId
         
     | 
| 
      
 78 
     | 
    
         
            +
                    ? generateGAVCoordinates(
         
     | 
| 
      
 79 
     | 
    
         
            +
                        option.value.groupId,
         
     | 
| 
      
 80 
     | 
    
         
            +
                        option.value.artifactId,
         
     | 
| 
      
 81 
     | 
    
         
            +
                        option.value.versionId,
         
     | 
| 
      
 82 
     | 
    
         
            +
                      )
         
     | 
| 
      
 83 
     | 
    
         
            +
                    : ''
         
     | 
| 
      
 84 
     | 
    
         
            +
                }`}
         
     | 
| 
       88 
85 
     | 
    
         
             
              >
         
     | 
| 
       89 
86 
     | 
    
         
             
                <div className="query-builder__setup__data-space__option__label">
         
     | 
| 
       90 
87 
     | 
    
         
             
                  {option.label}
         
     | 
| 
         @@ -93,34 +90,21 @@ export const formatDataSpaceOptionLabel = ( 
     | 
|
| 
       93 
90 
     | 
    
         
             
                  {option.value.path}
         
     | 
| 
       94 
91 
     | 
    
         
             
                </div>
         
     | 
| 
       95 
92 
     | 
    
         
             
                <div className="query-builder__setup__data-space__option__gav">
         
     | 
| 
       96 
     | 
    
         
            -
                  { 
     | 
| 
       97 
     | 
    
         
            -
                    option.value. 
     | 
| 
       98 
     | 
    
         
            -
                    option.value. 
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
      
 93 
     | 
    
         
            +
                  {option.value.groupId &&
         
     | 
| 
      
 94 
     | 
    
         
            +
                    option.value.artifactId &&
         
     | 
| 
      
 95 
     | 
    
         
            +
                    option.value.versionId && (
         
     | 
| 
      
 96 
     | 
    
         
            +
                      <>
         
     | 
| 
      
 97 
     | 
    
         
            +
                        {generateGAVCoordinates(
         
     | 
| 
      
 98 
     | 
    
         
            +
                          option.value.groupId,
         
     | 
| 
      
 99 
     | 
    
         
            +
                          option.value.artifactId,
         
     | 
| 
      
 100 
     | 
    
         
            +
                          option.value.versionId,
         
     | 
| 
      
 101 
     | 
    
         
            +
                        )}
         
     | 
| 
      
 102 
     | 
    
         
            +
                      </>
         
     | 
| 
      
 103 
     | 
    
         
            +
                    )}
         
     | 
| 
       101 
104 
     | 
    
         
             
                </div>
         
     | 
| 
       102 
105 
     | 
    
         
             
              </div>
         
     | 
| 
       103 
106 
     | 
    
         
             
            );
         
     | 
| 
       104 
107 
     | 
    
         | 
| 
       105 
     | 
    
         
            -
            const resolveDataSpaceClasses = (
         
     | 
| 
       106 
     | 
    
         
            -
              dataSpace: DataSpace,
         
     | 
| 
       107 
     | 
    
         
            -
              mapping: Mapping,
         
     | 
| 
       108 
     | 
    
         
            -
              graphManagerState: GraphManagerState,
         
     | 
| 
       109 
     | 
    
         
            -
            ): Class[] => {
         
     | 
| 
       110 
     | 
    
         
            -
              if (dataSpace.elements?.length) {
         
     | 
| 
       111 
     | 
    
         
            -
                const dataSpaceElements = dataSpace.elements.map((ep) => ep.element.value);
         
     | 
| 
       112 
     | 
    
         
            -
                return uniq([
         
     | 
| 
       113 
     | 
    
         
            -
                  ...dataSpaceElements.filter(filterByType(Class)),
         
     | 
| 
       114 
     | 
    
         
            -
                  ...dataSpaceElements
         
     | 
| 
       115 
     | 
    
         
            -
                    .filter(filterByType(Package))
         
     | 
| 
       116 
     | 
    
         
            -
                    .map((_package) => Array.from(getDescendantsOfPackage(_package)))
         
     | 
| 
       117 
     | 
    
         
            -
                    .flat()
         
     | 
| 
       118 
     | 
    
         
            -
                    .filter(filterByType(Class)),
         
     | 
| 
       119 
     | 
    
         
            -
                ]);
         
     | 
| 
       120 
     | 
    
         
            -
              }
         
     | 
| 
       121 
     | 
    
         
            -
              return getMappingCompatibleClasses(mapping, graphManagerState.usableClasses);
         
     | 
| 
       122 
     | 
    
         
            -
            };
         
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
108 
     | 
    
         
             
            type ExecutionContextOption = {
         
     | 
| 
       125 
109 
     | 
    
         
             
              label: string;
         
     | 
| 
       126 
110 
     | 
    
         
             
              value: DataSpaceExecutionContext;
         
     | 
| 
         @@ -154,9 +138,9 @@ const DataSpaceQueryBuilderSetupPanelContent = observer( 
     | 
|
| 
       154 
138 
     | 
    
         
             
                  label:
         
     | 
| 
       155 
139 
     | 
    
         
             
                    queryBuilderState.dataSpace.title ?? queryBuilderState.dataSpace.name,
         
     | 
| 
       156 
140 
     | 
    
         
             
                  value: {
         
     | 
| 
       157 
     | 
    
         
            -
                    groupId: queryBuilderState.groupId,
         
     | 
| 
       158 
     | 
    
         
            -
                    artifactId: queryBuilderState.artifactId,
         
     | 
| 
       159 
     | 
    
         
            -
                    versionId: queryBuilderState.versionId,
         
     | 
| 
      
 141 
     | 
    
         
            +
                    groupId: queryBuilderState.projectInfo?.groupId,
         
     | 
| 
      
 142 
     | 
    
         
            +
                    artifactId: queryBuilderState.projectInfo?.artifactId,
         
     | 
| 
      
 143 
     | 
    
         
            +
                    versionId: queryBuilderState.projectInfo?.versionId,
         
     | 
| 
       160 
144 
     | 
    
         
             
                    title: queryBuilderState.dataSpace.title,
         
     | 
| 
       161 
145 
     | 
    
         
             
                    name: queryBuilderState.dataSpace.name,
         
     | 
| 
       162 
146 
     | 
    
         
             
                    path: queryBuilderState.dataSpace.path,
         
     | 
| 
         @@ -241,7 +225,7 @@ const DataSpaceQueryBuilderSetupPanelContent = observer( 
     | 
|
| 
       241 
225 
     | 
    
         
             
                });
         
     | 
| 
       242 
226 
     | 
    
         | 
| 
       243 
227 
     | 
    
         
             
                // class
         
     | 
| 
       244 
     | 
    
         
            -
                const classes =  
     | 
| 
      
 228 
     | 
    
         
            +
                const classes = resolveUsableDataSpaceClasses(
         
     | 
| 
       245 
229 
     | 
    
         
             
                  queryBuilderState.dataSpace,
         
     | 
| 
       246 
230 
     | 
    
         
             
                  queryBuilderState.executionContext.mapping.value,
         
     | 
| 
       247 
231 
     | 
    
         
             
                  queryBuilderState.graphManagerState,
         
     | 
| 
         @@ -408,3 +392,53 @@ export const renderDataSpaceQueryBuilderSetupPanelContent = ( 
     | 
|
| 
       408 
392 
     | 
    
         
             
                queryBuilderState={queryBuilderState}
         
     | 
| 
       409 
393 
     | 
    
         
             
              />
         
     | 
| 
       410 
394 
     | 
    
         
             
            );
         
     | 
| 
      
 395 
     | 
    
         
            +
             
     | 
| 
      
 396 
     | 
    
         
            +
            export const queryDataSpace = async (
         
     | 
| 
      
 397 
     | 
    
         
            +
              dataSpace: DataSpace,
         
     | 
| 
      
 398 
     | 
    
         
            +
              editorStore: EditorStore,
         
     | 
| 
      
 399 
     | 
    
         
            +
            ): Promise<void> => {
         
     | 
| 
      
 400 
     | 
    
         
            +
              const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
         
     | 
| 
      
 401 
     | 
    
         
            +
              await flowResult(
         
     | 
| 
      
 402 
     | 
    
         
            +
                embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
         
     | 
| 
      
 403 
     | 
    
         
            +
                  setupQueryBuilderState: () => {
         
     | 
| 
      
 404 
     | 
    
         
            +
                    const queryBuilderState = new DataSpaceQueryBuilderState(
         
     | 
| 
      
 405 
     | 
    
         
            +
                      editorStore.applicationStore,
         
     | 
| 
      
 406 
     | 
    
         
            +
                      editorStore.graphManagerState,
         
     | 
| 
      
 407 
     | 
    
         
            +
                      editorStore.depotServerClient,
         
     | 
| 
      
 408 
     | 
    
         
            +
                      dataSpace,
         
     | 
| 
      
 409 
     | 
    
         
            +
                      dataSpace.defaultExecutionContext,
         
     | 
| 
      
 410 
     | 
    
         
            +
                      (dataSpaceInfo: DataSpaceInfo) => {
         
     | 
| 
      
 411 
     | 
    
         
            +
                        queryBuilderState.dataSpace = guaranteeType(
         
     | 
| 
      
 412 
     | 
    
         
            +
                          queryBuilderState.graphManagerState.graph.getElement(
         
     | 
| 
      
 413 
     | 
    
         
            +
                            dataSpaceInfo.path,
         
     | 
| 
      
 414 
     | 
    
         
            +
                          ),
         
     | 
| 
      
 415 
     | 
    
         
            +
                          DataSpace,
         
     | 
| 
      
 416 
     | 
    
         
            +
                        );
         
     | 
| 
      
 417 
     | 
    
         
            +
                        queryBuilderState.setExecutionContext(
         
     | 
| 
      
 418 
     | 
    
         
            +
                          queryBuilderState.dataSpace.defaultExecutionContext,
         
     | 
| 
      
 419 
     | 
    
         
            +
                        );
         
     | 
| 
      
 420 
     | 
    
         
            +
                        queryBuilderState.propagateExecutionContextChange(
         
     | 
| 
      
 421 
     | 
    
         
            +
                          queryBuilderState.dataSpace.defaultExecutionContext,
         
     | 
| 
      
 422 
     | 
    
         
            +
                        );
         
     | 
| 
      
 423 
     | 
    
         
            +
                      },
         
     | 
| 
      
 424 
     | 
    
         
            +
                      false,
         
     | 
| 
      
 425 
     | 
    
         
            +
                      undefined,
         
     | 
| 
      
 426 
     | 
    
         
            +
                      undefined,
         
     | 
| 
      
 427 
     | 
    
         
            +
                      undefined,
         
     | 
| 
      
 428 
     | 
    
         
            +
                      undefined,
         
     | 
| 
      
 429 
     | 
    
         
            +
                      undefined,
         
     | 
| 
      
 430 
     | 
    
         
            +
                      editorStore.applicationStore.config.options.queryBuilderConfig,
         
     | 
| 
      
 431 
     | 
    
         
            +
                    );
         
     | 
| 
      
 432 
     | 
    
         
            +
                    queryBuilderState.setExecutionContext(
         
     | 
| 
      
 433 
     | 
    
         
            +
                      dataSpace.defaultExecutionContext,
         
     | 
| 
      
 434 
     | 
    
         
            +
                    );
         
     | 
| 
      
 435 
     | 
    
         
            +
                    queryBuilderState.propagateExecutionContextChange(
         
     | 
| 
      
 436 
     | 
    
         
            +
                      dataSpace.defaultExecutionContext,
         
     | 
| 
      
 437 
     | 
    
         
            +
                    );
         
     | 
| 
      
 438 
     | 
    
         
            +
                    return queryBuilderState;
         
     | 
| 
      
 439 
     | 
    
         
            +
                  },
         
     | 
| 
      
 440 
     | 
    
         
            +
                  actionConfigs: [],
         
     | 
| 
      
 441 
     | 
    
         
            +
                  disableCompile: true,
         
     | 
| 
      
 442 
     | 
    
         
            +
                }),
         
     | 
| 
      
 443 
     | 
    
         
            +
              );
         
     | 
| 
      
 444 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -56,6 +56,7 @@ import { 
     | 
|
| 
       56 
56 
     | 
    
         
             
              DataSpacePreviewAction,
         
     | 
| 
       57 
57 
     | 
    
         
             
            } from './DataSpacePreviewAction.js';
         
     | 
| 
       58 
58 
     | 
    
         
             
            import type { PureGrammarTextSuggestion } from '@finos/legend-lego/code-editor';
         
     | 
| 
      
 59 
     | 
    
         
            +
            import { DataSpaceQueryAction } from './DataSpaceQueryAction.js';
         
     | 
| 
       59 
60 
     | 
    
         | 
| 
       60 
61 
     | 
    
         
             
            const DATA_SPACE_ELEMENT_TYPE = 'DATA SPACE';
         
     | 
| 
       61 
62 
     | 
    
         
             
            const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE =
         
     | 
| 
         @@ -81,6 +82,15 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin 
     | 
|
| 
       81 
82 
     | 
    
         | 
| 
       82 
83 
     | 
    
         
             
              override getExtraExplorerContextMenuItemRendererConfigurations(): ExplorerContextMenuItemRendererConfiguration[] {
         
     | 
| 
       83 
84 
     | 
    
         
             
                return [
         
     | 
| 
      
 85 
     | 
    
         
            +
                  {
         
     | 
| 
      
 86 
     | 
    
         
            +
                    key: 'data-space-query',
         
     | 
| 
      
 87 
     | 
    
         
            +
                    renderer: (editorStore, element) => {
         
     | 
| 
      
 88 
     | 
    
         
            +
                      if (element instanceof DataSpace) {
         
     | 
| 
      
 89 
     | 
    
         
            +
                        return <DataSpaceQueryAction dataSpace={element} />;
         
     | 
| 
      
 90 
     | 
    
         
            +
                      }
         
     | 
| 
      
 91 
     | 
    
         
            +
                      return undefined;
         
     | 
| 
      
 92 
     | 
    
         
            +
                    },
         
     | 
| 
      
 93 
     | 
    
         
            +
                  },
         
     | 
| 
       84 
94 
     | 
    
         
             
                  {
         
     | 
| 
       85 
95 
     | 
    
         
             
                    key: 'data-space-preview',
         
     | 
| 
       86 
96 
     | 
    
         
             
                    renderer: (editorStore, element) => {
         
     | 
| 
         @@ -0,0 +1,34 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            /**
         
     | 
| 
      
 2 
     | 
    
         
            +
             * Copyright (c) 2020-present, Goldman Sachs
         
     | 
| 
      
 3 
     | 
    
         
            +
             *
         
     | 
| 
      
 4 
     | 
    
         
            +
             * Licensed under the Apache License, Version 2.0 (the "License");
         
     | 
| 
      
 5 
     | 
    
         
            +
             * you may not use this file except in compliance with the License.
         
     | 
| 
      
 6 
     | 
    
         
            +
             * You may obtain a copy of the License at
         
     | 
| 
      
 7 
     | 
    
         
            +
             *
         
     | 
| 
      
 8 
     | 
    
         
            +
             *     http://www.apache.org/licenses/LICENSE-2.0
         
     | 
| 
      
 9 
     | 
    
         
            +
             *
         
     | 
| 
      
 10 
     | 
    
         
            +
             * Unless required by applicable law or agreed to in writing, software
         
     | 
| 
      
 11 
     | 
    
         
            +
             * distributed under the License is distributed on an "AS IS" BASIS,
         
     | 
| 
      
 12 
     | 
    
         
            +
             * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         
     | 
| 
      
 13 
     | 
    
         
            +
             * See the License for the specific language governing permissions and
         
     | 
| 
      
 14 
     | 
    
         
            +
             * limitations under the License.
         
     | 
| 
      
 15 
     | 
    
         
            +
             */
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            import { MenuContentItem } from '@finos/legend-art';
         
     | 
| 
      
 18 
     | 
    
         
            +
            import { observer } from 'mobx-react-lite';
         
     | 
| 
      
 19 
     | 
    
         
            +
            import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
         
     | 
| 
      
 20 
     | 
    
         
            +
            import { useEditorStore } from '@finos/legend-application-studio';
         
     | 
| 
      
 21 
     | 
    
         
            +
            import { queryDataSpace } from '../query/DataSpaceQueryBuilder.js';
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            export const DataSpaceQueryAction = observer(
         
     | 
| 
      
 24 
     | 
    
         
            +
              (props: { dataSpace: DataSpace }) => {
         
     | 
| 
      
 25 
     | 
    
         
            +
                const { dataSpace } = props;
         
     | 
| 
      
 26 
     | 
    
         
            +
                const editorStore = useEditorStore();
         
     | 
| 
      
 27 
     | 
    
         
            +
                const buildQuery = editorStore.applicationStore.guardUnhandledError(
         
     | 
| 
      
 28 
     | 
    
         
            +
                  async () => {
         
     | 
| 
      
 29 
     | 
    
         
            +
                    await queryDataSpace(dataSpace, editorStore);
         
     | 
| 
      
 30 
     | 
    
         
            +
                  },
         
     | 
| 
      
 31 
     | 
    
         
            +
                );
         
     | 
| 
      
 32 
     | 
    
         
            +
                return <MenuContentItem onClick={buildQuery}>Query...</MenuContentItem>;
         
     | 
| 
      
 33 
     | 
    
         
            +
              },
         
     | 
| 
      
 34 
     | 
    
         
            +
            );
         
     | 
| 
         @@ -32,6 +32,7 @@ import { 
     | 
|
| 
       32 
32 
     | 
    
         
             
              type PlainObject,
         
     | 
| 
       33 
33 
     | 
    
         
             
              ActionState,
         
     | 
| 
       34 
34 
     | 
    
         
             
              assertErrorThrown,
         
     | 
| 
      
 35 
     | 
    
         
            +
              guaranteeNonNullable,
         
     | 
| 
       35 
36 
     | 
    
         
             
            } from '@finos/legend-shared';
         
     | 
| 
       36 
37 
     | 
    
         
             
            import { action, flow, flowResult, makeObservable, observable } from 'mobx';
         
     | 
| 
       37 
38 
     | 
    
         
             
            import { DSL_DataSpace_getGraphManagerExtension } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
         
     | 
| 
         @@ -157,16 +158,15 @@ export class DataSpaceAdvancedSearchState { 
     | 
|
| 
       157 
158 
     | 
    
         
             
              *loadDataSpace(dataSpace: DataSpaceInfo): GeneratorFn<void> {
         
     | 
| 
       158 
159 
     | 
    
         
             
                this.loadDataSpaceState.inProgress();
         
     | 
| 
       159 
160 
     | 
    
         
             
                this.loadDataSpaceState.setMessage(`Initializing...`);
         
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
161 
     | 
    
         
             
                try {
         
     | 
| 
      
 162 
     | 
    
         
            +
                  const groupId = guaranteeNonNullable(dataSpace.groupId);
         
     | 
| 
      
 163 
     | 
    
         
            +
                  const artifactId = guaranteeNonNullable(dataSpace.artifactId);
         
     | 
| 
      
 164 
     | 
    
         
            +
                  const versionId = guaranteeNonNullable(dataSpace.versionId);
         
     | 
| 
       162 
165 
     | 
    
         
             
                  // fetch project
         
     | 
| 
       163 
166 
     | 
    
         
             
                  this.loadDataSpaceState.setMessage(`Fetching project...`);
         
     | 
| 
       164 
167 
     | 
    
         
             
                  const project = StoreProjectData.serialization.fromJson(
         
     | 
| 
       165 
168 
     | 
    
         
             
                    (yield flowResult(
         
     | 
| 
       166 
     | 
    
         
            -
                      this.depotServerClient.getProject(
         
     | 
| 
       167 
     | 
    
         
            -
                        dataSpace.groupId,
         
     | 
| 
       168 
     | 
    
         
            -
                        dataSpace.artifactId,
         
     | 
| 
       169 
     | 
    
         
            -
                      ),
         
     | 
| 
      
 169 
     | 
    
         
            +
                      this.depotServerClient.getProject(groupId, artifactId),
         
     | 
| 
       170 
170 
     | 
    
         
             
                    )) as PlainObject<StoreProjectData>,
         
     | 
| 
       171 
171 
     | 
    
         
             
                  );
         
     | 
| 
       172 
172 
     | 
    
         
             
                  // analyze data space
         
     | 
| 
         @@ -177,13 +177,13 @@ export class DataSpaceAdvancedSearchState { 
     | 
|
| 
       177 
177 
     | 
    
         
             
                    () =>
         
     | 
| 
       178 
178 
     | 
    
         
             
                      retrieveProjectEntitiesWithDependencies(
         
     | 
| 
       179 
179 
     | 
    
         
             
                        project,
         
     | 
| 
       180 
     | 
    
         
            -
                         
     | 
| 
      
 180 
     | 
    
         
            +
                        versionId,
         
     | 
| 
       181 
181 
     | 
    
         
             
                        this.depotServerClient,
         
     | 
| 
       182 
182 
     | 
    
         
             
                      ),
         
     | 
| 
       183 
183 
     | 
    
         
             
                    () =>
         
     | 
| 
       184 
184 
     | 
    
         
             
                      retrieveAnalyticsResultCache(
         
     | 
| 
       185 
185 
     | 
    
         
             
                        project,
         
     | 
| 
       186 
     | 
    
         
            -
                         
     | 
| 
      
 186 
     | 
    
         
            +
                        versionId,
         
     | 
| 
       187 
187 
     | 
    
         
             
                        dataSpace.path,
         
     | 
| 
       188 
188 
     | 
    
         
             
                        this.depotServerClient,
         
     | 
| 
       189 
189 
     | 
    
         
             
                      ),
         
     | 
| 
         @@ -192,45 +192,36 @@ export class DataSpaceAdvancedSearchState { 
     | 
|
| 
       192 
192 
     | 
    
         
             
                  this.dataSpaceViewerState = new DataSpaceViewerState(
         
     | 
| 
       193 
193 
     | 
    
         
             
                    this.applicationStore,
         
     | 
| 
       194 
194 
     | 
    
         
             
                    this.graphManagerState,
         
     | 
| 
       195 
     | 
    
         
            -
                     
     | 
| 
       196 
     | 
    
         
            -
                     
     | 
| 
       197 
     | 
    
         
            -
                     
     | 
| 
      
 195 
     | 
    
         
            +
                    groupId,
         
     | 
| 
      
 196 
     | 
    
         
            +
                    artifactId,
         
     | 
| 
      
 197 
     | 
    
         
            +
                    versionId,
         
     | 
| 
       198 
198 
     | 
    
         
             
                    analysisResult,
         
     | 
| 
       199 
199 
     | 
    
         
             
                    {
         
     | 
| 
       200 
200 
     | 
    
         
             
                      retrieveGraphData: () =>
         
     | 
| 
       201 
201 
     | 
    
         
             
                        new GraphDataWithOrigin(
         
     | 
| 
       202 
     | 
    
         
            -
                          new LegendSDLC(
         
     | 
| 
       203 
     | 
    
         
            -
                            dataSpace.groupId,
         
     | 
| 
       204 
     | 
    
         
            -
                            dataSpace.artifactId,
         
     | 
| 
       205 
     | 
    
         
            -
                            dataSpace.versionId,
         
     | 
| 
       206 
     | 
    
         
            -
                          ),
         
     | 
| 
      
 202 
     | 
    
         
            +
                          new LegendSDLC(groupId, artifactId, versionId),
         
     | 
| 
       207 
203 
     | 
    
         
             
                        ),
         
     | 
| 
       208 
204 
     | 
    
         
             
                      queryDataSpace: (executionContextKey: string) =>
         
     | 
| 
       209 
205 
     | 
    
         
             
                        generateDataSpaceQueryCreatorRoute(
         
     | 
| 
       210 
     | 
    
         
            -
                           
     | 
| 
       211 
     | 
    
         
            -
                           
     | 
| 
       212 
     | 
    
         
            -
                           
     | 
| 
      
 206 
     | 
    
         
            +
                          groupId,
         
     | 
| 
      
 207 
     | 
    
         
            +
                          artifactId,
         
     | 
| 
      
 208 
     | 
    
         
            +
                          versionId,
         
     | 
| 
       213 
209 
     | 
    
         
             
                          analysisResult.path,
         
     | 
| 
       214 
210 
     | 
    
         
             
                          executionContextKey,
         
     | 
| 
       215 
211 
     | 
    
         
             
                        ),
         
     | 
| 
       216 
212 
     | 
    
         
             
                      viewProject: (path: string | undefined) =>
         
     | 
| 
       217 
     | 
    
         
            -
                        this.viewProject(
         
     | 
| 
       218 
     | 
    
         
            -
                          dataSpace.groupId,
         
     | 
| 
       219 
     | 
    
         
            -
                          dataSpace.artifactId,
         
     | 
| 
       220 
     | 
    
         
            -
                          dataSpace.versionId,
         
     | 
| 
       221 
     | 
    
         
            -
                          path,
         
     | 
| 
       222 
     | 
    
         
            -
                        ),
         
     | 
| 
      
 213 
     | 
    
         
            +
                        this.viewProject(groupId, artifactId, versionId, path),
         
     | 
| 
       223 
214 
     | 
    
         
             
                      viewSDLCProject: (path: string | undefined) =>
         
     | 
| 
       224 
     | 
    
         
            -
                        this.viewSDLCProject( 
     | 
| 
      
 215 
     | 
    
         
            +
                        this.viewSDLCProject(groupId, artifactId, path),
         
     | 
| 
       225 
216 
     | 
    
         
             
                      queryClass: (_class: Class): void => {
         
     | 
| 
       226 
217 
     | 
    
         
             
                        this.proceedToCreateQuery(_class);
         
     | 
| 
       227 
218 
     | 
    
         
             
                      },
         
     | 
| 
       228 
219 
     | 
    
         
             
                      openServiceQuery: (servicePath: string): void =>
         
     | 
| 
       229 
220 
     | 
    
         
             
                        this.applicationStore.navigationService.navigator.visitAddress(
         
     | 
| 
       230 
221 
     | 
    
         
             
                          generateServiceQueryCreatorRoute(
         
     | 
| 
       231 
     | 
    
         
            -
                             
     | 
| 
       232 
     | 
    
         
            -
                             
     | 
| 
       233 
     | 
    
         
            -
                             
     | 
| 
      
 222 
     | 
    
         
            +
                            groupId,
         
     | 
| 
      
 223 
     | 
    
         
            +
                            artifactId,
         
     | 
| 
      
 224 
     | 
    
         
            +
                            versionId,
         
     | 
| 
       234 
225 
     | 
    
         
             
                            servicePath,
         
     | 
| 
       235 
226 
     | 
    
         
             
                          ),
         
     | 
| 
       236 
227 
     | 
    
         
             
                        ),
         
     | 
| 
         @@ -22,9 +22,9 @@ import { isString } from '@finos/legend-shared'; 
     | 
|
| 
       22 
22 
     | 
    
         
             
            import { extractEntityNameFromPath } from '@finos/legend-storage';
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            export interface DataSpaceInfo {
         
     | 
| 
       25 
     | 
    
         
            -
              groupId: string;
         
     | 
| 
       26 
     | 
    
         
            -
              artifactId: string;
         
     | 
| 
       27 
     | 
    
         
            -
              versionId: string;
         
     | 
| 
      
 25 
     | 
    
         
            +
              groupId: string | undefined;
         
     | 
| 
      
 26 
     | 
    
         
            +
              artifactId: string | undefined;
         
     | 
| 
      
 27 
     | 
    
         
            +
              versionId: string | undefined;
         
     | 
| 
       28 
28 
     | 
    
         
             
              title: string | undefined;
         
     | 
| 
       29 
29 
     | 
    
         
             
              name: string;
         
     | 
| 
       30 
30 
     | 
    
         
             
              path: string;
         
     |