mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
Merge remote-tracking branch 'upstream/main' into w2p-78407_allow-html-in-license-section
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -53,6 +53,9 @@ jobs:
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install the latest chromedriver compatible with the installed chrome version
|
||||
run: yarn global add chromedriver --detect_chromedriver_version
|
||||
|
||||
- name: Install Yarn dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
@@ -94,7 +97,9 @@ jobs:
|
||||
run: curl http://localhost:8080/server/api
|
||||
|
||||
- name: Run e2e tests (integration tests)
|
||||
run: yarn run e2e:ci
|
||||
run: |
|
||||
chromedriver --url-base='/wd/hub' --port=4444 &
|
||||
yarn run e2e:ci
|
||||
|
||||
- name: Shutdown Docker containers
|
||||
run: docker-compose -f ./docker/docker-compose-ci.yml down
|
||||
|
@@ -7,4 +7,8 @@ config.capabilities = {
|
||||
}
|
||||
};
|
||||
|
||||
// don't use protractor's webdriver, as it may be incompatible with the installed chrome version
|
||||
config.directConnect = false;
|
||||
config.seleniumAddress = 'http://localhost:4444/wd/hub';
|
||||
|
||||
exports.config = config;
|
||||
|
@@ -32,7 +32,7 @@
|
||||
"lint": "ng lint",
|
||||
"lint-fix": "ng lint --fix=true",
|
||||
"e2e": "ng e2e",
|
||||
"e2e:ci": "ng e2e --protractor-config=./e2e/protractor-ci.conf.js",
|
||||
"e2e:ci": "ng e2e --webdriver-update=false --protractor-config=./e2e/protractor-ci.conf.js",
|
||||
"compile:server": "webpack --config webpack.server.config.js --progress --color",
|
||||
"serve:ssr": "node dist/server",
|
||||
"clean:coverage": "rimraf coverage",
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div class="container">
|
||||
<div class="d-flex flex-wrap">
|
||||
<div>
|
||||
<h1 class="display-3">Welcome to the DSpace 7 Preview</h1>
|
||||
<h1 class="display-3">DSpace 7</h1>
|
||||
<p class="lead">DSpace is the world leading open source repository platform that enables organisations to:</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -13,6 +13,8 @@
|
||||
</li>
|
||||
<li>issue permanent urls and trustworthy identifiers, including optional integrations with handle.net and DataCite DOI</li>
|
||||
</ul>
|
||||
<p>Join an international community of <A HREF="https://wiki.duraspace.org/display/DSPACE/DSpace+Positioning" TARGET="_NEW">leading institutions using DSpace</A>.</p>
|
||||
<p>Join an international community of <a href="https://wiki.lyrasis.org/display/DSPACE/DSpace+Positioning"
|
||||
target="_blank">leading institutions using DSpace</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -45,32 +45,32 @@ export const sendRequest = (requestService: RequestService) =>
|
||||
(source: Observable<RestRequest>): Observable<RestRequest> =>
|
||||
source.pipe(tap((request: RestRequest) => requestService.send(request)));
|
||||
|
||||
export const getRemoteDataPayload = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
export const getRemoteDataPayload = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
source.pipe(map((remoteData: RemoteData<T>) => remoteData.payload));
|
||||
|
||||
export const getPaginatedListPayload = () =>
|
||||
<T>(source: Observable<PaginatedList<T>>): Observable<T[]> =>
|
||||
export const getPaginatedListPayload = <T>() =>
|
||||
(source: Observable<PaginatedList<T>>): Observable<T[]> =>
|
||||
source.pipe(map((list: PaginatedList<T>) => list.page));
|
||||
|
||||
export const getAllCompletedRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const getAllCompletedRemoteData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(filter((rd: RemoteData<T>) => hasValue(rd) && rd.hasCompleted));
|
||||
|
||||
export const getFirstCompletedRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const getFirstCompletedRemoteData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(getAllCompletedRemoteData(), take(1));
|
||||
|
||||
export const takeUntilCompletedRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const takeUntilCompletedRemoteData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(takeWhile((rd: RemoteData<T>) => hasNoValue(rd) || rd.isLoading, true));
|
||||
|
||||
export const getFirstSucceededRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const getFirstSucceededRemoteData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(filter((rd: RemoteData<T>) => rd.hasSucceeded), take(1));
|
||||
|
||||
export const getFirstSucceededRemoteWithNotEmptyData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const getFirstSucceededRemoteWithNotEmptyData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(find((rd: RemoteData<T>) => rd.hasSucceeded && isNotEmpty(rd.payload)));
|
||||
|
||||
/**
|
||||
@@ -83,8 +83,8 @@ export const getFirstSucceededRemoteWithNotEmptyData = () =>
|
||||
* These operators were created as a first step in refactoring
|
||||
* out all the instances where this is used incorrectly.
|
||||
*/
|
||||
export const getFirstSucceededRemoteDataPayload = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
export const getFirstSucceededRemoteDataPayload = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
source.pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
getRemoteDataPayload()
|
||||
@@ -100,8 +100,8 @@ export const getFirstSucceededRemoteDataPayload = () =>
|
||||
* These operators were created as a first step in refactoring
|
||||
* out all the instances where this is used incorrectly.
|
||||
*/
|
||||
export const getFirstSucceededRemoteDataWithNotEmptyPayload = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
export const getFirstSucceededRemoteDataWithNotEmptyPayload = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
source.pipe(
|
||||
getFirstSucceededRemoteWithNotEmptyData(),
|
||||
getRemoteDataPayload()
|
||||
@@ -117,8 +117,8 @@ export const getFirstSucceededRemoteDataWithNotEmptyPayload = () =>
|
||||
* These operators were created as a first step in refactoring
|
||||
* out all the instances where this is used incorrectly.
|
||||
*/
|
||||
export const getAllSucceededRemoteDataPayload = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
export const getAllSucceededRemoteDataPayload = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<T> =>
|
||||
source.pipe(
|
||||
getAllSucceededRemoteData(),
|
||||
getRemoteDataPayload()
|
||||
@@ -138,8 +138,8 @@ export const getAllSucceededRemoteDataPayload = () =>
|
||||
* These operators were created as a first step in refactoring
|
||||
* out all the instances where this is used incorrectly.
|
||||
*/
|
||||
export const getFirstSucceededRemoteListPayload = () =>
|
||||
<T>(source: Observable<RemoteData<PaginatedList<T>>>): Observable<T[]> =>
|
||||
export const getFirstSucceededRemoteListPayload = <T>() =>
|
||||
(source: Observable<RemoteData<PaginatedList<T>>>): Observable<T[]> =>
|
||||
source.pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
@@ -160,8 +160,8 @@ export const getFirstSucceededRemoteListPayload = () =>
|
||||
* These operators were created as a first step in refactoring
|
||||
* out all the instances where this is used incorrectly.
|
||||
*/
|
||||
export const getAllSucceededRemoteListPayload = () =>
|
||||
<T>(source: Observable<RemoteData<PaginatedList<T>>>): Observable<T[]> =>
|
||||
export const getAllSucceededRemoteListPayload = <T>() =>
|
||||
(source: Observable<RemoteData<PaginatedList<T>>>): Observable<T[]> =>
|
||||
source.pipe(
|
||||
getAllSucceededRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
@@ -174,8 +174,8 @@ export const getAllSucceededRemoteListPayload = () =>
|
||||
* @param router The router used to navigate to a new page
|
||||
* @param authService Service to check if the user is authenticated
|
||||
*/
|
||||
export const redirectOn4xx = (router: Router, authService: AuthService) =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const redirectOn4xx = <T>(router: Router, authService: AuthService) =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
observableCombineLatest(source, authService.isAuthenticated()).pipe(
|
||||
map(([rd, isAuthenticated]: [RemoteData<T>, boolean]) => {
|
||||
if (rd.hasFailed) {
|
||||
@@ -229,16 +229,16 @@ export const returnEndUserAgreementUrlTreeOnFalse = (router: Router, redirect: s
|
||||
return hasAgreed ? hasAgreed : router.createUrlTree([getEndUserAgreementPath()], { queryParams });
|
||||
}));
|
||||
|
||||
export const getFinishedRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const getFinishedRemoteData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(find((rd: RemoteData<T>) => !rd.isLoading));
|
||||
|
||||
export const getAllSucceededRemoteData = () =>
|
||||
<T>(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
export const getAllSucceededRemoteData = <T>() =>
|
||||
(source: Observable<RemoteData<T>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(filter((rd: RemoteData<T>) => rd.hasSucceeded));
|
||||
|
||||
export const toDSpaceObjectListRD = () =>
|
||||
<T extends DSpaceObject>(source: Observable<RemoteData<PaginatedList<SearchResult<T>>>>): Observable<RemoteData<PaginatedList<T>>> =>
|
||||
export const toDSpaceObjectListRD = <T extends DSpaceObject>() =>
|
||||
(source: Observable<RemoteData<PaginatedList<SearchResult<T>>>>): Observable<RemoteData<PaginatedList<T>>> =>
|
||||
source.pipe(
|
||||
filter((rd: RemoteData<PaginatedList<SearchResult<T>>>) => rd.hasSucceeded),
|
||||
map((rd: RemoteData<PaginatedList<SearchResult<T>>>) => {
|
||||
|
@@ -56,7 +56,7 @@
|
||||
<p class="m-0">
|
||||
<a class="text-white" href="http://www.dspace.org/">{{ 'footer.link.dspace' | translate}}</a>
|
||||
{{ 'footer.copyright' | translate:{year: dateObj | date:'y'} }}
|
||||
<a class="text-white" href="http://www.duraspace.org/">{{ 'footer.link.duraspace' | translate}}</a>
|
||||
<a class="text-white" href="https://www.lyrasis.org/">{{ 'footer.link.lyrasis' | translate}}</a>
|
||||
</p>
|
||||
<ul class="footer-info list-unstyled small d-flex justify-content-center mb-0">
|
||||
<li>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
'd-none': value?.isVirtual && (model.hasSelectableMetadata || context?.index > 0)}">
|
||||
<div [ngClass]="getClass('grid', 'control')">
|
||||
<ng-container #componentViewContainer></ng-container>
|
||||
<small *ngIf="hasHint && (model.repeatable === false || context?.index === context?.context?.groups?.length - 1) && (!showErrorMessages || errorMessages.length === 0)"
|
||||
<small *ngIf="hasHint && ((model.repeatable === false && (isRelationship === false || value?.value === null)) || (model.repeatable === true && context?.index === context?.context?.groups?.length - 1)) && (!showErrorMessages || errorMessages.length === 0)"
|
||||
class="text-muted ds-hint" [innerHTML]="model.hint | translate" [ngClass]="getClass('element', 'hint')"></small>
|
||||
<!-- In case of repeatable fields show empty space for all elements except the first -->
|
||||
<div *ngIf="context?.index !== null
|
||||
@@ -35,7 +35,7 @@
|
||||
<option *ngFor="let lang of model.languageCodes" [value]="lang.code">{{lang.display}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div *ngIf="isRelationship && !isVirtual()" class="col-auto text-center">
|
||||
<div *ngIf="isRelationship" class="col-auto text-center">
|
||||
<button class="btn btn-secondary"
|
||||
type="button"
|
||||
ngbTooltip="{{'form.lookup-help' | translate}}"
|
||||
|
@@ -23,7 +23,7 @@ class CustomLoader implements TranslateLoader {
|
||||
'footer': {
|
||||
'copyright': 'copyright © 2002-{{ year }}',
|
||||
'link.dspace': 'DSpace software',
|
||||
'link.duraspace': 'DuraSpace'
|
||||
'link.lyrasis': 'LYRASIS'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -17,12 +17,14 @@ import { RouterStub } from '../../shared/testing/router.stub';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
import { mockSubmissionObject } from '../../shared/mocks/submission.mock';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
|
||||
describe('SubmissionEditComponent Component', () => {
|
||||
|
||||
let comp: SubmissionEditComponent;
|
||||
let fixture: ComponentFixture<SubmissionEditComponent>;
|
||||
let submissionServiceStub: SubmissionServiceStub;
|
||||
let itemDataService: ItemDataService;
|
||||
let router: RouterStub;
|
||||
|
||||
const submissionId = '826';
|
||||
@@ -30,6 +32,9 @@ describe('SubmissionEditComponent Component', () => {
|
||||
const submissionObject: any = mockSubmissionObject;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
itemDataService = jasmine.createSpyObj('itemDataService', {
|
||||
findByHref: createSuccessfulRemoteDataObject$(submissionObject.item),
|
||||
});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
@@ -41,6 +46,7 @@ describe('SubmissionEditComponent Component', () => {
|
||||
providers: [
|
||||
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
||||
{ provide: SubmissionService, useClass: SubmissionServiceStub },
|
||||
{ provide: ItemDataService, useValue: itemDataService },
|
||||
{ provide: TranslateService, useValue: getMockTranslateService() },
|
||||
{ provide: Router, useValue: new RouterStub() },
|
||||
{ provide: ActivatedRoute, useValue: route },
|
||||
@@ -63,7 +69,7 @@ describe('SubmissionEditComponent Component', () => {
|
||||
router = null;
|
||||
});
|
||||
|
||||
it('should init properly when a valid SubmissionObject has been retrieved', fakeAsync(() => {
|
||||
it('should init properly when a valid SubmissionObject has been retrieved',() => {
|
||||
|
||||
route.testParams = { id: submissionId };
|
||||
submissionServiceStub.retrieveSubmission.and.returnValue(
|
||||
@@ -78,9 +84,9 @@ describe('SubmissionEditComponent Component', () => {
|
||||
expect(comp.sections).toBe(submissionObject.sections);
|
||||
expect(comp.submissionDefinition).toBe(submissionObject.submissionDefinition);
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
it('should redirect to mydspace when an empty SubmissionObject has been retrieved', fakeAsync(() => {
|
||||
it('should redirect to mydspace when an empty SubmissionObject has been retrieved',() => {
|
||||
|
||||
route.testParams = { id: submissionId };
|
||||
submissionServiceStub.retrieveSubmission.and.returnValue(createSuccessfulRemoteDataObject$({})
|
||||
@@ -90,9 +96,9 @@ describe('SubmissionEditComponent Component', () => {
|
||||
|
||||
expect(router.navigate).toHaveBeenCalled();
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
it('should not has effects when an invalid SubmissionObject has been retrieved', fakeAsync(() => {
|
||||
it('should not has effects when an invalid SubmissionObject has been retrieved',() => {
|
||||
|
||||
route.testParams = { id: submissionId };
|
||||
submissionServiceStub.retrieveSubmission.and.returnValue(observableOf(null));
|
||||
@@ -104,6 +110,6 @@ describe('SubmissionEditComponent Component', () => {
|
||||
expect(comp.selfUrl).toBeUndefined();
|
||||
expect(comp.sections).toBeUndefined();
|
||||
expect(comp.submissionDefinition).toBeUndefined();
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -2,11 +2,11 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
import { filter, switchMap } from 'rxjs/operators';
|
||||
import { filter, switchMap, debounceTime } from 'rxjs/operators';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { WorkspaceitemSectionsObject } from '../../core/submission/models/workspaceitem-sections.model';
|
||||
import { hasValue, isEmpty, isNotNull } from '../../shared/empty.util';
|
||||
import { hasValue, isEmpty, isNotNull, isNotEmptyOperator } from '../../shared/empty.util';
|
||||
import { SubmissionDefinitionsModel } from '../../core/config/models/config-submission-definitions.model';
|
||||
import { SubmissionService } from '../submission.service';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
@@ -14,6 +14,9 @@ import { SubmissionObject } from '../../core/submission/models/submission-object
|
||||
import { Collection } from '../../core/shared/collection.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { getAllSucceededRemoteData } from '../../core/shared/operators';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
||||
|
||||
/**
|
||||
* This component allows to edit an existing workspaceitem/workflowitem.
|
||||
@@ -60,6 +63,16 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
* @type {Array}
|
||||
*/
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
/**
|
||||
* BehaviorSubject containing the self link to the item for this submission
|
||||
* @private
|
||||
*/
|
||||
private itemLink$: BehaviorSubject<string> = new BehaviorSubject(undefined);
|
||||
|
||||
/**
|
||||
* The item for this submission.
|
||||
*/
|
||||
public item: Item;
|
||||
|
||||
/**
|
||||
@@ -69,6 +82,7 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
* @param {NotificationsService} notificationsService
|
||||
* @param {ActivatedRoute} route
|
||||
* @param {Router} router
|
||||
* @param {ItemDataService} itemDataService
|
||||
* @param {SubmissionService} submissionService
|
||||
* @param {TranslateService} translate
|
||||
*/
|
||||
@@ -76,6 +90,7 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
private notificationsService: NotificationsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private itemDataService: ItemDataService,
|
||||
private submissionService: SubmissionService,
|
||||
private translate: TranslateService) {
|
||||
}
|
||||
@@ -84,7 +99,8 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
* Retrieve workspaceitem/workflowitem from server and initialize all instance variables
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.subs.push(this.route.paramMap.pipe(
|
||||
this.subs.push(
|
||||
this.route.paramMap.pipe(
|
||||
switchMap((params: ParamMap) => this.submissionService.retrieveSubmission(params.get('id'))),
|
||||
// NOTE new submission is retrieved on the browser side only, so get null on server side rendering
|
||||
filter((submissionObjectRD: RemoteData<SubmissionObject>) => isNotNull(submissionObjectRD))
|
||||
@@ -98,9 +114,9 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
this.collectionId = (submissionObjectRD.payload.collection as Collection).id;
|
||||
this.selfUrl = submissionObjectRD.payload._links.self.href;
|
||||
this.sections = submissionObjectRD.payload.sections;
|
||||
this.item = submissionObjectRD.payload.item as Item;
|
||||
this.itemLink$.next(submissionObjectRD.payload._links.item.href);
|
||||
this.item = submissionObjectRD.payload.item;
|
||||
this.submissionDefinition = (submissionObjectRD.payload.submissionDefinition as SubmissionDefinitionsModel);
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
} else {
|
||||
if (submissionObjectRD.statusCode === 404) {
|
||||
@@ -109,7 +125,21 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
// TODO handle generic error
|
||||
}
|
||||
}));
|
||||
}),
|
||||
this.itemLink$.pipe(
|
||||
isNotEmptyOperator(),
|
||||
switchMap((itemLink: string) =>
|
||||
this.itemDataService.findByHref(itemLink)
|
||||
),
|
||||
getAllSucceededRemoteData(),
|
||||
// Multiple sources can update the item in quick succession.
|
||||
// We only want to rerender the form if the item is unchanged for some time
|
||||
debounceTime(300),
|
||||
).subscribe((itemRd: RemoteData<Item>) => {
|
||||
this.item = itemRd.payload;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -15,18 +15,24 @@ import { RouterStub } from '../../shared/testing/router.stub';
|
||||
import { mockSubmissionObject } from '../../shared/mocks/submission.mock';
|
||||
import { SubmissionSubmitComponent } from './submission-submit.component';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
|
||||
describe('SubmissionSubmitComponent Component', () => {
|
||||
|
||||
let comp: SubmissionSubmitComponent;
|
||||
let fixture: ComponentFixture<SubmissionSubmitComponent>;
|
||||
let submissionServiceStub: SubmissionServiceStub;
|
||||
let itemDataService: ItemDataService;
|
||||
let router: RouterStub;
|
||||
|
||||
const submissionId = '826';
|
||||
const submissionObject: any = mockSubmissionObject;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
itemDataService = jasmine.createSpyObj('itemDataService', {
|
||||
findByHref: createSuccessfulRemoteDataObject$(submissionObject.item),
|
||||
});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
@@ -38,6 +44,7 @@ describe('SubmissionSubmitComponent Component', () => {
|
||||
providers: [
|
||||
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
||||
{ provide: SubmissionService, useClass: SubmissionServiceStub },
|
||||
{ provide: ItemDataService, useValue: itemDataService },
|
||||
{ provide: TranslateService, useValue: getMockTranslateService() },
|
||||
{ provide: Router, useValue: new RouterStub() },
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||
@@ -60,7 +67,7 @@ describe('SubmissionSubmitComponent Component', () => {
|
||||
router = null;
|
||||
});
|
||||
|
||||
it('should init properly when a valid SubmissionObject has been retrieved', fakeAsync(() => {
|
||||
it('should init properly when a valid SubmissionObject has been retrieved',() => {
|
||||
|
||||
submissionServiceStub.createSubmission.and.returnValue(observableOf(submissionObject));
|
||||
|
||||
@@ -72,9 +79,9 @@ describe('SubmissionSubmitComponent Component', () => {
|
||||
expect(comp.sections).toBe(submissionObject.sections);
|
||||
expect(comp.submissionDefinition).toBe(submissionObject.submissionDefinition);
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
it('should redirect to mydspace when an empty SubmissionObject has been retrieved', fakeAsync(() => {
|
||||
it('should redirect to mydspace when an empty SubmissionObject has been retrieved',() => {
|
||||
|
||||
submissionServiceStub.createSubmission.and.returnValue(observableOf({}));
|
||||
|
||||
@@ -82,9 +89,9 @@ describe('SubmissionSubmitComponent Component', () => {
|
||||
|
||||
expect(router.navigate).toHaveBeenCalled();
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
it('should not has effects when an invalid SubmissionObject has been retrieved', fakeAsync(() => {
|
||||
it('should not has effects when an invalid SubmissionObject has been retrieved',() => {
|
||||
|
||||
submissionServiceStub.createSubmission.and.returnValue(observableOf(null));
|
||||
|
||||
@@ -94,6 +101,6 @@ describe('SubmissionSubmitComponent Component', () => {
|
||||
expect(comp.collectionId).toBeUndefined();
|
||||
expect(comp.selfUrl).toBeUndefined();
|
||||
expect(comp.submissionDefinition).toBeUndefined();
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
import { hasValue, isEmpty, isNotNull } from '../../shared/empty.util';
|
||||
import { hasValue, isEmpty, isNotNull, isNotEmptyOperator } from '../../shared/empty.util';
|
||||
import { SubmissionDefinitionsModel } from '../../core/config/models/config-submission-definitions.model';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
@@ -12,6 +12,11 @@ import { SubmissionObject } from '../../core/submission/models/submission-object
|
||||
import { Collection } from '../../core/shared/collection.model';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { WorkspaceitemSectionsObject } from '../../core/submission/models/workspaceitem-sections.model';
|
||||
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
||||
import { switchMap, debounceTime } from 'rxjs/operators';
|
||||
import { getAllSucceededRemoteData } from '../../core/shared/operators';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
|
||||
/**
|
||||
* This component allows to submit a new workspaceitem.
|
||||
@@ -28,6 +33,16 @@ export class SubmissionSubmitComponent implements OnDestroy, OnInit {
|
||||
* @type {string}
|
||||
*/
|
||||
public collectionId: string;
|
||||
|
||||
/**
|
||||
* BehaviorSubject containing the self link to the item for this submission
|
||||
* @private
|
||||
*/
|
||||
private itemLink$: BehaviorSubject<string> = new BehaviorSubject(undefined);
|
||||
|
||||
/**
|
||||
* The item for this submission.
|
||||
*/
|
||||
public item: Item;
|
||||
|
||||
/**
|
||||
@@ -71,6 +86,7 @@ export class SubmissionSubmitComponent implements OnDestroy, OnInit {
|
||||
*
|
||||
* @param {ChangeDetectorRef} changeDetectorRef
|
||||
* @param {NotificationsService} notificationsService
|
||||
* @param {ItemDataService} itemDataService
|
||||
* @param {SubmissionService} submissionService
|
||||
* @param {Router} router
|
||||
* @param {TranslateService} translate
|
||||
@@ -80,13 +96,16 @@ export class SubmissionSubmitComponent implements OnDestroy, OnInit {
|
||||
constructor(private changeDetectorRef: ChangeDetectorRef,
|
||||
private notificationsService: NotificationsService,
|
||||
private router: Router,
|
||||
private itemDataService: ItemDataService,
|
||||
private submissionService: SubmissionService,
|
||||
private translate: TranslateService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private route: ActivatedRoute) {
|
||||
this.route
|
||||
.queryParams
|
||||
.subscribe((params) => { this.collectionParam = (params.collection); });
|
||||
.subscribe((params) => {
|
||||
this.collectionParam = (params.collection);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,10 +127,23 @@ export class SubmissionSubmitComponent implements OnDestroy, OnInit {
|
||||
this.selfUrl = submissionObject._links.self.href;
|
||||
this.submissionDefinition = (submissionObject.submissionDefinition as SubmissionDefinitionsModel);
|
||||
this.submissionId = submissionObject.id;
|
||||
this.itemLink$.next(submissionObject._links.item.href);
|
||||
this.item = submissionObject.item as Item;
|
||||
}
|
||||
}
|
||||
}),
|
||||
this.itemLink$.pipe(
|
||||
isNotEmptyOperator(),
|
||||
switchMap((itemLink: string) =>
|
||||
this.itemDataService.findByHref(itemLink)
|
||||
),
|
||||
getAllSucceededRemoteData(),
|
||||
// Multiple sources can update the item in quick succession.
|
||||
// We only want to rerender the form if the item is unchanged for some time
|
||||
debounceTime(300),
|
||||
).subscribe((itemRd: RemoteData<Item>) => {
|
||||
this.item = itemRd.payload;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@@ -2287,9 +2287,9 @@
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2245,8 +2245,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "software DSpace",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2014,8 +2014,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace Software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -1241,7 +1241,7 @@
|
||||
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
"footer.link.cookies": "Cookie settings",
|
||||
|
||||
|
@@ -2081,8 +2081,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "Software DSpace",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -1891,8 +1891,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace-ohjelmisto",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2082,8 +2082,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -1748,8 +1748,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace szoftver",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
"footer.link.cookies": "Süti beállítások",
|
||||
|
@@ -2287,9 +2287,9 @@
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -1886,8 +1886,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2080,8 +2080,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2287,9 +2287,9 @@
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2037,8 +2037,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2037,8 +2037,8 @@
|
||||
// "footer.link.dspace": "DSpace software",
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2287,9 +2287,9 @@
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -2287,9 +2287,9 @@
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.dspace": "DSpace software",
|
||||
|
||||
// "footer.link.duraspace": "DuraSpace",
|
||||
// "footer.link.lyrasis": "LYRASIS",
|
||||
// TODO New key - Add a translation
|
||||
"footer.link.duraspace": "DuraSpace",
|
||||
"footer.link.lyrasis": "LYRASIS",
|
||||
|
||||
// "footer.link.cookies": "Cookie settings",
|
||||
// TODO New key - Add a translation
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<div class="jumbotron jumbotron-fluid">
|
||||
<div class="d-flex flex-wrap">
|
||||
<div>
|
||||
<h1 class="display-3">DSpace 7</h1>
|
||||
<h1 class="display-3">DSpace 7 - Beta 5</h1>
|
||||
<p class="lead">DSpace is the world leading open source repository platform that enables
|
||||
organisations to:</p>
|
||||
</div>
|
||||
@@ -20,6 +20,17 @@
|
||||
</li>
|
||||
</ul>
|
||||
<p>Join an international community of <a href="https://wiki.lyrasis.org/display/DSPACE/DSpace+Positioning" target="_blank">leading institutions using DSpace</a>.</p>
|
||||
<p>Participate in the <a href="https://wiki.lyrasis.org/display/DSPACE/DSpace+Release+7.0+Testathon+Page"
|
||||
target="_blank">official community Testathon</a>
|
||||
from <strong>April 19th through May 7th</strong>. The test user accounts below have their password set to the name of
|
||||
this
|
||||
software in lowercase.</p>
|
||||
<ul>
|
||||
<li>Demo Site Administrator = dspacedemo+admin@gmail.com</li>
|
||||
<li>Demo Community Administrator = dspacedemo+commadmin@gmail.com</li>
|
||||
<li>Demo Collection Administrator = dspacedemo+colladmin@gmail.com</li>
|
||||
<li>Demo Submitter = dspacedemo+submit@gmail.com</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<small class="credits">Photo by <a href="https://www.pexels.com/@inspiredimages">@inspiredimages</a></small>
|
||||
|
Reference in New Issue
Block a user