Skip to content

Commit

Permalink
Decouple metadata user feedback from metadata rating feature (#7770)
Browse files Browse the repository at this point in the history
* Decouple metadata user feedback from metadata rating feature

* Update web/src/main/webapp/WEB-INF/classes/setup/sql/data/data-db-default.sql
  • Loading branch information
josegar74 authored Feb 22, 2024
1 parent c3011e8 commit 85f4b66
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2021 Food and Agriculture Organization of the
* Copyright (C) 2001-2024 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -494,6 +494,7 @@
isXLinkLocal: "system.xlinkResolver.localXlinkEnable",
isSelfRegisterEnabled: "system.userSelfRegistration.enable",
isFeedbackEnabled: "system.userFeedback.enable",
isMetadataFeedbackEnabled: "system.userFeedback.metadata.enable",
isInspireEnabled: "system.inspire.enable",
isRatingUserFeedbackEnabled: "system.localrating.enable",
isSearchStatEnabled: "system.searchStats.enable",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* Copyright (C) 2001-2024 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -27,7 +27,8 @@
var module = angular.module("gn_md_feedback_directive", []);

/**
* Send email to metadata contact or catalog administrator.
* Send email to metadata contact or catalog administrator
* with feedback about a metadata record.
*/
module.directive("gnMdFeedback", [
"$http",
Expand All @@ -46,19 +47,17 @@
link: function postLink(scope, element, attrs) {
scope.showLabel = attrs.showLabel;

scope.isUserFeedbackEnabled = false;
scope.isUserMetadataFeedbackEnabled = false;

gnConfigService.load().then(function (c) {
var statusSystemRating = gnConfig[gnConfig.key.isRatingUserFeedbackEnabled];
if (statusSystemRating == "advanced") {
scope.isUserFeedbackEnabled = true;
}
scope.isUserMetadataFeedbackEnabled =
gnConfig[gnConfig.key.isMetadataFeedbackEnabled];
scope.recaptchaEnabled =
gnConfig["system.userSelfRegistration.recaptcha.enable"];
scope.recaptchaKey =
gnConfig["system.userSelfRegistration.recaptcha.publickey"];
});

scope.recaptchaEnabled =
gnConfig["system.userSelfRegistration.recaptcha.enable"];
scope.recaptchaKey =
gnConfig["system.userSelfRegistration.recaptcha.publickey"];
scope.resolveRecaptcha = false;

scope.mdFeedbackOpen = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="md-feedback gn-margin-bottom" data-ng-show="!isUserFeedbackEnabled">
<div class="md-feedback gn-margin-bottom" data-ng-show="isUserMetadataFeedbackEnabled">
<a
href
data-ng-click="toggle()"
Expand Down
6 changes: 4 additions & 2 deletions web-ui/src/main/resources/catalog/locales/en-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,10 @@
"system/userSelfRegistration/recaptcha/secretkey": "Re-captcha secret key",
"userFeedbackList": "Last user feedbacks",
"system/userFeedback": "User feedback",
"system/userFeedback/enable": "Enable feedback",
"system/userFeedback/enable-help": "When enabled, make sure a mail server is also configured.",
"system/userFeedback/enable": "Enable application feedback",
"system/userFeedback/enable-help": "Enabling this option allows to send feedback about the application to the system administrator. It requires the mail server is also configured.",
"system/userFeedback/metadata/enable": "Enable metadata feedback",
"system/userFeedback/metadata/enable-help": "Enabling this option allows to feedback to the metadata owner and system administrator about metadata record. It requires the mail server is also configured.",
"system/xlinkResolver": "Metadata XLink",
"system/xlinkResolver/enable": "Enable XLink resolution",
"system/xlinkResolver/enable-help": "If set, XLinks to metadata fragments in records will be resolved.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system
INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/userSelfRegistration/enable', 'false', 2, 1910, 'n');
INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/userFeedback/enable', 'false', 2, 1911, 'n');
INSERT INTO Settings (name, value, datatype, position, internal, editable) VALUES ('system/userFeedback/lastNotificationDate', '', 0, 1912, 'y', 'n');
INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/userFeedback/metadata/enable', 'false', 2, 1913, 'n');
INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/clickablehyperlinks/enable', 'true', 2, 2010, 'y');
INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/localrating/enable', 'advanced', 0, 2110, 'n');
INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/localrating/notificationLevel', 'catalogueAdministrator', 0, 2111, 'n');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
UPDATE Settings SET value='4.4.3' WHERE name='system/platform/version';
UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion';

INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/userFeedback/metadata/enable', 'false', 2, 1913, 'n');

0 comments on commit 85f4b66

Please sign in to comment.