Skip to content

Commit

Permalink
Added 'Hide Add new record button' in hub configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-brinkman committed Apr 18, 2024
1 parent fc75b1f commit 7f9d93c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions grails-app/assets/javascripts/hubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ function ContentViewModel(config) {
self.hideBreadCrumbs = ko.observable(config.hideBreadCrumbs || false);
self.hideProjectAndSurvey = ko.observable(config.hideProjectAndSurvey || false);
self.hideCancelButtonOnForm = ko.observable(config.hideCancelButtonOnForm || false);
self.hideNewButtonOnRecordView = ko.observable(config.hideNewButtonOnRecordView || false);
self.showNote = ko.observable(config.showNote || false);
self.recordNote = ko.observable(config.recordNote || '');
self.industries = ko.observable(config.industries || false);
Expand Down
6 changes: 5 additions & 1 deletion grails-app/views/admin/editHub.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@

<h5>Data entry page</h5>
<div class="checkbox">
<input type="checkbox" data-bind="checked: hideCancelButtonOnForm"> Hide cancel button on form create page
<input type="checkbox" data-bind="checked: hideCancelButtonOnForm"> Hide 'Cancel' button on form create page
</div>
<h5>Record view page</h5>
<div class="checkbox">
<input type="checkbox" data-bind="checked: hideNewButtonOnRecordView"> Hide 'Add new record' button on form create page
</div>
<!-- /ko -->
<h3>Quick links</h3>
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/bioActivity/index.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<g:if test="${hasEditRights}">
<a class="btn btn-primary-dark btn-lg" href="${createLink(controller: 'bioActivity', action: 'edit')}/${activity.activityId}"><span class="fas fa-pencil-alt"></span> Edit</a>
</g:if>
<g:if test="${userIsProjectMember}">
<g:if test="${userIsProjectMember && (!hubConfig.content?.hideNewButtonOnRecordView)}">
<a class="btn btn-primary-dark btn-lg" href="${createLink(controller: 'bioActivity', action: 'create')}/${pActivity.projectActivityId}"><span class="fas fa-plus"></span> Add new record</a>
</g:if>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/integration-test/resources/data/alaHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ var alaHub = {
"hideProjectSurveyDownloadXLSX" : false,
"hideBreadCrumbs" : false,
"hideCancelButtonOnForm" : false,
"hideNewButtonOnRecordView" : false,
"industries" : true,
"enablePartialSearch" : false,
"overriddenLabels" : [
Expand Down

0 comments on commit 7f9d93c

Please sign in to comment.