Skip to content

Commit

Permalink
Record view / contact focus on feature: allow to customise the contac…
Browse files Browse the repository at this point in the history
…t field name to filter (#8578)
  • Loading branch information
josegar74 authored Mar 5, 2025
1 parent c5da28a commit 8aabcfc
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,24 @@
// Group by 'default', 'role', 'org-role'
mode: "@gnMode",
// 'icon' or 'list' (default)
layout: "@layout"
layout: "@layout",
type: "@type"
},
link: function (scope, element, attrs, controller) {
if (["default", "role", "org-role"].indexOf(scope.mode) == -1) {
scope.mode = "default";
}

if (scope.type === "metadata") {
scope.focusOnFilterFieldName = "OrgObject.default";
} else if (scope.type === "distribution") {
scope.focusOnFilterFieldName = "OrgForDistributionObject.default";
} else if (scope.type === "processing") {
scope.focusOnFilterFieldName = "OrgForProcessingObject.default";
} else {
scope.focusOnFilterFieldName = "OrgForResourceObject.default";
}

scope.calculateContacts = function () {
if (scope.mode != "default") {
var groupByOrgAndMailOrName = function (resources) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</address>

<div
data-gn-search-filter-link="OrgForResourceObject.default"
data-gn-search-filter-link="{{focusOnFilterFieldName}}"
data-filter="c.organisation"
data-label="focusOnFrom"
>
Expand Down Expand Up @@ -99,7 +99,7 @@
</address>

<div
data-gn-search-filter-link="OrgForResourceObject.default"
data-gn-search-filter-link="{{focusOnFilterFieldName}}"
data-filter="c.organisation"
data-label="focusOnFrom"
>
Expand Down Expand Up @@ -157,7 +157,7 @@
</address>

<div
data-gn-search-filter-link="OrgForResourceObject.default"
data-gn-search-filter-link="{{focusOnFilterFieldName}}"
data-filter="c.organisation"
data-label="focusOnFrom"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ <h2 data-translate="">resourceContact</h2>
data-gn-metadata-contacts="mdView.current.record.contactForResource"
data-gn-mode="role"
data-layout="icon"
data-focus-on-field-name="resource"
></div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
data-gn-metadata-contacts="mdView.current.record.contact"
data-gn-mode="role"
data-layout="icon"
data-type="metadata"
></div>
</div>
<div data-ng-if="showCitation" data-gn-metadata-citation="mdView.current.record"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h2 data-translate="">processSteps</h2>
data-ng-if="mdView.current.record.contactForProcessing"
data-gn-metadata-contacts="mdView.current.record.contactForProcessing"
data-gn-mode="default"
data-type="processing"
data-layout="icon"
></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ <h3 data-translate="">format</h3>
data-ng-if="mdView.current.record.contactForDistribution"
data-gn-metadata-contacts="mdView.current.record.contactForDistribution"
data-gn-mode="default"
data-type="distribution"
data-layout="icon"
></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
data-ng-if="mdView.current.record.contactForDistribution"
data-gn-metadata-contacts="mdView.current.record.contactForDistribution"
data-gn-mode="default"
data-type="distribution"
data-layout="icon"
></div>

Expand Down

0 comments on commit 8aabcfc

Please sign in to comment.