Skip to content

Commit

Permalink
Merge pull request #116 from lcnetdev/bfp-264-multi-instance-nav
Browse files Browse the repository at this point in the history
[BFP 264] Multi instance navigation fix
  • Loading branch information
f-osorio authored Nov 6, 2024
2 parents 1d618ba + 973be76 commit 4070b8e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions src/lib/utils_parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,21 @@ const utilsParse = {
// not currently used
},


updateAdditionalInstanceParentValues: function(profile, instanceName, newRdId){
// when a record comes in with multiple (secondary) instances, each instance will have the
// same parent and parentId, so all of there components will match. This causes issues with
// navigation, but not anywhere else?
// adapted from `profile.createSecondaryInstance()` to have parent properties be unique and correct
for (let pt in profile.pt){
profile.pt[pt]['@guid'] = short.generate()
// update the parentId
profile.pt[pt].parentId = profile.pt[pt].parentId.replace(instanceName, newRdId)
profile.pt[pt].parent = profile.pt[pt].parent.replace(instanceName, newRdId)
}

return profile
},

transformRts: async function(profile){
let toDeleteNoData = []

Expand All @@ -361,7 +375,10 @@ const utilsParse = {


[...Array(this.hasInstance - totalInstanceRts)].forEach((_, i) => {
profile.rt[useInstanceRtName + '_'+(i+1)] = JSON.parse(JSON.stringify(useInstanceRt))
let key = useInstanceRtName + '_'+(i+1)
let updatedProfile = this.updateAdditionalInstanceParentValues(JSON.parse(JSON.stringify(useInstanceRt)), useInstanceRtName, key)

profile.rt[key] = JSON.parse(JSON.stringify(updatedProfile))
profile.rtOrder.push(useInstanceRtName + '_'+(i+1))
});

Expand Down Expand Up @@ -446,10 +463,7 @@ const utilsParse = {
}else if(instanceOf.attributes['rdf:about']){
profile.rt[pkey].instanceOf = instanceOf.attributes['rdf:about'].value
}


}

}

// find itemOf
Expand Down
2 changes: 1 addition & 1 deletion src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const useConfigStore = defineStore('config', {

versionMajor: 0,
versionMinor: 16,
versionPatch: 3,
versionPatch: 4,



Expand Down

0 comments on commit 4070b8e

Please sign in to comment.