Skip to content

Commit

Permalink
Merge pull request #808 from AtlasOfLivingAustralia/dev
Browse files Browse the repository at this point in the history
Merge 4.2 from dev into master
  • Loading branch information
jack-brinkman authored Dec 5, 2023
2 parents ebb141f + 6427066 commit 59637cb
Show file tree
Hide file tree
Showing 83 changed files with 626 additions and 10,657 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- master
- feature/**
- hotfix/**
- #745-Problem selecting and displaying multiple images when there are private images

env:
TZ: Australia/Canberra
Expand Down
34 changes: 0 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ dependencies {
implementation 'org.apache.tika:tika-parsers:1.3'
implementation "commons-fileupload:commons-fileupload:1.3.1"

implementation 'net.sf.jasperreports:jasperreports:6.4.1'
implementation 'net.sf.jasperreports:jasperreports-functions:6.4.1'
implementation 'au.org.ala:jasper-liberation-fonts-2.00.1:1.3'
implementation 'net.glxn:qrgen:1.4'
implementation 'org.apache.xmlgraphics:batik-bridge:1.9'
implementation 'org.apache.xmlgraphics:batik-svggen:1.9'
Expand Down Expand Up @@ -218,35 +215,4 @@ bootWar {

publish {
dependsOn assemble
}


tasks.register('reportCompile') {
ant.property(name: 'jasper.path', value: 'jasperreports-6.4.1.jar')

// ant.taskdef(resource: "com/abc/ant/antlib.xml", classpath: ant.properties['jasper.path'], loaderref: 'abc')


println "\n- Starting JasperReports *.jrxml compilation process..."
println configurations.runtimeClasspath.asPath
// define the Jasper Reports Compile Task
ant.taskdef(name:'reportCompile', classname: 'net.sf.jasperreports.ant.JRAntCompileTask', classpath: configurations.runtimeClasspath.asPath)

// remove existing jasper files
ant.delete{
fileset('dir':'grails-app/conf/reports', 'defaultexcludes':'yes'){
include('name':'**/*.jasper')
}
}

// create a temporary directory for use by the jasper compiler
ant.mkdir(dir:'target/jasper')

