feat: 🎸 Allow routes to load Google Cloud DICOM Stores in the Study List (#1069)
This commit is contained in:
1 parent
3bbeb1c521
commit
21b586b08f
9 files changed
+194
-45
No files matched your search
@@ -65,6 +65,19 @@ const ROUTES_DEF = {
|
||||
return !!appConfig.enableGoogleCloudAdapter;
|
||||
},
|
||||
},
|
||||
list: {
|
||||
path:
|
||||
'/projects/:project/locations/:location/datasets/:dataset/dicomStores/:dicomStore',
|
||||
component: StudyListRouting,
|
||||
condition: appConfig => {
|
||||
const showList =
|
||||
appConfig.showStudyList !== undefined
|
||||
? appConfig.showStudyList
|
||||
: true;
|
||||
|
||||
return showList && !!appConfig.enableGoogleCloudAdapter;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -92,23 +105,33 @@ const getRoutes = appConfig => {
|
||||
return routes;
|
||||
};
|
||||
|
||||
const parsePath = (path, server, params) => {
|
||||
let _path = path;
|
||||
const _paramsCopy = Object.assign({}, server, params);
|
||||
|
||||
for (let key in _paramsCopy) {
|
||||
_path = UrlUtil.paramString.replaceParam(_path, key, _paramsCopy[key]);
|
||||
}
|
||||
|
||||
return _path;
|
||||
};
|
||||
|
||||
const parseViewerPath = (appConfig = {}, server = {}, params) => {
|
||||
let viewerPath = ROUTES_DEF.default.viewer.path;
|
||||
if (appConfig.enableGoogleCloudAdapter) {
|
||||
viewerPath = ROUTES_DEF.gcloud.viewer.path;
|
||||
}
|
||||
|
||||
const _paramsCopy = Object.assign({}, server, params);
|
||||
|
||||
for (let key in _paramsCopy) {
|
||||
viewerPath = UrlUtil.paramString.replaceParam(
|
||||
viewerPath,
|
||||
key,
|
||||
_paramsCopy[key]
|
||||
);
|
||||
}
|
||||
|
||||
return viewerPath;
|
||||
return parsePath(viewerPath, server, params);
|
||||
};
|
||||
|
||||
export { getRoutes, parseViewerPath, reload };
|
||||
const parseStudyListPath = (appConfig = {}, server = {}, params) => {
|
||||
let studyListPath = ROUTES_DEF.default.list.path;
|
||||
if (appConfig.enableGoogleCloudAdapter) {
|
||||
studyListPath = ROUTES_DEF.gcloud.list.path || studyListPath;
|
||||
}
|
||||
|
||||
return parsePath(studyListPath, server, params);
|
||||
};
|
||||
|
||||
export { getRoutes, parseViewerPath, parseStudyListPath, reload };
|
||||
Reference in new issue
Block a user