Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bf14771
[DURACOM-413] port custom url functionality
FrancescoMolinaro Nov 12, 2025
66bd310
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-413
FrancescoMolinaro Nov 13, 2025
b42bf55
[DURACOM-413] additional tests
FrancescoMolinaro Nov 13, 2025
e88a40d
[DURACOM-413] update labels, fix sync script, adapt section handling
FrancescoMolinaro Nov 18, 2025
c93cb50
[DURACOM-413] update error handling/validation + resync translations
FrancescoMolinaro Nov 19, 2025
75937c4
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-413
FrancescoMolinaro Dec 5, 2025
d1c1ecf
[DURACOM-413] fix lint
FrancescoMolinaro Dec 5, 2025
8bdfd01
[DURACOM-426] init integration of authority framework
FrancescoMolinaro Dec 10, 2025
a9dc8ec
Merge branch 'task/main/DURACOM-413' into task/main/DURACOM-426
FrancescoMolinaro Dec 12, 2025
8c073ff
[DURACOM-426] port metadata link components for authorithy
FrancescoMolinaro Dec 15, 2025
d262480
[DURACOM-426] fix some tests
FrancescoMolinaro Dec 15, 2025
9c5e6bb
[DURACOM-426] fix some unit tests
FrancescoMolinaro Dec 16, 2025
a514b6e
[DURACOM-426] fix tests and lint
FrancescoMolinaro Dec 16, 2025
a9ee4e5
[DURACOM-426] add authority link for md representation
FrancescoMolinaro Dec 16, 2025
306029c
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Dec 18, 2025
36c77fe
[DURACOM-426] clean up, add example, minor restyle, fix templates
FrancescoMolinaro Dec 18, 2025
e9f3df5
[DURACOM-426] improve tests
FrancescoMolinaro Dec 18, 2025
5b6fa80
[DURACOM-426] refactor
FrancescoMolinaro Dec 19, 2025
b29dc1e
[DURACOM-426] improve title configurability in popover, add link view…
FrancescoMolinaro Jan 15, 2026
3f35069
[DURACOM-426] add labels, fix facets labels,fix onebox other info tem…
FrancescoMolinaro Jan 16, 2026
1258bc2
[DURACOM-426] filter data labels
FrancescoMolinaro Jan 19, 2026
36e34a2
[DURACOM-426] revert changes to lables, except for english
FrancescoMolinaro Jan 19, 2026
d2c0749
[DURACOM-426] add config example, remove unnecessary config
FrancescoMolinaro Jan 19, 2026
1aef155
[DURACOM-426] clean config, add labels
FrancescoMolinaro Jan 19, 2026
995ff87
[DURACOM-426] add authority enrichment
FrancescoMolinaro Jan 21, 2026
efc488a
[DURACOM-426] fix tests
FrancescoMolinaro Jan 21, 2026
252c249
[DURACOM-426] fix test and model update
FrancescoMolinaro Jan 22, 2026
e316b11
[DURACOM-426] add vocabulary template in item field, adapt tests
FrancescoMolinaro Jan 22, 2026
317c1ee
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Jan 23, 2026
be381eb
[DURACOM-426] fix lint
FrancescoMolinaro Jan 23, 2026
a19ef43
[DURACOM-426] refactor
FrancescoMolinaro Jan 29, 2026
837b47e
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Feb 6, 2026
ca4edf7
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Feb 12, 2026
a15ad30
[DURACOM-426] remove unused method and duplicated config example
FrancescoMolinaro Feb 12, 2026
5160bf9
[DURACOM-426] revert changes to sync script
FrancescoMolinaro Feb 12, 2026
76f97ba
[DURACOM-456] add bulk import functionality
FrancescoMolinaro Feb 17, 2026
8a38ec2
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-456
FrancescoMolinaro Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ submission:
style: text-muted
icon: fa-circle-xmark

# Icons to be displayed next to an authority controlled value, to give indication of the source.
sourceIcons:
# Example of configuration for authority logo based on sources.
# The configured icon will be displayed next to the authority value in submission and on item page or search results.
- source: orcid
- path: assets/images/orcid.logo.icon.svg
# Fallback language in which the UI will be rendered if the user's browser language is not an active language
fallbackLanguage: en