// compile the reports
ant.reportCompile(srcdir:'grails-app/conf/reports', destdir:'grails-app/conf/reports', tempdir:'target/jasper', keepJava:true, xmlvalidation:true){
include(name:'**/*.jrxml')
// include(classpath: configurations.developmentOnly.asPath)
// include(name:'**/*.jrtx')
}
println "-------\n- JasperReports compilation process finished"
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
profileHubVersion=4.1
profileHubVersion=4.2-SNAPSHOT
grailsVersion=5.2.4
grailsGradlePluginVersion=5.2.3
groovyVersion=3.0.11
alaSecurityLibsVersion=6.0.0
alaSecurityLibsVersion=6.2.0
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx2g
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ profileEditor.controller('ALAAdminController', function ($http, util, messageSer
};

self.tags = [];
self.cacheRegions = [];

loadBackupFileList();
loadOpusList();
loadPendingJobs();
loadTags();
cacheManagement();

self.reloadHelpUrls = function() {
var promise = $http.post(util.contextRoot() + "/admin/reloadHelpUrls");
Expand Down Expand Up @@ -225,4 +227,28 @@ profileEditor.controller('ALAAdminController', function ($http, util, messageSer
self.loadingTags = false;
});
}

function cacheManagement() {
self.loadingCacheManagement = true;
var promise = $http.get(util.contextRoot() + "/admin/cacheManagement");
promise.then(function (response) {
self.cacheRegions = response.data || [];
self.loadingCacheManagement = false;
}, function() {
self.loadingCacheManagement = false;
});
}

self.clearCache = function (cache) {
var promise = $http.get(util.contextRoot() + "/admin/clearCache/" + cache);
promise.then(function(response) {
if (response.data.error) {
messageService.alert(response.data.error);
} else {
messageService.success(response.data.resp);
}
}, function() {
messageService.alert("Failed to clear cache the job");
});
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ profileEditor.controller("AttachmentUploadController", function (profileService,
self.types = [pdfType, urlType];

self.metadata = angular.isDefined(attachment) ? _.clone(attachment) : {};

if (self.categories == null) {
profileService.getCategories().then(function (data) {
self.categories = data.resp;
if (self.metadata.category == null) {
self.metadata.category = self.categories[0].value;
}
});
}

self.files = null;
self.error = null;
self.type = angular.isDefined(attachment.url) && attachment.url ? urlType.key : pdfType.key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ profileEditor.controller('CommentController', function (profileService, util, co
var self = this;

self.comments = [];
self.savedComments = [];
self.currentComment = null;
self.opusId = util.getEntityId("opus");
self.profileId = util.getEntityId("profile");
Expand All @@ -19,6 +20,7 @@ profileEditor.controller('CommentController', function (profileService, util, co
var promise = profileService.getComments(self.opusId, self.profileId);
promise.then(function(data) {
self.comments = orderBy(data, 'dateCreated');
self.savedComments = self.comments;
})
};

Expand Down Expand Up @@ -76,7 +78,12 @@ profileEditor.controller('CommentController', function (profileService, util, co
}
comment.children.push(data);
} else {
if (!Array.isArray(self.comments)) {
self.comments = [];
self.savedComments = []
}
self.comments.push(data);
self.savedComments.push(data);
}

self.currentComment = null;
Expand All @@ -86,9 +93,12 @@ profileEditor.controller('CommentController', function (profileService, util, co
};

function find(path) {
var array = self.comments;
var array = self.savedComments;
var comment = null;
angular.forEach(path, function(index) {
if (index > array.length-1) {
index = array.length-1
}
comment = array[index];
if (comment.children) {
array = orderBy(comment.children, 'dateCreated');
Expand All @@ -114,7 +124,13 @@ profileEditor.controller('CommentController', function (profileService, util, co

comment.children.splice(lastIndex, 1);
} else {
self.comments.splice(path[0], 1);
let selectedComment = self.savedComments[path[0]]
let filterdComments = self.comments.filter(i => i !== selectedComment)
self.comments = filterdComments;

if (self.comments.length === 0) {
self.savedComments = [];
}
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,24 @@ profileEditor.controller('UserAccessController', function (messageService, util,
});
};

self.privateModeChanged = function() {
self.privateModeChanged = function(form, isOptionChanged) {
if (self.opus.privateCollection) {
self.roles.push(userRole);
} else {
if (isOptionChanged) {
var hasRole_USER = self.users.find(it => it.role === 'ROLE_USER')
if (hasRole_USER) {
self.users = self.users.filter(it => it.role !== 'ROLE_USER')
var data = {privateCollection: self.opus.privateCollection, authorities: self.users};
var promise = profileService.updateUsers(self.opusId, data);
promise.then(function () {
form.$setPristine();
messageService.success("User access has been successfully updated.");
}, function () {
messageService.alert("An error has occurred while updating user access.");
});
}
}
self.roles.splice(4, 1)
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,11 @@ profileEditor.service('profileService', function ($http, util, $cacheFactory, co
return util.toStandardPromise(future);
},

getCategories: function () {
var future = $http.get(util.contextRoot() + "/attachment/categories", {cache: true});
return util.toStandardPromise(future);
},

getLicences: function () {
var future = $http.get(util.contextRoot() + "/licences", {cache: true});
return util.toStandardPromise(future);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ <h4 class="modal-title">Add an attachment</h4>
<div class="col-sm-9">
<select id="category" ng-model="attachmentUploadCtrl.metadata.category" class="form-control">
<option value="">Select a category</option>
<option value="General">General</option>
<option value="Management">Management</option>
<option ng-repeat="category in attachmentUploadCtrl.categories | orderBy:'toString()'" value="{{category.key}}"
ng-selected="attachmentUploadCtrl.metadata.category == category.key">{{category.key}}</option>
</select>
</div>
</div>
Expand Down

This file was deleted.

3 changes: 3 additions & 0 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ grails:
profile: web
codegen:
defaultPackage: au.org.ala.profile.hub
cache:
ehcache:
ehcacheXmlLocation: 'classpath:profile-ehcache.xml'
gorm:
reactor:
# Whether to translate GORM events into Reactor events
Expand Down
3 changes: 0 additions & 3 deletions grails-app/conf/jasperreports.properties

This file was deleted.

43 changes: 43 additions & 0 deletions grails-app/conf/profile-ehcache.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns='http://www.ehcache.org/v3'
xmlns:jsr107='http://www.ehcache.org/v3/jsr107'>

<persistence directory="/data/profile-hub/ehcache"/>

<cache alias="userDetailsCache">
<expiry>
<ttl unit="days">1</ttl>
</expiry>
<resources>
<heap unit="entries">2000</heap>
</resources>
</cache>

<cache alias="userDetailsByIdCache">
<expiry>
<ttl unit="days">1</ttl>
</expiry>
<resources>
<heap unit="entries">2000</heap>
</resources>
</cache>

<cache alias="userListCache">
<expiry>
<ttl unit="days">1</ttl>
</expiry>
<resources>
<heap unit="entries">2000</heap>
</resources>
</cache>

<cache alias="vocabListCache">
<expiry>
<ttl unit="days">1</ttl>
</expiry>
<resources>
<heap unit="entries">20000</heap>
</resources>
</cache>

</config>
Loading

0 comments on commit 59637cb

Please sign in to comment.