From be43e4e06c06ba1dff2a8f0d7f1b0111e7ac2539 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Thu, 10 Oct 2024 17:24:24 -0400 Subject: [PATCH 1/2] WCMP2 ID s/reco/recommended/g --- src/components/DatasetEditorForm.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/DatasetEditorForm.vue b/src/components/DatasetEditorForm.vue index 871fec7..04fb713 100644 --- a/src/components/DatasetEditorForm.vue +++ b/src/components/DatasetEditorForm.vue @@ -1183,7 +1183,7 @@ export default defineComponent({ // Centre ID from wis2box section formModel.identification.centreID = schema.wis2box['centre_id']; - // Topic hierarcy from properties section, removing + // Topic hierarchy from properties section, removing // the 'origin/a/wis2' prefix let fullTopic = schema.properties['wmo:topicHierarchy']; formModel.identification.topicHierarchy = fullTopic.replace(/origin\/a\/wis2\//g, ''); @@ -1389,8 +1389,8 @@ export default defineComponent({ // Truncate policy to 4 letters let truncatedPolicy = model.value.identification.wmoDataPolicy.substring(0, 4); - // Replace ':core.' or ':reco.' in the identifier - model.value.identification.identifier = id.replace(/:core\.|:reco\./g, `:${truncatedPolicy}.`); + // Replace ':core.' or ':recommended.' in the identifier + model.value.identification.identifier = id.replace(/:core\.|:recommended\./g, `:${truncatedPolicy}.`); }; @@ -1398,11 +1398,11 @@ export default defineComponent({ // replace the data policy in the topic hierarchy const replaceDataPolicyInTopicHierarchy = () => { let policy = model.value.identification.wmoDataPolicy; - let hierarcy = model.value.identification.topicHierarchy; + let hierarchy = model.value.identification.topicHierarchy; // Replace 'core' or 'recommended' in the topic hierachy // string with the policy - model.value.identification.topicHierarchy = hierarcy.replace(/core|recommended/g, policy); + model.value.identification.topicHierarchy = hierarchy.replace(/core|recommended/g, policy); }; // Autofill form based on template @@ -2094,7 +2094,7 @@ export default defineComponent({ // Watched - // If the user changes the data policy, update the topic hierarcy accordingly + // If the user changes the data policy, update the topic hierarchy accordingly watch(() => model.value.identification.wmoDataPolicy, () => { if (!selectedTemplate.value) { return; @@ -2251,4 +2251,4 @@ export default defineComponent({ text-align: right; vertical-align: middle; } - \ No newline at end of file + From 77026b6d276efe859eadcafe447cbb8f69a8ead0 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Thu, 17 Oct 2024 06:46:12 -0400 Subject: [PATCH 2/2] remove substring --- src/components/DatasetEditorForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DatasetEditorForm.vue b/src/components/DatasetEditorForm.vue index 04fb713..06acd75 100644 --- a/src/components/DatasetEditorForm.vue +++ b/src/components/DatasetEditorForm.vue @@ -1387,7 +1387,7 @@ export default defineComponent({ let id = model.value.identification.identifier; // Truncate policy to 4 letters - let truncatedPolicy = model.value.identification.wmoDataPolicy.substring(0, 4); + let truncatedPolicy = model.value.identification.wmoDataPolicy; // Replace ':core.' or ':recommended.' in the identifier model.value.identification.identifier = id.replace(/:core\.|:recommended\./g, `:${truncatedPolicy}.`);