Expand Down Expand Up @@ -645,3 +651,86 @@ geospatialMapViewer:
accessibility:
# The duration in days after which the accessibility settings cookie expires
cookieExpirationDuration: 7

# Configuration for custom layout
layout:
# Configuration of icons and styles to be used for each authority controlled link
authorityRef:
- entityType: DEFAULT
entityStyle:
default:
icon: fa fa-user
style: text-info
- entityType: PERSON
entityStyle:
person:
icon: fa fa-user
style: text-success
default:
icon: fa fa-user
style: text-info
- entityType: ORGUNIT
entityStyle:
default:
icon: fa fa-university
style: text-success
- entityType: PROJECT
entityStyle:
default:
icon: fas fa-project-diagram
style: text-success

# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
# to efficiently display the search results.
followAuthorityMetadata:
- type: Publication
metadata: dc.contributor.author
- type: Product
metadata: dc.contributor.author

# The maximum number of item to process when following authority metadata values.
followAuthorityMaxItemLimit: 100

# The maximum number of metadata values to process for each metadata key
# when following authority metadata values.
followAuthorityMetadataValuesLimit: 5

# Configuration for customization of search results
searchResults:
# Metadata fields to be displayed in the search results under the standard ones
additionalMetadataFields:
- dc.contributor.author
- dc.date.issued
- dc.type
# Metadata fields to be displayed in the search results for the author section
authorMetadata:
- dc.contributor.author
- dc.creator
- dc.contributor.*

# Configuration of metadata to be displayed in the item metadata link view popover
metadataLinkViewPopoverData:
# Metdadata list to be displayed for entities without a specific configuration
fallbackMetdataList:
- dc.description.abstract
- dc.description.note
# Configuration for each entity type
entityDataConfig:
- entityType: Person
# Descriptive metadata (popover body)
metadataList:
- person.affiliation.name
- person.email
# Title metadata (popover header)
titleMetadataList:
- person.givenName
- person.familyName
# Configuration for identifier subtypes, based on metadata like dc.identifier.ror where ror is the subtype.
# This is used to map the layout of the identifier in the popover and the icon displayed next to the metadata value.
identifierSubtypes:
- name: ror
icon: assets/images/ror.logo.icon.svg
iconPosition: IdentifierSubtypesIconPositionEnum.LEFT
link: https://ror.org

