Skip to content

Commit

Permalink
Fix regression introduced for explorer tree building in finos#1693
Browse files Browse the repository at this point in the history
  • Loading branch information
Gayathri committed Dec 16, 2022
1 parent bf2487f commit c515a40
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changeset/six-pandas-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
'@finos/legend-application-studio': patch
---
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ export const Explorer = observer(() => {
// don't edit elements that fast in form mode, but this could throw off
// test runner
(editorStore.isInViewerMode ||
editorStore.isInGrammarTextMode ||
editorStore.changeDetectionState.graphObserveState.hasSucceeded);
// conflict resolution
const showConflictResolutionContent =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,13 @@ export class EditorGraphState {
return FormModeCompilationOutcome.FAILED;
}
this.editorStore.setGraphEditMode(GRAPH_EDITOR_MODE.GRAMMAR_TEXT);
// Stop change detection as we don't need the actual change detection in text mode
this.editorStore.changeDetectionState.stop();
this.editorStore.changeDetectionState.computeLocalChangesInTextMode(
(yield this.editorStore.graphManagerState.graphManager.pureCodeToEntities(
this.editorStore.grammarTextEditorState.graphGrammarText,
)) as Entity[],
);
yield flowResult(
this.globalCompileInTextMode({
ignoreBlocking: true,
Expand Down
20 changes: 20 additions & 0 deletions packages/legend-application-studio/src/stores/ExplorerTreeState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ export class ExplorerTreeState {

buildTreeInTextMode(): void {
this.buildState.reset();
if (!this.systemTreeData) {
this.systemTreeData = getPackableElementTreeData(
this.editorStore,
this.editorStore.graphManagerState.systemModel.root,
ExplorerTreeRootPackageLabel.SYSTEM,
);
}
if (!this.dependencyTreeData) {
this.dependencyTreeData = getPackableElementTreeData(
this.editorStore,
this.editorStore.graphManagerState.graph.dependencyManager.root,
ExplorerTreeRootPackageLabel.PROJECT_DEPENDENCY,
);
}
this.treeData = getPackableElementTreeData(
this.editorStore,
this.editorStore.graphManagerState.graph.root,
Expand All @@ -200,6 +214,12 @@ export class ExplorerTreeState {
this.editorStore.graphManagerState.graph.generationModel.root,
ExplorerTreeRootPackageLabel.MODEL_GENERATION,
);
if (!this.fileGenerationTreeData) {
this.fileGenerationTreeData = getGenerationTreeData(
this.editorStore.graphState.graphGenerationState.rootFileDirectory,
ExplorerTreeRootPackageLabel.FILE_GENERATION,
);
}
this.setSelectedNode(undefined);
this.buildState.complete();
}
Expand Down

0 comments on commit c515a40

Please sign in to comment.