From 06036cb1df175be02cd74db2ea1170316252f8f8 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Tue, 19 Sep 2023 15:45:06 +0200 Subject: [PATCH] Record view / Social network link points to permalink. Follow up of https://github.com/geonetwork/core-geonetwork/pull/6792 --- .../search/mdview/mdviewDirective.js | 21 +++++++++++++++++++ .../search/mdview/partials}/social.html | 6 +++--- .../default/templates/recordView/share.html | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) rename web-ui/src/main/resources/catalog/{views/default/templates/recordView => components/search/mdview/partials}/social.html (75%) diff --git a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js index f2f22dc978..08f7446d4b 100644 --- a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js +++ b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js @@ -563,6 +563,27 @@ } ]); + module.directive("gnMetadataSocialLink", [ + "gnUtilityService", + "$http", + function (gnUtilityService, $http) { + return { + templateUrl: "../../catalog/components/search/mdview/partials/social.html", + scope: { + md: "=gnMetadataSocialLink" + }, + link: function (scope, element, attrs) { + scope.mdService = gnUtilityService; + $http + .get("../api/records/" + scope.md.getUuid() + "/permalink") + .then(function (r) { + scope.socialMediaLink = r.data; + }); + } + }; + } + ]); + module.directive("gnQualityMeasuresTable", [ "gnGlobalSettings", function (gnGlobalSettings) { diff --git a/web-ui/src/main/resources/catalog/views/default/templates/recordView/social.html b/web-ui/src/main/resources/catalog/components/search/mdview/partials/social.html similarity index 75% rename from web-ui/src/main/resources/catalog/views/default/templates/recordView/social.html rename to web-ui/src/main/resources/catalog/components/search/mdview/partials/social.html index d12021a6d1..fb16dccb01 100644 --- a/web-ui/src/main/resources/catalog/views/default/templates/recordView/social.html +++ b/web-ui/src/main/resources/catalog/components/search/mdview/partials/social.html @@ -1,4 +1,4 @@ -
+

shareOn