Skip to content

Commit

Permalink
Library / Update to wro4j 1.10.1 (geonetwork#7315)
Browse files Browse the repository at this point in the history
* Library / Update to wro4j 1.10.1

Fix wro4j cache build with maven on Java 11

* Update OnlineSrcDirective.js

Remove change related to geonetwork#7317

* Library / Update to wro4j 1.10.1

Add missing var declarations

* Library / Update to wro4j 1.10.1

Remove unreachable code

* Library / Update to wro4j 1.10.1

    Add missing var declaration

* Library / Update to wro4j 1.10.1

Fix variable name

* Library / Update to wro4j 1.10.1

Add missing var declaration

---------

Co-authored-by: Jose García <[email protected]>
  • Loading branch information
fxprunayre and josegar74 authored Sep 11, 2023
1 parent 260719a commit 6f2819a
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 93 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@
<maven.build.timestamp.format>yyyy-MM-dd'T'HH'\:'mm'\:'ssZ</maven.build.timestamp.format>
<build.timestamp>${maven.build.timestamp}</build.timestamp>
<rootProjectDir>..</rootProjectDir>
<wro.version>1.7.9</wro.version>
<wro.version>1.10.1</wro.version>
<wro.debug>true</wro.debug>
<fop.version>2.7</fop.version>
<xmlunit.version>2.1.1</xmlunit.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@
matches = [];

// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, "i");
substringRegex = new RegExp(q, "i");

// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function (i, str) {
if (substrRegex.test(str)) {
if (substringRegex.test(str)) {
matches.push(str);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@
lang: "lang?_content_type=json&",
removeThumbnail: "md.thumbnail.remove?_content_type=json&",
removeOnlinesrc: "resource.del.and.detach", // TODO: CHANGE
suggest: "suggest",
selectionLayers: "selection.layers",

featureindexproxy: "../../index/features",
Expand Down Expand Up @@ -710,12 +709,14 @@
var mlObjs = angular.isArray(multilingualObjects)
? multilingualObjects
: [multilingualObjects];
mlObjs.forEach(function (mlObj) {
mlObj.default =
mlObj["lang" + gnLangs.current] ||
mlObj.default ||
mlObj["lang" + this.mainLanguage];
});
mlObjs.forEach(
function (mlObj) {
mlObj.default =
mlObj["lang" + gnLangs.current] ||
mlObj.default ||
mlObj["lang" + this.mainLanguage];
}.bind(this)
);
},
translateCodelists: function (index) {
var codelists = angular.isArray(index) ? index : [index];
Expand All @@ -734,7 +735,7 @@
for (var fieldName in index) {
var field = index[fieldName];
if (fieldName.endsWith("Object")) {
this.translateMultilingualObjects(field);
this.translateMultilingualObjects.call(this, field);
index[fieldName.replace(/Object$/g, "")] = angular.isArray(field)
? field.map(function (mlObj) {
return mlObj.default;
Expand All @@ -745,16 +746,16 @@
} else if (fieldName === "allKeywords") {
Object.keys(field).forEach(
function (th) {
this.translateMultilingualObjects(field[th].keywords);
this.translateMultilingualObjects.call(this, field[th].keywords);
}.bind(this)
);
} else if (
fieldName.match(/th_.*$/) !== null &&
fieldName.match(/.*(_tree|Number)$/) === null
) {
this.translateMultilingualObjects(field);
this.translateMultilingualObjects.call(this, field);
} else if (typeof field === "object") {
this.translateMultingualFields(field);
this.translateMultingualFields.call(this, field);
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
var encLegends = [];
var attributions = [];
var layers = $scope.map.getLayers();
pdfLegendsToDownload = [];
var pdfLegendsToDownload = [];

var sortedZindexLayers = layers.getArray().sort(function (a, b) {
return a.getZIndex() > b.getZIndex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
getWFSCapabilities: function (url, version) {
var defer = $q.defer();
if (url) {
defaultVersion = "1.1.0";
var defaultVersion = "1.1.0";
version = version || defaultVersion;
url = mergeDefaultParams(url, {
request: "GetCapabilities",
Expand Down Expand Up @@ -396,7 +396,7 @@
getWCSCapabilities: function (url, version) {
var defer = $q.defer();
if (url) {
defaultVersion = "1.1.0";
var defaultVersion = "1.1.0";
version = version || defaultVersion;
url = mergeDefaultParams(url, {
REQUEST: "GetCapabilities",
Expand Down Expand Up @@ -474,13 +474,13 @@
var layers = capObj.layers || capObj.Layer;

// Layer name may be a list of comma separated layers
layerList = layerName.split(",");
var layerList = layerName.split(",");
var needles = new Array(layerList.length);

layersLoop: for (var j = 0; j < layerList.length; j++) {
var name = layerList[j];
//non namespaced lowercase name
nameNoNamespace = this.getNameWithoutNamespace(name).toLowerCase();
var nameNoNamespace = this.getNameWithoutNamespace(name).toLowerCase();

capabilityLayers: for (var i = 0; i < layers.length; i++) {
//Add Info for Requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
scope.spyElems.pop();
}

rootElement = $("#" + scope.id);
var rootElement = $("#" + scope.id);

// Get the number of fieldset above the current element
// to compute depth later.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
// $(id).tagsinput('add', keyword);
// });

getRecordsAutocompleter = function (config) {
var getRecordsAutocompleter = function (config) {
var recordsAutocompleter = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace("title"),
queryTokenizer: Bloodhound.tokenizers.whitespace,
Expand Down Expand Up @@ -469,7 +469,7 @@
recordsAutocompleter.initialize();
return recordsAutocompleter;
};
autocompleter = getRecordsAutocompleter({ max: 10 });
var autocompleter = getRecordsAutocompleter({ max: 10 });

// Init typeahead
field
Expand Down Expand Up @@ -558,7 +558,7 @@
urls.forEach(function (url, i) {
// local://srv/api/registries/entries/af8a36bb-ecea-4880-bf83-26b691e7570e?
// transformation=contact-from-iso19139-to-foaf-agent&lang=eng,fre&schema=dcat2
uuid = url.replace(/.*entries\/(.*)\?.*/, "$1");
var uuid = url.replace(/.*entries\/(.*)\?.*/, "$1");
$http
.post(
"../api/search/records/_search",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
scope.generateThumbnail = function () {
//Added mandatory custom params here to avoid
//changing other printing services
jsonSpec = angular.extend(scope.jsonSpec, {
var jsonSpec = angular.extend(scope.jsonSpec, {
hasNoTitle: true
});

Expand Down Expand Up @@ -867,8 +867,6 @@
} else {
return DEFAULT_CONFIG;
}

return DEFAULT_CONFIG;
}

gnOnlinesrc.register("onlinesrc", function (linkToEditOrType) {
Expand Down Expand Up @@ -2124,7 +2122,7 @@
* Return the index or -1 if not present.
*/
var findObj = function (md) {
for (i = 0; i < scope.selection.length; ++i) {
for (var i = 0; i < scope.selection.length; ++i) {
if (scope.selection[i].md === md) {
return i;
}
Expand Down Expand Up @@ -2172,7 +2170,7 @@
*/
scope.linkToResource = function () {
var uuids = [];
for (i = 0; i < scope.selection.length; ++i) {
for (var i = 0; i < scope.selection.length; ++i) {
var obj = scope.selection[i],
parameter =
obj.md.uuid +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
scope.params = {};
scope.currentSuggestion = gnSuggestion.getCurrent();
scope.processParams = angular.fromJson(scope.currentSuggestion.params);
for (key in scope.processParams) {
for (var key in scope.processParams) {
if (scope.processParams[key].type == "expression") {
scope.params[key] = $interpolate(scope.processParams[key].defaultValue)(
scope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@
};

scope.restoreHistoryElement = function (statusId) {
confirmMessage = $translate.instant("confirmRestore");
var confirmMessage = $translate.instant("confirmRestore");
if ($window.confirm(confirmMessage)) {
return gnRecordHistoryService.restoreHistoryElement(statusId).then(
function (r) {
message = $translate.instant("recordRestored");
var message = $translate.instant("recordRestored");
scope.$emit("StatusUpdated", {
msg: message,
timeout: 0,
Expand All @@ -154,7 +154,7 @@
$window.location.reload();
},
function (response) {
message = "";
var message = "";
if (response.status === 403) {
message = $translate.instant("notAllowedError");
} else if (response.status === 404) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,6 @@
);
return defer.promise;
},
/**
* Save the metadata record currently in editing session.
*
* If refreshForm is true, then will also update the current form.
* This is required while switching tab for example. Update the tab
* value in the form and trigger save to update the view.
*/
save: function (refreshForm, silent, terminate) {
save(refreshForm, silent, terminate, false, false);
},
/**
* Save the metadata record currently in editing session.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
scope.$on("beforeSearchReset", function () {
field.typeahead("val", "");
stringValues = [];
for (i = 0; i < prev.length; i++) {
for (var i = 0; i < prev.length; i++) {
$(element).tagsinput("remove", prev[i]);
}
prev = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
}

// Set the route only if not same as before
formatter = gnSearchLocation.getFormatter();
var formatter = gnSearchLocation.getFormatter();

gnUtilityService.scrollTo();

Expand Down Expand Up @@ -341,7 +341,7 @@
var metadata = [];
metadata.push(new Metadata(r.data.hits.hits[i]));

data = { metadata: metadata };
var data = { metadata: metadata };
//Keep the search results (gnMdViewObj.records)
// that.feedMd(0, undefined, data.metadata);
//and the trace of where in the search result we are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
};

scope.removeFilter = function (filter) {
removeFacetElement = [];
var removeFacetElement = [];
removeFacetElement.push(filter.key);
var keys = Object.keys(filter.value);
if (angular.isObject(filter.value) && keys[0] != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
};

var cleanSearchParams = function (params) {
for (v in params) {
for (var v in params) {
if (v !== "sortOrder" && params[v] == "") {
delete params[v];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,8 @@
// By default, such an attribute is identified in the form by
// the parent element id + '_' + attribute name
if (angular.isDefined(attrs.thesaurusConceptIdAttribute)) {
var input;

if (scope.templateField) {
scope.conceptIdElementName =
// In multilingual mode, the ref to the CharacterString is known using the id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@
}

if (gnLangs.langs[currentUILang_3char]) {
v = gnLangs.langs[currentUILang_3char];
var v = gnLangs.langs[currentUILang_3char];
if (!_.includes(result, v)) result.push(v);
}
if (currentUILang2_3char && gnLangs.langs[currentUILang2_3char]) {
v = gnLangs.langs[currentUILang2_3char];
var v = gnLangs.langs[currentUILang2_3char];
if (!_.includes(result, v)) result.push(v);
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
this.loadFeaturedUserSearches = function (type, withPortal) {
var deferred = $q.defer(),
usersearches = $http.get("../api/usersearches/featured?type=" + type);
apiCalls = [usersearches];
var apiCalls = [usersearches];
if (withPortal) {
apiCalls.push($http.get("../api/sources/subportal"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@

function setDefault() {
var defaultThesaurus = attrs["default"];
for (t in scope.regionTypes) {
for (var t in scope.regionTypes) {
if (scope.regionTypes[t].name === defaultThesaurus) {
scope.regionType = scope.regionTypes[t];
return;
Expand Down Expand Up @@ -729,7 +729,7 @@
link: function (scope, element, attrs) {
if (attrs["gnRegionType"]) {
gnRegionService.loadList().then(function (data) {
for (i = 0; i < data.length; ++i) {
for (var i = 0; i < data.length; ++i) {
if (attrs["gnRegionType"] == data[i].name) {
scope.regionType = data[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
* @param {ol.Feature} feature
* @return {Object} serialized style
*/
getStyleObjFromFeature = function (feature) {
var getStyleObjFromFeature = function (feature) {
var st = feature.get("_style");
var drawType = feature.get("_type");
if (angular.isFunction(st)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
// Do not densify if shape does not appear to be an extent
if (geom.getType() !== "Polygon" || inCoords.length > 5) return;
for (var i = 0; i < inCoords.length - 1; i++) {
var p0, p1, x0, y0, dX;
var p0, p1, x0, y0, dX, dY;
p0 = inCoords[i];
p1 = inCoords[i + 1];
x0 = p0[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@
var promises = [this.promise, this.dictionary];

return $q.all(promises).then(function (data) {
features = data[0];
dictionary = data[1];
var features = data[0];
var dictionary = data[1];

if (!features || features.length == 0) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@
headers: new Headers(headerDict),
responseType: "blob"
};
legendPromise = $http.get(urlGetLegend, requestOptions).then(
var legendPromise = $http.get(urlGetLegend, requestOptions).then(
function (response) {
var contentType = headers("content-type");
if (contentType.indexOf("image") === 0) {
// encode data to base 64 url
fileReader = new FileReader();
var fileReader = new FileReader();
fileReader.onload = function () {
style.LegendURL[0].OnlineResource = fileReader.result;
layer.set("legend", fileReader.result);
Expand Down Expand Up @@ -296,7 +296,7 @@
var dimensionConfig = scope.layer.get(dimension);
if (dimensionConfig) {
var idx = dimensionConfig.values.length - 1;
for (i = 0; i < dimensionConfig.values.length; i++) {
for (var i = 0; i < dimensionConfig.values.length; i++) {
if (dimensionConfig.values[i] === dimensionConfig.default) {
idx = i;
break;
Expand Down
Loading

0 comments on commit 6f2819a

Please sign in to comment.