Skip to content

Commit 75ef143

Browse files
Merge branch 'task/main/DURACOM-426' into task/main/DURACOM-444
2 parents af6a268 + 5160bf9 commit 75ef143

9 files changed

Lines changed: 31 additions & 110 deletions

File tree

config/config.example.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ submission:
241241
# Icons to be displayed next to an authority controlled value, to give indication of the source.
242242
sourceIcons:
243243
# Example of configuration for authority logo based on sources.
244-
# The condigured icon will be displayed next to the authority value in submission and on item page or search results.
244+
# The configured icon will be displayed next to the authority value in submission and on item page or search results.
245245
- source: orcid
246246
- path: assets/images/orcid.logo.icon.svg
247247
# Fallback language in which the UI will be rendered if the user's browser language is not an active language
@@ -730,15 +730,3 @@ identifierSubtypes:
730730
iconPosition: IdentifierSubtypesIconPositionEnum.LEFT
731731
link: https://ror.org
732732

733-
# The maximum number of item to process when following authority metadata values.
734-
followAuthorityMaxItemLimit: 100
735-
736-
# The maximum number of metadata values to process for each metadata key
737-
# when following authority metadata values.
738-
followAuthorityMetadataValuesLimit: 5;
739-
740-
# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
741-
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests to efficiently display the search results.
742-
followAuthorityMetadata:
743-
- type: Publication
744-
metadata: dc.contributor.author

