Skip to content

Commit 36c77fe

Browse files
[DURACOM-426] clean up, add example, minor restyle, fix templates
1 parent 306029c commit 36c77fe

File tree

12 files changed

+79
-775
lines changed

12 files changed

+79
-775
lines changed

config/config.example.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,3 +629,50 @@ geospatialMapViewer:
629629
accessibility:
630630
# The duration in days after which the accessibility settings cookie expires
631631
cookieExpirationDuration: 7
632+
633+
# CRIS Layout
634+
# Configuration for custom CRIS layout
635+
crisLayout:
636+
# Configuration of icons and styles to be used for each authority controlled link
637+
crisRef:
638+
- entityType: DEFAULT
639+
entityStyle:
640+
default:
641+
icon: fa fa-user
642+
style: text-info
643+
- entityType: PERSON
644+
entityStyle:
645+
person:
646+
icon: fa fa-user
647+
style: text-success
648+
default:
649+
icon: fa fa-user
650+
style: text-info
651+
- entityType: ORGUNIT
652+
entityStyle:
653+
default:
654+
icon: fa fa-university
655+
style: text-success
656+
- entityType: PROJECT
657+
entityStyle:
658+
default:
659+
icon: fas fa-project-diagram
660+
style: text-success
661+
crisRefStyleMetadata:
662+
default: cris.entity.style
663+
664+
# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
665+
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
666+
# to efficiently display the search results.
667+
followAuthorityMetadata:
668+
- type: Publication
669+
metadata: dc.contributor.author
670+
- type: Product
671+
metadata: dc.contributor.author
672+
673+
# The maximum number of item to process when following authority metadata values.
674+
followAuthorityMaxItemLimit: 100
675+
676+
# The maximum number of metadata values to process for each metadata key
677+
# when following authority metadata values.
678+
followAuthorityMetadataValuesLimit: 5

