From 39a36ac8a89bdfa9979b190c86fe598c0c1fc85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Thu, 21 Sep 2023 10:39:15 +0200 Subject: [PATCH] Record view / Social network link points to permalink. (#7347) 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 d1a1d98c65e..17ad1cc229c 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 @@ -562,6 +562,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 d12021a6d1d..fb16dccb013 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