Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into feature/issue3004
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Nov 16, 2023
2 parents a6efb51 + b89408d commit e24585b
Show file tree
Hide file tree
Showing 17 changed files with 5,755 additions and 2,479 deletions.
8 changes: 6 additions & 2 deletions grails-app/assets/javascripts/dataSets.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

var MONITOR_APP = 'Monitor';
/**
* This view model backs the "Data set summary" tab that is optionally displayed on project
* pages that support it.
Expand Down Expand Up @@ -26,6 +28,7 @@ var DataSetsViewModel =function(dataSets, projectService, config) {
this.editUrl = config.editDataSetUrl + '?dataSetId='+dataSet.dataSetId;
this.viewUrl = config.viewDataSetUrl + '?dataSetId='+dataSet.dataSetId;
this.name = dataSet.name;
this.createdIn = dataSet.collectionApp === MONITOR_APP ? MONITOR_APP : 'MERIT';
this.progress = dataSet.progress;
this.deleteDataSet = function() {
bootbox.confirm("Are you sure?", function(yes) {
Expand Down Expand Up @@ -109,7 +112,7 @@ var DataSetViewModel = function(dataSet, projectService, options) {
}
});

self.collectionApp = ko.observable(dataSet.collectionApp);
self.collectionApp = ko.observable();
self.location = ko.observable(dataSet.location);
self.siteId = ko.observable(dataSet.siteId);
self.siteUrl = options.viewSiteUrl + '/' + dataSet.siteId;
Expand All @@ -127,11 +130,12 @@ var DataSetViewModel = function(dataSet, projectService, options) {
self.publicationUrl = ko.observable(dataSet.publicationUrl);
self.format = ko.observable(dataSet.format);
self.collectionApp.subscribe(function(collectionApp) {
if (collectionApp == 'Monitor') {
if (collectionApp == MONITOR_APP) {
self.format('Database Table');
self.publicationUrl('Biodiversity Data Repository (URL pending)');
}
});
self.collectionApp(dataSet.collectionApp); // Set this after declaration to trigger the subscription above.

if (dataSet.sensitivities && !_.isArray(dataSet.sensitivities)) {
dataSet.sensitivities = [dataSet.sensitivities];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class OrganisationController {
Map projectGroups = projectGroupingHelper.groupProjectsByProgram(projects, programGroups, ["organisationId:"+organisation.organisationId], true)

[about : [label: 'About', visible: true, stopBinding: false, type:'tab', default:!reportingVisible, displayedPrograms:projectGroups.displayedPrograms, servicesDashboard:[visible:true]],
projects : [label: 'Reporting', template:"/shared/projectListByProgram", visible: reportingVisible, stopBinding:true, default:reportingVisible, type: 'tab', reports:organisation.reports, adHocReportTypes:adHocReportTypes, reportOrder:reportOrder, hideDueDate:true, displayedPrograms:projectGroups.displayedPrograms],
projects : [label: 'Reporting', template:"/shared/projectListByProgram", visible: reportingVisible, stopBinding:true, default:reportingVisible, type: 'tab', reports:organisation.reports, adHocReportTypes:adHocReportTypes, reportOrder:reportOrder, hideDueDate:true, displayedPrograms:projectGroups.displayedPrograms, reportsFirst:true, declarationType:SettingPageType.RDP_REPORT_DECLARATION],
sites : [label: 'Sites', visible: reportingVisible, type: 'tab', stopBinding:true, projectCount:organisation.projects?.size()?:0, showShapefileDownload:hasAdminAccess],
dashboard : [label: 'Dashboard', visible: reportingVisible, stopBinding:true, type: 'tab', template:'/shared/dashboard', reports:dashboardReports],
admin : [label: 'Admin', visible: hasAdminAccess, type: 'tab', template:'admin', showEditAnnoucements:showEditAnnoucements, availableReportCategories:availableReportCategories]]
Expand Down
4 changes: 3 additions & 1 deletion grails-app/views/project/dataset/_dataSets.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<tr>
<th class="actions">Actions</th>
<th class="dataset-name">Title</th>
<th class="created-in">Created in</th>
<th class="dataset-progress">Status</th>
</tr>
</thead>
Expand All @@ -31,9 +32,10 @@
</a>
</td>
<td class="dataset-name" data-bind="text:name"></td>
<td class="created-in" data-bind="text:createdIn"></td>
<td><button type="button" class="btn btn-sm" data-bind="activityProgress:progress">
<span data-bind="text: progress"></span>
</button>
</button>
</td>
</tr>
</tbody>
Expand Down
5 changes: 5 additions & 0 deletions grails-app/views/shared/_categorizedReportsAndDeclaration.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- ko stopBinding:true -->
<g:render template="/shared/categorizedReporting"/>

<g:render template="/shared/declaration_bs4" model="${[declarationType:declarationType ?: au.org.ala.merit.SettingPageType.RLP_REPORT_DECLARATION]}"/>
<!-- /ko -->
12 changes: 6 additions & 6 deletions grails-app/views/shared/_projectListByProgram.gsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

<g:if test="${reportsFirst}">
<g:render template="/shared/categorizedReportsAndDeclaration"/>
</g:if>
<div class="projects-wrapper d-none d-md-block">
<g:if test="${displayedPrograms}">
<g:each var="programDetails" status="i" in="${displayedPrograms}">
Expand Down Expand Up @@ -32,8 +34,6 @@
</g:if>
</div>

<!-- ko stopBinding:true -->
<g:render template="/shared/categorizedReporting"/>

<g:render template="/shared/declaration_bs4" model="${[declarationType:au.org.ala.merit.SettingPageType.RLP_REPORT_DECLARATION]}"/>
<!-- /ko -->
<g:if test="${!reportsFirst}">
<g:render template="/shared/categorizedReportsAndDeclaration"/>
</g:if>
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e24585b

Please sign in to comment.