src/app/core/data/base/identifiable-data.service.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*
66
* http://www.dspace.org/license/
77
*/
8-
import { RequestParam } from '@dspace/core/cache/models/request-param.model';
98
import { Observable } from 'rxjs';
109
import {
1110
map,
@@ -18,7 +17,6 @@ import { CacheableObject } from '../../cache/cacheable-object.model';
1817
import { ObjectCacheService } from '../../cache/object-cache.service';
1918
import { FollowLinkConfig } from '../../shared/follow-link-config.model';
2019
import { HALEndpointService } from '../../shared/hal-endpoint.service';
21-
import { FindListOptions } from '../find-list-options.model';
2220
import { RemoteData } from '../remote-data';
2321
import { RequestService } from '../request.service';
2422
import { BaseDataService } from './base-data.service';
@@ -68,32 +66,6 @@ export class IdentifiableDataService<T extends CacheableObject> extends BaseData
6866
return this.findByHref(href$, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
6967
}
7068

71-
/**
72-
* Returns an observable of {@link RemoteData} of an object, based on its ID, with a list of
73-
* {@link FollowLinkConfig}, to automatically resolve {@link HALLink}s of the object
74-
* @param id ID of object we want to retrieve
75-
* @param projections Array of string of projections to be added to the parameters
76-
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
77-
* no valid cached version. Defaults to true
78-
* @param reRequestOnStale Whether or not the request should automatically be re-
79-
* requested after the response becomes stale
80-
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which
81-
* {@link HALLink}s should be automatically resolved
82-
*/
83-
findByIdWithProjections(id: string, projections: string[], useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<T>[]): Observable<RemoteData<T>> {
84-
const options = new FindListOptions();
85-
options.searchParams = [];
86-
87-
projections.forEach((projection) => {
88-
options.searchParams.push(new RequestParam('projection', projection));
89-
});
90-
91-
const href$ = this.getEndpoint().pipe(
92-
map((endpoint: string) => this.buildHrefFromFindOptions(endpoint + '/' + encodeURIComponent(id), options, [], ...linksToFollow)));
93-
94-
return this.findByHref(href$, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
95-
}
96-
9769
/**
9870
* Create the HREF for a specific object based on its identifier; with possible embed query params based on linksToFollow
9971
* @param endpoint The base endpoint for the type of object

src/app/core/data/item-data.service.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -481,28 +481,6 @@ export abstract class BaseItemDataService extends IdentifiableDataService<Item>
481481
}
482482
}
483483

484-
/**
485-
* Returns an observable of {@link RemoteData} of an object, based on its CustomURL or ID, with a list of
486-
* {@link FollowLinkConfig}, to automatically resolve {@link HALLink}s of the object
487-
* @param id CustomUrl or UUID of object we want to retrieve
488-
* @param projections Array of string of projections to be added to the parameters
489-
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
490-
* no valid cached version. Defaults to true
491-
* @param reRequestOnStale Whether or not the request should automatically be re-
492-
* requested after the response becomes stale
493-
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which
494-
* {@link HALLink}s should be automatically resolved
495-
* @param projections List of {@link projections} used to pass as parameters
496-
*/
497-
findByIdWithProjections(id: string, projections: string[], useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<Item>[]): Observable<RemoteData<Item>> {
498-
499-
if (uuidValidate(id)) {
500-
return super.findByIdWithProjections(id, projections, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
501-
} else {
502-
return this.findByCustomUrl(id, useCachedVersionIfAvailable, reRequestOnStale, linksToFollow, projections);
503-
}
504-
}
505-
506484
}
507485

508486
/**

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.html

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,6 @@
77
@if (!mdValue.editing && !mdRepresentation) {
88
<div class="dont-break-out preserve-line-breaks">{{ mdValue.newValue.value }}</div>
99
}
10-
@if (mdValue.editing && !mdRepresentation && ((isAuthorityControlled() | async) !== true || (enabledFreeTextEditing && (isSuggesterVocabulary() | async) !== true))) {
11-
<textarea class="form-control" rows="5" [(ngModel)]="mdValue.newValue.value"
12-
[attr.aria-label]="(dsoType + '.edit.metadata.edit.value') | translate"
13-
[dsDebounce]="300" (onDebounce)="confirm.emit(false)"></textarea>
14-
}
15-
@if (mdValue.editing && (isScrollableVocabulary() | async) && !enabledFreeTextEditing) {
16-
<ds-dynamic-scrollable-dropdown [bindId]="mdField"
17-
[group]="group"
18-
[model]="getModel()"
19-
(change)="onChangeAuthorityField($event)">
20-
</ds-dynamic-scrollable-dropdown>
21-
}
22-
@if (mdValue.editing && (((isHierarchicalVocabulary() | async) && !enabledFreeTextEditing) || (isSuggesterVocabulary() | async))) {
23-
<ds-dynamic-onebox [group]="group"
24-
[model]="getModel()"
25-
(change)="onChangeAuthorityField($event)">
26-
</ds-dynamic-onebox>
27-
}
28-
29-
3010
@if (mdValue.editing && !mdRepresentation) {
3111
<ds-dso-edit-metadata-value-field-loader [context]="context"
3212
[dso]="dso"
@@ -51,37 +31,6 @@
5131
</span>
5232
</div>
5333
}
54-
@if(mdValue.editing && (isAuthorityControlled() | async) && (isSuggesterVocabulary() | async)) {
55-
<div class="mt-2">
56-
<div class="btn-group w-75">
57-
<i dsAuthorityConfidenceState
58-
class="fas fa-fw p-0 mr-1 mt-auto mb-auto"
59-
aria-hidden="true"
60-
[authorityValue]="mdValue.newValue.confidence"
61-
[iconMode]="true"
62-
></i>
63-
<input class="form-control form-outline" data-test="authority-input" [(ngModel)]="mdValue.newValue.authority" [disabled]="!editingAuthority"
64-
[attr.aria-label]="(dsoType + '.edit.metadata.edit.authority.key') | translate"
65-
(change)="onChangeAuthorityKey()" />
66-
@if(editingAuthority) {
67-
<button class="btn btn-outline-success btn-sm ng-star-inserted" id="metadata-confirm-btn"
68-
[title]="dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate"
69-
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.close-authority-edition' | translate }}"
70-
(click)="onChangeEditingAuthorityStatus(false)">
71-
<i class="fas fa-lock-open fa-fw"></i>
72-
</button>
73-
} @else {
74-
<button class="btn btn-outline-secondary btn-sm ng-star-inserted" id="metadata-confirm-btn"
75-
[title]="dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate"
76-
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.open-authority-edition' | translate }}"
77-
(click)="onChangeEditingAuthorityStatus(true)">
78-
<i class="fas fa-lock fa-fw"></i>
79-
</button>
80-
}
81-
</div>
82-
</div>
83-
84-
}
8534
@if (mdRepresentation) {
8635
<div class="d-flex">
8736
<a class="me-2" target="_blank"

0 commit comments

Comments
 (0)