From cb961a99b6e7afafd5bedcba482377c4c05bf666 Mon Sep 17 00:00:00 2001 From: Juan Hoyos Date: Fri, 23 Aug 2024 19:10:55 -0500 Subject: [PATCH] fix(core): incorrect topic type and status on loading --- packages/core/src/openbim/BCFTopics/index.ts | 23 +++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/core/src/openbim/BCFTopics/index.ts b/packages/core/src/openbim/BCFTopics/index.ts index 6b8b687f..20018110 100644 --- a/packages/core/src/openbim/BCFTopics/index.ts +++ b/packages/core/src/openbim/BCFTopics/index.ts @@ -588,13 +588,26 @@ export class BCFTopics const xml = await markupFile.async("string"); const markup = BCFTopics.xmlParser.parse(xml).Markup; const markupTopic = markup.Topic; - const { Guid, Type, Status, Title, CreationDate, CreationAuthor } = - markupTopic; + const { + Guid, + TopicType, + TopicStatus, + Title, + CreationDate, + CreationAuthor, + } = markupTopic; // Required Data if (ignoreIncompleteTopicsOnImport) { if ( - !(Guid && Type && Status && Title && CreationDate && CreationAuthor) + !( + Guid && + TopicType && + TopicStatus && + Title && + CreationDate && + CreationAuthor + ) ) continue; } @@ -603,8 +616,8 @@ export class BCFTopics topic.guid = Guid ?? topic.guid; const relatedTopics = this.getMarkupRelatedTopics(markup, version); topicRelations[topic.guid] = new Set(relatedTopics); - topic.type = Type ?? topic.type; - topic.status = Status ?? topic.status; + topic.type = TopicType ?? topic.type; + topic.status = TopicStatus ?? topic.status; topic.title = Title ?? topic.title; topic.creationDate = CreationDate ? new Date(CreationDate)