Skip to content

Commit

Permalink
carried forward the filtering of the permission manager button based …
Browse files Browse the repository at this point in the history
…on the new configLocal.enablePermissionManagement variable to the other applications in Atlas
  • Loading branch information
rkboyce committed Jul 19, 2023
1 parent 498565a commit 9aecc36
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
<!-- ko ifnot: isNewEntity() -->
<button type="button" class="btn btn-primary" data-bind="click: () => isTagsModalShown(!isTagsModalShown()), visible: isEditPermitted() && !previewVersion(), css: { disabled: isProcessing() }, title: ko.i18n('common.tags', 'Tags')"><i class="fa fa-tags"></i></button>
<button type="button" class="btn btn-primary" data-bind="visible: !previewVersion(), click: copyCc, css: {disabled: !canCopy() || isProcessing() }, title: , title: ko.i18n('common.createACopy', 'Create a copy')"><i class="fa fa-copy"></i></button>

<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary" data-bind="visible: isOwner() && !previewVersion(), click: () => isAccessModalShown(!isAccessModalShown()), title: ko.i18n('common.configureAccess', 'Configure access')">
<i class="fa fa-lock"></i>
</button>
<button type="button" class="btn btn-danger" data-bind="visible: !previewVersion(), click: deleteCc, css: {disabled: !$component.isDeletePermitted() || isProcessing() }"><i class="fa fa-trash-alt"></i></button>
<!-- /ko -->

