mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
Merge branch 'main' into bugfix/addressing-#2276
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -39,3 +39,5 @@ package-lock.json
|
|||||||
/nbproject/
|
/nbproject/
|
||||||
|
|
||||||
junit.xml
|
junit.xml
|
||||||
|
|
||||||
|
/src/mirador-viewer/config.local.js
|
||||||
|
@@ -287,14 +287,17 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
|||||||
/**
|
/**
|
||||||
* This method will set everything to stale, which will cause the lists on this page to update.
|
* This method will set everything to stale, which will cause the lists on this page to update.
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset(): void {
|
||||||
this.epersonService.getBrowseEndpoint().pipe(
|
this.epersonService.getBrowseEndpoint().pipe(
|
||||||
take(1)
|
take(1),
|
||||||
).subscribe((href: string) => {
|
switchMap((href: string) => {
|
||||||
this.requestService.setStaleByHrefSubstring(href).pipe(take(1)).subscribe(() => {
|
return this.requestService.setStaleByHrefSubstring(href).pipe(
|
||||||
|
take(1),
|
||||||
|
);
|
||||||
|
})
|
||||||
|
).subscribe(()=>{
|
||||||
this.epersonService.cancelEditEPerson();
|
this.epersonService.cancelEditEPerson();
|
||||||
this.isEPersonFormShown = false;
|
this.isEPersonFormShown = false;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ import {
|
|||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs';
|
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs';
|
||||||
import { debounceTime, switchMap, take } from 'rxjs/operators';
|
import { debounceTime, finalize, map, switchMap, take } from 'rxjs/operators';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||||
@@ -463,8 +463,10 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
* Deletes the EPerson from the Repository. The EPerson will be the only that this form is showing.
|
* Deletes the EPerson from the Repository. The EPerson will be the only that this form is showing.
|
||||||
* It'll either show a success or error message depending on whether the delete was successful or not.
|
* It'll either show a success or error message depending on whether the delete was successful or not.
|
||||||
*/
|
*/
|
||||||
delete() {
|
delete(): void {
|
||||||
this.epersonService.getActiveEPerson().pipe(take(1)).subscribe((eperson: EPerson) => {
|
this.epersonService.getActiveEPerson().pipe(
|
||||||
|
take(1),
|
||||||
|
switchMap((eperson: EPerson) => {
|
||||||
const modalRef = this.modalService.open(ConfirmationModalComponent);
|
const modalRef = this.modalService.open(ConfirmationModalComponent);
|
||||||
modalRef.componentInstance.dso = eperson;
|
modalRef.componentInstance.dso = eperson;
|
||||||
modalRef.componentInstance.headerLabel = 'confirmation-modal.delete-eperson.header';
|
modalRef.componentInstance.headerLabel = 'confirmation-modal.delete-eperson.header';
|
||||||
@@ -473,23 +475,32 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
modalRef.componentInstance.confirmLabel = 'confirmation-modal.delete-eperson.confirm';
|
modalRef.componentInstance.confirmLabel = 'confirmation-modal.delete-eperson.confirm';
|
||||||
modalRef.componentInstance.brandColor = 'danger';
|
modalRef.componentInstance.brandColor = 'danger';
|
||||||
modalRef.componentInstance.confirmIcon = 'fas fa-trash';
|
modalRef.componentInstance.confirmIcon = 'fas fa-trash';
|
||||||
modalRef.componentInstance.response.pipe(take(1)).subscribe((confirm: boolean) => {
|
|
||||||
if (confirm) {
|
return modalRef.componentInstance.response.pipe(
|
||||||
if (hasValue(eperson.id)) {
|
take(1),
|
||||||
this.epersonService.deleteEPerson(eperson).pipe(getFirstCompletedRemoteData()).subscribe((restResponse: RemoteData<NoContent>) => {
|
switchMap((confirm: boolean) => {
|
||||||
if (restResponse.hasSucceeded) {
|
if (confirm && hasValue(eperson.id)) {
|
||||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
|
this.canDelete$ = observableOf(false);
|
||||||
this.submitForm.emit();
|
return this.epersonService.deleteEPerson(eperson).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson }))
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.notificationsService.error('Error occured when trying to delete EPerson with id: ' + eperson.id + ' with code: ' + restResponse.statusCode + ' and message: ' + restResponse.errorMessage);
|
return observableOf(null);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
finalize(() => this.canDelete$ = observableOf(true))
|
||||||
|
);
|
||||||
|
})
|
||||||
|
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||||
|
if (restResponse?.hasSucceeded) {
|
||||||
|
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
|
||||||
|
} else {
|
||||||
|
this.notificationsService.error(`Error occurred when trying to delete EPerson with id: ${eperson?.id} with code: ${restResponse?.statusCode} and message: ${restResponse?.errorMessage}`);
|
||||||
}
|
}
|
||||||
this.cancelForm.emit();
|
this.cancelForm.emit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop impersonating the EPerson
|
* Stop impersonating the EPerson
|
||||||
@@ -523,7 +534,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
* Cancel the current edit when component is destroyed & unsub all subscriptions
|
* Cancel the current edit when component is destroyed & unsub all subscriptions
|
||||||
*/
|
*/
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.onCancel();
|
|
||||||
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
|
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
|
||||||
this.paginationService.clearPagination(this.config.id);
|
this.paginationService.clearPagination(this.config.id);
|
||||||
if (hasValue(this.emailValueChangeSubscribe)) {
|
if (hasValue(this.emailValueChangeSubscribe)) {
|
||||||
|
@@ -6,5 +6,9 @@
|
|||||||
(deselect)="onDeselect($event)">
|
(deselect)="onDeselect($event)">
|
||||||
</ds-vocabulary-treeview>
|
</ds-vocabulary-treeview>
|
||||||
</div>
|
</div>
|
||||||
<a class="btn btn-primary" [routerLink]="['/search']" [queryParams]="queryParams">{{ 'browse.taxonomy.button' | translate }}</a>
|
<a class="btn btn-primary"
|
||||||
|
[routerLink]="['/search']"
|
||||||
|
[queryParams]="queryParams"
|
||||||
|
[queryParamsHandling]="'merge'">
|
||||||
|
{{ 'browse.taxonomy.button' | translate }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -775,6 +775,8 @@
|
|||||||
|
|
||||||
"browse.comcol.by.subject": "By Subject",
|
"browse.comcol.by.subject": "By Subject",
|
||||||
|
|
||||||
|
"browse.comcol.by.srsc": "By Subject Category",
|
||||||
|
|
||||||
"browse.comcol.by.title": "By Title",
|
"browse.comcol.by.title": "By Title",
|
||||||
|
|
||||||
"browse.comcol.head": "Browse",
|
"browse.comcol.head": "Browse",
|
||||||
|
@@ -1,4 +1,17 @@
|
|||||||
import Mirador from 'mirador/dist/es/src/index';
|
import Mirador from 'mirador/dist/es/src/index';
|
||||||
|
|
||||||
|
// You can modify this default Mirador configuration file. However,
|
||||||
|
// you should consider creating a copy of this file named
|
||||||
|
// 'config.local.js'. If that file exists it will be used to build
|
||||||
|
// your local Mirador instance. This allows you to keep local
|
||||||
|
// Mirador configuration separate from this default distribution
|
||||||
|
// copy.
|
||||||
|
|
||||||
|
// For an example of all Mirador configuration options, see
|
||||||
|
// https://github.com/ProjectMirador/mirador/blob/master/src/config/settings.js
|
||||||
|
|
||||||
|
// You can add or remove plugins. When adding new plugins be sure to also
|
||||||
|
// import them into the project via your package.json dependencies.
|
||||||
import miradorShareDialogPlugin from 'mirador-share-plugin/es/MiradorShareDialog';
|
import miradorShareDialogPlugin from 'mirador-share-plugin/es/MiradorShareDialog';
|
||||||
import miradorSharePlugin from 'mirador-share-plugin/es/miradorSharePlugin';
|
import miradorSharePlugin from 'mirador-share-plugin/es/miradorSharePlugin';
|
||||||
import miradorDownloadPlugin from 'mirador-dl-plugin/es/miradorDownloadPlugin';
|
import miradorDownloadPlugin from 'mirador-dl-plugin/es/miradorDownloadPlugin';
|
@@ -1,10 +1,13 @@
|
|||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
// @ts-ignore
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
entry: {
|
entry: {
|
||||||
mirador: './src/mirador-viewer/index.js'
|
mirador: fs.existsSync('./src/mirador-viewer/config.local.js')? './src/mirador-viewer/config.local.js' :
|
||||||
|
'./src/mirador-viewer/config.default.js'
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, '..' , 'dist/iiif/mirador'),
|
path: path.resolve(__dirname, '..' , 'dist/iiif/mirador'),
|
||||||
|
Reference in New Issue
Block a user