Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ declare module 'vue' {
AnnotationPopup: typeof import('./components/Tooltip/AnnotationPopup.vue')['default']
ConnectionDialog: typeof import('./components/DrawToolbar/ConnectionDialog.vue')['default']
ConnectivityGraph: typeof import('./components/ConnectivityGraph/ConnectivityGraph.vue')['default']
ConnectivityGraphNew: typeof import('./components/ConnectivityGraph/ConnectivityGraphNew.vue')['default']
ConnectivityList: typeof import('./components/ConnectivityList/ConnectivityList.vue')['default']
ConnectivityListNew: typeof import('./components/ConnectivityList/ConnectivityListNew.vue')['default']
CopyToClipboard: typeof import('./components/CopyToClipboard/CopyToClipboard.vue')['default']
CreateTooltipContent: typeof import('./components/Tooltip/CreateTooltipContent.vue')['default']
DrawToolbar: typeof import('./components/DrawToolbar/DrawToolbar.vue')['default']
Expand Down
51 changes: 51 additions & 0 deletions src/components/CompetencyQueries/CompetencyQueries.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { removeDuplicates } from '../utilities';

/**
* @private
* Competency Queries
Expand Down Expand Up @@ -28,6 +30,54 @@ async function _postRequest(API_URL, payload) {
}
}

/**
* CQ query 27: Single Connectivity List
* @param {*} flatmapAPI
* @param {*} knowledgeSource mapuuid
* @param {*} pathId
* @returns combined connectivity list
*/
async function querySingleConnectivityList(flatmapAPI, knowledgeSource, pathId) {
const data = await competencyQuery({
flatmapAPI: flatmapAPI,
knowledgeSource: knowledgeSource,
queryId: 27,
parameters: [
{
column: 'path_id',
value: pathId
},
]
});

if (data?.results?.values) {
const connectivityList = data.results.values.map((value) => {
// value => [
// "sckan_id",
// "path_id",
// "sckan_node_id",
// "sckan_node_label",
// "source_id", // mapuuid
// "node_id", // map node id
// "node_label" // map node label
// ]
return {
sckanId: value[0],
mapUUID: value[4],
pathId: value[1],
sckanNodeId: value[2] ? JSON.parse(value[2]) : [],
sckanNodeLabel: value[3] || "",
mapNodeId: value[5] ? JSON.parse(value[5]) : [],
mapNodeLabel: value[6] || "",
};
});
// remove duplicates
return removeDuplicates(connectivityList);
}

return [];
}

/**
* Competency Query
* @public
Expand Down Expand Up @@ -392,4 +442,5 @@ export {
queryPathsByDestination,
queryPathsByRoute,
queryForwardBackwardConnections,
querySingleConnectivityList,
};
Loading