6 changes: 6 additions & 0 deletions src/app/app-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ACCESS_CONTROL_MODULE_PATH } from './access-control/access-control-rout
import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths';
import {
ADMIN_MODULE_PATH,
BULK_IMPORT_PATH,
FORGOT_PASSWORD_PATH,
HEALTH_PAGE_PATH,
PROFILE_MODULE_PATH,
Expand Down Expand Up @@ -273,6 +274,11 @@ export const APP_ROUTES: Route[] = [
loadChildren: () => import('./audit-page/audit-page-routes').then((m) => m.ROUTES),
canActivate: [siteAdministratorGuard, endUserAgreementCurrentUserGuard],
},
{
path: BULK_IMPORT_PATH,
loadChildren: () => import('./bulk-import/bulk-import-page-routes').then((m) => m.ROUTES),
canActivate: [authenticatedGuard, endUserAgreementCurrentUserGuard],
},
{
path: 'subscriptions',
loadChildren: () => import('./subscriptions-page/subscriptions-page-routes')
Expand Down
7 changes: 7 additions & 0 deletions src/app/app-routing-paths.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Collection } from './core/shared/collection.model';

export const COAR_NOTIFY_SUPPORT = 'coar-notify-support';

export const ADMIN_MODULE_PATH = 'admin';
Expand Down Expand Up @@ -57,3 +59,8 @@ export function getEditItemPageRoute() {
}
export const CORRECTION_TYPE_PATH = 'corrections';

export const BULK_IMPORT_PATH = 'bulk-import';

export function getBulkImportRoute(collection: Collection): string {
return `/${BULK_IMPORT_PATH}/${collection.id}`;
}
4 changes: 4 additions & 0 deletions src/app/app.menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AdminSearchMenuProvider } from './shared/menu/providers/admin-search.me
import { AuditLogsMenuProvider } from './shared/menu/providers/audit-item.menu';
import { AuditOverviewMenuProvider } from './shared/menu/providers/audit-overview.menu';
import { BrowseMenuProvider } from './shared/menu/providers/browse.menu';
import { BulkImportMenuProvider } from './shared/menu/providers/bulk-import.menu';
import { CoarNotifyMenuProvider } from './shared/menu/providers/coar-notify.menu';
import { SubscribeMenuProvider } from './shared/menu/providers/comcol-subscribe.menu';
import { CommunityListMenuProvider } from './shared/menu/providers/community-list.menu';
Expand Down Expand Up @@ -104,6 +105,9 @@ export const MENUS = buildMenuStructure({
ClaimMenuProvider.onRoute(
MenuRoute.ITEM_PAGE,
),
BulkImportMenuProvider.onRoute(
MenuRoute.COLLECTION_PAGE,
),
]),
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class BrowseByTaxonomyComponent implements OnInit, OnChanges, OnDestroy {
this.selectedItems = [];
this.facetType = browseDefinition.facetType;
this.vocabularyName = browseDefinition.vocabulary;
this.vocabularyOptions = { name: this.vocabularyName, closed: true };
this.vocabularyOptions = { name: this.vocabularyName, metadata: null, scope: null, closed: true };
this.description = this.translate.instant(`browse.metadata.${this.vocabularyName}.tree.description`);
}));
this.subs.push(this.scope$.subscribe(() => {
Expand Down
23 changes: 23 additions & 0 deletions src/app/bulk-import/bulk-import-page-routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Route } from '@angular/router';

import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { bulkImportGuard } from './bulk-import.guard';
import { BulkImportPageComponent } from './bulk-import-page.component';
import { bulkImportPageResolver } from './bulk-import-page.resolver';

/**
* RouterModule to help navigate to the page with the bulk import.
*/
export const ROUTES: Route[] = [
{
path: ':id',
component: BulkImportPageComponent,
resolve: {
collection: bulkImportPageResolver,
breadcrumb: i18nBreadcrumbResolver,
},
pathMatch: 'full',
data: { title: 'bulk-import.title', breadcrumbKey: 'bulk-import' },
canActivate: [bulkImportGuard],
},
];
33 changes: 33 additions & 0 deletions src/app/bulk-import/bulk-import-page.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div class="container">
<h2 class="mb-3">{{ 'bulk-import.title' | translate }}</h2>
<form [formGroup]="form" (ngSubmit)="submit()">
<div class="form-group mb-2">
<label for="name">{{ 'bulk-import.collection-name' | translate }}</label>
<input type="text" class="form-control" id="name" formControlName="name">
</div>
<div class="form-group mb-2">
<label for="file">{{ 'bulk-import.file' | translate }}</label>
<input type="file" (change)="handleFileInput($event)" formControlName="file" id="file" class="form-control-file d-block" requireFile/>
</div>
<div class="form-check">
<input type="checkbox" formControlName="abortOnError" id="abortOnError" class="form-check-input" />
<label for="abortOnError" class="me-5">{{ 'bulk-import.abort-on-error' | translate }}</label>
</div>

<button type="submit" class="btn btn-primary float-end" [dsBtnDisabled]="form.invalid || (isProcessingImport() | async)" >
@if ((isProcessingImport() | async)) {
<span>
<i class='fas fa-circle-notch fa-spin'></i> {{'bulk-import.processing' | translate}}
</span>
} @else {
<span>
{{'bulk-import.submit' | translate}}
</span>
}
</button>
<button type="button" class="btn btn-outline-secondary float-end me-2" (click)="goBack()">
{{'bulk-import.back' | translate}}
</button>

</form>
</div>
151 changes: 151 additions & 0 deletions src/app/bulk-import/bulk-import-page.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import { CommonModule } from '@angular/common';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import {
ComponentFixture,
fakeAsync,
inject,
TestBed,
tick,
} from '@angular/core/testing';
import {
FormsModule,
ReactiveFormsModule,
} from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import {
ActivatedRoute,
Router,
} from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { NotificationsService } from '@dspace/core/notification-system/notifications.service';
import { ActivatedRouteStub } from '@dspace/core/testing/active-router.stub';
import { NotificationsServiceStub } from '@dspace/core/testing/notifications-service.stub';
import { getMockRequestService } from '@dspace/core/testing/request.service.mock';
import { RouterMock } from '@dspace/core/testing/router.mock';
import { TranslateLoaderMock } from '@dspace/core/testing/translate-loader.mock';
import { createSuccessfulRemoteDataObject } from '@dspace/core/utilities/remote-data.utils';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {
TranslateLoader,
TranslateModule,
} from '@ngx-translate/core';
import { of } from 'rxjs';

import { AuthService } from '../core/auth/auth.service';
import { DSONameService } from '../core/breadcrumbs/dso-name.service';
import { RestResponse } from '../core/cache/response.models';
import { ScriptDataService } from '../core/data/processes/script-data.service';
import { RequestService } from '../core/data/request.service';
import { RequestEntry } from '../core/data/request-entry.model';
import { Collection } from '../core/shared/collection.model';
import { BulkImportPageComponent } from './bulk-import-page.component';

describe('BulkImportPageComponent', () => {

let component: BulkImportPageComponent;
let fixture: ComponentFixture<BulkImportPageComponent>;

let requestService: any;
let scriptDataService: any;
let notificationsService: any;
let route: any;
let router: RouterMock;

const collection: Collection = Object.assign(new Collection(), {
id: '626b80c5-ef15-4b29-8e69-bda89b0a7acf',
name: 'Test collection',
});

const file: File = new File(['test'], 'test.xls');

const fileList: any = {
item: (index: number) => file,
length: 10,
};

const authService = jasmine.createSpyObj('authService', {
isAuthenticated: of(true),
setRedirectUrl: {},
});

beforeEach(() => {
requestService = getMockRequestService();
scriptDataService = jasmine.createSpyObj('scriptDataService', {
invoke: of(Object.assign(new RequestEntry(), {
response: new RestResponse(true, 200, 'OK'),
})),
});
notificationsService = new NotificationsServiceStub();

route = new ActivatedRouteStub({}, {
collection: createSuccessfulRemoteDataObject( collection ),
});
router = new RouterMock();

TestBed.configureTestingModule({
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useClass: TranslateLoaderMock,
},
}), BulkImportPageComponent],
providers: [
BulkImportPageComponent,
DSONameService,
{ provide: RequestService, useValue: requestService },
{ provide: RequestService, useValue: requestService },
{ provide: ScriptDataService, useValue: scriptDataService },
{ provide: NotificationsService, useValue: notificationsService },
{ provide: ActivatedRoute, useValue: route },
{ provide: Router, useValue: router },
{ provide: AuthService, useValue: authService },
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();

});

beforeEach(fakeAsync(() => {
fixture = TestBed.createComponent(BulkImportPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
tick();
}));

it('should create BulkImportPageComponent', inject([BulkImportPageComponent], (comp: BulkImportPageComponent) => {
expect(comp).toBeDefined();
}));

describe('when the user submit the form', () => {

beforeEach(() => {
component.form.value.abortOnError = true;
component.form.value.file = fileList;
component.setFile(fileList);
component.submit();
});

it('should invoke the bulk-import script', () => {
expect(scriptDataService.invoke).toHaveBeenCalledWith('bulk-import', [
{ name: '-c', value: '626b80c5-ef15-4b29-8e69-bda89b0a7acf' },
{ name: '-f', value: 'test.xls' },
{ name: '-er', value: true },
], [file]);
});

});

describe('when the user click on back button', () => {

beforeEach(() => {
component.goBack();
});

it('should nagivate to collection page', () => {
expect(router.navigateByUrl).toHaveBeenCalledWith('/collections/626b80c5-ef15-4b29-8e69-bda89b0a7acf');
});

});

});
Loading
Loading