From 987ea868da82571f51c4c186733cd772cedf08dd Mon Sep 17 00:00:00 2001 From: Michael Carenzo <79934822+mikecarenzo@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:10:55 -0400 Subject: [PATCH 1/2] remove application schema from file format --- src/attack_flow_builder/src/store/PageEditor.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/attack_flow_builder/src/store/PageEditor.ts b/src/attack_flow_builder/src/store/PageEditor.ts index 1de46385..d30b5681 100644 --- a/src/attack_flow_builder/src/store/PageEditor.ts +++ b/src/attack_flow_builder/src/store/PageEditor.ts @@ -244,7 +244,7 @@ export class PageEditor { let page = JSON.parse(file) as PageExport; // Initialize diagram factory - let factory = await DiagramFactory.create(page.schema); + let factory = await DiagramFactory.create(Configuration.schema); // Compile export index let index = new Map(); @@ -306,7 +306,6 @@ export class PageEditor { let doc: PageExport = { version: pkg.version, id: this.page.id, - schema: this.page.factory.getSchema(), objects: [...this.page.getSubtree()].map(o => o.toExport()), location: location } @@ -393,8 +392,11 @@ type PageExport = { /** * The page's internal schema. + * @deprecated + * Since version 2.1.0. Schemas now rest solely with the application. They + * are no longer exported with each file. */ - schema: BlockDiagramSchema + schema?: BlockDiagramSchema /** * The page's diagram objects. From 71d3eba8ccc7afa3f59d863d36807ca418ffdfe4 Mon Sep 17 00:00:00 2001 From: Michael Carenzo <79934822+mikecarenzo@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:17:54 -0400 Subject: [PATCH 2/2] reword depreciation --- src/attack_flow_builder/src/store/PageEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/attack_flow_builder/src/store/PageEditor.ts b/src/attack_flow_builder/src/store/PageEditor.ts index d30b5681..abfa9cd8 100644 --- a/src/attack_flow_builder/src/store/PageEditor.ts +++ b/src/attack_flow_builder/src/store/PageEditor.ts @@ -393,7 +393,7 @@ type PageExport = { /** * The page's internal schema. * @deprecated - * Since version 2.1.0. Schemas now rest solely with the application. They + * Since version 2.1.0. Schemas now rest solely with the application and * are no longer exported with each file. */ schema?: BlockDiagramSchema