<button type="button" class="btn btn-danger" data-bind="visible: !previewVersion(), click: deleteCc, css: {disabled: !$component.isDeletePermitted() || isProcessing() }"><i class="fa fa-trash-alt"></i></button>
<!-- /ko -->
</div>
</div>
Expand Down Expand Up @@ -103,4 +107,4 @@
loadAvailableTagsFn: $component.loadAvailableTags,
checkAssignPermissionFn: $component.checkAssignPermission,
checkUnassignPermissionFn: $component.checkUnassignPermission
"></tags-modal>
"></tags-modal>
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ define([
this.areStratasNamesEmpty = ko.observable();
this.duplicatedStrataNames = ko.observable([]);

this.enablePermissionManagement = ko.pureComputed(() => {
return config.enablePermissionManagement;
});

this.designDirtyFlag = sharedState.CohortCharacterization.dirtyFlag;
this.loading = ko.observable(false);
this.defaultName = ko.unwrap(constants.newEntityNames.characterization);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
<button class="btn btn-primary" data-bind="click: closeAnalysis, enable: !isProcessing(), title: ko.i18n('common.close', 'Close')"><i class="fa fa-times"></i></button>
<!-- ko ifnot: isNewEntity -->
<button type="button" class="btn btn-primary" data-bind="click: copyFeatureAnalysis, css: {disabled: !canCopy() || isProcessing() }, title: ko.i18n('common.createACopy', 'Create a copy')"><i class="fa fa-copy"></i></button>

<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary" data-bind="visible: isOwner, enable: !isProcessing(), click: () => isAccessModalShown(!isAccessModalShown()), title: ko.i18n('common.configureAccess', 'Configure access')">
<i class="fa fa-lock"></i>
</button>
<!-- /ko -->

<button class="btn btn-danger" data-bind="click: deleteFeature, enable: canDelete() && !isProcessing(), title: ko.i18n('common.delete', 'Delete')"><i class="fa fa-trash-alt"></i></button>
<!-- /ko -->
</div>
Expand Down Expand Up @@ -53,4 +57,4 @@
grantAccessFn: $component.grantAccess,
revokeAccessFn: $component.revokeAccess,
loadRoleSuggestionsFn: $component.loadAccessRoleSuggestions
"></configure-access-modal>
"></configure-access-modal>
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ define([
});
this.editorClasses = ko.computed(() => this.classes({ element: 'content', modifiers: this.canEdit() ? '' : 'disabled' }))

this.enablePermissionManagement = ko.pureComputed(() => {
return config.enablePermissionManagement;
});

this.selectedTabKey = ko.observable();
this.componentParams = ko.observable({
...params,
Expand Down
9 changes: 6 additions & 3 deletions js/pages/cohort-definitions/cohort-definition-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@
data-bind="visible: !previewVersion(), title: ko.i18n('cohortDefinitions.cohortDefinitionManager.createCopyCohortTitle', 'Create a copy of this cohort definition'), click: copy, enable: canCopy() && !isProcessing()"><i
class="fa fa-copy"></i></button>
<button class="btn btn-primary"
data-bind="visible: !previewVersion(), title: ko.i18n('cohortDefinitions.cohortDefinitionManager.getLinkCohortTitle', 'Get a link to this cohort definition'), enable: !dirtyFlag().isDirty() && !isProcessing(), click: function () { $component.cohortLinkModalOpened(true) }"><i
class="fa fa-link"></i></button>
data-bind="visible: !previewVersion(), title: ko.i18n('cohortDefinitions.cohortDefinitionManager.getLinkCohortTitle', 'Get a link to this cohort definition'), enable: !dirtyFlag().isDirty() && !isProcessing(), click: function () { $component.cohortLinkModalOpened(true) }"><i class="fa fa-link"></i></button>

<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary"
data-bind="title: ko.i18n('common.configureAccess', 'Configure access'), visible: isOwner() && !previewVersion(), click: () => isAccessModalShown(!isAccessModalShown())">
<i class="fa fa-lock"></i>
</button>
<!-- /ko -->

<!-- ko if: !isRunning() -->
<button class="btn btn-danger"
data-bind="visible: !previewVersion(), title: ko.i18n('common.delete', 'Delete'), click: $component.delete, enable: canDelete() && !isProcessing()"><i
Expand Down Expand Up @@ -790,4 +793,4 @@ <h3 data-bind="text: ko.i18n('cohortDefinitions.cohortDefinitionManager.panels.a
</div>
</script>

<!-- /ko -->
<!-- /ko -->
7 changes: 5 additions & 2 deletions js/pages/cohort-definitions/cohort-definition-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,13 @@ define(['jquery', 'knockout', 'text!./cohort-definition-manager.html',
super(params);

this.previewVersion = sharedState.CohortDefinition.previewVersion;

this.pollTimeoutId = null;
this.authApi = authApi;
this.config = config;
this.config = config;
this.enablePermissionManagement = ko.pureComputed(() => {
return config.enablePermissionManagement;
});
this.relatedSourcecodesOptions = globalConstants.relatedSourcecodesOptions;
this.commonUtils = commonUtils;
this.isLoading = ko.observable(false);
Expand Down
3 changes: 2 additions & 1 deletion js/pages/concept-sets/conceptset-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<!-- ko if: $component.currentConceptSet().id != null && $component.currentConceptSet().id != 0 -->
<button type="button" class="btn btn-primary" data-bind="click: () => isTagsModalShown(!isTagsModalShown()), visible: canEdit() && !previewVersion(), css: { disabled: isProcessing() }, title: ko.i18n('common.tags', 'Tags')"><i class="fa fa-tags"></i></button>
<button type="button" class="btn btn-primary" data-bind="visible: !previewVersion(), click: optimize, css: { disabled: !canOptimize() || isProcessing() }, text: ko.i18n('cs.manager.optimize', 'Optimize')"></button>

<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary" data-bind="visible: !previewVersion() && isOwner(), click: () => isAccessModalShown(!isAccessModalShown()), title: ko.i18n('common.configureAccess', 'Configure access')">
<button class="btn btn-primary" data-bind="visible: !previewVersion() && isOwner(), click: () => isAccessModalShown(!isAccessModalShown()), title: ko.i18n('common.configureAccess', 'Configure access')">
<i class="fa fa-lock"></i>
</button>
<!-- /ko -->
Expand Down
6 changes: 4 additions & 2 deletions js/pages/estimation/cca-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
<button class="btn btn-success" title="Save" data-bind="click: save, enable: canSave() && !isProcessing(), title: ko.i18n('common.save', 'Save')"><i class="fa fa-save"></i></button>
<button class="btn btn-primary" title="Close" data-bind="click: close, enable: !isProcessing(), title: ko.i18n('common.close', 'Close')"><i class="fa fa-times"></i></button>
<!-- ko ifnot: isNewEntity -->
<button class="btn btn-primary" title="Create a copy" data-bind="click: copy, enable: canCopy() && !isProcessing(), css: {'disabled': !canCopy()}, title: ko.i18n('common.createACopy', 'Create a copy')"><i class="fa fa-copy"></i></button>
<button class="btn btn-primary" title="Create a copy" data-bind="click: copy, enable: canCopy() && !isProcessing(), css: {'disabled': !canCopy()}, title: ko.i18n('common.createACopy', 'Create a copy')"><i class="fa fa-copy"></i></button>
<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary" title="Configure access" data-bind="visible: isOwner, click: () => isAccessModalShown(!isAccessModalShown()), title: ko.i18n('common.configureAccess', 'Configure access')">
<i class="fa fa-lock"></i>
</button>
<!-- /ko -->
<button class="btn btn-danger" title="Delete" data-bind="click: $component.delete, enable: canDelete() && !isProcessing(), title: ko.i18n('common.delete', 'Delete')"><i class="fa fa-trash-alt"></i></button>
<!-- /ko -->
</div>
Expand Down Expand Up @@ -75,4 +77,4 @@
loadRoleSuggestionsFn: $component.loadAccessRoleSuggestions
"></configure-access-modal>

<!-- /ko -->
<!-- /ko -->
7 changes: 5 additions & 2 deletions js/pages/estimation/cca-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ define([
this.cohortMethodAnalysisList = null;
this.defaultCovariateSettings = ko.observable();
this.options = constants.options;
this.config = config;
this.config = config;
this.enablePermissionManagement = ko.pureComputed(() => {
return config.enablePermissionManagement;
});
this.loading = ko.observable(true);
this.isAuthenticated = ko.pureComputed(() => {
return authApi.isAuthenticated();
Expand Down Expand Up @@ -592,4 +595,4 @@ define([
}

return commonUtils.build('cca-manager', ComparativeCohortAnalysisManager, view);
});
});
5 changes: 4 additions & 1 deletion js/pages/prediction/prediction-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
<button class="btn btn-primary"
data-bind="title: ko.i18n('common.createACopy', 'Create a copy'), click: copy, enable: canCopy() && !isProcessing()"><i
class="fa fa-copy"></i></button>
<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary"
data-bind="title: ko.i18n('common.configureAccess', 'Configure access'), visible: isOwner, click: () => isAccessModalShown(!isAccessModalShown())">
<i class="fa fa-lock"></i>
</button>
<!-- /ko -->

<button class="btn btn-danger"
data-bind="title: ko.i18n('common.delete', 'Delete'), click: $component.delete, enable: canDelete() && !isProcessing()"><i
class="fa fa-trash-alt"></i></button>
Expand Down Expand Up @@ -88,4 +91,4 @@
loadRoleSuggestionsFn: $component.loadAccessRoleSuggestions
"></configure-access-modal>

<!-- /ko -->
<!-- /ko -->
9 changes: 6 additions & 3 deletions js/pages/prediction/prediction-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ define([
'pages/Router',
'utils/CommonUtils',
'assets/ohdsi.util',
'appConfig',
'appConfig',
'./const',
'const',
'atlas-state',
Expand Down Expand Up @@ -80,7 +80,10 @@ define([
});

this.options = constants.options;
this.config = config;
this.config = config;
this.enablePermissionManagement = ko.pureComputed(() => {
return config.enablePermissionManagement;
});
this.loading = ko.observable(true);
this.patientLevelPredictionAnalysis = sharedState.predictionAnalysis.current;
this.selectedAnalysisId = sharedState.predictionAnalysis.selectedId;
Expand Down Expand Up @@ -491,4 +494,4 @@ define([
}

return commonUtils.build('prediction-manager', PatientLevelPredictionManager, view);
});
});
2 changes: 2 additions & 0 deletions js/pages/reusables/components/manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<!-- ko ifnot: isNewEntity -->
<button type="button" class="btn btn-primary" data-bind="click: () => isTagsModalShown(!isTagsModalShown()), visible: canEdit() && !previewVersion(), css: { disabled: isProcessing() }, title: ko.i18n('common.tags', 'Tags')"><i class="fa fa-tags"></i></button>
<button type="button" class="btn btn-primary" data-bind="visible: !previewVersion(), click: copy, css: {disabled: !$component.canCopy() || isProcessing()}, title: ko.i18n('common.createACopy', 'Create a copy')"><i class="fa fa-copy"></i></button>
<!-- ko if: enablePermissionManagement -->
<button class="btn btn-primary" data-bind="visible: isOwner() && !previewVersion(), click: () => isAccessModalShown(!isAccessModalShown()), title: ko.i18n('common.configureAccess', 'Configure access')"><i class="fa fa-lock"></i></button>
<!-- /ko -->
<button type="button" class="btn btn-danger" data-bind="visible: !previewVersion(), click: $component.del, css: {disabled: !canDelete() || isProcessing()}, title: ko.i18n('common.delete', 'Delete')"><i class="fa fa-trash-alt"></i></button>
<!-- /ko -->
</div>
Expand Down
4 changes: 4 additions & 0 deletions js/pages/reusables/components/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ define([

this.selectedTabKey = ko.observable("design");

this.enablePermissionManagement = ko.pureComputed(() => {
return config.enablePermissionManagement;
});

this.componentParams = ko.observable({
design: this.previewVersion() ? this.previewVersion : this.design,
designId: this.designId,
Expand Down

0 comments on commit 9aecc36

Please sign in to comment.