Skip to content

Commit

Permalink
Modify Query to have classPath as tagged value when we save it via da…
Browse files Browse the repository at this point in the history
…taspace workflow
  • Loading branch information
Gayathri committed Mar 17, 2023
1 parent cc0030d commit 5031f7e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/little-flies-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-extension-dsl-data-space': patch
---

Modify `Query` to have `classPath` as tagged value when we save it via dataspace workflow
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

// NOTE: these are non-compilable profile and tag that we come up with for query
// so that it records the dataSpace it is created from
// so that it records the dataSpace and class it is created from
export const QUERY_PROFILE_PATH = 'meta::pure::profiles::query';
export const QUERY_PROFILE_TAG_DATA_SPACE = 'dataSpace';
export const QUERY_PROFILE_TAG_CLASS = 'class';
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from '@finos/legend-shared';
import {
QUERY_PROFILE_PATH,
QUERY_PROFILE_TAG_CLASS,
QUERY_PROFILE_TAG_DATA_SPACE,
} from '../../DSL_DataSpace_Const.js';
import { getDataSpace } from '../../graphManager/DSL_DataSpace_GraphManagerHelper.js';
Expand All @@ -58,6 +59,16 @@ export const createQueryDataSpaceTaggedValue = (
return taggedValue;
};

export const createQueryClassTaggedValue = (
classPath: string,
): QueryTaggedValue => {
const taggedValue = new QueryTaggedValue();
taggedValue.profile = QUERY_PROFILE_PATH;
taggedValue.tag = QUERY_PROFILE_TAG_CLASS;
taggedValue.value = classPath;
return taggedValue;
};

export class DataSpaceQueryCreatorStore extends QueryEditorStore {
groupId: string;
artifactId: string;
Expand Down Expand Up @@ -237,6 +248,7 @@ export class DataSpaceQueryCreatorStore extends QueryEditorStore {
query.versionId = this.versionId;
query.taggedValues = [
createQueryDataSpaceTaggedValue(this.dataSpacePath),
createQueryClassTaggedValue(guaranteeNonNullable(this.classPath)),
];
},
};
Expand Down

0 comments on commit 5031f7e

Please sign in to comment.