scripts/sync-i18n-files.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ function parseCliInput() {
3737
.option('-o, --output-file <output>', 'where output of script ends up; mutually exclusive with -i')
3838
.usage('([-d <output-dir>] [-s <source-file>]) || (-t <target-file> (-i | -o <output>) [-s <source-file>])')
3939
.parse(process.argv);
40-
if (!program.targetFile) {
40+
41+
const sourceFile = program.opts().sourceFile;
42+
43+
if (!program.targetFile) {
4144
fs.readdirSync(projectRoot(LANGUAGE_FILES_LOCATION)).forEach(file => {
42-
if (program.opts().sourceFile && !program.opts().sourceFile.toString().endsWith(file)) {
45+
if (!sourceFile.toString().endsWith(file)) {
4346
const targetFileLocation = projectRoot(LANGUAGE_FILES_LOCATION + "/" + file);
44-
console.log('Syncing file at: ' + targetFileLocation + ' with source file at: ' + program.opts().sourceFile);
47+
console.log('Syncing file at: ' + targetFileLocation + ' with source file at: ' + sourceFile);
4548
if (program.outputDir) {
4649
if (!fs.existsSync(program.outputDir)) {
4750
fs.mkdirSync(program.outputDir);
@@ -66,7 +69,7 @@ function parseCliInput() {
6669
console.log(program.outputHelp());
6770
process.exit(1);
6871
}
69-
if (!checkIfFileExists(program.opts().sourceFile)) {
72+
if (!checkIfFileExists(sourceFile)) {
7073
console.error('Path of source file is not valid.');
7174
console.log(program.outputHelp());
7275
process.exit(1);

src/app/core/data/external-source-data.service.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ export class ExternalSourceDataService extends IdentifiableDataService<ExternalS
6666
);
6767
}
6868

69-
/**
70-
* Get the endpoint for an external source's entryValues by given entry id
71-
* @param externalSourceId The id of the external source to fetch entry for
72-
* @param entryId The id of the external source entry to retrieve
73-
*/
74-
getEntryIDHref(externalSourceId: string, entryId: string): Observable<string> {
75-
return this.getBrowseEndpoint().pipe(
76-
map((href) => href + '/' + externalSourceId + '/entryValues/' + entryId),
77-
);
78-
}
79-
8069
/**
8170
* Get the entries for an external source
8271
* @param externalSourceId The id of the external source to fetch entries for
@@ -122,18 +111,4 @@ export class ExternalSourceDataService extends IdentifiableDataService<ExternalS
122111
public searchBy(searchMethod: string, options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<ExternalSource>[]): Observable<RemoteData<PaginatedList<ExternalSource>>> {
123112
return this.searchData.searchBy(searchMethod, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
124113
}
125-
126-
/**
127-
* Get an entry for an external source by given entry id
128-
* @param externalSourceId The id of the external source to fetch entries for
129-
* @param entryId The id of the entry to retrieve
130-
*/
131-
getExternalSourceEntryById(externalSourceId: string, entryId: string): Observable<RemoteData<ExternalSourceEntry>> {
132-
const href$ = this.getEntryIDHref(externalSourceId, entryId).pipe(
133-
isNotEmptyOperator(),
134-
distinctUntilChanged(),
135-
);
136-
137-
return this.findByHref(href$) as any;
138-
}
139114
}

src/app/core/shared/item.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject
100100
isWithdrawn: boolean;
101101

102102
/**
103-
* A boolean representing if this Item is currently withdrawn or not
103+
* A string representing the entity type of this Item
104104
*/
105105
@autoserializeAs(String, 'entityType')
106106
entityType: string;

src/app/core/shared/metadata.models.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable max-classes-per-file */
2-
import { hasValue } from '@dspace/shared/utils/empty.util';
32
import {
43
autoserialize,
54
Deserialize,
@@ -57,25 +56,6 @@ export class MetadataValue implements MetadataValueInterface {
5756
/** The authority confidence value */
5857
@autoserialize
5958
confidence: number;
60-
61-
/**
62-
* Returns true if this Metadatum's authority key starts with 'virtual::'
63-
*/
64-
get isVirtual(): boolean {
65-
return hasValue(this.authority) && this.authority.startsWith(VIRTUAL_METADATA_PREFIX);
66-
}
67-
68-
/**
69-
* If this is a virtual Metadatum, it returns everything in the authority key after 'virtual::'.
70-
* Returns undefined otherwise.
71-
*/
72-
get virtualValue(): string {
73-
if (this.isVirtual) {
74-
return this.authority.substring(this.authority.indexOf(VIRTUAL_METADATA_PREFIX) + VIRTUAL_METADATA_PREFIX.length);
75-
} else {
76-
return undefined;
77-
}
78-
}
7959
}
8060

8161
/** Constraints for matching metadata values. */

src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,14 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
186186
this.isHierarchicalVocabulary$ = this.vocabulary$.pipe(
187187
filter((vocabulary: Vocabulary) => isNotEmpty(vocabulary)),
188188
map((vocabulary: Vocabulary) => vocabulary.hierarchical),
189-
tap((isHierarchical: boolean) => {
190-
if (this.model.value) {
191-
this.setCurrentValue(this.model.value, isHierarchical);
192-
}
193-
}),
194189
);
195190

191+
this.subs.push(this.isHierarchicalVocabulary$.subscribe((isHierarchical) => {
192+
if (this.model.value) {
193+
this.setCurrentValue(this.model.value, isHierarchical);
194+
}
195+
}));
196+
196197
this.subs.push(this.group.get(this.model.id).valueChanges.pipe(
197198
filter((value) => this.currentValue !== value))
198199
.subscribe((value) => {
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
<span class="d-flex align-items-center txt-value">
2-
@if ((orcidUrl$ | async)) {
3-
<a href="{{(orcidUrl$ | async)}}/{{metadataValue}}" target="_blank">
1+
@let hasBadge = hasOrcidBadge();
2+
@let orcidUrl = orcidUrl$ | async;
3+
4+
@if (hasBadge || orcidUrl) {
5+
<span class="d-flex align-items-center txt-value">
6+
@if (orcidUrl) {
7+
<a href="{{orcidUrl}}/{{metadataValue}}" target="_blank">
48
{{ metadataValue }}
59
</a>
610
} @else {
711
{{ metadataValue }}
812
}
913

10-
11-
@if (hasOrcidBadge()) {
14+
@if (hasBadge) {
1215
<img
1316
placement="top"
1417
ngbTooltip="{{ 'orcid.badge.tooltip' | translate }}"
1518
class="orcid-icon"
1619
alt="orcid-logo"
1720
src="assets/images/orcid.logo.icon.svg"/>
1821
}
19-
2022
</span>
23+
}

src/app/shared/metadata-link-view/metadata-link-view-orcid/metadata-link-view-orcid.component.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import {
55
OnInit,
66
} from '@angular/core';
77
import { ConfigurationDataService } from '@dspace/core/data/configuration-data.service';
8+
import { RemoteData } from '@dspace/core/data/remote-data';
89
import { ConfigurationProperty } from '@dspace/core/shared/configuration-property.model';
910
import { Item } from '@dspace/core/shared/item.model';
10-
import { getFirstSucceededRemoteDataPayload } from '@dspace/core/shared/operators';
11+
import { getFirstCompletedRemoteData } from '@dspace/core/shared/operators';
1112
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
1213
import { TranslateModule } from '@ngx-translate/core';
1314
import {
@@ -41,9 +42,11 @@ export class MetadataLinkViewOrcidComponent implements OnInit {
4142
this.orcidUrl$ = this.configurationService
4243
.findByPropertyName('orcid.domain-url')
4344
.pipe(
44-
getFirstSucceededRemoteDataPayload(),
45-
map((property: ConfigurationProperty) =>
46-
property?.values?.length > 0 ? property.values[0] : null,
45+
getFirstCompletedRemoteData(),
46+
map((propertyPayload: RemoteData<ConfigurationProperty>) =>
47+
propertyPayload.hasSucceeded ?
48+
(propertyPayload.payload?.values?.length > 0 ? propertyPayload.payload.values[0] : null)
49+
: null,
4750
),
4851
);
4952
this.metadataValue = this.itemValue.firstMetadataValue(

src/assets/i18n/en.json5

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7352,38 +7352,6 @@
73527352

73537353
"metadata-link-view.popover.label.Person.person.jobTitle": "Job title",
73547354

7355-
"metadata-link-view.popover.label.OrgUnit.dc.title": "Fullname",
7356-
7357-
"metadata-link-view.popover.label.OrgUnit.organization.identifier.ror": "ROR",
7358-
7359-
"metadata-link-view.popover.label.OrgUnit.crisou.director": "Director",
7360-
7361-
"metadata-link-view.popover.label.OrgUnit.organization.parentOrganization": "Parent Organization",
7362-
7363-
"metadata-link-view.popover.label.OrgUnit.dc.description.abstract": "Description",
7364-
7365-
"metadata-link-view.popover.label.Project.dc.title": "Title",
7366-
7367-
"metadata-link-view.popover.label.Project.oairecerif.project.status": "Status",
7368-
7369-
"metadata-link-view.popover.label.Project.dc.description.abstract": "Abstract",
7370-
7371-
"metadata-link-view.popover.label.Funding.dc.title": "Title",
7372-
7373-
"metadata-link-view.popover.label.Funding.oairecerif.funder": "Funder",
7374-
7375-
"metadata-link-view.popover.label.Funding.oairecerif.fundingProgram": "Funding program",
7376-
7377-
"metadata-link-view.popover.label.Funding.dc.description.abstract": "Abstract",
7378-
7379-
"metadata-link-view.popover.label.Publication.dc.title": "Title",
7380-
7381-
"metadata-link-view.popover.label.Publication.dc.identifier.doi": "DOI",
7382-
7383-
"metadata-link-view.popover.label.Publication.dc.identifier.uri": "URL",
7384-
7385-
"metadata-link-view.popover.label.Publication.dc.description.abstract": "Abstract",
7386-
73877355
"metadata-link-view.popover.label.other.dc.title": "Title",
73887356

73897357
"metadata-link-view.popover.label.other.dc.description.abstract": "Description",

0 commit comments

Comments
 (0)