diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c856e8f5fe..6f4a11acc8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,5 +117,28 @@ jobs: chromedriver --url-base='/wd/hub' --port=4444 & yarn run e2e:ci + # Start up the app with SSR enabled (run in background) + - name: Start app in SSR (server-side rendering) mode + run: | + nohup yarn run serve:ssr & + printf 'Waiting for app to start' + until curl --output /dev/null --silent --head --fail http://localhost:4000/home; do + printf '.' + sleep 2 + done + echo "App started successfully." + + # Get homepage and verify that the tag includes "DSpace". + # If it does, then SSR is working, as this tag is created by our MetadataService. + # This step also prints entire HTML of homepage for easier debugging if grep fails. + - name: Verify SSR (server-side rendering) + run: | + result=$(wget -O- -q http://localhost:4000/home) + echo "$result" + echo "$result" | grep -oE "]*>" | grep DSpace + + - name: Stop running app + run: kill -9 $(lsof -t -i:4000) + - name: Shutdown Docker containers run: docker-compose -f ./docker/docker-compose-ci.yml down diff --git a/LICENSE b/LICENSE index b7cb98fe83..f55d21fe42 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ DSpace source code BSD License: -Copyright (c) 2002-2020, LYRASIS. All rights reserved. +Copyright (c) 2002-2021, LYRASIS. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/README.md b/README.md index 3f5351ec82..660152349f 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,34 @@ dspace-angular ============== -> The next UI for DSpace 7, based on Angular Universal. +> The DSpace User Interface built on [Angular](https://angular.io/), written in [TypeScript](https://www.typescriptlang.org/) and using [Angular Universal](https://angular.io/guide/universal). -This project is currently under active development. For more information on the DSpace 7 release see the [DSpace 7.0 Release Status wiki page](https://wiki.lyrasis.org/display/DSPACE/DSpace+Release+7.0+Status) +Overview +-------- -You can find additional information on the DSpace 7 Angular UI on the [wiki](https://wiki.lyrasis.org/display/DSPACE/DSpace+7+-+Angular+UI+Development). +DSpace open source software is a turnkey repository application used by more than +2,000 organizations and institutions worldwide to provide durable access to digital resources. +For more information, visit http://www.dspace.org/ +DSpace consists of both a Java-based backend and an Angular-based frontend. + +* Backend (https://github.com/DSpace/DSpace/) provides a REST API, along with other machine-based interfaces (e.g. OAI-PMH, SWORD, etc) + * The REST Contract is at https://github.com/DSpace/RestContract +* Frontend (this codebase) is the User Interface built on the REST API + +Downloads +--------- + +* Backend (REST API): https://github.com/DSpace/DSpace/releases +* Frontend (User Interface): https://github.com/DSpace/dspace-angular/releases + + +## Documentation / Installation + +Documentation for each release may be viewed online or downloaded via our [Documentation Wiki](https://wiki.lyrasis.org/display/DSDOC/). + +The latest DSpace Installation instructions are available at: +https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace Quick start ----------- @@ -146,6 +168,9 @@ This will build the application and put the result in the `dist` folder. You ca ### Running the application with Docker +NOTE: At this time, we do not have production-ready Docker images for DSpace. +That said, we do have quick-start Docker Compose scripts for development or testing purposes. + See [Docker Runtime Options](docker/README.md) @@ -403,8 +428,8 @@ Frequently asked questions - You can write your tests next to your component files. e.g. for `src/app/home/home.component.ts` call it `src/app/home/home.component.spec.ts` - How do I start the app when I get `EACCES` and `EADDRINUSE` errors? - The `EADDRINUSE` error means the port `4000` is currently being used and `EACCES` is lack of permission to build files to `./dist/` -- What are the naming conventions for Angular 2? - - See [the official angular 2 style guide](https://angular.io/styleguide) +- What are the naming conventions for Angular? + - See [the official angular style guide](https://angular.io/styleguide) - Why is the size of my app larger in development? - The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the intrest of build speed. - node-pre-gyp ERR in yarn install (Windows) @@ -415,6 +440,32 @@ Frequently asked questions - then run `git add yarn.lock` to stage the lockfile for commit - and `git commit` to conclude the merge +Getting Help +------------ + +DSpace provides public mailing lists where you can post questions or raise topics for discussion. +We welcome everyone to participate in these lists: + +* [dspace-community@googlegroups.com](https://groups.google.com/d/forum/dspace-community) : General discussion about DSpace platform, announcements, sharing of best practices +* [dspace-tech@googlegroups.com](https://groups.google.com/d/forum/dspace-tech) : Technical support mailing list. See also our guide for [How to troubleshoot an error](https://wiki.lyrasis.org/display/DSPACE/Troubleshoot+an+error). +* [dspace-devel@googlegroups.com](https://groups.google.com/d/forum/dspace-devel) : Developers / Development mailing list + +Great Q&A is also available under the [DSpace tag on Stackoverflow](http://stackoverflow.com/questions/tagged/dspace) + +Additional support options are at https://wiki.lyrasis.org/display/DSPACE/Support + +DSpace also has an active service provider network. If you'd rather hire a service provider to +install, upgrade, customize or host DSpace, then we recommend getting in touch with one of our +[Registered Service Providers](http://www.dspace.org/service-providers). + + +Issue Tracker +------------- + +DSpace uses GitHub to track issues: +* Backend (REST API) issues: https://github.com/DSpace/DSpace/issues +* Frontend (User Interface) issues: https://github.com/DSpace/dspace-angular/issues + License ------- This project's source code is made available under the DSpace BSD License: http://www.dspace.org/license diff --git a/src/app/+logout-page/logout-page.component.scss b/src/app/+logout-page/logout-page.component.scss deleted file mode 100644 index 7e594c0d9b..0000000000 --- a/src/app/+logout-page/logout-page.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../+login-page/login-page.component.scss'; diff --git a/src/app/+my-dspace-page/my-dspace-page.component.scss b/src/app/+my-dspace-page/my-dspace-page.component.scss deleted file mode 100644 index 98c426c269..0000000000 --- a/src/app/+my-dspace-page/my-dspace-page.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../+search-page/search.component.scss'; diff --git a/src/app/access-control/group-registry/group-form/group-form.component.ts b/src/app/access-control/group-registry/group-form/group-form.component.ts index c2c694f445..7e0329f54f 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.ts @@ -17,8 +17,8 @@ import { Subscription } from 'rxjs'; import { catchError, map, switchMap, take } from 'rxjs/operators'; -import { getCollectionEditRolesRoute } from '../../../+collection-page/collection-page-routing-paths'; -import { getCommunityEditRolesRoute } from '../../../+community-page/community-page-routing-paths'; +import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths'; +import { getCommunityEditRolesRoute } from '../../../community-page/community-page-routing-paths'; import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; diff --git a/src/app/+admin/admin-curation-tasks/admin-curation-tasks.component.html b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.html similarity index 100% rename from src/app/+admin/admin-curation-tasks/admin-curation-tasks.component.html rename to src/app/admin/admin-curation-tasks/admin-curation-tasks.component.html diff --git a/src/app/+admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts similarity index 100% rename from src/app/+admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts rename to src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts diff --git a/src/app/+admin/admin-curation-tasks/admin-curation-tasks.component.ts b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.ts similarity index 100% rename from src/app/+admin/admin-curation-tasks/admin-curation-tasks.component.ts rename to src/app/admin/admin-curation-tasks/admin-curation-tasks.component.ts diff --git a/src/app/+admin/admin-import-metadata-page/metadata-import-page.component.html b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.html similarity index 100% rename from src/app/+admin/admin-import-metadata-page/metadata-import-page.component.html rename to src/app/admin/admin-import-metadata-page/metadata-import-page.component.html diff --git a/src/app/+admin/admin-import-metadata-page/metadata-import-page.component.spec.ts b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts similarity index 100% rename from src/app/+admin/admin-import-metadata-page/metadata-import-page.component.spec.ts rename to src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts diff --git a/src/app/+admin/admin-import-metadata-page/metadata-import-page.component.ts b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts similarity index 100% rename from src/app/+admin/admin-import-metadata-page/metadata-import-page.component.ts rename to src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts diff --git a/src/app/+admin/admin-registries/admin-registries-routing-paths.ts b/src/app/admin/admin-registries/admin-registries-routing-paths.ts similarity index 100% rename from src/app/+admin/admin-registries/admin-registries-routing-paths.ts rename to src/app/admin/admin-registries/admin-registries-routing-paths.ts diff --git a/src/app/+admin/admin-registries/admin-registries-routing.module.ts b/src/app/admin/admin-registries/admin-registries-routing.module.ts similarity index 100% rename from src/app/+admin/admin-registries/admin-registries-routing.module.ts rename to src/app/admin/admin-registries/admin-registries-routing.module.ts diff --git a/src/app/+admin/admin-registries/admin-registries.module.ts b/src/app/admin/admin-registries/admin-registries.module.ts similarity index 100% rename from src/app/+admin/admin-registries/admin-registries.module.ts rename to src/app/admin/admin-registries/admin-registries.module.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.html b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.html similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.html rename to src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.html diff --git a/src/app/+admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts rename to src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts rename to src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-format.actions.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.actions.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-format.actions.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-format.actions.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.spec.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-format.reducers.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.html b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.html similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.html rename to src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.html diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.component.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.module.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.module.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts rename to src/app/admin/admin-registries/bitstream-formats/bitstream-formats.resolver.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.html b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.html similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.html rename to src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.html diff --git a/src/app/+admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts rename to src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts rename to src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/format-form/format-form.component.html b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.html similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/format-form/format-form.component.html rename to src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.html diff --git a/src/app/+admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts rename to src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts diff --git a/src/app/+admin/admin-registries/bitstream-formats/format-form/format-form.component.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts similarity index 100% rename from src/app/+admin/admin-registries/bitstream-formats/format-form/format-form.component.ts rename to src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.actions.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.actions.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.actions.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.actions.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.html b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.html similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.html rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.component.html diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.scss b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.scss similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.scss rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.component.scss diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.component.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.spec.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-registry.reducers.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-registry.reducers.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.html b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.html similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.html rename to src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.html diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts diff --git a/src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts rename to src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.html b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.html similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.html rename to src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.html diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts rename to src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts rename to src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.html b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.html similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.html rename to src/app/admin/admin-registries/metadata-schema/metadata-schema.component.html diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.scss b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.scss similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.scss rename to src/app/admin/admin-registries/metadata-schema/metadata-schema.component.scss diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts rename to src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts diff --git a/src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts similarity index 100% rename from src/app/+admin/admin-registries/metadata-schema/metadata-schema.component.ts rename to src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts diff --git a/src/app/+admin/admin-routing-paths.ts b/src/app/admin/admin-routing-paths.ts similarity index 100% rename from src/app/+admin/admin-routing-paths.ts rename to src/app/admin/admin-routing-paths.ts diff --git a/src/app/+admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts similarity index 100% rename from src/app/+admin/admin-routing.module.ts rename to src/app/admin/admin-routing.module.ts diff --git a/src/app/+admin/admin-search-page/admin-search-page.component.html b/src/app/admin/admin-search-page/admin-search-page.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-page.component.html rename to src/app/admin/admin-search-page/admin-search-page.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-page.component.scss b/src/app/admin/admin-search-page/admin-search-page.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-page.component.scss rename to src/app/admin/admin-search-page/admin-search-page.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-page.component.spec.ts b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-page.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-page.component.spec.ts diff --git a/src/app/+admin/admin-search-page/admin-search-page.component.ts b/src/app/admin/admin-search-page/admin-search-page.component.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-page.component.ts rename to src/app/admin/admin-search-page/admin-search-page.component.ts diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.scss b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.scss rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts similarity index 96% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts index 38762057ad..2cb0413bbc 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts @@ -12,7 +12,7 @@ import { CollectionSearchResult } from '../../../../../shared/object-collection/ import { Collection } from '../../../../../core/shared/collection.model'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths'; +import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; import { LinkService } from '../../../../../core/cache/builders/link.service'; describe('CollectionAdminSearchResultGridElementComponent', () => { diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts similarity index 92% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts index 9477544f60..1412090e0f 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts @@ -5,7 +5,7 @@ import { Context } from '../../../../../core/shared/context.model'; import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; import { Collection } from '../../../../../core/shared/collection.model'; import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; -import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths'; +import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; @listableObjectComponent(CollectionSearchResult, ViewMode.GridElement, Context.AdminSearch) @Component({ diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.scss b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.scss rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts similarity index 96% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts index 66df215f87..17ce2cd7a1 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts @@ -14,7 +14,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { CommunityAdminSearchResultGridElementComponent } from './community-admin-search-result-grid-element.component'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { Community } from '../../../../../core/shared/community.model'; -import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths'; +import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; import { LinkService } from '../../../../../core/cache/builders/link.service'; describe('CommunityAdminSearchResultGridElementComponent', () => { diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts similarity index 93% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts index 59117b1f65..b0d603338b 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts @@ -5,7 +5,7 @@ import { Context } from '../../../../../core/shared/context.model'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { Community } from '../../../../../core/shared/community.model'; import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; -import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths'; +import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; @listableObjectComponent(CommunitySearchResult, ViewMode.GridElement, Context.AdminSearch) @Component({ diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.scss b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.scss rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.scss b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.scss rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts similarity index 96% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts index 56e25264cf..b394caef56 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { CollectionSearchResult } from '../../../../../shared/object-collection/ import { Collection } from '../../../../../core/shared/collection.model'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths'; +import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts similarity index 92% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts index 9622888660..8bcf20b230 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts @@ -5,7 +5,7 @@ import { Context } from '../../../../../core/shared/context.model'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; import { Collection } from '../../../../../core/shared/collection.model'; -import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths'; +import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch) @Component({ diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.scss b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.scss rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts similarity index 96% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts index 29d9925326..155d7f7509 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts @@ -10,7 +10,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { Community } from '../../../../../core/shared/community.model'; -import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths'; +import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts similarity index 93% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts index 2e82e7f3b8..9419ae3f3f 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts @@ -5,7 +5,7 @@ import { Context } from '../../../../../core/shared/context.model'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { Community } from '../../../../../core/shared/community.model'; -import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths'; +import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch) @Component({ diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.scss b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.scss rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts diff --git a/src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts rename to src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts diff --git a/src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.html b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.html similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.html rename to src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.html diff --git a/src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.scss b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.scss similarity index 100% rename from src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.scss rename to src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.scss diff --git a/src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts similarity index 97% rename from src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts rename to src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts index 2696e621de..f354ac5f89 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts @@ -7,7 +7,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { ItemAdminSearchResultActionsComponent } from './item-admin-search-result-actions.component'; import { Item } from '../../../core/shared/item.model'; import { URLCombiner } from '../../../core/url-combiner/url-combiner'; -import { getItemEditRoute } from '../../../+item-page/item-page-routing-paths'; +import { getItemEditRoute } from '../../../item-page/item-page-routing-paths'; import { ITEM_EDIT_DELETE_PATH, ITEM_EDIT_MOVE_PATH, @@ -15,7 +15,7 @@ import { ITEM_EDIT_PUBLIC_PATH, ITEM_EDIT_REINSTATE_PATH, ITEM_EDIT_WITHDRAW_PATH -} from '../../../+item-page/edit-item-page/edit-item-page.routing-paths'; +} from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; describe('ItemAdminSearchResultActionsComponent', () => { let component: ItemAdminSearchResultActionsComponent; diff --git a/src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts similarity index 93% rename from src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts rename to src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts index cded519796..fcc3cf0f17 100644 --- a/src/app/+admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts @@ -1,7 +1,7 @@ import { Component, Input } from '@angular/core'; import { Item } from '../../../core/shared/item.model'; import { URLCombiner } from '../../../core/url-combiner/url-combiner'; -import { getItemEditRoute } from '../../../+item-page/item-page-routing-paths'; +import { getItemEditRoute } from '../../../item-page/item-page-routing-paths'; import { ITEM_EDIT_MOVE_PATH, ITEM_EDIT_DELETE_PATH, @@ -9,7 +9,7 @@ import { ITEM_EDIT_PRIVATE_PATH, ITEM_EDIT_REINSTATE_PATH, ITEM_EDIT_WITHDRAW_PATH -} from '../../../+item-page/edit-item-page/edit-item-page.routing-paths'; +} from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; @Component({ selector: 'ds-item-admin-search-result-actions-element', diff --git a/src/app/+admin/admin-search-page/admin-search.module.ts b/src/app/admin/admin-search-page/admin-search.module.ts similarity index 100% rename from src/app/+admin/admin-search-page/admin-search.module.ts rename to src/app/admin/admin-search-page/admin-search.module.ts diff --git a/src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.html b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.html similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.html rename to src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.html diff --git a/src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.scss b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.scss similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.scss rename to src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.scss diff --git a/src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts rename to src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts diff --git a/src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts rename to src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.html b/src/app/admin/admin-sidebar/admin-sidebar.component.html similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar.component.html rename to src/app/admin/admin-sidebar/admin-sidebar.component.html diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.scss b/src/app/admin/admin-sidebar/admin-sidebar.component.scss similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar.component.scss rename to src/app/admin/admin-sidebar/admin-sidebar.component.scss diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar.component.spec.ts rename to src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.ts similarity index 100% rename from src/app/+admin/admin-sidebar/admin-sidebar.component.ts rename to src/app/admin/admin-sidebar/admin-sidebar.component.ts diff --git a/src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html similarity index 100% rename from src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html rename to src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html diff --git a/src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.scss b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.scss similarity index 100% rename from src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.scss rename to src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.scss diff --git a/src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts similarity index 100% rename from src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts rename to src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts diff --git a/src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts similarity index 100% rename from src/app/+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts rename to src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-page.component.html b/src/app/admin/admin-workflow-page/admin-workflow-page.component.html similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-page.component.html rename to src/app/admin/admin-workflow-page/admin-workflow-page.component.html diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-page.component.scss b/src/app/admin/admin-workflow-page/admin-workflow-page.component.scss similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-page.component.scss rename to src/app/admin/admin-workflow-page/admin-workflow-page.component.scss diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-page.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-page.component.spec.ts rename to src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-page.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-page.component.ts rename to src/app/admin/admin-workflow-page/admin-workflow-page.component.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.html b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.html similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.html rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.html diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.scss b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.scss similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.scss rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.scss diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.html b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.html similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.html rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.html diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.scss b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.scss similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.scss rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.scss diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.html b/src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.html similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.html rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.html diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.scss b/src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.scss similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.scss rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.scss diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.spec.ts similarity index 96% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.spec.ts rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.spec.ts index cb1a0c9cdf..75e0e2e7a8 100644 --- a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.spec.ts @@ -10,7 +10,7 @@ import { WorkflowItem } from '../../../core/submission/models/workflowitem.model import { getWorkflowItemDeleteRoute, getWorkflowItemSendBackRoute -} from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing-paths'; +} from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; describe('WorkflowItemAdminWorkflowActionsComponent', () => { let component: WorkflowItemAdminWorkflowActionsComponent; diff --git a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts similarity index 93% rename from src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts rename to src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts index fbda9f1b29..32725a0e7a 100644 --- a/src/app/+admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/workflow-item-admin-workflow-actions.component.ts @@ -3,7 +3,7 @@ import { WorkflowItem } from '../../../core/submission/models/workflowitem.model import { getWorkflowItemSendBackRoute, getWorkflowItemDeleteRoute -} from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing-paths'; +} from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; @Component({ selector: 'ds-workflow-item-admin-workflow-actions-element', diff --git a/src/app/+admin/admin-workflow-page/admin-workflow.module.ts b/src/app/admin/admin-workflow-page/admin-workflow.module.ts similarity index 100% rename from src/app/+admin/admin-workflow-page/admin-workflow.module.ts rename to src/app/admin/admin-workflow-page/admin-workflow.module.ts diff --git a/src/app/+admin/admin.module.ts b/src/app/admin/admin.module.ts similarity index 100% rename from src/app/+admin/admin.module.ts rename to src/app/admin/admin.module.ts diff --git a/src/app/app-routing-paths.ts b/src/app/app-routing-paths.ts index 7dfdbd2c49..81b0755d11 100644 --- a/src/app/app-routing-paths.ts +++ b/src/app/app-routing-paths.ts @@ -2,14 +2,19 @@ import { DSpaceObject } from './core/shared/dspace-object.model'; import { Community } from './core/shared/community.model'; import { Collection } from './core/shared/collection.model'; import { Item } from './core/shared/item.model'; -import { getCommunityPageRoute } from './+community-page/community-page-routing-paths'; -import { getCollectionPageRoute } from './+collection-page/collection-page-routing-paths'; -import { getItemPageRoute } from './+item-page/item-page-routing-paths'; +import { getCommunityPageRoute } from './community-page/community-page-routing-paths'; +import { getCollectionPageRoute } from './collection-page/collection-page-routing-paths'; +import { getItemPageRoute } from './item-page/item-page-routing-paths'; import { hasValue } from './shared/empty.util'; import { URLCombiner } from './core/url-combiner/url-combiner'; export const BITSTREAM_MODULE_PATH = 'bitstreams'; +/** + * The bitstream module path to resolve XMLUI and JSPUI bitstream download URLs + */ +export const LEGACY_BITSTREAM_MODULE_PATH = 'bitstream'; + export function getBitstreamModuleRoute() { return `/${BITSTREAM_MODULE_PATH}`; } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index ffbd993e8c..52a07b89f5 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -14,10 +14,11 @@ import { PROFILE_MODULE_PATH, REGISTER_PATH, WORKFLOW_ITEM_MODULE_PATH, + LEGACY_BITSTREAM_MODULE_PATH, } from './app-routing-paths'; -import { COLLECTION_MODULE_PATH } from './+collection-page/collection-page-routing-paths'; -import { COMMUNITY_MODULE_PATH } from './+community-page/community-page-routing-paths'; -import { ITEM_MODULE_PATH } from './+item-page/item-page-routing-paths'; +import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths'; +import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths'; +import { ITEM_MODULE_PATH } from './item-page/item-page-routing-paths'; import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths'; import { ReloadGuard } from './core/reload/reload.guard'; import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-user-agreement-current-user.guard'; @@ -35,7 +36,7 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu { path: 'reload/:rnd', component: ThemedPageNotFoundComponent, pathMatch: 'full', canActivate: [ReloadGuard] }, { path: 'home', - loadChildren: () => import('./+home-page/home-page.module') + loadChildren: () => import('./home-page/home-page.module') .then((m) => m.HomePageModule), data: { showBreadcrumbs: false }, canActivate: [EndUserAgreementCurrentUserGuard] @@ -48,13 +49,13 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu }, { path: 'id', - loadChildren: () => import('./+lookup-by-id/lookup-by-id.module') + loadChildren: () => import('./lookup-by-id/lookup-by-id.module') .then((m) => m.LookupIdModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: 'handle', - loadChildren: () => import('./+lookup-by-id/lookup-by-id.module') + loadChildren: () => import('./lookup-by-id/lookup-by-id.module') .then((m) => m.LookupIdModule), canActivate: [EndUserAgreementCurrentUserGuard] }, @@ -72,88 +73,94 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu }, { path: COMMUNITY_MODULE_PATH, - loadChildren: () => import('./+community-page/community-page.module') + loadChildren: () => import('./community-page/community-page.module') .then((m) => m.CommunityPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: COLLECTION_MODULE_PATH, - loadChildren: () => import('./+collection-page/collection-page.module') + loadChildren: () => import('./collection-page/collection-page.module') .then((m) => m.CollectionPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: ITEM_MODULE_PATH, - loadChildren: () => import('./+item-page/item-page.module') + loadChildren: () => import('./item-page/item-page.module') .then((m) => m.ItemPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: 'entities/:entity-type', - loadChildren: () => import('./+item-page/item-page.module') + loadChildren: () => import('./item-page/item-page.module') .then((m) => m.ItemPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, + { + path: LEGACY_BITSTREAM_MODULE_PATH, + loadChildren: () => import('./bitstream-page/bitstream-page.module') + .then((m) => m.BitstreamPageModule), + canActivate: [EndUserAgreementCurrentUserGuard] + }, { path: BITSTREAM_MODULE_PATH, - loadChildren: () => import('./+bitstream-page/bitstream-page.module') + loadChildren: () => import('./bitstream-page/bitstream-page.module') .then((m) => m.BitstreamPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: 'mydspace', - loadChildren: () => import('./+my-dspace-page/my-dspace-page.module') + loadChildren: () => import('./my-dspace-page/my-dspace-page.module') .then((m) => m.MyDSpacePageModule), canActivate: [AuthenticatedGuard, EndUserAgreementCurrentUserGuard] }, { path: 'search', - loadChildren: () => import('./+search-page/search-page-routing.module') + loadChildren: () => import('./search-page/search-page-routing.module') .then((m) => m.SearchPageRoutingModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: 'browse', - loadChildren: () => import('./+browse-by/browse-by-page.module') + loadChildren: () => import('./browse-by/browse-by-page.module') .then((m) => m.BrowseByPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: ADMIN_MODULE_PATH, - loadChildren: () => import('./+admin/admin.module') + loadChildren: () => import('./admin/admin.module') .then((m) => m.AdminModule), canActivate: [SiteAdministratorGuard, EndUserAgreementCurrentUserGuard] }, { path: 'login', - loadChildren: () => import('./+login-page/login-page.module') + loadChildren: () => import('./login-page/login-page.module') .then((m) => m.LoginPageModule), }, { path: 'logout', - loadChildren: () => import('./+logout-page/logout-page.module') + loadChildren: () => import('./logout-page/logout-page.module') .then((m) => m.LogoutPageModule), }, { path: 'submit', - loadChildren: () => import('./+submit-page/submit-page.module') + loadChildren: () => import('./submit-page/submit-page.module') .then((m) => m.SubmitPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: 'import-external', - loadChildren: () => import('./+import-external-page/import-external-page.module') + loadChildren: () => import('./import-external-page/import-external-page.module') .then((m) => m.ImportExternalPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: 'workspaceitems', - loadChildren: () => import('./+workspaceitems-edit-page/workspaceitems-edit-page.module') + loadChildren: () => import('./workspaceitems-edit-page/workspaceitems-edit-page.module') .then((m) => m.WorkspaceitemsEditPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, { path: WORKFLOW_ITEM_MODULE_PATH, - loadChildren: () => import('./+workflowitems-edit-page/workflowitems-edit-page.module') + loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module') .then((m) => m.WorkflowItemsEditPageModule), canActivate: [EndUserAgreementCurrentUserGuard] }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 18b97c8e9e..131e6c6b58 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,5 +1,5 @@ import { APP_BASE_HREF, CommonModule } from '@angular/common'; -import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; +import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; import { APP_INITIALIZER, NgModule } from '@angular/core'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; @@ -11,9 +11,9 @@ import { DYNAMIC_MATCHER_PROVIDERS } from '@ng-dynamic-forms/core'; import { TranslateModule } from '@ngx-translate/core'; import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to'; -import { AdminSidebarSectionComponent } from './+admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; -import { AdminSidebarComponent } from './+admin/admin-sidebar/admin-sidebar.component'; -import { ExpandableAdminSidebarSectionComponent } from './+admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; +import { AdminSidebarSectionComponent } from './admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; +import { AdminSidebarComponent } from './admin/admin-sidebar/admin-sidebar.component'; +import { ExpandableAdminSidebarSectionComponent } from './admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { appEffects } from './app.effects'; @@ -38,6 +38,7 @@ import { ForbiddenComponent } from './forbidden/forbidden.component'; import { AuthInterceptor } from './core/auth/auth.interceptor'; import { LocaleInterceptor } from './core/locale/locale.interceptor'; import { XsrfInterceptor } from './core/xsrf/xsrf.interceptor'; +import { LogInterceptor } from './core/log/log.interceptor'; import { RootComponent } from './root/root.component'; import { ThemedRootComponent } from './root/themed-root.component'; import { ThemedEntryComponentModule } from '../themes/themed-entry-component.module'; @@ -49,6 +50,9 @@ import { ThemedBreadcrumbsComponent } from './breadcrumbs/themed-breadcrumbs.com import { ThemedHeaderNavbarWrapperComponent } from './header-nav-wrapper/themed-header-navbar-wrapper.component'; import { IdleModalComponent } from './shared/idle-modal/idle-modal.component'; +import { UUIDService } from './core/shared/uuid.service'; +import { CookieService } from './core/services/cookie.service'; + export function getBase() { return environment.ui.nameSpace; } @@ -121,6 +125,27 @@ const PROVIDERS = [ useClass: XsrfInterceptor, multi: true }, + // register LogInterceptor as HttpInterceptor + { + provide: HTTP_INTERCEPTORS, + useClass: LogInterceptor, + multi: true + }, + // insert the unique id of the user that is using the application utilizing cookies + { + provide: APP_INITIALIZER, + useFactory: (cookieService: CookieService, uuidService: UUIDService) => { + const correlationId = cookieService.get('CORRELATION-ID'); + + // Check if cookie exists, if don't, set it with unique id + if (!correlationId) { + cookieService.set('CORRELATION-ID', uuidService.generate()); + } + return () => true; + }, + multi: true, + deps: [ CookieService, UUIDService ] + }, ...DYNAMIC_MATCHER_PROVIDERS, ]; diff --git a/src/app/app.reducer.ts b/src/app/app.reducer.ts index 5abc378702..a02095d834 100644 --- a/src/app/app.reducer.ts +++ b/src/app/app.reducer.ts @@ -11,7 +11,7 @@ import { import { metadataRegistryReducer, MetadataRegistryState -} from './+admin/admin-registries/metadata-registry/metadata-registry.reducers'; +} from './admin/admin-registries/metadata-registry/metadata-registry.reducers'; import { CommunityListReducer, CommunityListState diff --git a/src/app/+bitstream-page/bitstream-authorizations/bitstream-authorizations.component.html b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.html similarity index 100% rename from src/app/+bitstream-page/bitstream-authorizations/bitstream-authorizations.component.html rename to src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.html diff --git a/src/app/+bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts similarity index 100% rename from src/app/+bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts rename to src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts diff --git a/src/app/+bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts similarity index 100% rename from src/app/+bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts rename to src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts diff --git a/src/app/+bitstream-page/bitstream-page-routing.module.ts b/src/app/bitstream-page/bitstream-page-routing.module.ts similarity index 80% rename from src/app/+bitstream-page/bitstream-page-routing.module.ts rename to src/app/bitstream-page/bitstream-page-routing.module.ts index 284f29f7b4..27b9db9a05 100644 --- a/src/app/+bitstream-page/bitstream-page-routing.module.ts +++ b/src/app/bitstream-page/bitstream-page-routing.module.ts @@ -9,6 +9,7 @@ import { ResourcePolicyCreateComponent } from '../shared/resource-policies/creat import { ResourcePolicyResolver } from '../shared/resource-policies/resolvers/resource-policy.resolver'; import { ResourcePolicyEditComponent } from '../shared/resource-policies/edit/resource-policy-edit.component'; import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bitstream-authorizations.component'; +import { LegacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver'; const EDIT_BITSTREAM_PATH = ':id/edit'; const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; @@ -20,7 +21,24 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; imports: [ RouterModule.forChild([ { - path:':id/download', + // Resolve XMLUI bitstream download URLs + path: 'handle/:prefix/:suffix/:filename', + component: BitstreamDownloadPageComponent, + resolve: { + bitstream: LegacyBitstreamUrlResolver + }, + }, + { + // Resolve JSPUI bitstream download URLs + path: ':prefix/:suffix/:sequence_id/:filename', + component: BitstreamDownloadPageComponent, + resolve: { + bitstream: LegacyBitstreamUrlResolver + }, + }, + { + // Resolve angular bitstream download URLs + path: ':id/download', component: BitstreamDownloadPageComponent, resolve: { bitstream: BitstreamPageResolver diff --git a/src/app/+bitstream-page/bitstream-page.module.ts b/src/app/bitstream-page/bitstream-page.module.ts similarity index 100% rename from src/app/+bitstream-page/bitstream-page.module.ts rename to src/app/bitstream-page/bitstream-page.module.ts diff --git a/src/app/+bitstream-page/bitstream-page.resolver.ts b/src/app/bitstream-page/bitstream-page.resolver.ts similarity index 100% rename from src/app/+bitstream-page/bitstream-page.resolver.ts rename to src/app/bitstream-page/bitstream-page.resolver.ts diff --git a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html similarity index 100% rename from src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html rename to src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html diff --git a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss similarity index 100% rename from src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss rename to src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss diff --git a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts similarity index 99% rename from src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts rename to src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index 9c2cb3a093..67f8866e6d 100644 --- a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -19,7 +19,7 @@ import { FormControl, FormGroup } from '@angular/forms'; import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { getEntityEditRoute } from '../../+item-page/item-page-routing-paths'; +import { getEntityEditRoute } from '../../item-page/item-page-routing-paths'; import { createPaginatedList } from '../../shared/testing/utils.test'; import { Item } from '../../core/shared/item.model'; diff --git a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts similarity index 99% rename from src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts rename to src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 4ad0aac7ef..f6ece7f4fa 100644 --- a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -33,7 +33,7 @@ import { Metadata } from '../../core/shared/metadata.utils'; import { Location } from '@angular/common'; import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list.model'; -import { getEntityEditRoute, getItemEditRoute } from '../../+item-page/item-page-routing-paths'; +import { getEntityEditRoute, getItemEditRoute } from '../../item-page/item-page-routing-paths'; import { Bundle } from '../../core/shared/bundle.model'; @Component({ diff --git a/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts b/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts new file mode 100644 index 0000000000..25e245c5b7 --- /dev/null +++ b/src/app/bitstream-page/legacy-bitstream-url.resolver.spec.ts @@ -0,0 +1,145 @@ +import { LegacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver'; +import { of as observableOf, EMPTY } from 'rxjs'; +import { BitstreamDataService } from '../core/data/bitstream-data.service'; +import { RemoteData } from '../core/data/remote-data'; +import { RequestEntryState } from '../core/data/request.reducer'; +import { TestScheduler } from 'rxjs/testing'; + +describe(`LegacyBitstreamUrlResolver`, () => { + let resolver: LegacyBitstreamUrlResolver; + let bitstreamDataService: BitstreamDataService; + let testScheduler; + let remoteDataMocks; + let route; + let state; + + beforeEach(() => { + testScheduler = new TestScheduler((actual, expected) => { + expect(actual).toEqual(expected); + }); + + route = { + params: {}, + queryParams: {} + }; + state = {}; + remoteDataMocks = { + RequestPending: new RemoteData(undefined, 0, 0, RequestEntryState.RequestPending, undefined, undefined, undefined), + ResponsePending: new RemoteData(undefined, 0, 0, RequestEntryState.ResponsePending, undefined, undefined, undefined), + Success: new RemoteData(0, 0, 0, RequestEntryState.Success, undefined, {}, 200), + Error: new RemoteData(0, 0, 0, RequestEntryState.Error, 'Internal server error', undefined, 500), + }; + bitstreamDataService = { + findByItemHandle: () => undefined + } as any; + resolver = new LegacyBitstreamUrlResolver(bitstreamDataService); + }); + + describe(`resolve`, () => { + describe(`For JSPUI-style URLs`, () => { + beforeEach(() => { + spyOn(bitstreamDataService, 'findByItemHandle').and.returnValue(EMPTY); + route = Object.assign({}, route, { + params: { + prefix: '123456789', + suffix: '1234', + filename: 'some-file.pdf', + sequence_id: '5' + } + }); + }); + it(`should call findByItemHandle with the handle, sequence id, and filename from the route`, () => { + testScheduler.run(() => { + resolver.resolve(route, state); + expect(bitstreamDataService.findByItemHandle).toHaveBeenCalledWith( + `${route.params.prefix}/${route.params.suffix}`, + route.params.sequence_id, + route.params.filename + ); + }); + }); + }); + + describe(`For XMLUI-style URLs`, () => { + describe(`when there is a sequenceId query parameter`, () => { + beforeEach(() => { + spyOn(bitstreamDataService, 'findByItemHandle').and.returnValue(EMPTY); + route = Object.assign({}, route, { + params: { + prefix: '123456789', + suffix: '1234', + filename: 'some-file.pdf', + }, + queryParams: { + sequenceId: '5' + } + }); + }); + it(`should call findByItemHandle with the handle and filename from the route, and the sequence ID from the queryParams`, () => { + testScheduler.run(() => { + resolver.resolve(route, state); + expect(bitstreamDataService.findByItemHandle).toHaveBeenCalledWith( + `${route.params.prefix}/${route.params.suffix}`, + route.queryParams.sequenceId, + route.params.filename + ); + }); + }); + }); + describe(`when there's no sequenceId query parameter`, () => { + beforeEach(() => { + spyOn(bitstreamDataService, 'findByItemHandle').and.returnValue(EMPTY); + route = Object.assign({}, route, { + params: { + prefix: '123456789', + suffix: '1234', + filename: 'some-file.pdf', + }, + }); + }); + it(`should call findByItemHandle with the handle, and filename from the route`, () => { + testScheduler.run(() => { + resolver.resolve(route, state); + expect(bitstreamDataService.findByItemHandle).toHaveBeenCalledWith( + `${route.params.prefix}/${route.params.suffix}`, + undefined, + route.params.filename + ); + }); + }); + }); + }); + describe(`should return and complete after the remotedata has...`, () => { + it(`...failed`, () => { + testScheduler.run(({ cold, expectObservable }) => { + spyOn(bitstreamDataService, 'findByItemHandle').and.returnValue(cold('a-b-c', { + a: remoteDataMocks.RequestPending, + b: remoteDataMocks.ResponsePending, + c: remoteDataMocks.Error, + })); + const expected = '----(c|)'; + const values = { + c: remoteDataMocks.Error, + }; + + expectObservable(resolver.resolve(route, state)).toBe(expected, values); + }); + }); + it(`...succeeded`, () => { + testScheduler.run(({ cold, expectObservable }) => { + spyOn(bitstreamDataService, 'findByItemHandle').and.returnValue(cold('a-b-c', { + a: remoteDataMocks.RequestPending, + b: remoteDataMocks.ResponsePending, + c: remoteDataMocks.Success, + })); + const expected = '----(c|)'; + const values = { + c: remoteDataMocks.Success, + }; + + expectObservable(resolver.resolve(route, state)).toBe(expected, values); + }); + }); + }); + }); +}); diff --git a/src/app/bitstream-page/legacy-bitstream-url.resolver.ts b/src/app/bitstream-page/legacy-bitstream-url.resolver.ts new file mode 100644 index 0000000000..948bec2473 --- /dev/null +++ b/src/app/bitstream-page/legacy-bitstream-url.resolver.ts @@ -0,0 +1,48 @@ +import { Injectable } from '@angular/core'; +import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; +import { Observable } from 'rxjs'; +import { RemoteData } from '../core/data/remote-data'; +import { Bitstream } from '../core/shared/bitstream.model'; +import { getFirstCompletedRemoteData } from '../core/shared/operators'; +import { hasNoValue } from '../shared/empty.util'; +import { BitstreamDataService } from '../core/data/bitstream-data.service'; + +/** + * This class resolves a bitstream based on the DSpace 6 XMLUI or JSPUI bitstream download URLs + */ +@Injectable({ + providedIn: 'root' +}) +export class LegacyBitstreamUrlResolver implements Resolve> { + constructor(protected bitstreamDataService: BitstreamDataService) { + } + + /** + * Resolve a bitstream based on the handle of the item, and the sequence id or the filename of the + * bitstream + * + * @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot + * @param {RouterStateSnapshot} state The current RouterStateSnapshot + * @returns Observable<> Emits the found bitstream based on the parameters in + * current route, or an error if something went wrong + */ + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): + Observable> { + const prefix = route.params.prefix; + const suffix = route.params.suffix; + const filename = route.params.filename; + + let sequenceId = route.params.sequence_id; + if (hasNoValue(sequenceId)) { + sequenceId = route.queryParams.sequenceId; + } + + return this.bitstreamDataService.findByItemHandle( + `${prefix}/${suffix}`, + sequenceId, + filename, + ).pipe( + getFirstCompletedRemoteData() + ); + } +} diff --git a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts similarity index 96% rename from src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts rename to src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts index a5cc69e430..7b0ddcb18e 100644 --- a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.spec.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts @@ -15,7 +15,7 @@ import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { Community } from '../../core/shared/community.model'; import { Item } from '../../core/shared/item.model'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; -import { toRemoteData } from '../+browse-by-metadata-page/browse-by-metadata-page.component.spec'; +import { toRemoteData } from '../browse-by-metadata-page/browse-by-metadata-page.component.spec'; import { VarDirective } from '../../shared/utils/var.directive'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @@ -107,6 +107,6 @@ describe('BrowseByDatePageComponent', () => { }); it('should create a list of startsWith options with the current year first', () => { - expect(comp.startsWithOptions[0]).toEqual(new Date().getFullYear()); + expect(comp.startsWithOptions[0]).toEqual(new Date().getUTCFullYear()); }); }); diff --git a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts similarity index 93% rename from src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts rename to src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index a9eaa09e2f..3158c3d7cc 100644 --- a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { BrowseByMetadataPageComponent, browseParamsToOptions -} from '../+browse-by-metadata-page/browse-by-metadata-page.component'; +} from '../browse-by-metadata-page/browse-by-metadata-page.component'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { combineLatest as observableCombineLatest } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; @@ -12,7 +12,7 @@ import { ActivatedRoute, Params, Router } from '@angular/router'; import { BrowseService } from '../../core/browse/browse.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; -import { BrowseByType, rendersBrowseBy } from '../+browse-by-switcher/browse-by-decorator'; +import { BrowseByType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { environment } from '../../../environments/environment'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; @@ -21,8 +21,8 @@ import { SortDirection, SortOptions } from '../../core/cache/models/sort-options @Component({ selector: 'ds-browse-by-date-page', - styleUrls: ['../+browse-by-metadata-page/browse-by-metadata-page.component.scss'], - templateUrl: '../+browse-by-metadata-page/browse-by-metadata-page.component.html' + styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], + templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html' }) /** * Component for browsing items by metadata definition of type 'date' @@ -92,7 +92,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { } } const options = []; - const currentYear = new Date().getFullYear(); + const currentYear = new Date().getUTCFullYear(); const oneYearBreak = Math.floor((currentYear - environment.browseBy.oneYearLimit) / 5) * 5; const fiveYearBreak = Math.floor((currentYear - environment.browseBy.fiveYearLimit) / 10) * 10; if (lowerLimit <= fiveYearBreak) { diff --git a/src/app/+browse-by/browse-by-dso-breadcrumb.resolver.ts b/src/app/browse-by/browse-by-dso-breadcrumb.resolver.ts similarity index 100% rename from src/app/+browse-by/browse-by-dso-breadcrumb.resolver.ts rename to src/app/browse-by/browse-by-dso-breadcrumb.resolver.ts diff --git a/src/app/+browse-by/browse-by-guard.spec.ts b/src/app/browse-by/browse-by-guard.spec.ts similarity index 100% rename from src/app/+browse-by/browse-by-guard.spec.ts rename to src/app/browse-by/browse-by-guard.spec.ts diff --git a/src/app/+browse-by/browse-by-guard.ts b/src/app/browse-by/browse-by-guard.ts similarity index 100% rename from src/app/+browse-by/browse-by-guard.ts rename to src/app/browse-by/browse-by-guard.ts diff --git a/src/app/+browse-by/browse-by-i18n-breadcrumb.resolver.ts b/src/app/browse-by/browse-by-i18n-breadcrumb.resolver.ts similarity index 100% rename from src/app/+browse-by/browse-by-i18n-breadcrumb.resolver.ts rename to src/app/browse-by/browse-by-i18n-breadcrumb.resolver.ts diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.html b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html similarity index 100% rename from src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.html rename to src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.scss b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.scss similarity index 100% rename from src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.scss rename to src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.scss diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts similarity index 100% rename from src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.spec.ts rename to src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts similarity index 98% rename from src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts rename to src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index 5b84daab6e..3573ffb264 100644 --- a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -14,7 +14,7 @@ import { getFirstSucceededRemoteData } from '../../core/shared/operators'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; -import { BrowseByType, rendersBrowseBy } from '../+browse-by-switcher/browse-by-decorator'; +import { BrowseByType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; diff --git a/src/app/+browse-by/browse-by-page.module.ts b/src/app/browse-by/browse-by-page.module.ts similarity index 100% rename from src/app/+browse-by/browse-by-page.module.ts rename to src/app/browse-by/browse-by-page.module.ts diff --git a/src/app/+browse-by/browse-by-routing.module.ts b/src/app/browse-by/browse-by-routing.module.ts similarity index 89% rename from src/app/+browse-by/browse-by-routing.module.ts rename to src/app/browse-by/browse-by-routing.module.ts index 8cf989695a..72d78f13fd 100644 --- a/src/app/+browse-by/browse-by-routing.module.ts +++ b/src/app/browse-by/browse-by-routing.module.ts @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core'; import { BrowseByGuard } from './browse-by-guard'; import { BrowseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver'; import { BrowseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver'; -import { ThemedBrowseBySwitcherComponent } from './+browse-by-switcher/themed-browse-by-switcher.component'; +import { ThemedBrowseBySwitcherComponent } from './browse-by-switcher/themed-browse-by-switcher.component'; @NgModule({ imports: [ diff --git a/src/app/+browse-by/+browse-by-switcher/browse-by-decorator.spec.ts b/src/app/browse-by/browse-by-switcher/browse-by-decorator.spec.ts similarity index 100% rename from src/app/+browse-by/+browse-by-switcher/browse-by-decorator.spec.ts rename to src/app/browse-by/browse-by-switcher/browse-by-decorator.spec.ts diff --git a/src/app/+browse-by/+browse-by-switcher/browse-by-decorator.ts b/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts similarity index 100% rename from src/app/+browse-by/+browse-by-switcher/browse-by-decorator.ts rename to src/app/browse-by/browse-by-switcher/browse-by-decorator.ts diff --git a/src/app/+browse-by/+browse-by-switcher/browse-by-switcher.component.html b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.html similarity index 100% rename from src/app/+browse-by/+browse-by-switcher/browse-by-switcher.component.html rename to src/app/browse-by/browse-by-switcher/browse-by-switcher.component.html diff --git a/src/app/+browse-by/+browse-by-switcher/browse-by-switcher.component.spec.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts similarity index 100% rename from src/app/+browse-by/+browse-by-switcher/browse-by-switcher.component.spec.ts rename to src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts diff --git a/src/app/+browse-by/+browse-by-switcher/browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts similarity index 100% rename from src/app/+browse-by/+browse-by-switcher/browse-by-switcher.component.ts rename to src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts diff --git a/src/app/+browse-by/+browse-by-switcher/themed-browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts similarity index 87% rename from src/app/+browse-by/+browse-by-switcher/themed-browse-by-switcher.component.ts rename to src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts index e92fe30ba9..0187d4e3c5 100644 --- a/src/app/+browse-by/+browse-by-switcher/themed-browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts @@ -17,7 +17,7 @@ export class ThemedBrowseBySwitcherComponent extends ThemedComponent { - return import(`../../../themes/${themeName}/app/+browse-by/+browse-by-switcher/browse-by-switcher.component`); + return import(`../../../themes/${themeName}/app/browse-by/browse-by-switcher/browse-by-switcher.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts similarity index 97% rename from src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts rename to src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts index d44c667044..584da1c45a 100644 --- a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.spec.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts @@ -9,7 +9,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { toRemoteData } from '../+browse-by-metadata-page/browse-by-metadata-page.component.spec'; +import { toRemoteData } from '../browse-by-metadata-page/browse-by-metadata-page.component.spec'; import { BrowseByTitlePageComponent } from './browse-by-title-page.component'; import { ItemDataService } from '../../core/data/item-data.service'; import { Community } from '../../core/shared/community.model'; diff --git a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts similarity index 89% rename from src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts rename to src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index 381684f9f0..b3a2ceed00 100644 --- a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -5,20 +5,20 @@ import { hasValue } from '../../shared/empty.util'; import { BrowseByMetadataPageComponent, browseParamsToOptions -} from '../+browse-by-metadata-page/browse-by-metadata-page.component'; +} from '../browse-by-metadata-page/browse-by-metadata-page.component'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { BrowseService } from '../../core/browse/browse.service'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { BrowseByType, rendersBrowseBy } from '../+browse-by-switcher/browse-by-decorator'; +import { BrowseByType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { PaginationService } from '../../core/pagination/pagination.service'; import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @Component({ selector: 'ds-browse-by-title-page', - styleUrls: ['../+browse-by-metadata-page/browse-by-metadata-page.component.scss'], - templateUrl: '../+browse-by-metadata-page/browse-by-metadata-page.component.html' + styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], + templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html' }) /** * Component for browsing items by title (dc.title) diff --git a/src/app/+browse-by/browse-by.module.ts b/src/app/browse-by/browse-by.module.ts similarity index 63% rename from src/app/+browse-by/browse-by.module.ts rename to src/app/browse-by/browse-by.module.ts index 08b6c5739b..2d3618aae6 100644 --- a/src/app/+browse-by/browse-by.module.ts +++ b/src/app/browse-by/browse-by.module.ts @@ -1,11 +1,11 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { BrowseByTitlePageComponent } from './+browse-by-title-page/browse-by-title-page.component'; +import { BrowseByTitlePageComponent } from './browse-by-title-page/browse-by-title-page.component'; import { SharedModule } from '../shared/shared.module'; -import { BrowseByMetadataPageComponent } from './+browse-by-metadata-page/browse-by-metadata-page.component'; -import { BrowseByDatePageComponent } from './+browse-by-date-page/browse-by-date-page.component'; -import { BrowseBySwitcherComponent } from './+browse-by-switcher/browse-by-switcher.component'; -import { ThemedBrowseBySwitcherComponent } from './+browse-by-switcher/themed-browse-by-switcher.component'; +import { BrowseByMetadataPageComponent } from './browse-by-metadata-page/browse-by-metadata-page.component'; +import { BrowseByDatePageComponent } from './browse-by-date-page/browse-by-date-page.component'; +import { BrowseBySwitcherComponent } from './browse-by-switcher/browse-by-switcher.component'; +import { ThemedBrowseBySwitcherComponent } from './browse-by-switcher/themed-browse-by-switcher.component'; const ENTRY_COMPONENTS = [ // put only entry components that use custom decorator diff --git a/src/app/+collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts similarity index 100% rename from src/app/+collection-page/collection-form/collection-form.component.ts rename to src/app/collection-page/collection-form/collection-form.component.ts diff --git a/src/app/+collection-page/collection-form/collection-form.module.ts b/src/app/collection-page/collection-form/collection-form.module.ts similarity index 100% rename from src/app/+collection-page/collection-form/collection-form.module.ts rename to src/app/collection-page/collection-form/collection-form.module.ts diff --git a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.html b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.html similarity index 97% rename from src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.html rename to src/app/collection-page/collection-item-mapper/collection-item-mapper.component.html index cc4b0c22a1..e10b9da247 100644 --- a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.html +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.html @@ -42,6 +42,7 @@ [key]="'map'" [dsoRD$]="mappedItemsRD$" [paginationOptions]="(searchOptions$ | async)?.pagination" + [featureId]="FeatureIds.CanManageMappings" [confirmButton]="'collection.edit.item-mapper.confirm'" [cancelButton]="'collection.edit.item-mapper.cancel'" (confirm)="mapItems($event)" diff --git a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.scss b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.scss similarity index 100% rename from src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.scss rename to src/app/collection-page/collection-item-mapper/collection-item-mapper.component.scss diff --git a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts similarity index 96% rename from src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts rename to src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts index 49b6a0d63c..5ae1445cef 100644 --- a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts @@ -40,6 +40,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { createPaginatedList } from '../../shared/testing/utils.test'; +import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; describe('CollectionItemMapperComponent', () => { let comp: CollectionItemMapperComponent; @@ -136,6 +137,10 @@ describe('CollectionItemMapperComponent', () => { } }; + const authorizationDataService = jasmine.createSpyObj('authorizationDataService', { + isAuthorized: observableOf(true) + }); + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], @@ -152,6 +157,7 @@ describe('CollectionItemMapperComponent', () => { { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub() }, { provide: RouteService, useValue: routeServiceStub }, + { provide: AuthorizationDataService, useValue: authorizationDataService } ] }).compileComponents(); })); diff --git a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts similarity index 98% rename from src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts rename to src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts index 571b755897..9a93457436 100644 --- a/src/app/+collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -22,12 +22,13 @@ import { ItemDataService } from '../../core/data/item-data.service'; import { TranslateService } from '@ngx-translate/core'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { isNotEmpty } from '../../shared/empty.util'; -import { SEARCH_CONFIG_SERVICE } from '../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; import { PaginatedSearchOptions } from '../../shared/search/paginated-search-options.model'; import { SearchService } from '../../core/shared/search/search.service'; import { followLink } from '../../shared/utils/follow-link-config.model'; import { NoContent } from '../../core/shared/NoContent.model'; +import { FeatureID } from '../../core/data/feature-authorization/feature-id'; @Component({ selector: 'ds-collection-item-mapper', @@ -50,6 +51,8 @@ import { NoContent } from '../../core/shared/NoContent.model'; */ export class CollectionItemMapperComponent implements OnInit { + FeatureIds = FeatureID; + /** * A view on the tabset element * Used to switch tabs programmatically diff --git a/src/app/+collection-page/collection-page-administrator.guard.ts b/src/app/collection-page/collection-page-administrator.guard.ts similarity index 100% rename from src/app/+collection-page/collection-page-administrator.guard.ts rename to src/app/collection-page/collection-page-administrator.guard.ts diff --git a/src/app/+collection-page/collection-page-routing-paths.ts b/src/app/collection-page/collection-page-routing-paths.ts similarity index 100% rename from src/app/+collection-page/collection-page-routing-paths.ts rename to src/app/collection-page/collection-page-routing-paths.ts diff --git a/src/app/+collection-page/collection-page-routing.module.ts b/src/app/collection-page/collection-page-routing.module.ts similarity index 100% rename from src/app/+collection-page/collection-page-routing.module.ts rename to src/app/collection-page/collection-page-routing.module.ts diff --git a/src/app/+collection-page/collection-page.component.html b/src/app/collection-page/collection-page.component.html similarity index 100% rename from src/app/+collection-page/collection-page.component.html rename to src/app/collection-page/collection-page.component.html diff --git a/src/app/+collection-page/collection-page.component.scss b/src/app/collection-page/collection-page.component.scss similarity index 100% rename from src/app/+collection-page/collection-page.component.scss rename to src/app/collection-page/collection-page.component.scss diff --git a/src/app/+collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts similarity index 100% rename from src/app/+collection-page/collection-page.component.ts rename to src/app/collection-page/collection-page.component.ts diff --git a/src/app/+collection-page/collection-page.module.ts b/src/app/collection-page/collection-page.module.ts similarity index 94% rename from src/app/+collection-page/collection-page.module.ts rename to src/app/collection-page/collection-page.module.ts index 7946e7a1a4..a13731ed23 100644 --- a/src/app/+collection-page/collection-page.module.ts +++ b/src/app/collection-page/collection-page.module.ts @@ -8,7 +8,7 @@ import { CollectionPageRoutingModule } from './collection-page-routing.module'; import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component'; import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component'; import { EditItemTemplatePageComponent } from './edit-item-template-page/edit-item-template-page.component'; -import { EditItemPageModule } from '../+item-page/edit-item-page/edit-item-page.module'; +import { EditItemPageModule } from '../item-page/edit-item-page/edit-item-page.module'; import { CollectionItemMapperComponent } from './collection-item-mapper/collection-item-mapper.component'; import { SearchService } from '../core/shared/search/search.service'; import { StatisticsModule } from '../statistics/statistics.module'; diff --git a/src/app/+collection-page/collection-page.resolver.spec.ts b/src/app/collection-page/collection-page.resolver.spec.ts similarity index 100% rename from src/app/+collection-page/collection-page.resolver.spec.ts rename to src/app/collection-page/collection-page.resolver.spec.ts diff --git a/src/app/+collection-page/collection-page.resolver.ts b/src/app/collection-page/collection-page.resolver.ts similarity index 100% rename from src/app/+collection-page/collection-page.resolver.ts rename to src/app/collection-page/collection-page.resolver.ts diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.component.html b/src/app/collection-page/create-collection-page/create-collection-page.component.html similarity index 100% rename from src/app/+collection-page/create-collection-page/create-collection-page.component.html rename to src/app/collection-page/create-collection-page/create-collection-page.component.html diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.component.scss b/src/app/collection-page/create-collection-page/create-collection-page.component.scss similarity index 100% rename from src/app/+collection-page/create-collection-page/create-collection-page.component.scss rename to src/app/collection-page/create-collection-page/create-collection-page.component.scss diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.component.spec.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts similarity index 100% rename from src/app/+collection-page/create-collection-page/create-collection-page.component.spec.ts rename to src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.component.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.ts similarity index 100% rename from src/app/+collection-page/create-collection-page/create-collection-page.component.ts rename to src/app/collection-page/create-collection-page/create-collection-page.component.ts diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.guard.spec.ts b/src/app/collection-page/create-collection-page/create-collection-page.guard.spec.ts similarity index 100% rename from src/app/+collection-page/create-collection-page/create-collection-page.guard.spec.ts rename to src/app/collection-page/create-collection-page/create-collection-page.guard.spec.ts diff --git a/src/app/+collection-page/create-collection-page/create-collection-page.guard.ts b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts similarity index 100% rename from src/app/+collection-page/create-collection-page/create-collection-page.guard.ts rename to src/app/collection-page/create-collection-page/create-collection-page.guard.ts diff --git a/src/app/+collection-page/delete-collection-page/delete-collection-page.component.html b/src/app/collection-page/delete-collection-page/delete-collection-page.component.html similarity index 100% rename from src/app/+collection-page/delete-collection-page/delete-collection-page.component.html rename to src/app/collection-page/delete-collection-page/delete-collection-page.component.html diff --git a/src/app/+collection-page/delete-collection-page/delete-collection-page.component.scss b/src/app/collection-page/delete-collection-page/delete-collection-page.component.scss similarity index 100% rename from src/app/+collection-page/delete-collection-page/delete-collection-page.component.scss rename to src/app/collection-page/delete-collection-page/delete-collection-page.component.scss diff --git a/src/app/+collection-page/delete-collection-page/delete-collection-page.component.spec.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts similarity index 100% rename from src/app/+collection-page/delete-collection-page/delete-collection-page.component.spec.ts rename to src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts diff --git a/src/app/+collection-page/delete-collection-page/delete-collection-page.component.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts similarity index 100% rename from src/app/+collection-page/delete-collection-page/delete-collection-page.component.ts rename to src/app/collection-page/delete-collection-page/delete-collection-page.component.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.html b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.html similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.html rename to src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.html diff --git a/src/app/+collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts rename to src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts rename to src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-curate/collection-curate.component.html b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.html similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-curate/collection-curate.component.html rename to src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.html diff --git a/src/app/+collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts rename to src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-curate/collection-curate.component.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-curate/collection-curate.component.ts rename to src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html rename to src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html diff --git a/src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts rename to src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts rename to src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.html b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.html similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.html rename to src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.html diff --git a/src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts rename to src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-roles/collection-roles.component.ts rename to src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-source/collection-source.component.html b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.html similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-source/collection-source.component.html rename to src/app/collection-page/edit-collection-page/collection-source/collection-source.component.html diff --git a/src/app/+collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts rename to src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts diff --git a/src/app/+collection-page/edit-collection-page/collection-source/collection-source.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/collection-source/collection-source.component.ts rename to src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts diff --git a/src/app/+collection-page/edit-collection-page/edit-collection-page.component.spec.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/edit-collection-page.component.spec.ts rename to src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts diff --git a/src/app/+collection-page/edit-collection-page/edit-collection-page.component.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/edit-collection-page.component.ts rename to src/app/collection-page/edit-collection-page/edit-collection-page.component.ts diff --git a/src/app/+collection-page/edit-collection-page/edit-collection-page.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/edit-collection-page.module.ts rename to src/app/collection-page/edit-collection-page/edit-collection-page.module.ts diff --git a/src/app/+collection-page/edit-collection-page/edit-collection-page.routing.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts similarity index 100% rename from src/app/+collection-page/edit-collection-page/edit-collection-page.routing.module.ts rename to src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts diff --git a/src/app/+collection-page/edit-item-template-page/edit-item-template-page.component.html b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.html similarity index 100% rename from src/app/+collection-page/edit-item-template-page/edit-item-template-page.component.html rename to src/app/collection-page/edit-item-template-page/edit-item-template-page.component.html diff --git a/src/app/+collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts similarity index 100% rename from src/app/+collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts rename to src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts diff --git a/src/app/+collection-page/edit-item-template-page/edit-item-template-page.component.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts similarity index 100% rename from src/app/+collection-page/edit-item-template-page/edit-item-template-page.component.ts rename to src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts diff --git a/src/app/+collection-page/edit-item-template-page/item-template-page.resolver.spec.ts b/src/app/collection-page/edit-item-template-page/item-template-page.resolver.spec.ts similarity index 100% rename from src/app/+collection-page/edit-item-template-page/item-template-page.resolver.spec.ts rename to src/app/collection-page/edit-item-template-page/item-template-page.resolver.spec.ts diff --git a/src/app/+collection-page/edit-item-template-page/item-template-page.resolver.ts b/src/app/collection-page/edit-item-template-page/item-template-page.resolver.ts similarity index 100% rename from src/app/+collection-page/edit-item-template-page/item-template-page.resolver.ts rename to src/app/collection-page/edit-item-template-page/item-template-page.resolver.ts diff --git a/src/app/+collection-page/themed-collection-page.component.ts b/src/app/collection-page/themed-collection-page.component.ts similarity index 88% rename from src/app/+collection-page/themed-collection-page.component.ts rename to src/app/collection-page/themed-collection-page.component.ts index 4ad9ed87e3..82074e43e6 100644 --- a/src/app/+collection-page/themed-collection-page.component.ts +++ b/src/app/collection-page/themed-collection-page.component.ts @@ -16,7 +16,7 @@ export class ThemedCollectionPageComponent extends ThemedComponent { - return import(`../../themes/${themeName}/app/+collection-page/collection-page.component`); + return import(`../../themes/${themeName}/app/collection-page/collection-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/community-list-page/community-list-service.ts b/src/app/community-list-page/community-list-service.ts index e882ae5902..76d33585da 100644 --- a/src/app/community-list-page/community-list-service.ts +++ b/src/app/community-list-page/community-list-service.ts @@ -16,8 +16,8 @@ import { PaginatedList, buildPaginatedList } from '../core/data/paginated-list.m import { CollectionDataService } from '../core/data/collection-data.service'; import { CommunityListSaveAction } from './community-list.actions'; import { CommunityListState } from './community-list.reducer'; -import { getCommunityPageRoute } from '../+community-page/community-page-routing-paths'; -import { getCollectionPageRoute } from '../+collection-page/collection-page-routing-paths'; +import { getCommunityPageRoute } from '../community-page/community-page-routing-paths'; +import { getCollectionPageRoute } from '../collection-page/collection-page-routing-paths'; import { getFirstSucceededRemoteData, getFirstCompletedRemoteData } from '../core/shared/operators'; import { followLink } from '../shared/utils/follow-link-config.model'; diff --git a/src/app/+community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts similarity index 100% rename from src/app/+community-page/community-form/community-form.component.ts rename to src/app/community-page/community-form/community-form.component.ts diff --git a/src/app/+community-page/community-form/community-form.module.ts b/src/app/community-page/community-form/community-form.module.ts similarity index 100% rename from src/app/+community-page/community-form/community-form.module.ts rename to src/app/community-page/community-form/community-form.module.ts diff --git a/src/app/+community-page/community-page-administrator.guard.ts b/src/app/community-page/community-page-administrator.guard.ts similarity index 100% rename from src/app/+community-page/community-page-administrator.guard.ts rename to src/app/community-page/community-page-administrator.guard.ts diff --git a/src/app/+community-page/community-page-routing-paths.ts b/src/app/community-page/community-page-routing-paths.ts similarity index 91% rename from src/app/+community-page/community-page-routing-paths.ts rename to src/app/community-page/community-page-routing-paths.ts index 02adcea718..759d72cf3e 100644 --- a/src/app/+community-page/community-page-routing-paths.ts +++ b/src/app/community-page/community-page-routing-paths.ts @@ -1,4 +1,4 @@ -import { getCollectionPageRoute } from '../+collection-page/collection-page-routing-paths'; +import { getCollectionPageRoute } from '../collection-page/collection-page-routing-paths'; import { URLCombiner } from '../core/url-combiner/url-combiner'; export const COMMUNITY_PARENT_PARAMETER = 'parent'; diff --git a/src/app/+community-page/community-page-routing.module.ts b/src/app/community-page/community-page-routing.module.ts similarity index 100% rename from src/app/+community-page/community-page-routing.module.ts rename to src/app/community-page/community-page-routing.module.ts diff --git a/src/app/+community-page/community-page.component.html b/src/app/community-page/community-page.component.html similarity index 100% rename from src/app/+community-page/community-page.component.html rename to src/app/community-page/community-page.component.html diff --git a/src/app/+community-page/community-page.component.scss b/src/app/community-page/community-page.component.scss similarity index 100% rename from src/app/+community-page/community-page.component.scss rename to src/app/community-page/community-page.component.scss diff --git a/src/app/+community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts similarity index 100% rename from src/app/+community-page/community-page.component.ts rename to src/app/community-page/community-page.component.ts diff --git a/src/app/+community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts similarity index 100% rename from src/app/+community-page/community-page.module.ts rename to src/app/community-page/community-page.module.ts diff --git a/src/app/+community-page/community-page.resolver.spec.ts b/src/app/community-page/community-page.resolver.spec.ts similarity index 100% rename from src/app/+community-page/community-page.resolver.spec.ts rename to src/app/community-page/community-page.resolver.spec.ts diff --git a/src/app/+community-page/community-page.resolver.ts b/src/app/community-page/community-page.resolver.ts similarity index 100% rename from src/app/+community-page/community-page.resolver.ts rename to src/app/community-page/community-page.resolver.ts diff --git a/src/app/+community-page/create-community-page/create-community-page.component.html b/src/app/community-page/create-community-page/create-community-page.component.html similarity index 100% rename from src/app/+community-page/create-community-page/create-community-page.component.html rename to src/app/community-page/create-community-page/create-community-page.component.html diff --git a/src/app/+community-page/create-community-page/create-community-page.component.scss b/src/app/community-page/create-community-page/create-community-page.component.scss similarity index 100% rename from src/app/+community-page/create-community-page/create-community-page.component.scss rename to src/app/community-page/create-community-page/create-community-page.component.scss diff --git a/src/app/+community-page/create-community-page/create-community-page.component.spec.ts b/src/app/community-page/create-community-page/create-community-page.component.spec.ts similarity index 100% rename from src/app/+community-page/create-community-page/create-community-page.component.spec.ts rename to src/app/community-page/create-community-page/create-community-page.component.spec.ts diff --git a/src/app/+community-page/create-community-page/create-community-page.component.ts b/src/app/community-page/create-community-page/create-community-page.component.ts similarity index 100% rename from src/app/+community-page/create-community-page/create-community-page.component.ts rename to src/app/community-page/create-community-page/create-community-page.component.ts diff --git a/src/app/+community-page/create-community-page/create-community-page.guard.spec.ts b/src/app/community-page/create-community-page/create-community-page.guard.spec.ts similarity index 100% rename from src/app/+community-page/create-community-page/create-community-page.guard.spec.ts rename to src/app/community-page/create-community-page/create-community-page.guard.spec.ts diff --git a/src/app/+community-page/create-community-page/create-community-page.guard.ts b/src/app/community-page/create-community-page/create-community-page.guard.ts similarity index 100% rename from src/app/+community-page/create-community-page/create-community-page.guard.ts rename to src/app/community-page/create-community-page/create-community-page.guard.ts diff --git a/src/app/+community-page/delete-community-page/delete-community-page.component.html b/src/app/community-page/delete-community-page/delete-community-page.component.html similarity index 100% rename from src/app/+community-page/delete-community-page/delete-community-page.component.html rename to src/app/community-page/delete-community-page/delete-community-page.component.html diff --git a/src/app/+community-page/delete-community-page/delete-community-page.component.scss b/src/app/community-page/delete-community-page/delete-community-page.component.scss similarity index 100% rename from src/app/+community-page/delete-community-page/delete-community-page.component.scss rename to src/app/community-page/delete-community-page/delete-community-page.component.scss diff --git a/src/app/+community-page/delete-community-page/delete-community-page.component.spec.ts b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts similarity index 100% rename from src/app/+community-page/delete-community-page/delete-community-page.component.spec.ts rename to src/app/community-page/delete-community-page/delete-community-page.component.spec.ts diff --git a/src/app/+community-page/delete-community-page/delete-community-page.component.ts b/src/app/community-page/delete-community-page/delete-community-page.component.ts similarity index 100% rename from src/app/+community-page/delete-community-page/delete-community-page.component.ts rename to src/app/community-page/delete-community-page/delete-community-page.component.ts diff --git a/src/app/+community-page/edit-community-page/community-authorizations/community-authorizations.component.html b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.html similarity index 100% rename from src/app/+community-page/edit-community-page/community-authorizations/community-authorizations.component.html rename to src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.html diff --git a/src/app/+community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts rename to src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts diff --git a/src/app/+community-page/edit-community-page/community-authorizations/community-authorizations.component.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-authorizations/community-authorizations.component.ts rename to src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts diff --git a/src/app/+community-page/edit-community-page/community-curate/community-curate.component.html b/src/app/community-page/edit-community-page/community-curate/community-curate.component.html similarity index 100% rename from src/app/+community-page/edit-community-page/community-curate/community-curate.component.html rename to src/app/community-page/edit-community-page/community-curate/community-curate.component.html diff --git a/src/app/+community-page/edit-community-page/community-curate/community-curate.component.spec.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-curate/community-curate.component.spec.ts rename to src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts diff --git a/src/app/+community-page/edit-community-page/community-curate/community-curate.component.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-curate/community-curate.component.ts rename to src/app/community-page/edit-community-page/community-curate/community-curate.component.ts diff --git a/src/app/+community-page/edit-community-page/community-metadata/community-metadata.component.html b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.html similarity index 100% rename from src/app/+community-page/edit-community-page/community-metadata/community-metadata.component.html rename to src/app/community-page/edit-community-page/community-metadata/community-metadata.component.html diff --git a/src/app/+community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts rename to src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts diff --git a/src/app/+community-page/edit-community-page/community-metadata/community-metadata.component.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-metadata/community-metadata.component.ts rename to src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts diff --git a/src/app/+community-page/edit-community-page/community-roles/community-roles.component.html b/src/app/community-page/edit-community-page/community-roles/community-roles.component.html similarity index 100% rename from src/app/+community-page/edit-community-page/community-roles/community-roles.component.html rename to src/app/community-page/edit-community-page/community-roles/community-roles.component.html diff --git a/src/app/+community-page/edit-community-page/community-roles/community-roles.component.spec.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-roles/community-roles.component.spec.ts rename to src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts diff --git a/src/app/+community-page/edit-community-page/community-roles/community-roles.component.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts similarity index 100% rename from src/app/+community-page/edit-community-page/community-roles/community-roles.component.ts rename to src/app/community-page/edit-community-page/community-roles/community-roles.component.ts diff --git a/src/app/+community-page/edit-community-page/edit-community-page.component.spec.ts b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts similarity index 100% rename from src/app/+community-page/edit-community-page/edit-community-page.component.spec.ts rename to src/app/community-page/edit-community-page/edit-community-page.component.spec.ts diff --git a/src/app/+community-page/edit-community-page/edit-community-page.component.ts b/src/app/community-page/edit-community-page/edit-community-page.component.ts similarity index 100% rename from src/app/+community-page/edit-community-page/edit-community-page.component.ts rename to src/app/community-page/edit-community-page/edit-community-page.component.ts diff --git a/src/app/+community-page/edit-community-page/edit-community-page.module.ts b/src/app/community-page/edit-community-page/edit-community-page.module.ts similarity index 100% rename from src/app/+community-page/edit-community-page/edit-community-page.module.ts rename to src/app/community-page/edit-community-page/edit-community-page.module.ts diff --git a/src/app/+community-page/edit-community-page/edit-community-page.routing.module.ts b/src/app/community-page/edit-community-page/edit-community-page.routing.module.ts similarity index 100% rename from src/app/+community-page/edit-community-page/edit-community-page.routing.module.ts rename to src/app/community-page/edit-community-page/edit-community-page.routing.module.ts diff --git a/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.html b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html similarity index 100% rename from src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.html rename to src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html diff --git a/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.scss b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss similarity index 100% rename from src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.scss rename to src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss diff --git a/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts similarity index 100% rename from src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts rename to src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts diff --git a/src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts similarity index 100% rename from src/app/+community-page/sub-collection-list/community-page-sub-collection-list.component.ts rename to src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts diff --git a/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.html b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.html similarity index 100% rename from src/app/+community-page/sub-community-list/community-page-sub-community-list.component.html rename to src/app/community-page/sub-community-list/community-page-sub-community-list.component.html diff --git a/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.scss b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.scss similarity index 100% rename from src/app/+community-page/sub-community-list/community-page-sub-community-list.component.scss rename to src/app/community-page/sub-community-list/community-page-sub-community-list.component.scss diff --git a/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts similarity index 100% rename from src/app/+community-page/sub-community-list/community-page-sub-community-list.component.spec.ts rename to src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts diff --git a/src/app/+community-page/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts similarity index 100% rename from src/app/+community-page/sub-community-list/community-page-sub-community-list.component.ts rename to src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts diff --git a/src/app/+community-page/themed-community-page.component.ts b/src/app/community-page/themed-community-page.component.ts similarity index 88% rename from src/app/+community-page/themed-community-page.component.ts rename to src/app/community-page/themed-community-page.component.ts index 97dd59821c..eeb058fb04 100644 --- a/src/app/+community-page/themed-community-page.component.ts +++ b/src/app/community-page/themed-community-page.component.ts @@ -16,7 +16,7 @@ export class ThemedCommunityPageComponent extends ThemedComponent { - return import(`../../themes/${themeName}/app/+community-page/community-page.component`); + return import(`../../themes/${themeName}/app/community-page/community-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/core/auth/auth.actions.ts b/src/app/core/auth/auth.actions.ts index ad3f9a9711..15e42c8576 100644 --- a/src/app/core/auth/auth.actions.ts +++ b/src/app/core/auth/auth.actions.ts @@ -294,13 +294,10 @@ export class ResetAuthenticationMessagesAction implements Action { export class RetrieveAuthMethodsAction implements Action { public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS; - payload: { - status: AuthStatus; - blocking: boolean; - }; + payload: AuthStatus; - constructor(status: AuthStatus, blocking: boolean) { - this.payload = { status, blocking }; + constructor(authStatus: AuthStatus) { + this.payload = authStatus; } } @@ -311,14 +308,10 @@ export class RetrieveAuthMethodsAction implements Action { */ export class RetrieveAuthMethodsSuccessAction implements Action { public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS_SUCCESS; + payload: AuthMethod[]; - payload: { - authMethods: AuthMethod[]; - blocking: boolean; - }; - - constructor(authMethods: AuthMethod[], blocking: boolean ) { - this.payload = { authMethods, blocking }; + constructor(authMethods: AuthMethod[] ) { + this.payload = authMethods; } } @@ -329,12 +322,6 @@ export class RetrieveAuthMethodsSuccessAction implements Action { */ export class RetrieveAuthMethodsErrorAction implements Action { public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR; - - payload: boolean; - - constructor(blocking: boolean) { - this.payload = blocking; - } } /** diff --git a/src/app/core/auth/auth.effects.spec.ts b/src/app/core/auth/auth.effects.spec.ts index cd4f456b44..ed91eb3eea 100644 --- a/src/app/core/auth/auth.effects.spec.ts +++ b/src/app/core/auth/auth.effects.spec.ts @@ -35,6 +35,7 @@ import { EPersonMock } from '../../shared/testing/eperson.mock'; import { AppState, storeModuleConfig } from '../../app.reducer'; import { StoreActionTypes } from '../../store.actions'; import { isAuthenticated, isAuthenticatedLoaded } from './selectors'; +import { AuthorizationDataService } from '../data/feature-authorization/authorization-data.service'; describe('AuthEffects', () => { let authEffects: AuthEffects; @@ -43,12 +44,12 @@ describe('AuthEffects', () => { let initialState; let token; let store: MockStore; - let authStatus; + + const authorizationService = jasmine.createSpyObj(['invalidateAuthorizationsRequestCache']); function init() { authServiceStub = new AuthServiceStub(); token = authServiceStub.getToken(); - authStatus = Object.assign(new AuthStatus(), {}); initialState = { core: { auth: { @@ -70,6 +71,7 @@ describe('AuthEffects', () => { providers: [ AuthEffects, provideMockStore({ initialState }), + { provide: AuthorizationDataService, useValue: authorizationService }, { provide: AuthService, useValue: authServiceStub }, provideMockActions(() => actions), // other providers @@ -219,38 +221,16 @@ describe('AuthEffects', () => { expect(authEffects.checkTokenCookie$).toBeObservable(expected); }); - describe('on CSR', () => { - it('should return a RETRIEVE_AUTH_METHODS action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is false', () => { - spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( - observableOf( - { authenticated: false }) - ); - spyOn((authEffects as any).authService, 'getRetrieveAuthMethodsAction').and.returnValue( - new RetrieveAuthMethodsAction({ authenticated: false } as AuthStatus, false) - ); - actions = hot('--a-', { a: { type: AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_COOKIE } }); + it('should return a RETRIEVE_AUTH_METHODS action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is false', () => { + spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( + observableOf( + { authenticated: false }) + ); + actions = hot('--a-', { a: { type: AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_COOKIE } }); - const expected = cold('--b-', { b: new RetrieveAuthMethodsAction({ authenticated: false } as AuthStatus, false) }); + const expected = cold('--b-', { b: new RetrieveAuthMethodsAction({ authenticated: false } as AuthStatus) }); - expect(authEffects.checkTokenCookie$).toBeObservable(expected); - }); - }); - - describe('on SSR', () => { - it('should return a RETRIEVE_AUTH_METHODS action in response to a CHECK_AUTHENTICATION_TOKEN_COOKIE action when authenticated is false', () => { - spyOn((authEffects as any).authService, 'checkAuthenticationCookie').and.returnValue( - observableOf( - { authenticated: false }) - ); - spyOn((authEffects as any).authService, 'getRetrieveAuthMethodsAction').and.returnValue( - new RetrieveAuthMethodsAction({ authenticated: false } as AuthStatus, true) - ); - actions = hot('--a-', { a: { type: AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_COOKIE } }); - - const expected = cold('--b-', { b: new RetrieveAuthMethodsAction({ authenticated: false } as AuthStatus, true) }); - - expect(authEffects.checkTokenCookie$).toBeObservable(expected); - }); + expect(authEffects.checkTokenCookie$).toBeObservable(expected); }); }); @@ -383,74 +363,27 @@ describe('AuthEffects', () => { describe('retrieveMethods$', () => { - describe('on CSR', () => { - describe('when retrieve authentication methods succeeded', () => { - it('should return a RETRIEVE_AUTH_METHODS_SUCCESS action in response to a RETRIEVE_AUTH_METHODS action', () => { - actions = hot('--a-', { a: - { - type: AuthActionTypes.RETRIEVE_AUTH_METHODS, - payload: { status: authStatus, blocking: false} - } - }); + describe('when retrieve authentication methods succeeded', () => { + it('should return a RETRIEVE_AUTH_METHODS_SUCCESS action in response to a RETRIEVE_AUTH_METHODS action', () => { + actions = hot('--a-', { a: { type: AuthActionTypes.RETRIEVE_AUTH_METHODS } }); - const expected = cold('--b-', { b: new RetrieveAuthMethodsSuccessAction(authMethodsMock, false) }); + const expected = cold('--b-', { b: new RetrieveAuthMethodsSuccessAction(authMethodsMock) }); - expect(authEffects.retrieveMethods$).toBeObservable(expected); - }); - }); - - describe('when retrieve authentication methods failed', () => { - it('should return a RETRIEVE_AUTH_METHODS_ERROR action in response to a RETRIEVE_AUTH_METHODS action', () => { - spyOn((authEffects as any).authService, 'retrieveAuthMethodsFromAuthStatus').and.returnValue(observableThrow('')); - - actions = hot('--a-', { a: - { - type: AuthActionTypes.RETRIEVE_AUTH_METHODS, - payload: { status: authStatus, blocking: false} - } - }); - - const expected = cold('--b-', { b: new RetrieveAuthMethodsErrorAction(false) }); - - expect(authEffects.retrieveMethods$).toBeObservable(expected); - }); + expect(authEffects.retrieveMethods$).toBeObservable(expected); }); }); - describe('on SSR', () => { - describe('when retrieve authentication methods succeeded', () => { - it('should return a RETRIEVE_AUTH_METHODS_SUCCESS action in response to a RETRIEVE_AUTH_METHODS action', () => { - actions = hot('--a-', { a: - { - type: AuthActionTypes.RETRIEVE_AUTH_METHODS, - payload: { status: authStatus, blocking: true} - } - }); + describe('when retrieve authentication methods failed', () => { + it('should return a RETRIEVE_AUTH_METHODS_ERROR action in response to a RETRIEVE_AUTH_METHODS action', () => { + spyOn((authEffects as any).authService, 'retrieveAuthMethodsFromAuthStatus').and.returnValue(observableThrow('')); - const expected = cold('--b-', { b: new RetrieveAuthMethodsSuccessAction(authMethodsMock, true) }); + actions = hot('--a-', { a: { type: AuthActionTypes.RETRIEVE_AUTH_METHODS } }); - expect(authEffects.retrieveMethods$).toBeObservable(expected); - }); - }); + const expected = cold('--b-', { b: new RetrieveAuthMethodsErrorAction() }); - describe('when retrieve authentication methods failed', () => { - it('should return a RETRIEVE_AUTH_METHODS_ERROR action in response to a RETRIEVE_AUTH_METHODS action', () => { - spyOn((authEffects as any).authService, 'retrieveAuthMethodsFromAuthStatus').and.returnValue(observableThrow('')); - - actions = hot('--a-', { a: - { - type: AuthActionTypes.RETRIEVE_AUTH_METHODS, - payload: { status: authStatus, blocking: true} - } - }); - - const expected = cold('--b-', { b: new RetrieveAuthMethodsErrorAction(true) }); - - expect(authEffects.retrieveMethods$).toBeObservable(expected); - }); + expect(authEffects.retrieveMethods$).toBeObservable(expected); }); }); - }); describe('clearInvalidTokenOnRehydrate$', () => { @@ -488,4 +421,16 @@ describe('AuthEffects', () => { })); }); }); + + describe('invalidateAuthorizationsRequestCache$', () => { + it('should call invalidateAuthorizationsRequestCache method in response to a REHYDRATE action', (done) => { + actions = hot('--a-|', { a: { type: StoreActionTypes.REHYDRATE } }); + + authEffects.invalidateAuthorizationsRequestCache$.subscribe(() => { + expect((authEffects as any).authorizationsService.invalidateAuthorizationsRequestCache).toHaveBeenCalled(); + }); + + done(); + }); + }); }); diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 8ce10c0c6b..1477a1832e 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -1,13 +1,14 @@ import { Injectable, NgZone } from '@angular/core'; import { + asyncScheduler, combineLatest as observableCombineLatest, Observable, of as observableOf, - timer, - asyncScheduler, queueScheduler + queueScheduler, + timer } from 'rxjs'; -import { catchError, filter, map, switchMap, take, tap, observeOn } from 'rxjs/operators'; +import { catchError, filter, map, observeOn, switchMap, take, tap } from 'rxjs/operators'; // import @ngrx import { Actions, Effect, ofType } from '@ngrx/effects'; import { Action, select, Store } from '@ngrx/store'; @@ -43,7 +44,8 @@ import { RetrieveAuthMethodsAction, RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction, - RetrieveTokenAction, SetUserAsIdleAction + RetrieveTokenAction, + SetUserAsIdleAction } from './auth.actions'; import { hasValue } from '../../shared/empty.util'; import { environment } from '../../../environments/environment'; @@ -51,6 +53,7 @@ import { RequestActionTypes } from '../data/request.actions'; import { NotificationsActionTypes } from '../../shared/notifications/notifications.actions'; import { LeaveZoneScheduler } from '../utilities/leave-zone.scheduler'; import { EnterZoneScheduler } from '../utilities/enter-zone.scheduler'; +import { AuthorizationDataService } from '../data/feature-authorization/authorization-data.service'; // Action Types that do not break/prevent the user from an idle state const IDLE_TIMER_IGNORE_TYPES: string[] @@ -161,7 +164,7 @@ export class AuthEffects { if (response.authenticated) { return new RetrieveTokenAction(); } else { - return this.authService.getRetrieveAuthMethodsAction(response); + return new RetrieveAuthMethodsAction(response); } }), catchError((error) => observableOf(new AuthenticatedErrorAction(error))) @@ -216,6 +219,16 @@ export class AuthEffects { ); })); + /** + * When the store is rehydrated in the browser, invalidate all cache hits regarding the + * authorizations endpoint, to be sure to have consistent responses after a login with external idp + * + */ + @Effect({ dispatch: false }) invalidateAuthorizationsRequestCache$ = this.actions$ + .pipe(ofType(StoreActionTypes.REHYDRATE), + tap(() => this.authorizationsService.invalidateAuthorizationsRequestCache()) + ); + @Effect() public logOut$: Observable = this.actions$ .pipe( @@ -250,10 +263,10 @@ export class AuthEffects { .pipe( ofType(AuthActionTypes.RETRIEVE_AUTH_METHODS), switchMap((action: RetrieveAuthMethodsAction) => { - return this.authService.retrieveAuthMethodsFromAuthStatus(action.payload.status) + return this.authService.retrieveAuthMethodsFromAuthStatus(action.payload) .pipe( - map((authMethodModels: AuthMethod[]) => new RetrieveAuthMethodsSuccessAction(authMethodModels, action.payload.blocking)), - catchError((error) => observableOf(new RetrieveAuthMethodsErrorAction(action.payload.blocking))) + map((authMethodModels: AuthMethod[]) => new RetrieveAuthMethodsSuccessAction(authMethodModels)), + catchError((error) => observableOf(new RetrieveAuthMethodsErrorAction())) ); }) ); @@ -282,11 +295,13 @@ export class AuthEffects { * @constructor * @param {Actions} actions$ * @param {NgZone} zone + * @param {AuthorizationDataService} authorizationsService * @param {AuthService} authService * @param {Store} store */ constructor(private actions$: Actions, private zone: NgZone, + private authorizationsService: AuthorizationDataService, private authService: AuthService, private store: Store) { } diff --git a/src/app/core/auth/auth.reducer.spec.ts b/src/app/core/auth/auth.reducer.spec.ts index ba271fafb5..8cd587b61a 100644 --- a/src/app/core/auth/auth.reducer.spec.ts +++ b/src/app/core/auth/auth.reducer.spec.ts @@ -23,7 +23,9 @@ import { RetrieveAuthMethodsAction, RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction, - SetRedirectUrlAction, SetUserAsIdleAction, UnsetUserAsIdleAction + SetRedirectUrlAction, + SetUserAsIdleAction, + UnsetUserAsIdleAction } from './auth.actions'; import { AuthTokenInfo } from './models/auth-token-info.model'; import { EPersonMock } from '../../shared/testing/eperson.mock'; @@ -551,7 +553,7 @@ describe('authReducer', () => { authMethods: [], idle: false }; - const action = new RetrieveAuthMethodsAction(new AuthStatus(), true); + const action = new RetrieveAuthMethodsAction(new AuthStatus()); const newState = authReducer(initialState, action); state = { authenticated: false, @@ -577,7 +579,7 @@ describe('authReducer', () => { new AuthMethod(AuthMethodType.Password), new AuthMethod(AuthMethodType.Shibboleth, 'location') ]; - const action = new RetrieveAuthMethodsSuccessAction(authMethods, false); + const action = new RetrieveAuthMethodsSuccessAction(authMethods); const newState = authReducer(initialState, action); state = { authenticated: false, @@ -590,33 +592,7 @@ describe('authReducer', () => { expect(newState).toEqual(state); }); - it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_SUCCESS action with blocking as true', () => { - initialState = { - authenticated: false, - loaded: false, - blocking: true, - loading: true, - authMethods: [], - idle: false - }; - const authMethods = [ - new AuthMethod(AuthMethodType.Password), - new AuthMethod(AuthMethodType.Shibboleth, 'location') - ]; - const action = new RetrieveAuthMethodsSuccessAction(authMethods, true); - const newState = authReducer(initialState, action); - state = { - authenticated: false, - loaded: false, - blocking: true, - loading: false, - authMethods: authMethods, - idle: false - }; - expect(newState).toEqual(state); - }); - - it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_ERROR action ', () => { + it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_ERROR action', () => { initialState = { authenticated: false, loaded: false, @@ -626,7 +602,7 @@ describe('authReducer', () => { idle: false }; - const action = new RetrieveAuthMethodsErrorAction(false); + const action = new RetrieveAuthMethodsErrorAction(); const newState = authReducer(initialState, action); state = { authenticated: false, @@ -680,27 +656,4 @@ describe('authReducer', () => { }; expect(newState).toEqual(state); }); - - it('should properly set the state, in response to a RETRIEVE_AUTH_METHODS_ERROR action with blocking as true', () => { - initialState = { - authenticated: false, - loaded: false, - blocking: true, - loading: true, - authMethods: [], - idle: false - }; - - const action = new RetrieveAuthMethodsErrorAction(true); - const newState = authReducer(initialState, action); - state = { - authenticated: false, - loaded: false, - blocking: true, - loading: false, - authMethods: [new AuthMethod(AuthMethodType.Password)], - idle: false - }; - expect(newState).toEqual(state); - }); }); diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index ef803503c8..2fc79a8861 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -10,7 +10,6 @@ import { RedirectWhenTokenExpiredAction, RefreshTokenSuccessAction, RetrieveAuthenticatedEpersonSuccessAction, - RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction, SetRedirectUrlAction } from './auth.actions'; @@ -217,14 +216,14 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut case AuthActionTypes.RETRIEVE_AUTH_METHODS_SUCCESS: return Object.assign({}, state, { loading: false, - blocking: (action as RetrieveAuthMethodsSuccessAction).payload.blocking, - authMethods: (action as RetrieveAuthMethodsSuccessAction).payload.authMethods + blocking: false, + authMethods: (action as RetrieveAuthMethodsSuccessAction).payload }); case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR: return Object.assign({}, state, { loading: false, - blocking: (action as RetrieveAuthMethodsErrorAction).payload, + blocking: false, authMethods: [new AuthMethod(AuthMethodType.Password)] }); diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index a5b5d70704..09848d9044 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -34,9 +34,9 @@ import { } from './selectors'; import { AppState } from '../../app.reducer'; import { - CheckAuthenticationTokenAction, RefreshTokenAction, + CheckAuthenticationTokenAction, + RefreshTokenAction, ResetAuthenticationMessagesAction, - RetrieveAuthMethodsAction, SetRedirectUrlAction, SetUserAsIdleAction, UnsetUserAsIdleAction @@ -573,15 +573,6 @@ export class AuthService { ); } - /** - * Return a new instance of RetrieveAuthMethodsAction - * - * @param authStatus The auth status - */ - getRetrieveAuthMethodsAction(authStatus: AuthStatus): RetrieveAuthMethodsAction { - return new RetrieveAuthMethodsAction(authStatus, false); - } - /** * Determines if current user is idle * @returns {Observable} diff --git a/src/app/core/auth/server-auth.service.ts b/src/app/core/auth/server-auth.service.ts index cccc1490f8..ea5a3b41f2 100644 --- a/src/app/core/auth/server-auth.service.ts +++ b/src/app/core/auth/server-auth.service.ts @@ -4,13 +4,12 @@ import { HttpHeaders } from '@angular/common/http'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { isNotEmpty, hasValue } from '../../shared/empty.util'; +import { hasValue, isNotEmpty } from '../../shared/empty.util'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { AuthService } from './auth.service'; import { AuthStatus } from './models/auth-status.model'; import { AuthTokenInfo } from './models/auth-token-info.model'; import { RemoteData } from '../data/remote-data'; -import { RetrieveAuthMethodsAction } from './auth.actions'; /** * The auth service. @@ -61,13 +60,4 @@ export class ServerAuthService extends AuthService { map((rd: RemoteData) => Object.assign(new AuthStatus(), rd.payload)) ); } - - /** - * Return a new instance of RetrieveAuthMethodsAction - * - * @param authStatus The auth status - */ - getRetrieveAuthMethodsAction(authStatus: AuthStatus): RetrieveAuthMethodsAction { - return new RetrieveAuthMethodsAction(authStatus, true); - } } diff --git a/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts index d41446c185..46c49add06 100644 --- a/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/collection-breadcrumb.resolver.ts @@ -4,7 +4,7 @@ import { DSOBreadcrumbResolver } from './dso-breadcrumb.resolver'; import { Collection } from '../shared/collection.model'; import { CollectionDataService } from '../data/collection-data.service'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; -import { COLLECTION_PAGE_LINKS_TO_FOLLOW } from '../../+collection-page/collection-page.resolver'; +import { COLLECTION_PAGE_LINKS_TO_FOLLOW } from '../../collection-page/collection-page.resolver'; /** * The class that resolves the BreadcrumbConfig object for a Collection diff --git a/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts index 27cc207c58..309927771d 100644 --- a/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/community-breadcrumb.resolver.ts @@ -4,7 +4,7 @@ import { DSOBreadcrumbResolver } from './dso-breadcrumb.resolver'; import { CommunityDataService } from '../data/community-data.service'; import { Community } from '../shared/community.model'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; -import { COMMUNITY_PAGE_LINKS_TO_FOLLOW } from '../../+community-page/community-page.resolver'; +import { COMMUNITY_PAGE_LINKS_TO_FOLLOW } from '../../community-page/community-page.resolver'; /** * The class that resolves the BreadcrumbConfig object for a Community diff --git a/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts b/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts index 529349eb89..3005b6f09a 100644 --- a/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts +++ b/src/app/core/breadcrumbs/item-breadcrumb.resolver.ts @@ -4,7 +4,7 @@ import { ItemDataService } from '../data/item-data.service'; import { Item } from '../shared/item.model'; import { DSOBreadcrumbResolver } from './dso-breadcrumb.resolver'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; -import { ITEM_PAGE_LINKS_TO_FOLLOW } from '../../+item-page/item.resolver'; +import { ITEM_PAGE_LINKS_TO_FOLLOW } from '../../item-page/item.resolver'; /** * The class that resolves the BreadcrumbConfig object for an Item diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 3c34e5ec35..026c87be9d 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -10,7 +10,7 @@ import { import { EffectsModule } from '@ngrx/effects'; import { Action, StoreConfig, StoreModule } from '@ngrx/store'; -import { MyDSpaceGuard } from '../+my-dspace-page/my-dspace.guard'; +import { MyDSpaceGuard } from '../my-dspace-page/my-dspace.guard'; import { isNotEmpty } from '../shared/empty.util'; import { FormBuilderService } from '../shared/form/builder/form-builder.service'; diff --git a/src/app/core/core.reducers.ts b/src/app/core/core.reducers.ts index 448c1b8641..8b3ec32b46 100644 --- a/src/app/core/core.reducers.ts +++ b/src/app/core/core.reducers.ts @@ -11,7 +11,7 @@ import { routeReducer, RouteState } from './services/route.reducer'; import { bitstreamFormatReducer, BitstreamFormatRegistryState -} from '../+admin/admin-registries/bitstream-formats/bitstream-format.reducers'; +} from '../admin/admin-registries/bitstream-formats/bitstream-format.reducers'; import { historyReducer, HistoryState } from './history/history.reducer'; import { metaTagReducer, MetaTagState } from './metadata/meta-tag.reducer'; diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index 3890f4e663..23aec80ff2 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -28,6 +28,7 @@ import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { sendRequest } from '../shared/operators'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { PageInfo } from '../shared/page-info.model'; +import { RequestParam } from '../cache/models/request-param.model'; /** * A service to retrieve {@link Bitstream}s from the REST API @@ -136,4 +137,50 @@ export class BitstreamDataService extends DataService { return this.rdbService.buildFromRequestUUID(requestId); } + /** + * Returns an observable of {@link RemoteData} of a {@link Bitstream}, based on a handle and an + * optional sequenceId or filename, with a list of {@link FollowLinkConfig}, to automatically + * resolve {@link HALLink}s of the object + * + * @param handle The handle of the bitstream we want to retrieve + * @param sequenceId The sequence id of the bitstream we want to retrieve + * @param filename The filename of the bitstream we want to retrieve + * @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's + * no valid cached version. Defaults to true + * @param reRequestOnStale Whether or not the request should automatically be re- + * requested after the response becomes stale + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which + * {@link HALLink}s should be automatically resolved + */ + findByItemHandle( + handle: string, + sequenceId?: string, + filename?: string, + useCachedVersionIfAvailable = true, + reRequestOnStale = true, + ...linksToFollow: FollowLinkConfig[] + ): Observable> { + const searchParams = []; + searchParams.push(new RequestParam('handle', handle)); + if (hasValue(sequenceId)) { + searchParams.push(new RequestParam('sequenceId', sequenceId)); + } + if (hasValue(filename)) { + searchParams.push(new RequestParam('filename', filename)); + } + + const hrefObs = this.getSearchByHref( + 'byItemHandle', + { searchParams }, + ...linksToFollow + ); + + return this.findByHref( + hrefObs, + useCachedVersionIfAvailable, + reRequestOnStale, + ...linksToFollow + ); + } + } diff --git a/src/app/core/data/bitstream-format-data.service.spec.ts b/src/app/core/data/bitstream-format-data.service.spec.ts index bb3fe2f064..c072803c83 100644 --- a/src/app/core/data/bitstream-format-data.service.spec.ts +++ b/src/app/core/data/bitstream-format-data.service.spec.ts @@ -15,7 +15,7 @@ import { BitstreamFormatsRegistryDeselectAction, BitstreamFormatsRegistryDeselectAllAction, BitstreamFormatsRegistrySelectAction -} from '../../+admin/admin-registries/bitstream-formats/bitstream-format.actions'; +} from '../../admin/admin-registries/bitstream-formats/bitstream-format.actions'; import { TestScheduler } from 'rxjs/testing'; import { CoreState } from '../core.reducers'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; diff --git a/src/app/core/data/bitstream-format-data.service.ts b/src/app/core/data/bitstream-format-data.service.ts index 424c9fbd99..0d0dc5eb63 100644 --- a/src/app/core/data/bitstream-format-data.service.ts +++ b/src/app/core/data/bitstream-format-data.service.ts @@ -7,8 +7,8 @@ import { BitstreamFormatsRegistryDeselectAction, BitstreamFormatsRegistryDeselectAllAction, BitstreamFormatsRegistrySelectAction -} from '../../+admin/admin-registries/bitstream-formats/bitstream-format.actions'; -import { BitstreamFormatRegistryState } from '../../+admin/admin-registries/bitstream-formats/bitstream-format.reducers'; +} from '../../admin/admin-registries/bitstream-formats/bitstream-format.actions'; +import { BitstreamFormatRegistryState } from '../../admin/admin-registries/bitstream-formats/bitstream-format.reducers'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { dataService } from '../cache/builders/build-decorators'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; diff --git a/src/app/core/data/dso-redirect-data.service.ts b/src/app/core/data/dso-redirect-data.service.ts index 693ae0b41a..83395d4719 100644 --- a/src/app/core/data/dso-redirect-data.service.ts +++ b/src/app/core/data/dso-redirect-data.service.ts @@ -19,7 +19,7 @@ import { RequestService } from './request.service'; import { getFirstCompletedRemoteData } from '../shared/operators'; import { DSpaceObject } from '../shared/dspace-object.model'; import { Item } from '../shared/item.model'; -import { getItemPageRoute } from '../../+item-page/item-page-routing-paths'; +import { getItemPageRoute } from '../../item-page/item-page-routing-paths'; @Injectable() export class DsoRedirectDataService extends DataService { diff --git a/src/app/core/data/feature-authorization/authorization-data.service.spec.ts b/src/app/core/data/feature-authorization/authorization-data.service.spec.ts index 23457b8409..01bd23d7c7 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.spec.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.spec.ts @@ -21,6 +21,10 @@ describe('AuthorizationDataService', () => { let site: Site; let ePerson: EPerson; + const requestService = jasmine.createSpyObj('requestService', { + setStaleByHrefSubstring: jasmine.createSpy('setStaleByHrefSubstring') + }); + function init() { site = Object.assign(new Site(), { id: 'test-site', @@ -39,7 +43,7 @@ describe('AuthorizationDataService', () => { isAuthenticated: () => observableOf(true), getAuthenticatedUserFromStore: () => observableOf(ePerson) } as AuthService; - service = new AuthorizationDataService(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, authService, siteService); + service = new AuthorizationDataService(requestService, undefined, undefined, undefined, undefined, undefined, undefined, undefined, authService, siteService); } beforeEach(() => { @@ -47,6 +51,11 @@ describe('AuthorizationDataService', () => { spyOn(service, 'searchBy').and.returnValue(observableOf(undefined)); }); + it('should call setStaleByHrefSubstring method', () => { + service.invalidateAuthorizationsRequestCache(); + expect((service as any).requestService.setStaleByHrefSubstring).toHaveBeenCalledWith((service as any).linkPath); + }); + describe('searchByObject', () => { const objectUrl = 'fake-object-url'; const ePersonUuid = 'fake-eperson-uuid'; diff --git a/src/app/core/data/feature-authorization/authorization-data.service.ts b/src/app/core/data/feature-authorization/authorization-data.service.ts index 170e82f5f8..b9812cdbb3 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.ts @@ -51,6 +51,13 @@ export class AuthorizationDataService extends DataService { super(); } + /** + * Set all authorization requests to stale + */ + invalidateAuthorizationsRequestCache() { + this.requestService.setStaleByHrefSubstring(this.linkPath); + } + /** * Checks if an {@link EPerson} (or anonymous) has access to a specific object within a {@link Feature} * @param objectUrl URL to the object to search {@link Authorization}s for. diff --git a/src/app/core/data/relationship.service.ts b/src/app/core/data/relationship.service.ts index da1ff790df..727cd105e6 100644 --- a/src/app/core/data/relationship.service.ts +++ b/src/app/core/data/relationship.service.ts @@ -6,7 +6,7 @@ import { distinctUntilChanged, filter, map, mergeMap, startWith, switchMap, take import { compareArraysUsingIds, PAGINATED_RELATIONS_TO_ITEMS_OPERATOR, relationsToItems -} from '../../+item-page/simple/item-types/shared/item-relationships-utils'; +} from '../../item-page/simple/item-types/shared/item-relationships-utils'; import { AppState, keySelector } from '../../app.reducer'; import { hasValue, hasValueOperator, isNotEmpty, isNotEmptyOperator } from '../../shared/empty.util'; import { ReorderableRelationship } from '../../shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component'; diff --git a/src/app/core/dspace-rest/dspace-rest.service.ts b/src/app/core/dspace-rest/dspace-rest.service.ts index d949fff140..ea4e8c2831 100644 --- a/src/app/core/dspace-rest/dspace-rest.service.ts +++ b/src/app/core/dspace-rest/dspace-rest.service.ts @@ -112,11 +112,15 @@ export class DspaceRestService { statusText: res.statusText })), catchError((err) => { - return observableThrowError({ - statusCode: err.status, - statusText: err.statusText, - message: (hasValue(err.error) && isNotEmpty(err.error.message)) ? err.error.message : err.message - }); + if (hasValue(err.status)) { + return observableThrowError({ + statusCode: err.status, + statusText: err.statusText, + message: (hasValue(err.error) && isNotEmpty(err.error.message)) ? err.error.message : err.message + }); + } else { + return observableThrowError(err); + } })); } diff --git a/src/app/core/log/log.interceptor.spec.ts b/src/app/core/log/log.interceptor.spec.ts new file mode 100644 index 0000000000..9bda4b7934 --- /dev/null +++ b/src/app/core/log/log.interceptor.spec.ts @@ -0,0 +1,76 @@ +import { TestBed } from '@angular/core/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { HTTP_INTERCEPTORS } from '@angular/common/http'; +import { Router } from '@angular/router'; + +import { LogInterceptor } from './log.interceptor'; +import { DspaceRestService } from '../dspace-rest/dspace-rest.service'; +import { RestRequestMethod } from '../data/rest-request-method'; +import { CookieService } from '../services/cookie.service'; +import { CookieServiceMock } from '../../shared/mocks/cookie.service.mock'; +import { RouterStub } from '../../shared/testing/router.stub'; + + +describe('LogInterceptor', () => { + let service: DspaceRestService; + let httpMock: HttpTestingController; + let cookieService: CookieService; + const router = Object.assign(new RouterStub(),{url : '/statistics'}); + + // Mock payload/statuses are dummy content as we are not testing the results + // of any below requests. We are only testing for X-XSRF-TOKEN header. + const mockPayload = { + id: 1 + }; + const mockStatusCode = 200; + const mockStatusText = 'SUCCESS'; + + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [ + DspaceRestService, + // LogInterceptor, + { + provide: HTTP_INTERCEPTORS, + useClass: LogInterceptor, + multi: true, + }, + { provide: CookieService, useValue: new CookieServiceMock() }, + { provide: Router, useValue: router }, + ], + }); + + service = TestBed.get(DspaceRestService); + httpMock = TestBed.get(HttpTestingController); + cookieService = TestBed.get(CookieService); + + cookieService.set('CORRELATION-ID','123455'); + }); + + + it('headers should be set', (done) => { + service.request(RestRequestMethod.POST, 'server/api/core/items', 'test', { withCredentials: false }).subscribe((response) => { + expect(response).toBeTruthy(); + done(); + }); + + const httpRequest = httpMock.expectOne('server/api/core/items'); + httpRequest.flush(mockPayload, { status: mockStatusCode, statusText: mockStatusText }); + expect(httpRequest.request.headers.has('X-CORRELATION-ID')).toBeTrue(); + expect(httpRequest.request.headers.has('X-REFERRER')).toBeTrue(); + }); + + it('headers should have the right values', (done) => { + service.request(RestRequestMethod.POST, 'server/api/core/items', 'test', { withCredentials: false }).subscribe((response) => { + expect(response).toBeTruthy(); + done(); + }); + + const httpRequest = httpMock.expectOne('server/api/core/items'); + httpRequest.flush(mockPayload, { status: mockStatusCode, statusText: mockStatusText }); + expect(httpRequest.request.headers.get('X-CORRELATION-ID')).toEqual('123455'); + expect(httpRequest.request.headers.get('X-REFERRER')).toEqual('/statistics'); + }); +}); diff --git a/src/app/core/log/log.interceptor.ts b/src/app/core/log/log.interceptor.ts new file mode 100644 index 0000000000..bf843f1da8 --- /dev/null +++ b/src/app/core/log/log.interceptor.ts @@ -0,0 +1,36 @@ +import { Injectable } from '@angular/core'; +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { Router } from '@angular/router'; + +import { Observable } from 'rxjs'; + +import { CookieService } from '../services/cookie.service'; +import { hasValue } from '../../shared/empty.util'; + +/** + * Log Interceptor intercepting Http Requests & Responses to + * exchange add headers of the user using the application utilizing unique id in cookies. + * Add header for users current page path. + */ +@Injectable() +export class LogInterceptor implements HttpInterceptor { + + constructor(private cookieService: CookieService, private router: Router) {} + + intercept(request: HttpRequest, next: HttpHandler): Observable> { + + // Get Unique id of the user from the cookies + const correlationId = this.cookieService.get('CORRELATION-ID'); + + // Add headers from the intercepted request + let headers = request.headers; + if (hasValue(correlationId)) { + headers = headers.append('X-CORRELATION-ID', correlationId); + } + headers = headers.append('X-REFERRER', this.router.url); + + // Add new headers to the intercepted request + request = request.clone({ withCredentials: true, headers: headers }); + return next.handle(request); + } +} diff --git a/src/app/core/metadata/metadata.service.spec.ts b/src/app/core/metadata/metadata.service.spec.ts index b3404e84d5..985851c321 100644 --- a/src/app/core/metadata/metadata.service.spec.ts +++ b/src/app/core/metadata/metadata.service.spec.ts @@ -74,7 +74,7 @@ describe('MetadataService', () => { } } as any as Router; hardRedirectService = jasmine.createSpyObj( { - getRequestOrigin: 'https://request.org', + getCurrentOrigin: 'https://request.org', }); // @ts-ignore @@ -107,18 +107,18 @@ describe('MetadataService', () => { tick(); expect(title.setTitle).toHaveBeenCalledWith('Test PowerPoint Document'); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_title', + name: 'citation_title', content: 'Test PowerPoint Document' }); - expect(meta.addTag).toHaveBeenCalledWith({ property: 'citation_author', content: 'Doe, Jane' }); + expect(meta.addTag).toHaveBeenCalledWith({ name: 'citation_author', content: 'Doe, Jane' }); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_publication_date', + name: 'citation_publication_date', content: '1650-06-26' }); - expect(meta.addTag).toHaveBeenCalledWith({ property: 'citation_issn', content: '123456789' }); - expect(meta.addTag).toHaveBeenCalledWith({ property: 'citation_language', content: 'en' }); + expect(meta.addTag).toHaveBeenCalledWith({ name: 'citation_issn', content: '123456789' }); + expect(meta.addTag).toHaveBeenCalledWith({ name: 'citation_language', content: 'en' }); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_keywords', + name: 'citation_keywords', content: 'keyword1; keyword2; keyword3' }); })); @@ -133,11 +133,11 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_dissertation_name', + name: 'citation_dissertation_name', content: 'Test PowerPoint Document' }); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_pdf_url', + name: 'citation_pdf_url', content: 'https://request.org/bitstreams/4db100c1-e1f5-4055-9404-9bc3e2d15f29/download' }); })); @@ -152,7 +152,7 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_technical_report_institution', + name: 'citation_technical_report_institution', content: 'Mock Publisher' }); })); @@ -170,11 +170,11 @@ describe('MetadataService', () => { tick(); expect(title.setTitle).toHaveBeenCalledWith('DSpace :: Dummy Title'); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'title', + name: 'title', content: 'DSpace :: Dummy Title' }); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'description', + name: 'description', content: 'This is a dummy item component for testing!' }); })); @@ -191,7 +191,7 @@ describe('MetadataService', () => { metadataService.listenForRouteChange(); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'Generator', + name: 'Generator', content: 'mock-dspace-version' }); })); @@ -208,7 +208,7 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_abstract_html_url', + name: 'citation_abstract_html_url', content: 'https://ddg.gg' }); })); @@ -223,7 +223,7 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_abstract_html_url', + name: 'citation_abstract_html_url', content: 'https://request.org/items/0ec7ff22-f211-40ab-a69e-c819b0b1f357' }); })); @@ -240,11 +240,11 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_dissertation_institution', + name: 'citation_dissertation_institution', content: 'Mock Publisher' }); - expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ property: 'citation_technical_report_institution' })); - expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ property: 'citation_publisher' })); + expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ name: 'citation_technical_report_institution' })); + expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ name: 'citation_publisher' })); })); it('should use citation_tech_report_institution tag for tech reports', fakeAsync(() => { @@ -256,12 +256,12 @@ describe('MetadataService', () => { } }); tick(); - expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ property: 'citation_dissertation_institution' })); + expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ name: 'citation_dissertation_institution' })); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_technical_report_institution', + name: 'citation_technical_report_institution', content: 'Mock Publisher' }); - expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ property: 'citation_publisher' })); + expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ name: 'citation_publisher' })); })); it('should use citation_publisher for other item types', fakeAsync(() => { @@ -273,10 +273,10 @@ describe('MetadataService', () => { } }); tick(); - expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ property: 'citation_dissertation_institution' })); - expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ property: 'citation_technical_report_institution' })); + expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ name: 'citation_dissertation_institution' })); + expect(meta.addTag).not.toHaveBeenCalledWith(jasmine.objectContaining({ name: 'citation_technical_report_institution' })); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_publisher', + name: 'citation_publisher', content: 'Mock Publisher' }); })); @@ -295,7 +295,7 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_pdf_url', + name: 'citation_pdf_url', content: 'https://request.org/bitstreams/4db100c1-e1f5-4055-9404-9bc3e2d15f29/download' }); })); @@ -313,7 +313,7 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_pdf_url', + name: 'citation_pdf_url', content: 'https://request.org/bitstreams/4db100c1-e1f5-4055-9404-9bc3e2d15f29/download' }); })); @@ -334,7 +334,7 @@ describe('MetadataService', () => { }); tick(); expect(meta.addTag).toHaveBeenCalledWith({ - property: 'citation_pdf_url', + name: 'citation_pdf_url', content: 'https://request.org/bitstreams/cf9b0c8e-a1eb-4b65-afd0-567366448713/download' }); })); @@ -354,8 +354,8 @@ describe('MetadataService', () => { })); it('should remove previous tags on route change', fakeAsync(() => { - expect(meta.removeTag).toHaveBeenCalledWith('property=\'title\''); - expect(meta.removeTag).toHaveBeenCalledWith('property=\'description\''); + expect(meta.removeTag).toHaveBeenCalledWith('name=\'title\''); + expect(meta.removeTag).toHaveBeenCalledWith('name=\'description\''); })); it('should clear all tags and add new ones on route change', () => { diff --git a/src/app/core/metadata/metadata.service.ts b/src/app/core/metadata/metadata.service.ts index 10e37b4282..1c6946b0d3 100644 --- a/src/app/core/metadata/metadata.service.ts +++ b/src/app/core/metadata/metadata.service.ts @@ -272,7 +272,7 @@ export class MetadataService { if (this.currentObject.value instanceof Item) { let url = this.getMetaTagValue('dc.identifier.uri'); if (hasNoValue(url)) { - url = new URLCombiner(this.hardRedirectService.getRequestOrigin(), this.router.url).toString(); + url = new URLCombiner(this.hardRedirectService.getCurrentOrigin(), this.router.url).toString(); } this.addMetaTag('citation_abstract_html_url', url); } @@ -336,7 +336,7 @@ export class MetadataService { // Use the found link to set the tag this.addMetaTag( 'citation_pdf_url', - new URLCombiner(this.hardRedirectService.getRequestOrigin(), link).toString() + new URLCombiner(this.hardRedirectService.getCurrentOrigin(), link).toString() ); }); } @@ -403,7 +403,7 @@ export class MetadataService { */ private setGenerator(): void { this.rootService.findRoot().pipe(getFirstSucceededRemoteDataPayload()).subscribe((root) => { - this.meta.addTag({ property: 'Generator', content: root.dspaceVersion }); + this.meta.addTag({ name: 'Generator', content: root.dspaceVersion }); }); } @@ -447,17 +447,17 @@ export class MetadataService { return this.currentObject.value.allMetadataValues(keys); } - private addMetaTag(property: string, content: string): void { + private addMetaTag(name: string, content: string): void { if (content) { - const tag = { property, content } as MetaDefinition; + const tag = { name, content } as MetaDefinition; this.meta.addTag(tag); - this.storeTag(property); + this.storeTag(name); } } - private addMetaTags(property: string, content: string[]): void { + private addMetaTags(name: string, content: string[]): void { for (const value of content) { - this.addMetaTag(property, value); + this.addMetaTag(name, value); } } @@ -470,8 +470,8 @@ export class MetadataService { select(tagsInUseSelector), take(1) ).subscribe((tagsInUse: string[]) => { - for (const property of tagsInUse) { - this.meta.removeTag('property=\'' + property + '\''); + for (const name of tagsInUse) { + this.meta.removeTag('name=\'' + name + '\''); } this.store.dispatch(new ClearMetaTagAction()); }); diff --git a/src/app/core/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index 5f2f123f01..199f43e98e 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -15,7 +15,7 @@ import { MetadataRegistryEditSchemaAction, MetadataRegistrySelectFieldAction, MetadataRegistrySelectSchemaAction -} from '../../+admin/admin-registries/metadata-registry/metadata-registry.actions'; +} from '../../admin/admin-registries/metadata-registry/metadata-registry.actions'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { StoreMock } from '../../shared/testing/store.mock'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; diff --git a/src/app/core/registry/registry.service.ts b/src/app/core/registry/registry.service.ts index b7b35c6a5a..0046dbdb19 100644 --- a/src/app/core/registry/registry.service.ts +++ b/src/app/core/registry/registry.service.ts @@ -7,7 +7,7 @@ import { hasValue, hasValueOperator, isNotEmptyOperator } from '../../shared/emp import { getFirstSucceededRemoteDataPayload } from '../shared/operators'; import { createSelector, select, Store } from '@ngrx/store'; import { AppState } from '../../app.reducer'; -import { MetadataRegistryState } from '../../+admin/admin-registries/metadata-registry/metadata-registry.reducers'; +import { MetadataRegistryState } from '../../admin/admin-registries/metadata-registry/metadata-registry.reducers'; import { MetadataRegistryCancelFieldAction, MetadataRegistryCancelSchemaAction, @@ -19,7 +19,7 @@ import { MetadataRegistryEditSchemaAction, MetadataRegistrySelectFieldAction, MetadataRegistrySelectSchemaAction -} from '../../+admin/admin-registries/metadata-registry/metadata-registry.actions'; +} from '../../admin/admin-registries/metadata-registry/metadata-registry.actions'; import { map, mergeMap, tap } from 'rxjs/operators'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; diff --git a/src/app/core/services/browser-hard-redirect.service.spec.ts b/src/app/core/services/browser-hard-redirect.service.spec.ts index d0fecd9be5..b9745906c3 100644 --- a/src/app/core/services/browser-hard-redirect.service.spec.ts +++ b/src/app/core/services/browser-hard-redirect.service.spec.ts @@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing'; import { BrowserHardRedirectService } from './browser-hard-redirect.service'; describe('BrowserHardRedirectService', () => { - const origin = 'test origin'; + const origin = 'https://test-host.com:4000'; const mockLocation = { href: undefined, pathname: '/pathname', @@ -43,7 +43,7 @@ describe('BrowserHardRedirectService', () => { describe('when requesting the origin', () => { it('should return the location origin', () => { - expect(service.getRequestOrigin()).toEqual(origin); + expect(service.getCurrentOrigin()).toEqual(origin); }); }); diff --git a/src/app/core/services/browser-hard-redirect.service.ts b/src/app/core/services/browser-hard-redirect.service.ts index 5f90fb8dbd..eeb9006039 100644 --- a/src/app/core/services/browser-hard-redirect.service.ts +++ b/src/app/core/services/browser-hard-redirect.service.ts @@ -28,16 +28,20 @@ export class BrowserHardRedirectService extends HardRedirectService { } /** - * Get the origin of a request + * Get the current route, with query params included + * e.g. /search?page=1&query=open%20access&f.dateIssued.min=1980&f.dateIssued.max=2020 */ - getCurrentRoute() { + getCurrentRoute(): string { return this.location.pathname + this.location.search; } /** - * Get the hostname of the request + * Get the origin of the current URL + * i.e. "://" [ ":" ] + * e.g. if the URL is https://demo7.dspace.org/search?query=test, + * the origin would be https://demo7.dspace.org */ - getRequestOrigin() { + getCurrentOrigin(): string { return this.location.origin; } } diff --git a/src/app/core/services/hard-redirect.service.spec.ts b/src/app/core/services/hard-redirect.service.spec.ts deleted file mode 100644 index f060143e65..0000000000 --- a/src/app/core/services/hard-redirect.service.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { HardRedirectService } from './hard-redirect.service'; -import { environment } from '../../../environments/environment'; -import { TestBed } from '@angular/core/testing'; -import { Injectable } from '@angular/core'; - -const requestOrigin = 'http://dspace-angular-ui.dspace.com'; - -describe('HardRedirectService', () => { - let service: TestHardRedirectService; - - beforeEach(() => { - TestBed.configureTestingModule({ providers: [TestHardRedirectService] }); - service = TestBed.inject(TestHardRedirectService); - }); - - describe('when calling rewriteDownloadURL', () => { - let originalValue; - const relativePath = '/test/url/path'; - const testURL = environment.rest.baseUrl + relativePath; - beforeEach(() => { - originalValue = environment.rewriteDownloadUrls; - }); - - it('it should return the same url when rewriteDownloadURL is false', () => { - environment.rewriteDownloadUrls = false; - expect(service.rewriteDownloadURL(testURL)).toEqual(testURL); - }); - - it('it should replace part of the url when rewriteDownloadURL is true', () => { - environment.rewriteDownloadUrls = true; - expect(service.rewriteDownloadURL(testURL)).toEqual(requestOrigin + environment.rest.nameSpace + relativePath); - }); - - afterEach(() => { - environment.rewriteDownloadUrls = originalValue; - }); - }); -}); - -@Injectable() -class TestHardRedirectService extends HardRedirectService { - constructor() { - super(); - } - - redirect(url: string) { - return undefined; - } - - getCurrentRoute() { - return undefined; - } - - getRequestOrigin() { - return requestOrigin; - } -} diff --git a/src/app/core/services/hard-redirect.service.ts b/src/app/core/services/hard-redirect.service.ts index a09521dae5..3733059283 100644 --- a/src/app/core/services/hard-redirect.service.ts +++ b/src/app/core/services/hard-redirect.service.ts @@ -1,6 +1,4 @@ import { Injectable } from '@angular/core'; -import { environment } from '../../../environments/environment'; -import { URLCombiner } from '../url-combiner/url-combiner'; /** * Service to take care of hard redirects @@ -20,21 +18,13 @@ export abstract class HardRedirectService { * Get the current route, with query params included * e.g. /search?page=1&query=open%20access&f.dateIssued.min=1980&f.dateIssued.max=2020 */ - abstract getCurrentRoute(); + abstract getCurrentRoute(): string; /** - * Get the hostname of the request + * Get the origin of the current URL + * i.e. "://" [ ":" ] + * e.g. if the URL is https://demo7.dspace.org/search?query=test, + * the origin would be https://demo7.dspace.org */ - abstract getRequestOrigin(); - - public rewriteDownloadURL(originalUrl: string): string { - if (environment.rewriteDownloadUrls) { - const hostName = this.getRequestOrigin(); - const namespace = environment.rest.nameSpace; - const rewrittenUrl = new URLCombiner(hostName, namespace).toString(); - return originalUrl.replace(environment.rest.baseUrl, rewrittenUrl); - } else { - return originalUrl; - } - } + abstract getCurrentOrigin(): string; } diff --git a/src/app/core/services/server-hard-redirect.service.spec.ts b/src/app/core/services/server-hard-redirect.service.spec.ts index 892f4f4087..4501547b92 100644 --- a/src/app/core/services/server-hard-redirect.service.spec.ts +++ b/src/app/core/services/server-hard-redirect.service.spec.ts @@ -7,11 +7,12 @@ describe('ServerHardRedirectService', () => { const mockResponse = jasmine.createSpyObj(['redirect', 'end']); const service: ServerHardRedirectService = new ServerHardRedirectService(mockRequest, mockResponse); - const origin = 'test-host'; + const origin = 'https://test-host.com:4000'; beforeEach(() => { + mockRequest.protocol = 'https'; mockRequest.headers = { - host: 'test-host', + host: 'test-host.com:4000', }; TestBed.configureTestingModule({}); @@ -49,7 +50,7 @@ describe('ServerHardRedirectService', () => { describe('when requesting the origin', () => { it('should return the location origin', () => { - expect(service.getRequestOrigin()).toEqual(origin); + expect(service.getCurrentOrigin()).toEqual(origin); }); }); diff --git a/src/app/core/services/server-hard-redirect.service.ts b/src/app/core/services/server-hard-redirect.service.ts index 65b404ca6c..94b9ed6198 100644 --- a/src/app/core/services/server-hard-redirect.service.ts +++ b/src/app/core/services/server-hard-redirect.service.ts @@ -55,16 +55,19 @@ export class ServerHardRedirectService extends HardRedirectService { } /** - * Get the origin of a request + * Get the URL of the current route */ - getCurrentRoute() { + getCurrentRoute(): string { return this.req.originalUrl; } /** - * Get the hostname of the request + * Get the origin of the current URL + * i.e. "://" [ ":" ] + * e.g. if the URL is https://demo7.dspace.org/search?query=test, + * the origin would be https://demo7.dspace.org */ - getRequestOrigin() { - return this.req.headers.host; + getCurrentOrigin(): string { + return this.req.protocol + '://' + this.req.headers.host; } } diff --git a/src/app/core/shared/operators.spec.ts b/src/app/core/shared/operators.spec.ts index 780487eade..6fd15ceacc 100644 --- a/src/app/core/shared/operators.spec.ts +++ b/src/app/core/shared/operators.spec.ts @@ -15,7 +15,12 @@ import { redirectOn4xx } from './operators'; import { of as observableOf } from 'rxjs'; -import { createFailedRemoteDataObject, createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; +import { + createFailedRemoteDataObject, + createSuccessfulRemoteDataObject +} from '../../shared/remote-data.utils'; + +// tslint:disable:no-shadowed-variable describe('Core Module - RxJS Operators', () => { let scheduler: TestScheduler; @@ -172,8 +177,12 @@ describe('Core Module - RxJS Operators', () => { describe('redirectOn4xx', () => { let router; let authService; + let testScheduler; beforeEach(() => { + testScheduler = new TestScheduler((actual, expected) => { + expect(actual).toEqual(expected); + }); router = jasmine.createSpyObj('router', ['navigateByUrl']); authService = jasmine.createSpyObj('authService', { isAuthenticated: observableOf(true), @@ -181,32 +190,69 @@ describe('Core Module - RxJS Operators', () => { }); }); - it('should call navigateByUrl to a 404 page, when the remote data contains a 404 error', () => { - const testRD = createFailedRemoteDataObject('Object was not found', 404); + it('should call navigateByUrl to a 404 page, when the remote data contains a 404 error, and not emit anything', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createFailedRemoteDataObject('Object was not found', 404); + const source = cold('a', { a: testRD }); + const expected = '-'; + const values = {}; - observableOf(testRD).pipe(redirectOn4xx(router, authService)).subscribe(); - expect(router.navigateByUrl).toHaveBeenCalledWith('/404', { skipLocationChange: true }); + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(router.navigateByUrl).toHaveBeenCalledWith('/404', { skipLocationChange: true }); + }); }); - it('should call navigateByUrl to a 401 page, when the remote data contains a 403 error', () => { - const testRD = createFailedRemoteDataObject('Forbidden', 403); + it('should call navigateByUrl to a 404 page, when the remote data contains a 422 error, and not emit anything', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createFailedRemoteDataObject('Unprocessable Entity', 422); + const source = cold('a', { a: testRD }); + const expected = '-'; + const values = {}; - observableOf(testRD).pipe(redirectOn4xx(router, authService)).subscribe(); - expect(router.navigateByUrl).toHaveBeenCalledWith('/403', { skipLocationChange: true }); + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(router.navigateByUrl).toHaveBeenCalledWith('/404', { skipLocationChange: true }); + }); }); - it('should not call navigateByUrl to a 404, 403 or 401 page, when the remote data contains another error than a 404, 403 or 401', () => { - const testRD = createFailedRemoteDataObject('Something went wrong', 500); + it('should call navigateByUrl to a 401 page, when the remote data contains a 403 error, and not emit anything', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createFailedRemoteDataObject('Forbidden', 403); + const source = cold('a', { a: testRD }); + const expected = '-'; + const values = {}; - observableOf(testRD).pipe(redirectOn4xx(router, authService)).subscribe(); - expect(router.navigateByUrl).not.toHaveBeenCalled(); + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(router.navigateByUrl).toHaveBeenCalledWith('/403', { skipLocationChange: true }); + }); }); - it('should not call navigateByUrl to a 404, 403 or 401 page, when the remote data contains no error', () => { - const testRD = createSuccessfulRemoteDataObject(undefined); + it('should not call navigateByUrl to a 404, 403 or 401 page, when the remote data contains another error than a 404, 422, 403 or 401, and emit the source rd', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createFailedRemoteDataObject('Something went wrong', 500); + const source = cold('a', { a: testRD }); + const expected = 'a'; + const values = { a: testRD }; - observableOf(testRD).pipe(redirectOn4xx(router, authService)).subscribe(); - expect(router.navigateByUrl).not.toHaveBeenCalled(); + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(router.navigateByUrl).not.toHaveBeenCalled(); + }); + }); + + it('should not call navigateByUrl to a 404, 403 or 401 page, when the remote data contains no error, and emit the source rd', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createSuccessfulRemoteDataObject(undefined); + const source = cold('a', { a: testRD }); + const expected = 'a'; + const values = { a: testRD }; + + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(router.navigateByUrl).not.toHaveBeenCalled(); + }); }); describe('when the user is not authenticated', () => { @@ -214,20 +260,32 @@ describe('Core Module - RxJS Operators', () => { (authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false)); }); - it('should set the redirect url and navigate to login when the remote data contains a 401 error', () => { - const testRD = createFailedRemoteDataObject('The current user is unauthorized', 401); + it('should set the redirect url and navigate to login when the remote data contains a 401 error, and not emit anything', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createFailedRemoteDataObject('The current user is unauthorized', 401); + const source = cold('a', { a: testRD }); + const expected = '-'; + const values = {}; - observableOf(testRD).pipe(redirectOn4xx(router, authService)).subscribe(); - expect(authService.setRedirectUrl).toHaveBeenCalled(); - expect(router.navigateByUrl).toHaveBeenCalledWith('login'); + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(authService.setRedirectUrl).toHaveBeenCalled(); + expect(router.navigateByUrl).toHaveBeenCalledWith('login'); + }); }); - it('should set the redirect url and navigate to login when the remote data contains a 403 error', () => { - const testRD = createFailedRemoteDataObject('Forbidden', 403); + it('should set the redirect url and navigate to login when the remote data contains a 403 error, and not emit anything', () => { + testScheduler.run(({ cold, expectObservable, flush }) => { + const testRD = createFailedRemoteDataObject('Forbidden', 403); + const source = cold('a', { a: testRD }); + const expected = '-'; + const values = {}; - observableOf(testRD).pipe(redirectOn4xx(router, authService)).subscribe(); - expect(authService.setRedirectUrl).toHaveBeenCalled(); - expect(router.navigateByUrl).toHaveBeenCalledWith('login'); + expectObservable(source.pipe(redirectOn4xx(router, authService))).toBe(expected, values); + flush(); + expect(authService.setRedirectUrl).toHaveBeenCalled(); + expect(router.navigateByUrl).toHaveBeenCalledWith('login'); + }); }); }); }); diff --git a/src/app/core/shared/operators.ts b/src/app/core/shared/operators.ts index 20aaf23ba8..3be04447ab 100644 --- a/src/app/core/shared/operators.ts +++ b/src/app/core/shared/operators.ts @@ -1,6 +1,17 @@ import { Router, UrlTree } from '@angular/router'; import { combineLatest as observableCombineLatest, Observable } from 'rxjs'; -import { debounceTime, filter, find, map, mergeMap, switchMap, take, takeWhile, tap } from 'rxjs/operators'; +import { + debounceTime, + filter, + find, + map, + mergeMap, + switchMap, + take, + takeWhile, + tap, + withLatestFrom +} from 'rxjs/operators'; import { hasNoValue, hasValue, hasValueOperator, isNotEmpty } from '../../shared/empty.util'; import { SearchResult } from '../../shared/search/search-result.model'; import { PaginatedList } from '../data/paginated-list.model'; @@ -22,6 +33,11 @@ export const DEBOUNCE_TIME_OPERATOR = new InjectionToken<(dueTime: number) => factory: () => debounceTime }); +export const REDIRECT_ON_4XX = new InjectionToken<(router: Router, authService: AuthService) => (source: Observable>) => Observable>>('redirectOn4xx', { + providedIn: 'root', + factory: () => redirectOn4xx +}); + /** * This file contains custom RxJS operators that can be used in multiple places */ @@ -175,29 +191,37 @@ export const getAllSucceededRemoteListPayload = () => ); /** - * Operator that checks if a remote data object returned a 401 or 404 error - * When it does contain such an error, it will redirect the user to the related error page, without altering the current URL + * Operator that checks if a remote data object returned a 4xx error + * When it does contain such an error, it will redirect the user to the related error page, without + * altering the current URL + * * @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) => (source: Observable>): Observable> => - observableCombineLatest(source, authService.isAuthenticated()).pipe( - map(([rd, isAuthenticated]: [RemoteData, boolean]) => { + source.pipe( + withLatestFrom(authService.isAuthenticated()), + filter(([rd, isAuthenticated]: [RemoteData, boolean]) => { if (rd.hasFailed) { - if (rd.statusCode === 404) { - router.navigateByUrl(getPageNotFoundRoute(), {skipLocationChange: true}); + if (rd.statusCode === 404 || rd.statusCode === 422) { + router.navigateByUrl(getPageNotFoundRoute(), { skipLocationChange: true }); + return false; } else if (rd.statusCode === 403 || rd.statusCode === 401) { if (isAuthenticated) { - router.navigateByUrl(getForbiddenRoute(), {skipLocationChange: true}); + router.navigateByUrl(getForbiddenRoute(), { skipLocationChange: true }); + return false; } else { authService.setRedirectUrl(router.url); router.navigateByUrl('login'); + return false; } } } - return rd; - })); + return true; + }), + map(([rd,]: [RemoteData, boolean]) => rd) + ); /** * Operator that returns a UrlTree to a forbidden page or the login page when the boolean received is false diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts index a7e665d8d4..9228ffb009 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.spec.ts @@ -5,7 +5,7 @@ import { JournalIssueComponent } from './journal-issue.component'; import { createRelationshipsObservable, getItemPageFieldsTest -} from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +} from '../../../../item-page/simple/item-types/shared/item.component.spec'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; const mockItem: Item = Object.assign(new Item(), { diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts index 9be8a1f4e9..f96379dafd 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts index 9013c4b76c..eb18109da8 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.spec.ts @@ -5,7 +5,7 @@ import { JournalVolumeComponent } from './journal-volume.component'; import { createRelationshipsObservable, getItemPageFieldsTest -} from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +} from '../../../../item-page/simple/item-types/shared/item.component.spec'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; const mockItem: Item = Object.assign(new Item(), { diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts index ee90dd8f5a..eeb93e7070 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts index 34ac45a63a..fdbc486769 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts @@ -5,7 +5,7 @@ import { By } from '@angular/platform-browser'; import { Store } from '@ngrx/store'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { GenericItemPageFieldComponent } from '../../../../+item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts index 605bd52238..3fe0903145 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.spec.ts index e7c1d0a331..3377712f13 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.spec.ts @@ -5,7 +5,7 @@ import { OrgUnitComponent } from './org-unit.component'; import { createRelationshipsObservable, getItemPageFieldsTest -} from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +} from '../../../../item-page/simple/item-types/shared/item.component.spec'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; const mockItem: Item = Object.assign(new Item(), { diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts index 6df2d87503..ab756db562 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts index 6a9b5235d7..546621700a 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.spec.ts @@ -1,7 +1,7 @@ import { createRelationshipsObservable, getItemPageFieldsTest -} from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +} from '../../../../item-page/simple/item-types/shared/item.component.spec'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; import { Item } from '../../../../core/shared/item.model'; import { PageInfo } from '../../../../core/shared/page-info.model'; diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts index 9972736b95..8b104cc9b1 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; diff --git a/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts index 02fe71126b..ed60d3dac4 100644 --- a/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.spec.ts @@ -1,7 +1,7 @@ import { createRelationshipsObservable, getItemPageFieldsTest -} from '../../../../+item-page/simple/item-types/shared/item.component.spec'; +} from '../../../../item-page/simple/item-types/shared/item.component.spec'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; import { Item } from '../../../../core/shared/item.model'; import { PageInfo } from '../../../../core/shared/page-info.model'; diff --git a/src/app/entity-groups/research-entities/item-pages/project/project.component.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts index 4e432e869e..e53d8afd69 100644 --- a/src/app/entity-groups/research-entities/item-pages/project/project.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component'; +import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; diff --git a/src/app/forgot-password/forgot-password-routing.module.ts b/src/app/forgot-password/forgot-password-routing.module.ts index 2496c4eec6..002ef5bc4b 100644 --- a/src/app/forgot-password/forgot-password-routing.module.ts +++ b/src/app/forgot-password/forgot-password-routing.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { ItemPageResolver } from '../+item-page/item-page.resolver'; +import { ItemPageResolver } from '../item-page/item-page.resolver'; import { RegistrationResolver } from '../register-email-form/registration.resolver'; import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed-forgot-password-form.component'; import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgot-email.component'; diff --git a/src/app/+home-page/home-news/home-news.component.html b/src/app/home-page/home-news/home-news.component.html similarity index 100% rename from src/app/+home-page/home-news/home-news.component.html rename to src/app/home-page/home-news/home-news.component.html diff --git a/src/app/+home-page/home-news/home-news.component.scss b/src/app/home-page/home-news/home-news.component.scss similarity index 100% rename from src/app/+home-page/home-news/home-news.component.scss rename to src/app/home-page/home-news/home-news.component.scss diff --git a/src/app/+home-page/home-news/home-news.component.ts b/src/app/home-page/home-news/home-news.component.ts similarity index 100% rename from src/app/+home-page/home-news/home-news.component.ts rename to src/app/home-page/home-news/home-news.component.ts diff --git a/src/app/+home-page/home-news/themed-home-news.component.scss b/src/app/home-page/home-news/themed-home-news.component.scss similarity index 100% rename from src/app/+home-page/home-news/themed-home-news.component.scss rename to src/app/home-page/home-news/themed-home-news.component.scss diff --git a/src/app/+home-page/home-news/themed-home-news.component.ts b/src/app/home-page/home-news/themed-home-news.component.ts similarity index 88% rename from src/app/+home-page/home-news/themed-home-news.component.ts rename to src/app/home-page/home-news/themed-home-news.component.ts index 09abbf8935..da7233f4a4 100644 --- a/src/app/+home-page/home-news/themed-home-news.component.ts +++ b/src/app/home-page/home-news/themed-home-news.component.ts @@ -17,7 +17,7 @@ export class ThemedHomeNewsComponent extends ThemedComponent } protected importThemedComponent(themeName: string): Promise { - return import(`../../../themes/${themeName}/app/+home-page/home-news/home-news.component`); + return import(`../../../themes/${themeName}/app/home-page/home-news/home-news.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+home-page/home-page-routing.module.ts b/src/app/home-page/home-page-routing.module.ts similarity index 100% rename from src/app/+home-page/home-page-routing.module.ts rename to src/app/home-page/home-page-routing.module.ts diff --git a/src/app/+home-page/home-page.component.default.scss b/src/app/home-page/home-page.component.default.scss similarity index 100% rename from src/app/+home-page/home-page.component.default.scss rename to src/app/home-page/home-page.component.default.scss diff --git a/src/app/+home-page/home-page.component.html b/src/app/home-page/home-page.component.html similarity index 100% rename from src/app/+home-page/home-page.component.html rename to src/app/home-page/home-page.component.html diff --git a/src/app/+home-page/home-page.component.scss b/src/app/home-page/home-page.component.scss similarity index 100% rename from src/app/+home-page/home-page.component.scss rename to src/app/home-page/home-page.component.scss diff --git a/src/app/+home-page/home-page.component.ts b/src/app/home-page/home-page.component.ts similarity index 100% rename from src/app/+home-page/home-page.component.ts rename to src/app/home-page/home-page.component.ts diff --git a/src/app/+home-page/home-page.module.ts b/src/app/home-page/home-page.module.ts similarity index 100% rename from src/app/+home-page/home-page.module.ts rename to src/app/home-page/home-page.module.ts diff --git a/src/app/+home-page/home-page.resolver.ts b/src/app/home-page/home-page.resolver.ts similarity index 100% rename from src/app/+home-page/home-page.resolver.ts rename to src/app/home-page/home-page.resolver.ts diff --git a/src/app/+home-page/themed-home-page.component.ts b/src/app/home-page/themed-home-page.component.ts similarity index 89% rename from src/app/+home-page/themed-home-page.component.ts rename to src/app/home-page/themed-home-page.component.ts index 69d6a60908..e50f955cb1 100644 --- a/src/app/+home-page/themed-home-page.component.ts +++ b/src/app/home-page/themed-home-page.component.ts @@ -16,7 +16,7 @@ export class ThemedHomePageComponent extends ThemedComponent } protected importThemedComponent(themeName: string): Promise { - return import(`../../themes/${themeName}/app/+home-page/home-page.component`); + return import(`../../themes/${themeName}/app/home-page/home-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+home-page/top-level-community-list/top-level-community-list.component.html b/src/app/home-page/top-level-community-list/top-level-community-list.component.html similarity index 100% rename from src/app/+home-page/top-level-community-list/top-level-community-list.component.html rename to src/app/home-page/top-level-community-list/top-level-community-list.component.html diff --git a/src/app/+home-page/top-level-community-list/top-level-community-list.component.scss b/src/app/home-page/top-level-community-list/top-level-community-list.component.scss similarity index 100% rename from src/app/+home-page/top-level-community-list/top-level-community-list.component.scss rename to src/app/home-page/top-level-community-list/top-level-community-list.component.scss diff --git a/src/app/+home-page/top-level-community-list/top-level-community-list.component.spec.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts similarity index 100% rename from src/app/+home-page/top-level-community-list/top-level-community-list.component.spec.ts rename to src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts diff --git a/src/app/+home-page/top-level-community-list/top-level-community-list.component.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.ts similarity index 100% rename from src/app/+home-page/top-level-community-list/top-level-community-list.component.ts rename to src/app/home-page/top-level-community-list/top-level-community-list.component.ts diff --git a/src/app/+import-external-page/import-external-page.component.html b/src/app/import-external-page/import-external-page.component.html similarity index 100% rename from src/app/+import-external-page/import-external-page.component.html rename to src/app/import-external-page/import-external-page.component.html diff --git a/src/app/+import-external-page/import-external-page.component.scss b/src/app/import-external-page/import-external-page.component.scss similarity index 100% rename from src/app/+import-external-page/import-external-page.component.scss rename to src/app/import-external-page/import-external-page.component.scss diff --git a/src/app/+import-external-page/import-external-page.component.spec.ts b/src/app/import-external-page/import-external-page.component.spec.ts similarity index 100% rename from src/app/+import-external-page/import-external-page.component.spec.ts rename to src/app/import-external-page/import-external-page.component.spec.ts diff --git a/src/app/+import-external-page/import-external-page.component.ts b/src/app/import-external-page/import-external-page.component.ts similarity index 100% rename from src/app/+import-external-page/import-external-page.component.ts rename to src/app/import-external-page/import-external-page.component.ts diff --git a/src/app/+import-external-page/import-external-page.module.ts b/src/app/import-external-page/import-external-page.module.ts similarity index 100% rename from src/app/+import-external-page/import-external-page.module.ts rename to src/app/import-external-page/import-external-page.module.ts diff --git a/src/app/+import-external-page/import-external-routing.module.ts b/src/app/import-external-page/import-external-routing.module.ts similarity index 100% rename from src/app/+import-external-page/import-external-routing.module.ts rename to src/app/import-external-page/import-external-routing.module.ts diff --git a/src/app/+item-page/bitstreams/upload/upload-bitstream.component.html b/src/app/item-page/bitstreams/upload/upload-bitstream.component.html similarity index 100% rename from src/app/+item-page/bitstreams/upload/upload-bitstream.component.html rename to src/app/item-page/bitstreams/upload/upload-bitstream.component.html diff --git a/src/app/+item-page/bitstreams/upload/upload-bitstream.component.spec.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts similarity index 100% rename from src/app/+item-page/bitstreams/upload/upload-bitstream.component.spec.ts rename to src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts diff --git a/src/app/+item-page/bitstreams/upload/upload-bitstream.component.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts similarity index 100% rename from src/app/+item-page/bitstreams/upload/upload-bitstream.component.ts rename to src/app/item-page/bitstreams/upload/upload-bitstream.component.ts diff --git a/src/app/+item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts b/src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts rename to src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts diff --git a/src/app/+item-page/edit-item-page/edit-item-operators.spec.ts b/src/app/item-page/edit-item-page/edit-item-operators.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-operators.spec.ts rename to src/app/item-page/edit-item-page/edit-item-operators.spec.ts diff --git a/src/app/+item-page/edit-item-page/edit-item-operators.ts b/src/app/item-page/edit-item-page/edit-item-operators.ts similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-operators.ts rename to src/app/item-page/edit-item-page/edit-item-operators.ts diff --git a/src/app/+item-page/edit-item-page/edit-item-page.component.html b/src/app/item-page/edit-item-page/edit-item-page.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-page.component.html rename to src/app/item-page/edit-item-page/edit-item-page.component.html diff --git a/src/app/+item-page/edit-item-page/edit-item-page.component.scss b/src/app/item-page/edit-item-page/edit-item-page.component.scss similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-page.component.scss rename to src/app/item-page/edit-item-page/edit-item-page.component.scss diff --git a/src/app/+item-page/edit-item-page/edit-item-page.component.spec.ts b/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-page.component.spec.ts rename to src/app/item-page/edit-item-page/edit-item-page.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/edit-item-page.component.ts b/src/app/item-page/edit-item-page/edit-item-page.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-page.component.ts rename to src/app/item-page/edit-item-page/edit-item-page.component.ts diff --git a/src/app/+item-page/edit-item-page/edit-item-page.module.ts b/src/app/item-page/edit-item-page/edit-item-page.module.ts similarity index 98% rename from src/app/+item-page/edit-item-page/edit-item-page.module.ts rename to src/app/item-page/edit-item-page/edit-item-page.module.ts index 17010acab4..11b1d585ba 100644 --- a/src/app/+item-page/edit-item-page/edit-item-page.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.module.ts @@ -15,7 +15,7 @@ import { ItemMetadataComponent } from './item-metadata/item-metadata.component'; import { EditInPlaceFieldComponent } from './item-metadata/edit-in-place-field/edit-in-place-field.component'; import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component'; import { ItemEditBitstreamComponent } from './item-bitstreams/item-edit-bitstream/item-edit-bitstream.component'; -import { SearchPageModule } from '../../+search-page/search-page.module'; +import { SearchPageModule } from '../../search-page/search-page.module'; import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component'; import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component'; import { EditRelationshipComponent } from './item-relationships/edit-relationship/edit-relationship.component'; diff --git a/src/app/+item-page/edit-item-page/edit-item-page.routing-paths.ts b/src/app/item-page/edit-item-page/edit-item-page.routing-paths.ts similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-page.routing-paths.ts rename to src/app/item-page/edit-item-page/edit-item-page.routing-paths.ts diff --git a/src/app/+item-page/edit-item-page/edit-item-page.routing.module.ts b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts similarity index 100% rename from src/app/+item-page/edit-item-page/edit-item-page.routing.module.ts rename to src/app/item-page/edit-item-page/edit-item-page.routing.module.ts diff --git a/src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.html b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.html rename to src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.html diff --git a/src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts rename to src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-authorizations/item-authorizations.component.ts rename to src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.html b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.html rename to src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.html diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss similarity index 74% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss rename to src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss index 1fcbe99702..46d172dadc 100644 --- a/src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss @@ -19,11 +19,15 @@ .drag-handle { visibility: hidden; &:hover { - cursor: grab; + cursor: move; } } -:host ::ng-deep .bitstream-row:hover .drag-handle { +.bitstream-row-drag-handle:hover { + cursor: move; +} + +:host ::ng-deep .bitstream-row:hover .drag-handle, :host ::ng-deep .bitstream-row-drag-handle:focus .drag-handle { visibility: visible !important; } @@ -40,3 +44,9 @@ .cdk-drag-animating { transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); } + +.cdk-drop-list-dragging { + .bitstream-row-drag-handle, .drag-handle { + cursor: grabbing; + } +} diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html similarity index 92% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html index 8f0d83bd1f..f7904f6cc8 100644 --- a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html @@ -21,7 +21,7 @@ -
+
diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.html b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.html similarity index 68% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.html rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.html index 0561f78e97..1bce8667ee 100644 --- a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.html +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.html @@ -1,5 +1,5 @@ -
+
diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.html b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.html rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.html diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts rename to src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts diff --git a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.html b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.html rename to src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.html diff --git a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.scss b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.scss similarity index 100% rename from src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.scss rename to src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.scss diff --git a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts similarity index 96% rename from src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts rename to src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts index d3577c3637..c15c84a647 100644 --- a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts @@ -40,6 +40,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { createPaginatedList } from '../../../shared/testing/utils.test'; +import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; describe('ItemCollectionMapperComponent', () => { let comp: ItemCollectionMapperComponent; @@ -110,6 +111,10 @@ describe('ItemCollectionMapperComponent', () => { onDefaultLangChange: new EventEmitter() }; + const authorizationDataService = jasmine.createSpyObj('authorizationDataService', { + isAuthorized: observableOf(true) + }); + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], @@ -124,7 +129,8 @@ describe('ItemCollectionMapperComponent', () => { { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub() }, { provide: TranslateService, useValue: translateServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - { provide: CollectionDataService, useValue: collectionDataServiceStub } + { provide: CollectionDataService, useValue: collectionDataServiceStub }, + { provide: AuthorizationDataService, useValue: authorizationDataService } ] }).compileComponents(); })); diff --git a/src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts rename to src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts diff --git a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.html b/src/app/item-page/edit-item-page/item-delete/item-delete.component.html similarity index 100% rename from src/app/+item-page/edit-item-page/item-delete/item-delete.component.html rename to src/app/item-page/edit-item-page/item-delete/item-delete.component.html diff --git a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts rename to src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-delete/item-delete.component.ts rename to src/app/item-page/edit-item-page/item-delete/item-delete.component.ts diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.html b/src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.html similarity index 92% rename from src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.html rename to src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.html index cf226f7733..5277fa1a3a 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.html +++ b/src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.html @@ -29,7 +29,7 @@ {{metadata?.value}}
-
@@ -40,7 +40,7 @@ {{metadata?.language}}
-
diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.scss b/src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.scss similarity index 100% rename from src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.scss rename to src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.scss diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts b/src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts rename to src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.spec.ts diff --git a/src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts b/src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts similarity index 100% rename from src/app/+item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts rename to src/app/item-page/edit-item-page/item-metadata/edit-in-place-field/edit-in-place-field.component.ts diff --git a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.html b/src/app/item-page/edit-item-page/item-metadata/item-metadata.component.html similarity index 90% rename from src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.html rename to src/app/item-page/edit-item-page/item-metadata/item-metadata.component.html index 008708d3fb..e154487402 100644 --- a/src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.html +++ b/src/app/item-page/edit-item-page/item-metadata/item-metadata.component.html @@ -25,9 +25,9 @@ - - - + + + { - return import(`../../../themes/${themeName}/app/+item-page/full/full-item-page.component`); + return import(`../../../themes/${themeName}/app/item-page/full/full-item-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+item-page/item-page-administrator.guard.ts b/src/app/item-page/item-page-administrator.guard.ts similarity index 100% rename from src/app/+item-page/item-page-administrator.guard.ts rename to src/app/item-page/item-page-administrator.guard.ts diff --git a/src/app/+item-page/item-page-routing-paths.ts b/src/app/item-page/item-page-routing-paths.ts similarity index 100% rename from src/app/+item-page/item-page-routing-paths.ts rename to src/app/item-page/item-page-routing-paths.ts diff --git a/src/app/+item-page/item-page-routing.module.ts b/src/app/item-page/item-page-routing.module.ts similarity index 100% rename from src/app/+item-page/item-page-routing.module.ts rename to src/app/item-page/item-page-routing.module.ts diff --git a/src/app/+item-page/item-page.module.ts b/src/app/item-page/item-page.module.ts similarity index 100% rename from src/app/+item-page/item-page.module.ts rename to src/app/item-page/item-page.module.ts diff --git a/src/app/+item-page/item-page.resolver.ts b/src/app/item-page/item-page.resolver.ts similarity index 100% rename from src/app/+item-page/item-page.resolver.ts rename to src/app/item-page/item-page.resolver.ts diff --git a/src/app/+item-page/item.resolver.ts b/src/app/item-page/item.resolver.ts similarity index 100% rename from src/app/+item-page/item.resolver.ts rename to src/app/item-page/item.resolver.ts diff --git a/src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.html b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.html similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.html rename to src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.html diff --git a/src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.scss b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.scss similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.scss rename to src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.scss diff --git a/src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts rename to src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts diff --git a/src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts rename to src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts diff --git a/src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.html b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.html similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.html rename to src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.html diff --git a/src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.scss b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.scss similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.scss rename to src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.scss diff --git a/src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts rename to src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts diff --git a/src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts rename to src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts diff --git a/src/app/+item-page/media-viewer/media-viewer.component.html b/src/app/item-page/media-viewer/media-viewer.component.html similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer.component.html rename to src/app/item-page/media-viewer/media-viewer.component.html diff --git a/src/app/+item-page/media-viewer/media-viewer.component.scss b/src/app/item-page/media-viewer/media-viewer.component.scss similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer.component.scss rename to src/app/item-page/media-viewer/media-viewer.component.scss diff --git a/src/app/+item-page/media-viewer/media-viewer.component.spec.ts b/src/app/item-page/media-viewer/media-viewer.component.spec.ts similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer.component.spec.ts rename to src/app/item-page/media-viewer/media-viewer.component.spec.ts diff --git a/src/app/+item-page/media-viewer/media-viewer.component.ts b/src/app/item-page/media-viewer/media-viewer.component.ts similarity index 100% rename from src/app/+item-page/media-viewer/media-viewer.component.ts rename to src/app/item-page/media-viewer/media-viewer.component.ts diff --git a/src/app/+item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts b/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts similarity index 100% rename from src/app/+item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts rename to src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts diff --git a/src/app/+item-page/simple/field-components/file-section/file-section.component.html b/src/app/item-page/simple/field-components/file-section/file-section.component.html similarity index 100% rename from src/app/+item-page/simple/field-components/file-section/file-section.component.html rename to src/app/item-page/simple/field-components/file-section/file-section.component.html diff --git a/src/app/+item-page/simple/field-components/file-section/file-section.component.spec.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/file-section/file-section.component.spec.ts rename to src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/file-section/file-section.component.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/file-section/file-section.component.ts rename to src/app/item-page/simple/field-components/file-section/file-section.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.html b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/item-page-field.component.html rename to src/app/item-page/simple/field-components/specific-field/item-page-field.component.html diff --git a/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/item-page-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/item-page-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.html similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.html rename to src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.html diff --git a/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html rename to src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.html diff --git a/src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts rename to src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts diff --git a/src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts similarity index 100% rename from src/app/+item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts rename to src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts diff --git a/src/app/+item-page/simple/item-page.component.html b/src/app/item-page/simple/item-page.component.html similarity index 100% rename from src/app/+item-page/simple/item-page.component.html rename to src/app/item-page/simple/item-page.component.html diff --git a/src/app/+item-page/simple/item-page.component.scss b/src/app/item-page/simple/item-page.component.scss similarity index 100% rename from src/app/+item-page/simple/item-page.component.scss rename to src/app/item-page/simple/item-page.component.scss diff --git a/src/app/+item-page/simple/item-page.component.spec.ts b/src/app/item-page/simple/item-page.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/item-page.component.spec.ts rename to src/app/item-page/simple/item-page.component.spec.ts diff --git a/src/app/+item-page/simple/item-page.component.ts b/src/app/item-page/simple/item-page.component.ts similarity index 100% rename from src/app/+item-page/simple/item-page.component.ts rename to src/app/item-page/simple/item-page.component.ts diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.html b/src/app/item-page/simple/item-types/publication/publication.component.html similarity index 100% rename from src/app/+item-page/simple/item-types/publication/publication.component.html rename to src/app/item-page/simple/item-types/publication/publication.component.html diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.scss b/src/app/item-page/simple/item-types/publication/publication.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/publication/publication.component.scss rename to src/app/item-page/simple/item-types/publication/publication.component.scss diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.spec.ts b/src/app/item-page/simple/item-types/publication/publication.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/item-types/publication/publication.component.spec.ts rename to src/app/item-page/simple/item-types/publication/publication.component.spec.ts diff --git a/src/app/+item-page/simple/item-types/publication/publication.component.ts b/src/app/item-page/simple/item-types/publication/publication.component.ts similarity index 100% rename from src/app/+item-page/simple/item-types/publication/publication.component.ts rename to src/app/item-page/simple/item-types/publication/publication.component.ts diff --git a/src/app/+item-page/simple/item-types/shared/item-relationships-utils.ts b/src/app/item-page/simple/item-types/shared/item-relationships-utils.ts similarity index 100% rename from src/app/+item-page/simple/item-types/shared/item-relationships-utils.ts rename to src/app/item-page/simple/item-types/shared/item-relationships-utils.ts diff --git a/src/app/+item-page/simple/item-types/shared/item.component.spec.ts b/src/app/item-page/simple/item-types/shared/item.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/item-types/shared/item.component.spec.ts rename to src/app/item-page/simple/item-types/shared/item.component.spec.ts diff --git a/src/app/+item-page/simple/item-types/shared/item.component.ts b/src/app/item-page/simple/item-types/shared/item.component.ts similarity index 100% rename from src/app/+item-page/simple/item-types/shared/item.component.ts rename to src/app/item-page/simple/item-types/shared/item.component.ts diff --git a/src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.html b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html similarity index 100% rename from src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.html rename to src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html diff --git a/src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.scss b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss similarity index 100% rename from src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.scss rename to src/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss diff --git a/src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts rename to src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts diff --git a/src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts similarity index 100% rename from src/app/+item-page/simple/item-types/untyped-item/untyped-item.component.ts rename to src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts diff --git a/src/app/+item-page/simple/metadata-representation-list/metadata-representation-list.component.html b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.html similarity index 100% rename from src/app/+item-page/simple/metadata-representation-list/metadata-representation-list.component.html rename to src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.html diff --git a/src/app/+item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts rename to src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts diff --git a/src/app/+item-page/simple/metadata-representation-list/metadata-representation-list.component.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts similarity index 100% rename from src/app/+item-page/simple/metadata-representation-list/metadata-representation-list.component.ts rename to src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts diff --git a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.html b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html similarity index 100% rename from src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.html rename to src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html diff --git a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts rename to src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts diff --git a/src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts similarity index 100% rename from src/app/+item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts rename to src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts diff --git a/src/app/+item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html similarity index 100% rename from src/app/+item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html rename to src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html diff --git a/src/app/+item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts rename to src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts diff --git a/src/app/+item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts similarity index 100% rename from src/app/+item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts rename to src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts diff --git a/src/app/+item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts similarity index 100% rename from src/app/+item-page/simple/related-items/related-items-component.ts rename to src/app/item-page/simple/related-items/related-items-component.ts diff --git a/src/app/+item-page/simple/related-items/related-items.component.html b/src/app/item-page/simple/related-items/related-items.component.html similarity index 100% rename from src/app/+item-page/simple/related-items/related-items.component.html rename to src/app/item-page/simple/related-items/related-items.component.html diff --git a/src/app/+item-page/simple/related-items/related-items.component.scss b/src/app/item-page/simple/related-items/related-items.component.scss similarity index 100% rename from src/app/+item-page/simple/related-items/related-items.component.scss rename to src/app/item-page/simple/related-items/related-items.component.scss diff --git a/src/app/+item-page/simple/related-items/related-items.component.spec.ts b/src/app/item-page/simple/related-items/related-items.component.spec.ts similarity index 100% rename from src/app/+item-page/simple/related-items/related-items.component.spec.ts rename to src/app/item-page/simple/related-items/related-items.component.spec.ts diff --git a/src/app/+item-page/simple/themed-item-page.component.ts b/src/app/item-page/simple/themed-item-page.component.ts similarity index 88% rename from src/app/+item-page/simple/themed-item-page.component.ts rename to src/app/item-page/simple/themed-item-page.component.ts index 3d04f04acd..5bb26fafc9 100644 --- a/src/app/+item-page/simple/themed-item-page.component.ts +++ b/src/app/item-page/simple/themed-item-page.component.ts @@ -17,7 +17,7 @@ export class ThemedItemPageComponent extends ThemedComponent } protected importThemedComponent(themeName: string): Promise { - return import(`../../../themes/${themeName}/app/+item-page/simple/item-page.component`); + return import(`../../../themes/${themeName}/app/item-page/simple/item-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+login-page/login-page-routing.module.ts b/src/app/login-page/login-page-routing.module.ts similarity index 100% rename from src/app/+login-page/login-page-routing.module.ts rename to src/app/login-page/login-page-routing.module.ts diff --git a/src/app/+login-page/login-page.component.html b/src/app/login-page/login-page.component.html similarity index 100% rename from src/app/+login-page/login-page.component.html rename to src/app/login-page/login-page.component.html diff --git a/src/app/+login-page/login-page.component.scss b/src/app/login-page/login-page.component.scss similarity index 100% rename from src/app/+login-page/login-page.component.scss rename to src/app/login-page/login-page.component.scss diff --git a/src/app/+login-page/login-page.component.spec.ts b/src/app/login-page/login-page.component.spec.ts similarity index 100% rename from src/app/+login-page/login-page.component.spec.ts rename to src/app/login-page/login-page.component.spec.ts diff --git a/src/app/+login-page/login-page.component.ts b/src/app/login-page/login-page.component.ts similarity index 100% rename from src/app/+login-page/login-page.component.ts rename to src/app/login-page/login-page.component.ts diff --git a/src/app/+login-page/login-page.module.ts b/src/app/login-page/login-page.module.ts similarity index 100% rename from src/app/+login-page/login-page.module.ts rename to src/app/login-page/login-page.module.ts diff --git a/src/app/+login-page/themed-login-page.component.ts b/src/app/login-page/themed-login-page.component.ts similarity index 89% rename from src/app/+login-page/themed-login-page.component.ts rename to src/app/login-page/themed-login-page.component.ts index cdf5932802..e314b4a3f7 100644 --- a/src/app/+login-page/themed-login-page.component.ts +++ b/src/app/login-page/themed-login-page.component.ts @@ -16,7 +16,7 @@ export class ThemedLoginPageComponent extends ThemedComponent { - return import(`../../themes/${themeName}/app/+login-page/login-page.component`); + return import(`../../themes/${themeName}/app/login-page/login-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+logout-page/logout-page-routing.module.ts b/src/app/logout-page/logout-page-routing.module.ts similarity index 100% rename from src/app/+logout-page/logout-page-routing.module.ts rename to src/app/logout-page/logout-page-routing.module.ts diff --git a/src/app/+logout-page/logout-page.component.html b/src/app/logout-page/logout-page.component.html similarity index 100% rename from src/app/+logout-page/logout-page.component.html rename to src/app/logout-page/logout-page.component.html diff --git a/src/app/logout-page/logout-page.component.scss b/src/app/logout-page/logout-page.component.scss new file mode 100644 index 0000000000..a25e77fb6b --- /dev/null +++ b/src/app/logout-page/logout-page.component.scss @@ -0,0 +1 @@ +@import '../login-page/login-page.component.scss'; diff --git a/src/app/+logout-page/logout-page.component.spec.ts b/src/app/logout-page/logout-page.component.spec.ts similarity index 100% rename from src/app/+logout-page/logout-page.component.spec.ts rename to src/app/logout-page/logout-page.component.spec.ts diff --git a/src/app/+logout-page/logout-page.component.ts b/src/app/logout-page/logout-page.component.ts similarity index 100% rename from src/app/+logout-page/logout-page.component.ts rename to src/app/logout-page/logout-page.component.ts diff --git a/src/app/+logout-page/logout-page.module.ts b/src/app/logout-page/logout-page.module.ts similarity index 100% rename from src/app/+logout-page/logout-page.module.ts rename to src/app/logout-page/logout-page.module.ts diff --git a/src/app/+logout-page/themed-logout-page.component.ts b/src/app/logout-page/themed-logout-page.component.ts similarity index 89% rename from src/app/+logout-page/themed-logout-page.component.ts rename to src/app/logout-page/themed-logout-page.component.ts index 19e1e2d1d1..8d4adfd243 100644 --- a/src/app/+logout-page/themed-logout-page.component.ts +++ b/src/app/logout-page/themed-logout-page.component.ts @@ -16,7 +16,7 @@ export class ThemedLogoutPageComponent extends ThemedComponent { - return import(`../../themes/${themeName}/app/+logout-page/logout-page.component`); + return import(`../../themes/${themeName}/app/logout-page/logout-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+lookup-by-id/lookup-by-id-routing.module.ts b/src/app/lookup-by-id/lookup-by-id-routing.module.ts similarity index 100% rename from src/app/+lookup-by-id/lookup-by-id-routing.module.ts rename to src/app/lookup-by-id/lookup-by-id-routing.module.ts diff --git a/src/app/+lookup-by-id/lookup-by-id.module.ts b/src/app/lookup-by-id/lookup-by-id.module.ts similarity index 100% rename from src/app/+lookup-by-id/lookup-by-id.module.ts rename to src/app/lookup-by-id/lookup-by-id.module.ts diff --git a/src/app/+lookup-by-id/lookup-guard.spec.ts b/src/app/lookup-by-id/lookup-guard.spec.ts similarity index 100% rename from src/app/+lookup-by-id/lookup-guard.spec.ts rename to src/app/lookup-by-id/lookup-guard.spec.ts diff --git a/src/app/+lookup-by-id/lookup-guard.ts b/src/app/lookup-by-id/lookup-guard.ts similarity index 100% rename from src/app/+lookup-by-id/lookup-guard.ts rename to src/app/lookup-by-id/lookup-guard.ts diff --git a/src/app/+lookup-by-id/objectnotfound/objectnotfound.component.html b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.html similarity index 100% rename from src/app/+lookup-by-id/objectnotfound/objectnotfound.component.html rename to src/app/lookup-by-id/objectnotfound/objectnotfound.component.html diff --git a/src/app/+lookup-by-id/objectnotfound/objectnotfound.component.scss b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.scss similarity index 100% rename from src/app/+lookup-by-id/objectnotfound/objectnotfound.component.scss rename to src/app/lookup-by-id/objectnotfound/objectnotfound.component.scss diff --git a/src/app/+lookup-by-id/objectnotfound/objectnotfound.component.spec.ts b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts similarity index 100% rename from src/app/+lookup-by-id/objectnotfound/objectnotfound.component.spec.ts rename to src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts diff --git a/src/app/+lookup-by-id/objectnotfound/objectnotfound.component.ts b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts similarity index 100% rename from src/app/+lookup-by-id/objectnotfound/objectnotfound.component.ts rename to src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts diff --git a/src/app/+lookup-by-id/objectnotfound/themed-objectnotfound.component.ts b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts similarity index 87% rename from src/app/+lookup-by-id/objectnotfound/themed-objectnotfound.component.ts rename to src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts index e1bec33dfd..e2338d5f07 100644 --- a/src/app/+lookup-by-id/objectnotfound/themed-objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts @@ -16,7 +16,7 @@ export class ThemedObjectNotFoundComponent extends ThemedComponent { - return import(`../../../themes/${themeName}/app/+lookup-by-id/objectnotfound/objectnotfound.component`); + return import(`../../../themes/${themeName}/app/lookup-by-id/objectnotfound/objectnotfound.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/+my-dspace-page/collection-selector/collection-selector.component.html b/src/app/my-dspace-page/collection-selector/collection-selector.component.html similarity index 100% rename from src/app/+my-dspace-page/collection-selector/collection-selector.component.html rename to src/app/my-dspace-page/collection-selector/collection-selector.component.html diff --git a/src/app/+my-dspace-page/collection-selector/collection-selector.component.scss b/src/app/my-dspace-page/collection-selector/collection-selector.component.scss similarity index 100% rename from src/app/+my-dspace-page/collection-selector/collection-selector.component.scss rename to src/app/my-dspace-page/collection-selector/collection-selector.component.scss diff --git a/src/app/+my-dspace-page/collection-selector/collection-selector.component.spec.ts b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts similarity index 100% rename from src/app/+my-dspace-page/collection-selector/collection-selector.component.spec.ts rename to src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts diff --git a/src/app/+my-dspace-page/collection-selector/collection-selector.component.ts b/src/app/my-dspace-page/collection-selector/collection-selector.component.ts similarity index 100% rename from src/app/+my-dspace-page/collection-selector/collection-selector.component.ts rename to src/app/my-dspace-page/collection-selector/collection-selector.component.ts diff --git a/src/app/+my-dspace-page/my-dspace-configuration-value-type.ts b/src/app/my-dspace-page/my-dspace-configuration-value-type.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-configuration-value-type.ts rename to src/app/my-dspace-page/my-dspace-configuration-value-type.ts diff --git a/src/app/+my-dspace-page/my-dspace-configuration.service.spec.ts b/src/app/my-dspace-page/my-dspace-configuration.service.spec.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-configuration.service.spec.ts rename to src/app/my-dspace-page/my-dspace-configuration.service.spec.ts diff --git a/src/app/+my-dspace-page/my-dspace-configuration.service.ts b/src/app/my-dspace-page/my-dspace-configuration.service.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-configuration.service.ts rename to src/app/my-dspace-page/my-dspace-configuration.service.ts diff --git a/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.html b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.html similarity index 100% rename from src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.html rename to src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.html diff --git a/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.scss b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.scss similarity index 100% rename from src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.scss rename to src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.scss diff --git a/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts rename to src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts diff --git a/src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts rename to src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts diff --git a/src/app/+my-dspace-page/my-dspace-page-routing.module.ts b/src/app/my-dspace-page/my-dspace-page-routing.module.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-page-routing.module.ts rename to src/app/my-dspace-page/my-dspace-page-routing.module.ts diff --git a/src/app/+my-dspace-page/my-dspace-page.component.html b/src/app/my-dspace-page/my-dspace-page.component.html similarity index 100% rename from src/app/+my-dspace-page/my-dspace-page.component.html rename to src/app/my-dspace-page/my-dspace-page.component.html diff --git a/src/app/my-dspace-page/my-dspace-page.component.scss b/src/app/my-dspace-page/my-dspace-page.component.scss new file mode 100644 index 0000000000..b35b2ba709 --- /dev/null +++ b/src/app/my-dspace-page/my-dspace-page.component.scss @@ -0,0 +1 @@ +@import '../search-page/search.component.scss'; diff --git a/src/app/+my-dspace-page/my-dspace-page.component.spec.ts b/src/app/my-dspace-page/my-dspace-page.component.spec.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-page.component.spec.ts rename to src/app/my-dspace-page/my-dspace-page.component.spec.ts diff --git a/src/app/+my-dspace-page/my-dspace-page.component.ts b/src/app/my-dspace-page/my-dspace-page.component.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-page.component.ts rename to src/app/my-dspace-page/my-dspace-page.component.ts diff --git a/src/app/+my-dspace-page/my-dspace-page.module.ts b/src/app/my-dspace-page/my-dspace-page.module.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-page.module.ts rename to src/app/my-dspace-page/my-dspace-page.module.ts diff --git a/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.html b/src/app/my-dspace-page/my-dspace-results/my-dspace-results.component.html similarity index 100% rename from src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.html rename to src/app/my-dspace-page/my-dspace-results/my-dspace-results.component.html diff --git a/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.spec.ts b/src/app/my-dspace-page/my-dspace-results/my-dspace-results.component.spec.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.spec.ts rename to src/app/my-dspace-page/my-dspace-results/my-dspace-results.component.spec.ts diff --git a/src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.ts b/src/app/my-dspace-page/my-dspace-results/my-dspace-results.component.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-results/my-dspace-results.component.ts rename to src/app/my-dspace-page/my-dspace-results/my-dspace-results.component.ts diff --git a/src/app/+my-dspace-page/my-dspace-search.module.ts b/src/app/my-dspace-page/my-dspace-search.module.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace-search.module.ts rename to src/app/my-dspace-page/my-dspace-search.module.ts diff --git a/src/app/+my-dspace-page/my-dspace.guard.ts b/src/app/my-dspace-page/my-dspace.guard.ts similarity index 100% rename from src/app/+my-dspace-page/my-dspace.guard.ts rename to src/app/my-dspace-page/my-dspace.guard.ts diff --git a/src/app/+my-dspace-page/themed-my-dspace-page.component.ts b/src/app/my-dspace-page/themed-my-dspace-page.component.ts similarity index 89% rename from src/app/+my-dspace-page/themed-my-dspace-page.component.ts rename to src/app/my-dspace-page/themed-my-dspace-page.component.ts index 47275496ca..2c74da052e 100644 --- a/src/app/+my-dspace-page/themed-my-dspace-page.component.ts +++ b/src/app/my-dspace-page/themed-my-dspace-page.component.ts @@ -18,7 +18,7 @@ export class ThemedMyDSpacePageComponent extends ThemedComponent { - return import(`../../themes/${themeName}/app/+my-dspace-page/my-dspace-page.component`); + return import(`../../themes/${themeName}/app/my-dspace-page/my-dspace-page.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html index a7cf7c1856..bfefcb5a6c 100644 --- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html +++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html @@ -1,4 +1,5 @@ - +
{{'item.edit.metadata.headers.field' | translate}}{{'item.edit.metadata.headers.value' | translate}}{{'item.edit.metadata.headers.language' | translate}}{{'item.edit.metadata.headers.field' | translate}}{{'item.edit.metadata.headers.value' | translate}}{{'item.edit.metadata.headers.language' | translate}} {{'item.edit.metadata.headers.edit' | translate}}
{{collection?.name}} diff --git a/src/app/shared/object-select/item-select/item-select.component.spec.ts b/src/app/shared/object-select/item-select/item-select.component.spec.ts index 224fb764b6..de52f1c3c2 100644 --- a/src/app/shared/object-select/item-select/item-select.component.spec.ts +++ b/src/app/shared/object-select/item-select/item-select.component.spec.ts @@ -11,13 +11,13 @@ import { HostWindowService } from '../../host-window.service'; import { HostWindowServiceStub } from '../../testing/host-window-service.stub'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { of as observableOf, of } from 'rxjs'; +import { of } from 'rxjs'; import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; import { createPaginatedList } from '../../testing/utils.test'; import { PaginationService } from '../../../core/pagination/pagination.service'; -import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; -import { FindListOptions } from '../../../core/data/request.models'; import { PaginationServiceStub } from '../../testing/pagination-service.stub'; +import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; +import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; describe('ItemSelectComponent', () => { let comp: ItemSelectComponent; @@ -39,7 +39,8 @@ describe('ItemSelectComponent', () => { key: 'dc.type', language: null, value: 'Article' - }] + }], + _links: { self: { href: 'selfId1' } } }), Object.assign(new Item(), { id: 'id2', @@ -54,7 +55,8 @@ describe('ItemSelectComponent', () => { key: 'dc.type', language: null, value: 'Article' - }] + }], + _links: { self: { href: 'selfId2' } } }) ]; const mockItems = createSuccessfulRemoteDataObject$(createPaginatedList(mockItemList)); @@ -66,6 +68,7 @@ describe('ItemSelectComponent', () => { paginationService = new PaginationServiceStub(mockPaginationOptions); + const authorizationDataService = new AuthorizationDataService(null, null, null, null, null, null, null, null, null, null); beforeEach(waitForAsync(() => { @@ -75,7 +78,8 @@ describe('ItemSelectComponent', () => { providers: [ { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockItemList[1].id]) }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - { provide: PaginationService, useValue: paginationService } + { provide: PaginationService, useValue: paginationService }, + { provide: AuthorizationDataService, useValue: authorizationDataService } ], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); @@ -146,4 +150,21 @@ describe('ItemSelectComponent', () => { expect(comp.cancel.emit).toHaveBeenCalled(); }); }); + + describe('when the authorize feature is not authorized', () => { + + beforeEach(() => { + comp.featureId = FeatureID.CanManageMappings; + spyOn(authorizationDataService, 'isAuthorized').and.returnValue(of(false)); + }); + + it('should disable the checkbox', waitForAsync(() => { + fixture.detectChanges(); + fixture.whenStable().then(() => { + const checkbox = fixture.debugElement.query(By.css('input.item-checkbox')).nativeElement; + expect(authorizationDataService.isAuthorized).toHaveBeenCalled(); + expect(checkbox.disabled).toBeTrue(); + }); + })); + }); }); diff --git a/src/app/shared/object-select/item-select/item-select.component.ts b/src/app/shared/object-select/item-select/item-select.component.ts index b4918ada99..5cf32c2953 100644 --- a/src/app/shared/object-select/item-select/item-select.component.ts +++ b/src/app/shared/object-select/item-select/item-select.component.ts @@ -6,7 +6,8 @@ import { hasValueOperator, isNotEmpty } from '../../empty.util'; import { Observable } from 'rxjs'; import { getAllSucceededRemoteDataPayload } from '../../../core/shared/operators'; import { map } from 'rxjs/operators'; -import { getItemPageRoute } from '../../../+item-page/item-page-routing-paths'; +import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; +import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @Component({ selector: 'ds-item-select', @@ -33,8 +34,9 @@ export class ItemSelectComponent extends ObjectSelectComponent { [itemId: string]: string }>; - constructor(protected objectSelectService: ObjectSelectService) { - super(objectSelectService); + constructor(protected objectSelectService: ObjectSelectService, + protected authorizationService: AuthorizationDataService ) { + super(objectSelectService, authorizationService); } ngOnInit(): void { diff --git a/src/app/shared/object-select/object-select/object-select.component.ts b/src/app/shared/object-select/object-select/object-select.component.ts index f8be095719..165a8c0a4f 100644 --- a/src/app/shared/object-select/object-select/object-select.component.ts +++ b/src/app/shared/object-select/object-select/object-select.component.ts @@ -1,11 +1,15 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { take } from 'rxjs/operators'; +import { startWith, take } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model'; import { ObjectSelectService } from '../object-select.service'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; +import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; +import { of } from 'rxjs/internal/observable/of'; +import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; +import { DSpaceObject } from '../../../core/shared/dspace-object.model'; /** * An abstract component used to select DSpaceObjects from a specific list and returning the UUIDs of the selected DSpaceObjects @@ -47,6 +51,12 @@ export abstract class ObjectSelectComponent implements OnInit, OnDestro @Input() confirmButton: string; + /** + * Authorize check to enable the selection when present. + */ + @Input() + featureId: FeatureID; + /** * The message key used for the cancel button * @type {string} @@ -79,7 +89,8 @@ export abstract class ObjectSelectComponent implements OnInit, OnDestro */ selectedIds$: Observable; - constructor(protected objectSelectService: ObjectSelectService) { + constructor(protected objectSelectService: ObjectSelectService, + protected authorizationService: AuthorizationDataService) { } ngOnInit(): void { @@ -107,6 +118,16 @@ export abstract class ObjectSelectComponent implements OnInit, OnDestro return this.objectSelectService.getSelected(this.key, id); } + /** + * Return if the item can be selected or not due to authorization check. + */ + canSelect(item: DSpaceObject): Observable { + if (!this.featureId) { + return of(true); + } + return this.authorizationService.isAuthorized(this.featureId, item.self).pipe(startWith(false)); + } + /** * Called when the confirm button is pressed * Sends the selected UUIDs to the parent component diff --git a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts index 77931400a2..67947c3425 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts @@ -11,7 +11,7 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; import { EnumKeysPipe } from '../utils/enum-keys-pipe'; import { VarDirective } from '../utils/var.directive'; -import { SEARCH_CONFIG_SERVICE } from '../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationServiceStub } from '../testing/pagination-service.stub'; diff --git a/src/app/shared/page-size-selector/page-size-selector.component.ts b/src/app/shared/page-size-selector/page-size-selector.component.ts index 764a8063db..ddfe1ca4d9 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.ts @@ -2,7 +2,7 @@ import { Component, Inject, OnInit } from '@angular/core'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { Observable } from 'rxjs'; import { ActivatedRoute, Router } from '@angular/router'; -import { SEARCH_CONFIG_SERVICE } from '../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; import { PaginatedSearchOptions } from '../search/paginated-search-options.model'; import { map, take } from 'rxjs/operators'; diff --git a/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts b/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts index f9b9ff8e90..64a3bc5361 100644 --- a/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts +++ b/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts @@ -16,7 +16,7 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import { Component, ElementRef, EventEmitter, OnDestroy, Output, ViewChild } from '@angular/core'; import { PaginationComponent } from '../pagination/pagination.component'; import { ObjectValuesPipe } from '../utils/object-values-pipe'; -import { compareArraysUsing } from '../../+item-page/simple/item-types/shared/item-relationships-utils'; +import { compareArraysUsing } from '../../item-page/simple/item-types/shared/item-relationships-utils'; import { PaginationService } from '../../core/pagination/pagination.service'; /** diff --git a/src/app/shared/resource-policies/create/resource-policy-create.component.ts b/src/app/shared/resource-policies/create/resource-policy-create.component.ts index 83e77f5646..24abd05a86 100644 --- a/src/app/shared/resource-policies/create/resource-policy-create.component.ts +++ b/src/app/shared/resource-policies/create/resource-policy-create.component.ts @@ -12,7 +12,7 @@ import { RemoteData } from '../../../core/data/remote-data'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths'; +import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @Component({ diff --git a/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts b/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts index 1ee0aa3c4a..a515eef675 100644 --- a/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts +++ b/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts @@ -11,7 +11,7 @@ import { RemoteData } from '../../../core/data/remote-data'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; -import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths'; +import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @Component({ diff --git a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts index 3e7b39d33b..79f842d33b 100644 --- a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts +++ b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts @@ -25,7 +25,7 @@ import { getMockFormService } from '../../mocks/form-service.mock'; import { FormBuilderService } from '../../form/builder/form-builder.service'; import { EpersonGroupListComponent } from './eperson-group-list/eperson-group-list.component'; import { FormComponent } from '../../form/form.component'; -import { stringToNgbDateStruct } from '../../date.util'; +import { stringToNgbDateStruct, dateToISOFormat } from '../../date.util'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { EPersonMock } from '../../testing/eperson.mock'; @@ -107,8 +107,8 @@ export const submittedResourcePolicy = Object.assign(new ResourcePolicy(), { description: 'description', policyType: PolicyType.TYPE_WORKFLOW, action: ActionType.WRITE, - startDate: '2019-04-14T00:00:00Z', - endDate: '2020-04-14T00:00:00Z', + startDate: dateToISOFormat('2019-04-14T00:00:00Z'), + endDate: dateToISOFormat('2020-04-14T00:00:00Z'), type: RESOURCE_POLICY }); diff --git a/src/app/shared/search-form/search-form.component.html b/src/app/shared/search-form/search-form.component.html index bb75f449ff..940f3502c3 100644 --- a/src/app/shared/search-form/search-form.component.html +++ b/src/app/shared/search-form/search-form.component.html @@ -1,6 +1,6 @@
- diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts index a8081e8f2d..dc58a8c853 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts @@ -21,7 +21,7 @@ import { PageInfo } from '../../../../../core/shared/page-info.model'; import { SearchFacetFilterComponent } from './search-facet-filter.component'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { SearchConfigurationServiceStub } from '../../../../testing/search-configuration-service.stub'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; describe('SearchFacetFilterComponent', () => { diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts index afb47f9be5..0b28929554 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts @@ -23,7 +23,7 @@ import { SearchConfigurationService } from '../../../../../core/shared/search/se import { getFirstSucceededRemoteData } from '../../../../../core/shared/operators'; import { InputSuggestion } from '../../../../input-suggestions/input-suggestions.model'; import { SearchOptions } from '../../../search-options.model'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { currentPath } from '../../../../utils/route.utils'; import { getFacetValueForType, stripOperatorFromFilterValue } from '../../../search.utils'; import { createPendingRemoteDataObject } from '../../../../remote-data.utils'; diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts index 5e0077e11d..ee337a503b 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts @@ -11,7 +11,7 @@ import { SearchFilterComponent } from './search-filter.component'; import { SearchFilterConfig } from '../../search-filter-config.model'; import { FilterType } from '../../filter-type.model'; import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub'; -import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; import { SequenceService } from '../../../../core/shared/sequence.service'; describe('SearchFilterComponent', () => { diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts index 0f7f763b45..a1b66eb332 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts @@ -9,7 +9,7 @@ import { slide } from '../../../animations/slide'; import { isNotEmpty } from '../../../empty.util'; import { SearchService } from '../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; import { SequenceService } from '../../../../core/shared/sequence.service'; @Component({ diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts index 598a397fe7..41f0b4307d 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts @@ -20,7 +20,7 @@ import { Router } from '@angular/router'; import { PageInfo } from '../../../../../core/shared/page-info.model'; import { SearchRangeFilterComponent } from './search-range-filter.component'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationServiceStub } from '../../../../testing/search-configuration-service.stub'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; import { RouteService } from '../../../../../core/services/route.service'; diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts index b23a2d8224..702854dee5 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts @@ -11,7 +11,7 @@ import { FILTER_CONFIG, IN_PLACE_SEARCH, SearchFilterService } from '../../../.. import { SearchService } from '../../../../../core/shared/search/search.service'; import { Router } from '@angular/router'; import * as moment from 'moment'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service'; import { RouteService } from '../../../../../core/services/route.service'; import { hasValue } from '../../../../empty.util'; @@ -56,7 +56,7 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple /** * Fallback maximum for the range */ - max = new Date().getFullYear(); + max = new Date().getUTCFullYear(); /** * The current range of the filter diff --git a/src/app/shared/search/search-filters/search-filters.component.spec.ts b/src/app/shared/search/search-filters/search-filters.component.spec.ts index 2dd810db63..031c2e132b 100644 --- a/src/app/shared/search/search-filters/search-filters.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filters.component.spec.ts @@ -8,7 +8,7 @@ import { SearchFilterService } from '../../../core/shared/search/search-filter.s import { SearchFiltersComponent } from './search-filters.component'; import { SearchService } from '../../../core/shared/search/search.service'; import { of as observableOf, Subject } from 'rxjs'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub'; describe('SearchFiltersComponent', () => { diff --git a/src/app/shared/search/search-filters/search-filters.component.ts b/src/app/shared/search/search-filters/search-filters.component.ts index 348af6743d..0556da4426 100644 --- a/src/app/shared/search/search-filters/search-filters.component.ts +++ b/src/app/shared/search/search-filters/search-filters.component.ts @@ -9,7 +9,7 @@ import { SearchFilterConfig } from '../search-filter-config.model'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../../../core/shared/search/search-filter.service'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { currentPath } from '../../utils/route.utils'; import { Router } from '@angular/router'; import { hasValue } from '../../empty.util'; diff --git a/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts b/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts index 35de768977..b3f9471cbd 100644 --- a/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts +++ b/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts @@ -7,7 +7,7 @@ import { Observable, of as observableOf } from 'rxjs'; import { Params, Router } from '@angular/router'; import { SearchLabelComponent } from './search-label.component'; import { ObjectKeysPipe } from '../../../utils/object-keys-pipe'; -import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; import { SearchServiceStub } from '../../../testing/search-service.stub'; import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub'; import { SearchService } from '../../../../core/shared/search/search.service'; diff --git a/src/app/shared/search/search-labels/search-labels.component.spec.ts b/src/app/shared/search/search-labels/search-labels.component.spec.ts index f96ba56279..e00c56aabc 100644 --- a/src/app/shared/search/search-labels/search-labels.component.spec.ts +++ b/src/app/shared/search/search-labels/search-labels.component.spec.ts @@ -9,7 +9,7 @@ import { SearchService } from '../../../core/shared/search/search.service'; import { RouterTestingModule } from '@angular/router/testing'; import { ObjectKeysPipe } from '../../utils/object-keys-pipe'; import { SearchServiceStub } from '../../testing/search-service.stub'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; describe('SearchLabelsComponent', () => { let comp: SearchLabelsComponent; diff --git a/src/app/shared/search/search-labels/search-labels.component.ts b/src/app/shared/search/search-labels/search-labels.component.ts index 2322c80acf..8f77d73b21 100644 --- a/src/app/shared/search/search-labels/search-labels.component.ts +++ b/src/app/shared/search/search-labels/search-labels.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, Input } from '@angular/core'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { Observable } from 'rxjs'; import { Params, Router } from '@angular/router'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; diff --git a/src/app/shared/search/search-settings/search-settings.component.spec.ts b/src/app/shared/search/search-settings/search-settings.component.spec.ts index 6c483a5bc4..6cf8ffc618 100644 --- a/src/app/shared/search/search-settings/search-settings.component.spec.ts +++ b/src/app/shared/search/search-settings/search-settings.component.spec.ts @@ -12,7 +12,7 @@ import { EnumKeysPipe } from '../../utils/enum-keys-pipe'; import { By } from '@angular/platform-browser'; import { SearchFilterService } from '../../../core/shared/search/search-filter.service'; import { VarDirective } from '../../utils/var.directive'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { SidebarService } from '../../sidebar/sidebar.service'; import { SidebarServiceStub } from '../../testing/sidebar-service.stub'; import { PaginationService } from '../../../core/pagination/pagination.service'; diff --git a/src/app/shared/search/search-settings/search-settings.component.ts b/src/app/shared/search/search-settings/search-settings.component.ts index b9d86571f6..9f6cab4a7b 100644 --- a/src/app/shared/search/search-settings/search-settings.component.ts +++ b/src/app/shared/search/search-settings/search-settings.component.ts @@ -4,7 +4,7 @@ import { SortDirection, SortOptions } from '../../../core/cache/models/sort-opti import { ActivatedRoute, Router } from '@angular/router'; import { PaginatedSearchOptions } from '../paginated-search-options.model'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../+my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { PaginationService } from '../../../core/pagination/pagination.service'; @Component({ diff --git a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.html b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.html index 8df37214d1..e66483b645 100644 --- a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.html +++ b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.html @@ -1,7 +1,8 @@
-
{{ 'search.switch-configuration.title' | translate}}
+
{{ 'search.switch-configuration.title' | translate}}
+
+ {{dropMsg | translate}} {{'uploader.or' | translate}} + -

+
@@ -32,7 +32,7 @@ {{'uploader.queue-length' | translate}}: {{ uploader?.queue?.length }} | {{ uploader?.queue[0]?.file.name }}
-
diff --git a/src/app/statistics-page/statistics-page-routing.module.ts b/src/app/statistics-page/statistics-page-routing.module.ts index 5b96bcca6e..3c88e096e7 100644 --- a/src/app/statistics-page/statistics-page-routing.module.ts +++ b/src/app/statistics-page/statistics-page-routing.module.ts @@ -3,13 +3,13 @@ import { RouterModule } from '@angular/router'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; import { StatisticsPageModule } from './statistics-page.module'; -import { CollectionPageResolver } from '../+collection-page/collection-page.resolver'; -import { CommunityPageResolver } from '../+community-page/community-page.resolver'; +import { CollectionPageResolver } from '../collection-page/collection-page.resolver'; +import { CommunityPageResolver } from '../community-page/community-page.resolver'; import { ThemedCollectionStatisticsPageComponent } from './collection-statistics-page/themed-collection-statistics-page.component'; import { ThemedCommunityStatisticsPageComponent } from './community-statistics-page/themed-community-statistics-page.component'; import { ThemedItemStatisticsPageComponent } from './item-statistics-page/themed-item-statistics-page.component'; import { ThemedSiteStatisticsPageComponent } from './site-statistics-page/themed-site-statistics-page.component'; -import { ItemResolver } from '../+item-page/item.resolver'; +import { ItemResolver } from '../item-page/item.resolver'; @NgModule({ imports: [ diff --git a/src/app/submission/edit/submission-edit.component.html b/src/app/submission/edit/submission-edit.component.html index 19bcd6f079..b74d3861f8 100644 --- a/src/app/submission/edit/submission-edit.component.html +++ b/src/app/submission/edit/submission-edit.component.html @@ -3,6 +3,7 @@ [sections]="sections" [selfUrl]="selfUrl" [submissionDefinition]="submissionDefinition" + [submissionErrors]="submissionErrors" [item]="item" [submissionId]="submissionId">
diff --git a/src/app/submission/edit/submission-edit.component.ts b/src/app/submission/edit/submission-edit.component.ts index 154e73a765..c415b89b81 100644 --- a/src/app/submission/edit/submission-edit.component.ts +++ b/src/app/submission/edit/submission-edit.component.ts @@ -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, debounceTime } from 'rxjs/operators'; +import { debounceTime, filter, switchMap } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { WorkspaceitemSectionsObject } from '../../core/submission/models/workspaceitem-sections.model'; -import { hasValue, isEmpty, isNotNull, isNotEmptyOperator } from '../../shared/empty.util'; +import { hasValue, isEmpty, isNotEmptyOperator, isNotNull } 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'; @@ -18,6 +18,8 @@ import { getAllSucceededRemoteData } from '../../core/shared/operators'; import { ItemDataService } from '../../core/data/item-data.service'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; import { SubmissionJsonPatchOperationsService } from '../../core/submission/submission-json-patch-operations.service'; +import { SubmissionError } from '../objects/submission-objects.reducer'; +import parseSectionErrors from '../utils/parseSectionErrors'; /** * This component allows to edit an existing workspaceitem/workflowitem. @@ -53,6 +55,12 @@ export class SubmissionEditComponent implements OnDestroy, OnInit { */ public submissionDefinition: SubmissionDefinitionsModel; + /** + * The submission errors present in the submission object + * @type {SubmissionError} + */ + public submissionErrors: SubmissionError; + /** * The submission id * @type {string} @@ -86,6 +94,7 @@ export class SubmissionEditComponent implements OnDestroy, OnInit { * @param {ItemDataService} itemDataService * @param {SubmissionService} submissionService * @param {TranslateService} translate + * @param {SubmissionJsonPatchOperationsService} submissionJsonPatchOperationsService */ constructor(private changeDetectorRef: ChangeDetectorRef, private notificationsService: NotificationsService, @@ -112,6 +121,8 @@ export class SubmissionEditComponent implements OnDestroy, OnInit { this.notificationsService.info(null, this.translate.get('submission.general.cannot_submit')); this.router.navigate(['/mydspace']); } else { + const { errors } = submissionObjectRD.payload; + this.submissionErrors = parseSectionErrors(errors); this.submissionId = submissionObjectRD.payload.id.toString(); this.collectionId = (submissionObjectRD.payload.collection as Collection).id; this.selfUrl = submissionObjectRD.payload._links.self.href; diff --git a/src/app/submission/form/footer/submission-form-footer.component.html b/src/app/submission/form/footer/submission-form-footer.component.html index 9771e34cec..4964eb56a2 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.html +++ b/src/app/submission/form/footer/submission-form-footer.component.html @@ -1,43 +1,52 @@
- -
-
-
-
Saving...
-
Depositing...
-
-
-
- - -
+
+ + {{'submission.general.info.saved' | translate}} + + + {{'submission.general.info.pending-changes' | translate}} + +
+
+
Saving...
+
Depositing...
+
+
+
+ + + +
+
diff --git a/src/app/submission/form/footer/submission-form-footer.component.spec.ts b/src/app/submission/form/footer/submission-form-footer.component.spec.ts index 57a193ad7d..dd47dad444 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.spec.ts +++ b/src/app/submission/form/footer/submission-form-footer.component.spec.ts @@ -205,7 +205,7 @@ describe('SubmissionFormFooterComponent Component', () => { comp.showDepositAndDiscard = observableOf(true); compAsAny.submissionIsInvalid = observableOf(true); fixture.detectChanges(); - const depositBtn: any = fixture.debugElement.query(By.css('.btn-primary')); + const depositBtn: any = fixture.debugElement.query(By.css('.btn-success')); expect(depositBtn.nativeElement.disabled).toBeTruthy(); }); @@ -214,7 +214,7 @@ describe('SubmissionFormFooterComponent Component', () => { comp.showDepositAndDiscard = observableOf(true); compAsAny.submissionIsInvalid = observableOf(false); fixture.detectChanges(); - const depositBtn: any = fixture.debugElement.query(By.css('.btn-primary')); + const depositBtn: any = fixture.debugElement.query(By.css('.btn-success')); expect(depositBtn.nativeElement.disabled).toBeFalsy(); }); diff --git a/src/app/submission/form/submission-form.component.spec.ts b/src/app/submission/form/submission-form.component.spec.ts index dd8e6d0ea3..bd504e09c1 100644 --- a/src/app/submission/form/submission-form.component.spec.ts +++ b/src/app/submission/form/submission-form.component.spec.ts @@ -126,6 +126,7 @@ describe('SubmissionFormComponent Component', () => { comp.submissionDefinition = submissionDefinition; comp.selfUrl = selfUrl; comp.sections = sectionsData; + comp.submissionErrors = null; comp.item = new Item(); submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState)); diff --git a/src/app/submission/form/submission-form.component.ts b/src/app/submission/form/submission-form.component.ts index 6d4ddb4ca0..4cbffbca78 100644 --- a/src/app/submission/form/submission-form.component.ts +++ b/src/app/submission/form/submission-form.component.ts @@ -11,7 +11,7 @@ import { WorkspaceitemSectionsObject } from '../../core/submission/models/worksp import { hasValue, isNotEmpty } from '../../shared/empty.util'; import { UploaderOptions } from '../../shared/uploader/uploader-options.model'; -import { SubmissionObjectEntry } from '../objects/submission-objects.reducer'; +import { SubmissionError, SubmissionObjectEntry } from '../objects/submission-objects.reducer'; import { SectionDataObject } from '../sections/models/section-data.model'; import { SubmissionService } from '../submission.service'; import { Item } from '../../core/shared/item.model'; @@ -41,6 +41,12 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { */ @Input() sections: WorkspaceitemSectionsObject; + /** + * The submission errors present in the submission object + * @type {SubmissionError} + */ + @Input() submissionErrors: SubmissionError; + /** * The submission self url * @type {string} @@ -163,7 +169,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { this.submissionDefinition, this.sections, this.item, - null); + this.submissionErrors); this.changeDetectorRef.detectChanges(); }) ); diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts index 823cbb5d82..bcdd01d5a1 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts @@ -1,5 +1,5 @@ import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { waitForAsync, ComponentFixture, inject, TestBed } from '@angular/core/testing'; +import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; import { of as observableOf } from 'rxjs'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; @@ -165,6 +165,7 @@ describe('SubmissionUploadFilesComponent Component', () => { submissionId, sectionId, mockSectionsData[sectionId], + expectedErrors[sectionId], expectedErrors[sectionId] ); }); @@ -188,6 +189,7 @@ describe('SubmissionUploadFilesComponent Component', () => { submissionId, sectionId, mockSectionsData[sectionId], + expectedErrors[sectionId], expectedErrors[sectionId] ); }); diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts index b1b5051458..fa81fe2bbd 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts @@ -143,7 +143,7 @@ export class SubmissionUploadFilesComponent implements OnChanges { } } }); - this.sectionService.updateSectionData(this.submissionId, sectionId, sectionData, sectionErrors); + this.sectionService.updateSectionData(this.submissionId, sectionId, sectionData, sectionErrors, sectionErrors); }); } diff --git a/src/app/submission/objects/submission-objects.actions.ts b/src/app/submission/objects/submission-objects.actions.ts index 49c3420e6e..4935acb792 100644 --- a/src/app/submission/objects/submission-objects.actions.ts +++ b/src/app/submission/objects/submission-objects.actions.ts @@ -1,7 +1,7 @@ import { Action } from '@ngrx/store'; import { type } from '../../shared/ngrx/type'; -import { SectionVisibility, SubmissionSectionError } from './submission-objects.reducer'; +import { SectionVisibility, SubmissionError, SubmissionSectionError } from './submission-objects.reducer'; import { WorkspaceitemSectionUploadFileObject } from '../../core/submission/models/workspaceitem-section-upload-file.model'; import { WorkspaceitemSectionDataType, @@ -206,7 +206,8 @@ export class UpdateSectionDataAction implements Action { submissionId: string; sectionId: string; data: WorkspaceitemSectionDataType; - errors: SubmissionSectionError[]; + errorsToShow: SubmissionSectionError[]; + serverValidationErrors: SubmissionSectionError[]; metadata: string[]; }; @@ -219,17 +220,20 @@ export class UpdateSectionDataAction implements Action { * the section's ID to add * @param data * the section's data - * @param errors - * the section's errors + * @param errorsToShow + * the list of the section's errors to show + * @param serverValidationErrors + * the list of the section errors detected by the server * @param metadata * the section's metadata */ constructor(submissionId: string, sectionId: string, data: WorkspaceitemSectionDataType, - errors: SubmissionSectionError[], + errorsToShow: SubmissionSectionError[], + serverValidationErrors: SubmissionSectionError[], metadata?: string[]) { - this.payload = { submissionId, sectionId, data, errors, metadata }; + this.payload = { submissionId, sectionId, data, errorsToShow, serverValidationErrors, metadata }; } } @@ -308,7 +312,7 @@ export class InitSubmissionFormAction implements Action { submissionDefinition: SubmissionDefinitionsModel; sections: WorkspaceitemSectionsObject; item: Item; - errors: SubmissionSectionError[]; + errors: SubmissionError; }; /** @@ -333,7 +337,7 @@ export class InitSubmissionFormAction implements Action { submissionDefinition: SubmissionDefinitionsModel, sections: WorkspaceitemSectionsObject, item: Item, - errors: SubmissionSectionError[]) { + errors: SubmissionError) { this.payload = { collectionId, submissionId, selfUrl, submissionDefinition, sections, item, errors }; } } diff --git a/src/app/submission/objects/submission-objects.effects.spec.ts b/src/app/submission/objects/submission-objects.effects.spec.ts index 3ed4a4450d..122ebd90ac 100644 --- a/src/app/submission/objects/submission-objects.effects.spec.ts +++ b/src/app/submission/objects/submission-objects.effects.spec.ts @@ -28,7 +28,7 @@ import { mockSectionsData, mockSectionsDataTwo, mockSectionsErrors, - mockSectionsErrorsTwo, + mockSectionsErrorsTouchedField, mockSubmissionCollectionId, mockSubmissionDefinition, mockSubmissionDefinitionResponse, @@ -358,18 +358,21 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, + errorsList.traditionalpageone || [], errorsList.traditionalpageone || [] ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, + errorsList.license || [], errorsList.license || [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, + errorsList.upload || [], errorsList.upload || [] ), }); @@ -408,25 +411,29 @@ describe('SubmissionObjectEffects test suite', () => { } }); - const errorsList = parseSectionErrors(mockSectionsErrorsTwo); + const errorsToShowList = parseSectionErrors(mockSectionsErrorsTouchedField); + const serverValidationErrorsList = parseSectionErrors(mockSectionsErrors); const expected = cold('--(bcd)-', { b: new UpdateSectionDataAction( submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, - errorsList.traditionalpageone + errorsToShowList.traditionalpageone, + serverValidationErrorsList.traditionalpageone ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, - errorsList.license || [] + errorsToShowList.license || [], + serverValidationErrorsList.license || [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, - errorsList.upload || [] + errorsToShowList.upload || [], + serverValidationErrorsList.upload || [] ), }); @@ -459,18 +466,21 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, + [], [] ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, + [], [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, + [], [] ), }); @@ -506,18 +516,21 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, + errorsList.traditionalpageone || [], errorsList.traditionalpageone || [] ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, + errorsList.license || [], errorsList.license || [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, + errorsList.upload || [], errorsList.upload || [] ), }); @@ -553,24 +566,28 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsDataTwo.traditionalpageone as any, + errorsList.traditionalpageone || [], errorsList.traditionalpageone || [] ), c: new UpdateSectionDataAction( submissionId, 'traditionalpagetwo', mockSectionsDataTwo.traditionalpagetwo as any, + errorsList.traditionalpagetwo || [], errorsList.traditionalpagetwo || [] ), d: new UpdateSectionDataAction( submissionId, 'license', mockSectionsDataTwo.license as any, + errorsList.license || [], errorsList.license || [] ), e: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsDataTwo.upload as any, + errorsList.upload || [], errorsList.upload || [] ), }); @@ -610,18 +627,21 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, - [] + [], + errorsList.traditionalpageone ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, + errorsList.license || [], errorsList.license || [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, + errorsList.upload || [], errorsList.upload || [] ), }); @@ -655,18 +675,21 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, + [], [] ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, + [], [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, + [], [] ), }); @@ -696,26 +719,28 @@ describe('SubmissionObjectEffects test suite', () => { } }); - const errorsList = parseSectionErrors(mockSectionsErrors); - console.log(errorsList); + const serverValidationErrorsList = parseSectionErrors(mockSectionsErrors); const expected = cold('--(bcd)-', { b: new UpdateSectionDataAction( submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, - [] + [], + serverValidationErrorsList.traditionalpageone ), c: new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, - errorsList.license || [] + serverValidationErrorsList.license || [], + serverValidationErrorsList.license || [] ), d: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, - errorsList.upload || [] + serverValidationErrorsList.upload || [], + serverValidationErrorsList.upload || [] ), }); @@ -750,24 +775,28 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsDataTwo.traditionalpageone as any, - [] + [], + errorsList.traditionalpageone ), c: new UpdateSectionDataAction( submissionId, 'traditionalpagetwo', mockSectionsDataTwo.traditionalpagetwo as any, + errorsList.traditionalpagetwo || [], errorsList.traditionalpagetwo || [] ), d: new UpdateSectionDataAction( submissionId, 'license', mockSectionsDataTwo.license as any, + errorsList.license || [], errorsList.license || [] ), e: new UpdateSectionDataAction( submissionId, 'upload', mockSectionsDataTwo.upload as any, + errorsList.upload || [], errorsList.upload || [] ), }); @@ -880,18 +909,21 @@ describe('SubmissionObjectEffects test suite', () => { submissionId, 'traditionalpageone', mockSectionsData.traditionalpageone as any, + errorsList.traditionalpageone || [], errorsList.traditionalpageone || [] ), new UpdateSectionDataAction( submissionId, 'license', mockSectionsData.license as any, + errorsList.license || [], errorsList.license || [] ), new UpdateSectionDataAction( submissionId, 'upload', mockSectionsData.upload as any, + errorsList.upload || [], errorsList.upload || [] ) ] diff --git a/src/app/submission/objects/submission-objects.effects.ts b/src/app/submission/objects/submission-objects.effects.ts index bc7bf45dba..b4ba1c2480 100644 --- a/src/app/submission/objects/submission-objects.effects.ts +++ b/src/app/submission/objects/submission-objects.effects.ts @@ -5,16 +5,7 @@ import { TranslateService } from '@ngx-translate/core'; import { isEqual, union } from 'lodash'; import { from as observableFrom, Observable, of as observableOf } from 'rxjs'; -import { - catchError, - filter, - map, - mergeMap, - switchMap, - take, - tap, - withLatestFrom -} from 'rxjs/operators'; +import { catchError, filter, map, mergeMap, switchMap, take, tap, withLatestFrom } from 'rxjs/operators'; import { SubmissionObject } from '../../core/submission/models/submission-object.model'; import { WorkflowItem } from '../../core/submission/models/workflowitem.model'; import { WorkspaceitemSectionUploadObject } from '../../core/submission/models/workspaceitem-section-upload.model'; @@ -52,13 +43,13 @@ import { UpdateSectionDataAction, UpdateSectionDataSuccessAction } from './submission-objects.actions'; -import {SubmissionObjectEntry, SubmissionSectionError, SubmissionSectionObject} from './submission-objects.reducer'; +import { SubmissionObjectEntry, SubmissionSectionError, SubmissionSectionObject } from './submission-objects.reducer'; import { Item } from '../../core/shared/item.model'; import { RemoteData } from '../../core/data/remote-data'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { SubmissionObjectDataService } from '../../core/submission/submission-object-data.service'; import { followLink } from '../../shared/utils/follow-link-config.model'; -import parseSectionErrorPaths, {SectionErrorPath} from '../utils/parseSectionErrorPaths'; +import parseSectionErrorPaths, { SectionErrorPath } from '../utils/parseSectionErrorPaths'; import { FormState } from '../../shared/form/form.reducer'; @Injectable() @@ -83,7 +74,7 @@ export class SubmissionObjectEffects { } else { sectionData = action.payload.item.metadata; } - const sectionErrors = null; + const sectionErrors = isNotEmpty(action.payload.errors) ? (action.payload.errors[sectionId] || null) : null; mappedActions.push( new InitSectionAction( action.payload.submissionId, @@ -232,10 +223,7 @@ export class SubmissionObjectEffects { switchMap(([action, state]: [DepositSubmissionAction, any]) => { return this.submissionService.depositSubmission(state.submission.objects[action.payload.submissionId].selfUrl).pipe( map(() => new DepositSubmissionSuccessAction(action.payload.submissionId)), - catchError((error) => { - console.log('submission error', error); - return observableOf(new DepositSubmissionErrorAction(action.payload.submissionId)); - })); + catchError((error) => observableOf(new DepositSubmissionErrorAction(action.payload.submissionId)))); })); /** @@ -297,7 +285,7 @@ export class SubmissionObjectEffects { return item$.pipe( map((item: Item) => item.metadata), filter((metadata) => !isEqual(action.payload.data, metadata)), - map((metadata: any) => new UpdateSectionDataAction(action.payload.submissionId, action.payload.sectionId, metadata, action.payload.errors, action.payload.metadata)) + map((metadata: any) => new UpdateSectionDataAction(action.payload.submissionId, action.payload.sectionId, metadata, action.payload.errorsToShow, action.payload.serverValidationErrors, action.payload.metadata)) ); } else { return observableOf(new UpdateSectionDataSuccessAction()); @@ -413,7 +401,7 @@ export class SubmissionObjectEffects { const sectionForm = getForm(forms, currentState, sectionId); const filteredErrors = filterErrors(sectionForm, sectionErrors, currentState.sections[sectionId].sectionType, notify); - mappedActions.push(new UpdateSectionDataAction(submissionId, sectionId, sectionData, filteredErrors)); + mappedActions.push(new UpdateSectionDataAction(submissionId, sectionId, sectionData, filteredErrors, sectionErrors)); } }); } diff --git a/src/app/submission/objects/submission-objects.reducer.spec.ts b/src/app/submission/objects/submission-objects.reducer.spec.ts index 0431cdff79..2a24afae19 100644 --- a/src/app/submission/objects/submission-objects.reducer.spec.ts +++ b/src/app/submission/objects/submission-objects.reducer.spec.ts @@ -28,7 +28,8 @@ import { SaveSubmissionSectionFormAction, SaveSubmissionSectionFormErrorAction, SaveSubmissionSectionFormSuccessAction, - SectionStatusChangeAction, SubmissionObjectAction, + SectionStatusChangeAction, + SubmissionObjectAction, UpdateSectionDataAction } from './submission-objects.actions'; import { SectionsType } from '../sections/sections-type'; @@ -68,7 +69,7 @@ describe('submissionReducer test suite', () => { } }; - const action = new InitSubmissionFormAction(collectionId, submissionId, selfUrl, submissionDefinition, {}, new Item(), []); + const action = new InitSubmissionFormAction(collectionId, submissionId, selfUrl, submissionDefinition, {}, new Item(), null); const newState = submissionObjectReducer({}, action); expect(newState).toEqual(expectedState); @@ -237,12 +238,13 @@ describe('submissionReducer test suite', () => { collapsed: false, enabled: true, data: {}, - errors: [], + errorsToShow: [], + serverValidationErrors: [], isLoading: false, - isValid: false + isValid: true } as any; - let action: any = new InitSubmissionFormAction(collectionId, submissionId, selfUrl, submissionDefinition, {}, new Item(), []); + let action: any = new InitSubmissionFormAction(collectionId, submissionId, selfUrl, submissionDefinition, {}, new Item(), null); let newState = submissionObjectReducer({}, action); action = new InitSectionAction( @@ -329,7 +331,7 @@ describe('submissionReducer test suite', () => { ] } as any; - const action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', data, []); + const action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', data, [], []); const newState = submissionObjectReducer(initState, action); expect(newState[826].sections.traditionalpageone.data).toEqual(data); @@ -340,7 +342,7 @@ describe('submissionReducer test suite', () => { } as any; const metadata = ['dc.title', 'dc.contributor.author']; - const action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', data, [], metadata); + const action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', data, [], [], metadata); const newState = submissionObjectReducer(initState, action); expect(newState[826].sections.traditionalpageone.metadata).toEqual(metadata); @@ -354,10 +356,10 @@ describe('submissionReducer test suite', () => { } ]; - const action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', {}, errors); + const action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', {}, errors, errors); const newState = submissionObjectReducer(initState, action); - expect(newState[826].sections.traditionalpageone.errors).toEqual(errors); + expect(newState[826].sections.traditionalpageone.errorsToShow).toEqual(errors); }); it('should remove all submission section errors properly', () => { @@ -366,7 +368,7 @@ describe('submissionReducer test suite', () => { newState = submissionObjectReducer(initState, action); - expect(newState[826].sections.traditionalpageone.errors).toEqual([]); + expect(newState[826].sections.traditionalpageone.errorsToShow).toEqual([]); }); it('should add submission section error properly', () => { @@ -378,7 +380,7 @@ describe('submissionReducer test suite', () => { const action = new InertSectionErrorsAction(submissionId, 'traditionalpageone', error); const newState = submissionObjectReducer(initState, action); - expect(newState[826].sections.traditionalpageone.errors).toEqual([error]); + expect(newState[826].sections.traditionalpageone.errorsToShow).toEqual([error]); }); it('should remove specified submission section error/s properly', () => { @@ -402,21 +404,21 @@ describe('submissionReducer test suite', () => { message: 'error.validation.required' }]; - let action: any = new UpdateSectionDataAction(submissionId, 'traditionalpageone', {}, errors); + let action: any = new UpdateSectionDataAction(submissionId, 'traditionalpageone', {}, errors, errors); let newState = submissionObjectReducer(initState, action); action = new DeleteSectionErrorsAction(submissionId, 'traditionalpageone', error); newState = submissionObjectReducer(newState, action); - expect(newState[826].sections.traditionalpageone.errors).toEqual(expectedErrors); + expect(newState[826].sections.traditionalpageone.errorsToShow).toEqual(expectedErrors); - action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', {}, errors); + action = new UpdateSectionDataAction(submissionId, 'traditionalpageone', {}, errors, errors); newState = submissionObjectReducer(initState, action); action = new DeleteSectionErrorsAction(submissionId, 'traditionalpageone', errors); newState = submissionObjectReducer(newState, action); - expect(newState[826].sections.traditionalpageone.errors).toEqual([]); + expect(newState[826].sections.traditionalpageone.errorsToShow).toEqual([]); }); it('should add a new file', () => { diff --git a/src/app/submission/objects/submission-objects.reducer.ts b/src/app/submission/objects/submission-objects.reducer.ts index a82bc72f4e..4159c56ae1 100644 --- a/src/app/submission/objects/submission-objects.reducer.ts +++ b/src/app/submission/objects/submission-objects.reducer.ts @@ -1,4 +1,4 @@ -import { hasValue, isNotEmpty, isNotNull, isUndefined } from '../../shared/empty.util'; +import { hasValue, isEmpty, isNotEmpty, isNotNull, isUndefined } from '../../shared/empty.util'; import { differenceWith, findKey, isEqual, uniqWith } from 'lodash'; import { @@ -97,9 +97,14 @@ export interface SubmissionSectionObject { data: WorkspaceitemSectionDataType; /** - * The list of the section errors + * The list of the section's errors to show. It contains the error list to display when section is not pristine */ - errors: SubmissionSectionError[]; + errorsToShow: SubmissionSectionError[]; + + /** + * The list of the section's errors detected by the server. They may not be shown yet if section is pristine + */ + serverValidationErrors: SubmissionSectionError[]; /** * A boolean representing if this section is loading @@ -117,6 +122,13 @@ export interface SubmissionSectionObject { formId: string; } +/** + * An interface to represent section error + */ +export interface SubmissionError { + [submissionId: string]: SubmissionSectionError[]; +} + /** * An interface to represent section error */ @@ -332,7 +344,7 @@ const removeError = (state: SubmissionObjectState, action: DeleteSectionErrorsAc if (Array.isArray(errors)) { filteredErrors = differenceWith(errors, errors, isEqual); } else { - filteredErrors = state[ submissionId ].sections[ sectionId ].errors + filteredErrors = state[ submissionId ].sections[ sectionId ].errorsToShow .filter((currentError) => currentError.path !== errors.path || !isEqual(currentError, errors)); } @@ -340,7 +352,7 @@ const removeError = (state: SubmissionObjectState, action: DeleteSectionErrorsAc [ submissionId ]: Object.assign({}, state[ submissionId ], { sections: Object.assign({}, state[ submissionId ].sections, { [ sectionId ]: Object.assign({}, state[ submissionId ].sections [ sectionId ], { - errors: filteredErrors + errorsToShow: filteredErrors }) }) }) @@ -354,13 +366,13 @@ const addError = (state: SubmissionObjectState, action: InertSectionErrorsAction const { submissionId, sectionId, error } = action.payload; if (hasValue(state[ submissionId ].sections[ sectionId ])) { - const errors = uniqWith(state[ submissionId ].sections[ sectionId ].errors.concat(error), isEqual); + const errorsToShow = uniqWith(state[ submissionId ].sections[ sectionId ].errorsToShow.concat(error), isEqual); return Object.assign({}, state, { [ submissionId ]: Object.assign({}, state[ submissionId ], { activeSection: state[ action.payload.submissionId ].activeSection, sections: Object.assign({}, state[ submissionId ].sections, { [ sectionId ]: Object.assign({}, state[ action.payload.submissionId ].sections [ action.payload.sectionId ], { - errors + errorsToShow }) }), }) @@ -378,7 +390,7 @@ const addError = (state: SubmissionObjectState, action: InertSectionErrorsAction * @param action * a RemoveSectionErrorsAction * @return SubmissionObjectState - * the new state, with the section's errors updated. + * the new state, with the section's errorsToShow updated. */ function removeSectionErrors(state: SubmissionObjectState, action: RemoveSectionErrorsAction): SubmissionObjectState { if (isNotEmpty(state[ action.payload.submissionId ]) @@ -387,7 +399,7 @@ function removeSectionErrors(state: SubmissionObjectState, action: RemoveSection [ action.payload.submissionId ]: Object.assign({}, state[ action.payload.submissionId ], { sections: Object.assign({}, state[ action.payload.submissionId ].sections, { [ action.payload.sectionId ]: Object.assign({}, state[ action.payload.submissionId ].sections [ action.payload.sectionId ], { - errors: [] + errorsToShow: [] }) }) }) @@ -644,9 +656,10 @@ function initSection(state: SubmissionObjectState, action: InitSectionAction): S collapsed: false, enabled: action.payload.enabled, data: action.payload.data, - errors: action.payload.errors || [], + errorsToShow: [], + serverValidationErrors: action.payload.errors || [], isLoading: false, - isValid: false + isValid: isEmpty(action.payload.errors) } }) }) @@ -702,7 +715,8 @@ function updateSectionData(state: SubmissionObjectState, action: UpdateSectionDa [ action.payload.sectionId ]: Object.assign({}, state[ action.payload.submissionId ].sections [ action.payload.sectionId ], { enabled: true, data: action.payload.data, - errors: action.payload.errors, + errorsToShow: action.payload.errorsToShow, + serverValidationErrors: action.payload.serverValidationErrors, metadata: reduceSectionMetadata(action.payload.metadata, state[ action.payload.submissionId ].sections [ action.payload.sectionId ].metadata) }) }) diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts index 415e7a5be8..3757ca87b8 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts @@ -27,7 +27,8 @@ describe('SubmissionSectionCcLicensesComponent', () => { config: 'test config', mandatory: true, data: {}, - errors: [], + errorsToShow: [], + serverValidationErrors: [], header: 'test header', id: 'test section id', sectionType: SectionsType.SubmissionForm diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts index 2c185d4a4e..9e6a5ae07f 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts @@ -1,11 +1,7 @@ import { Component, Inject } from '@angular/core'; import { Observable, of as observableOf, Subscription } from 'rxjs'; -import { - Field, - Option, - SubmissionCcLicence -} from '../../../core/submission/models/submission-cc-license.model'; -import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../../core/shared/operators'; +import { Field, Option, SubmissionCcLicence } from '../../../core/submission/models/submission-cc-license.model'; +import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../../core/shared/operators'; import { distinctUntilChanged, filter, map, take } from 'rxjs/operators'; import { SubmissionCcLicenseDataService } from '../../../core/submission/submission-cc-license-data.service'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; @@ -234,7 +230,7 @@ export class SubmissionSectionCcLicensesComponent extends SectionModelComponent this.subscriptions.push( this.sectionService.getSectionState(this.submissionId, this.sectionData.id, SectionsType.CcLicense).pipe( filter((sectionState) => { - return isNotEmpty(sectionState) && (isNotEmpty(sectionState.data) || isNotEmpty(sectionState.errors)); + return isNotEmpty(sectionState) && (isNotEmpty(sectionState.data) || isNotEmpty(sectionState.errorsToShow)); }), distinctUntilChanged(), map((sectionState) => sectionState.data as WorkspaceitemSectionCcLicenseObject), diff --git a/src/app/submission/sections/container/section-container.component.html b/src/app/submission/sections/container/section-container.component.html index 8262d51f6f..28ed377c4a 100644 --- a/src/app/submission/sections/container/section-container.component.html +++ b/src/app/submission/sections/container/section-container.component.html @@ -1,5 +1,5 @@
- {{ 'submission.sections.'+sectionData.header | translate }} + {{ 'submission.sections.'+sectionData.header | translate }}
+ aria-hidden="true" title="{{'submission.sections.status.warnings.title' | translate}}"> + aria-hidden="true" title="{{'submission.sections.status.errors.title' | translate}}"> - - - + aria-hidden="true" title="{{'submission.sections.status.valid.title' | translate}}"> + + + - +
diff --git a/src/app/submission/sections/container/section-container.component.spec.ts b/src/app/submission/sections/container/section-container.component.spec.ts index 324582c0c9..7568b17ea7 100644 --- a/src/app/submission/sections/container/section-container.component.spec.ts +++ b/src/app/submission/sections/container/section-container.component.spec.ts @@ -22,11 +22,12 @@ const sectionState = { header: 'submit.progressbar.describe.stepone', config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone', mandatory: true, - sectionType: 'submission-form', + sectionType: SectionsType.SubmissionForm, collapsed: false, enabled: true, data: {}, - errors: [], + errorsToShow: [], + serverValidationErrors: [], isLoading: false, isValid: false } as any; @@ -35,7 +36,8 @@ const sectionObject: SectionDataObject = { config: 'https://dspace7.4science.it/or2018/api/config/submissionforms/traditionalpageone', mandatory: true, data: {}, - errors: [], + errorsToShow: [], + serverValidationErrors: [], header: 'submit.progressbar.describe.stepone', id: 'traditionalpageone', sectionType: SectionsType.SubmissionForm @@ -56,6 +58,7 @@ describe('SubmissionSectionContainerComponent test suite', () => { function init() { sectionsServiceStub.isSectionValid.and.returnValue(observableOf(true)); sectionsServiceStub.getSectionState.and.returnValue(observableOf(sectionState)); + sectionsServiceStub.getShownSectionErrors.and.returnValue(observableOf([])); submissionServiceStub.getActiveSectionId.and.returnValue(observableOf('traditionalpageone')); } diff --git a/src/app/submission/sections/form/section-form-operations.service.ts b/src/app/submission/sections/form/section-form-operations.service.ts index adba46bf3a..7c6c242d42 100644 --- a/src/app/submission/sections/form/section-form-operations.service.ts +++ b/src/app/submission/sections/form/section-form-operations.service.ts @@ -300,7 +300,6 @@ export class SectionFormOperationsService { const path = this.getFieldPathFromEvent(event); const value = this.getFieldValueFromChangeEvent(event); - console.log(value); if (this.formBuilder.isQualdropGroup(event.model as DynamicFormControlModel)) { this.dispatchOperationsFromMap(this.getQualdropValueMap(event), pathCombiner, event, previousValue); } else if (event.context && event.context instanceof DynamicFormArrayGroupModel) { diff --git a/src/app/submission/sections/form/section-form.component.spec.ts b/src/app/submission/sections/form/section-form.component.spec.ts index 126f7ac3f7..90861bce5e 100644 --- a/src/app/submission/sections/form/section-form.component.spec.ts +++ b/src/app/submission/sections/form/section-form.component.spec.ts @@ -44,6 +44,7 @@ import { SubmissionObjectDataService } from '../../../core/submission/submission import { ObjectCacheService } from '../../../core/cache/object-cache.service'; import { RequestService } from '../../../core/data/request.service'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; +import { cold } from 'jasmine-marbles'; function getMockSubmissionFormsConfigService(): SubmissionFormsConfigService { return jasmine.createSpyObj('FormOperationsService', { @@ -59,7 +60,8 @@ const sectionObject: SectionDataObject = { config: 'https://dspace7.4science.it/or2018/api/config/submissionforms/traditionalpageone', mandatory: true, data: {}, - errors: [], + errorsToShow: [], + serverValidationErrors: [], header: 'submit.progressbar.describe.stepone', id: 'traditionalpageone', sectionType: SectionsType.SubmissionForm @@ -200,6 +202,7 @@ describe('SubmissionSectionformComponent test suite', () => { formService.isValid.and.returnValue(observableOf(true)); formConfigService.findByHref.and.returnValue(observableOf(testFormConfiguration)); sectionsServiceStub.getSectionData.and.returnValue(observableOf(sectionData)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); const html = ` `; @@ -246,6 +249,7 @@ describe('SubmissionSectionformComponent test suite', () => { formService.isValid.and.returnValue(observableOf(true)); formConfigService.findByHref.and.returnValue(createSuccessfulRemoteDataObject$(testFormConfiguration)); sectionsServiceStub.getSectionData.and.returnValue(observableOf(sectionData)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); spyOn(comp, 'initForm'); spyOn(comp, 'subscriptions'); @@ -253,7 +257,7 @@ describe('SubmissionSectionformComponent test suite', () => { fixture.detectChanges(); expect(compAsAny.formConfig).toEqual(testFormConfiguration); - expect(comp.sectionData.errors).toEqual([]); + expect(comp.sectionData.errorsToShow).toEqual([]); expect(comp.sectionData.data).toEqual(sectionData); expect(comp.isLoading).toBeFalsy(); expect(comp.initForm).toHaveBeenCalledWith(sectionData); @@ -322,7 +326,7 @@ describe('SubmissionSectionformComponent test suite', () => { }; const sectionError = []; comp.sectionData.data = {}; - comp.sectionData.errors = []; + comp.sectionData.errorsToShow = []; compAsAny.formData = {}; compAsAny.sectionMetadata = ['dc.title']; @@ -342,7 +346,7 @@ describe('SubmissionSectionformComponent test suite', () => { 'dc.title': [new FormFieldMetadataValueObject('test')] }; comp.sectionData.data = {}; - comp.sectionData.errors = []; + comp.sectionData.errorsToShow = []; compAsAny.formData = sectionData; compAsAny.sectionMetadata = ['dc.title']; @@ -368,7 +372,8 @@ describe('SubmissionSectionformComponent test suite', () => { it('should check for error', () => { comp.isUpdating = false; comp.formId = 'test'; - comp.sectionData.errors = []; + comp.sectionData.errorsToShow = []; + comp.sectionData.serverValidationErrors = []; comp.checksForErrors(parsedSectionErrors); @@ -379,7 +384,37 @@ describe('SubmissionSectionformComponent test suite', () => { parsedSectionErrors, [] ); - expect(comp.sectionData.errors).toEqual(parsedSectionErrors); + expect(comp.sectionData.errorsToShow).toEqual(parsedSectionErrors); + }); + + it('should return a valid status when form is valid and there are no server validation errors', () => { + formService.isValid.and.returnValue(observableOf(true)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); + const expected = cold('(b|)', { + b: true + }); + + expect(compAsAny.getSectionStatus()).toBeObservable(expected); + }); + + it('should return an invalid status when form is valid and there are server validation errors', () => { + formService.isValid.and.returnValue(observableOf(true)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf(parsedSectionErrors)); + const expected = cold('(b|)', { + b: false + }); + + expect(compAsAny.getSectionStatus()).toBeObservable(expected); + }); + + it('should return an invalid status when form is not valid and there are no server validation errors', () => { + formService.isValid.and.returnValue(observableOf(false)); + sectionsServiceStub.getSectionServerErrors.and.returnValue(observableOf([])); + const expected = cold('(b|)', { + b: false + }); + + expect(compAsAny.getSectionStatus()).toBeObservable(expected); }); it('should subscribe to state properly', () => { @@ -392,7 +427,7 @@ describe('SubmissionSectionformComponent test suite', () => { }; const sectionState = { data: sectionData, - errors: parsedSectionErrors + errorsToShow: parsedSectionErrors }; formService.getFormData.and.returnValue(observableOf(formData)); @@ -402,7 +437,7 @@ describe('SubmissionSectionformComponent test suite', () => { expect(compAsAny.subs.length).toBe(2); expect(compAsAny.formData).toEqual(formData); - expect(comp.updateForm).toHaveBeenCalledWith(sectionState.data, sectionState.errors); + expect(comp.updateForm).toHaveBeenCalledWith(sectionState.data, sectionState.errorsToShow); }); diff --git a/src/app/submission/sections/form/section-form.component.ts b/src/app/submission/sections/form/section-form.component.ts index 99a2e12b47..8ae246dcca 100644 --- a/src/app/submission/sections/form/section-form.component.ts +++ b/src/app/submission/sections/form/section-form.component.ts @@ -2,15 +2,7 @@ import { ChangeDetectorRef, Component, Inject, ViewChild } from '@angular/core'; import { DynamicFormControlEvent, DynamicFormControlModel } from '@ng-dynamic-forms/core'; import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { - distinctUntilChanged, - filter, - find, - map, - take, - tap, - mergeMap -} from 'rxjs/operators'; +import { distinctUntilChanged, filter, find, map, mergeMap, take, tap } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { findIndex, isEqual } from 'lodash'; @@ -19,7 +11,7 @@ import { FormComponent } from '../../../shared/form/form.component'; import { FormService } from '../../../shared/form/form.service'; import { SectionModelComponent } from '../models/section.model'; import { SubmissionFormsConfigService } from '../../../core/config/submission-forms-config.service'; -import { hasValue, isNotEmpty, isUndefined } from '../../../shared/empty.util'; +import { hasValue, isEmpty, isNotEmpty, isUndefined } from '../../../shared/empty.util'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { SubmissionFormsModel } from '../../../core/config/models/config-submission-forms.model'; import { SubmissionSectionError, SubmissionSectionObject } from '../../objects/submission-objects.reducer'; @@ -183,7 +175,7 @@ export class SubmissionSectionformComponent extends SectionModelComponent { take(1)) .subscribe(([sectionData, workspaceItem]: [WorkspaceitemSectionFormObject, WorkspaceItem]) => { if (isUndefined(this.formModel)) { - this.sectionData.errors = []; + // this.sectionData.errorsToShow = []; this.workspaceItem = workspaceItem; // Is the first loading so init form this.initForm(sectionData); @@ -211,7 +203,14 @@ export class SubmissionSectionformComponent extends SectionModelComponent { * the section status */ protected getSectionStatus(): Observable { - return this.formService.isValid(this.formId); + const formStatus$ = this.formService.isValid(this.formId); + const serverValidationStatus$ = this.sectionService.getSectionServerErrors(this.submissionId, this.sectionData.id).pipe( + map((validationErrors) => isEmpty(validationErrors)) + ); + + return observableCombineLatest([formStatus$, serverValidationStatus$]).pipe( + map(([formValidation, serverSideValidation]: [boolean, boolean]) => formValidation && serverSideValidation) + ); } /** @@ -263,7 +262,7 @@ export class SubmissionSectionformComponent extends SectionModelComponent { this.submissionService.getSubmissionScope() ); const sectionMetadata = this.sectionService.computeSectionConfiguredMetadata(this.formConfig); - this.sectionService.updateSectionData(this.submissionId, this.sectionData.id, sectionData, [], sectionMetadata); + this.sectionService.updateSectionData(this.submissionId, this.sectionData.id, sectionData, this.sectionData.errorsToShow, this.sectionData.serverValidationErrors, sectionMetadata); } catch (e) { const msg: string = this.translate.instant('error.submission.sections.init-form-error') + e.toString(); @@ -296,10 +295,10 @@ export class SubmissionSectionformComponent extends SectionModelComponent { this.checksForErrors(errors); this.isUpdating = false; this.cdr.detectChanges(); - } else if (isNotEmpty(errors) || isNotEmpty(this.sectionData.errors)) { + } else if (isNotEmpty(errors) || isNotEmpty(this.sectionData.errorsToShow)) { this.checksForErrors(errors); } - } else if (isNotEmpty(errors) || isNotEmpty(this.sectionData.errors)) { + } else if (isNotEmpty(errors) || isNotEmpty(this.sectionData.errorsToShow)) { this.checksForErrors(errors); } @@ -315,8 +314,8 @@ export class SubmissionSectionformComponent extends SectionModelComponent { this.formService.isFormInitialized(this.formId).pipe( find((status: boolean) => status === true && !this.isUpdating)) .subscribe(() => { - this.sectionService.checkSectionErrors(this.submissionId, this.sectionData.id, this.formId, errors, this.sectionData.errors); - this.sectionData.errors = errors; + this.sectionService.checkSectionErrors(this.submissionId, this.sectionData.id, this.formId, errors, this.sectionData.errorsToShow); + this.sectionData.errorsToShow = errors; this.cdr.detectChanges(); }); } @@ -340,13 +339,13 @@ export class SubmissionSectionformComponent extends SectionModelComponent { */ this.sectionService.getSectionState(this.submissionId, this.sectionData.id, this.sectionData.sectionType).pipe( filter((sectionState: SubmissionSectionObject) => { - return isNotEmpty(sectionState) && (isNotEmpty(sectionState.data) || isNotEmpty(sectionState.errors)); + return isNotEmpty(sectionState) && (isNotEmpty(sectionState.data) || isNotEmpty(sectionState.errorsToShow)); }), distinctUntilChanged()) .subscribe((sectionState: SubmissionSectionObject) => { this.fieldsOnTheirWayToBeRemoved = new Map(); this.sectionMetadata = sectionState.metadata; - this.updateForm(sectionState.data as WorkspaceitemSectionFormObject, sectionState.errors); + this.updateForm(sectionState.data as WorkspaceitemSectionFormObject, sectionState.errorsToShow); }) ); } @@ -367,11 +366,22 @@ export class SubmissionSectionformComponent extends SectionModelComponent { const metadata = this.formOperationsService.getFieldPathSegmentedFromChangeEvent(event); const value = this.formOperationsService.getFieldValueFromChangeEvent(event); - if (environment.submission.autosave.metadata.indexOf(metadata) !== -1 && isNotEmpty(value)) { + if ((environment.submission.autosave.metadata.indexOf(metadata) !== -1 && isNotEmpty(value)) || this.hasRelatedCustomError(metadata)) { this.submissionService.dispatchSave(this.submissionId); } } + private hasRelatedCustomError(medatata): boolean { + const index = findIndex(this.sectionData.errorsToShow, {path: this.pathCombiner.getPath(medatata).path}); + if (index !== -1) { + const error = this.sectionData.errorsToShow[index]; + const validator = error.message.replace('error.validation.', ''); + return !environment.form.validatorMap.hasOwnProperty(validator); + } else { + return false; + } + } + /** * Method called when a form dfFocus event is fired. * Initialize [FormFieldPreviousValueObject] instance. diff --git a/src/app/submission/sections/license/section-license.component.spec.ts b/src/app/submission/sections/license/section-license.component.spec.ts index 1dd9f36fe5..f7a3895052 100644 --- a/src/app/submission/sections/license/section-license.component.spec.ts +++ b/src/app/submission/sections/license/section-license.component.spec.ts @@ -70,7 +70,8 @@ const sectionObject: SectionDataObject = { acceptanceDate: null, granted: false }, - errors: [], + errorsToShow: [], + serverValidationErrors: [], header: 'submit.progressbar.describe.license', id: 'license', sectionType: SectionsType.License diff --git a/src/app/submission/sections/models/section-data.model.ts b/src/app/submission/sections/models/section-data.model.ts index 8feb78fa69..9078b5dfb9 100644 --- a/src/app/submission/sections/models/section-data.model.ts +++ b/src/app/submission/sections/models/section-data.model.ts @@ -18,9 +18,14 @@ export interface SectionDataObject { data: WorkspaceitemSectionDataType; /** - * The list of the section errors + * The list of the section's errors to show */ - errors: SubmissionSectionError[]; + errorsToShow: SubmissionSectionError[]; + + /** + * The list of the section's errors detected by the server + */ + serverValidationErrors: SubmissionSectionError[]; /** * The section header diff --git a/src/app/submission/sections/sections.directive.ts b/src/app/submission/sections/sections.directive.ts index ab7f01eeb0..a42cd4be78 100644 --- a/src/app/submission/sections/sections.directive.ts +++ b/src/app/submission/sections/sections.directive.ts @@ -6,7 +6,7 @@ import { uniq } from 'lodash'; import { SectionsService } from './sections.service'; import { hasValue, isNotEmpty, isNotNull } from '../../shared/empty.util'; -import { SubmissionSectionError, SubmissionSectionObject } from '../objects/submission-objects.reducer'; +import { SubmissionSectionError } from '../objects/submission-objects.reducer'; import parseSectionErrorPaths, { SectionErrorPath } from '../utils/parseSectionErrorPaths'; import { SubmissionService } from '../submission.service'; import { SectionsType } from './sections-type'; @@ -111,8 +111,7 @@ export class SectionsDirective implements OnDestroy, OnInit { })); this.subs.push( - this.sectionService.getSectionState(this.submissionId, this.sectionId, this.sectionType).pipe( - map((state: SubmissionSectionObject) => state.errors)) + this.sectionService.getShownSectionErrors(this.submissionId, this.sectionId, this.sectionType) .subscribe((errors: SubmissionSectionError[]) => { if (isNotEmpty(errors)) { errors.forEach((errorItem: SubmissionSectionError) => { diff --git a/src/app/submission/sections/sections.service.spec.ts b/src/app/submission/sections/sections.service.spec.ts index d199f1beae..9fbcedcc4d 100644 --- a/src/app/submission/sections/sections.service.spec.ts +++ b/src/app/submission/sections/sections.service.spec.ts @@ -28,13 +28,15 @@ import { SectionStatusChangeAction, UpdateSectionDataAction } from '../objects/submission-objects.actions'; -import { FormAddError, FormClearErrorsAction, FormRemoveErrorAction } from '../../shared/form/form.actions'; +import { FormClearErrorsAction } from '../../shared/form/form.actions'; import parseSectionErrors from '../utils/parseSectionErrors'; import { SubmissionScopeType } from '../../core/submission/submission-scope-type'; import { SubmissionSectionError } from '../objects/submission-objects.reducer'; import { getMockScrollToService } from '../../shared/mocks/scroll-to-service.mock'; import { storeModuleConfig } from '../../app.reducer'; import { SectionsType } from './sections-type'; +import { FormService } from '../../shared/form/form.service'; +import { getMockFormService } from '../../shared/mocks/form-service.mock'; describe('SectionsService test suite', () => { let notificationsServiceStub: NotificationsServiceStub; @@ -57,6 +59,8 @@ describe('SectionsService test suite', () => { select: jasmine.createSpy('select') }); + const formService: any = getMockFormService(); + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ @@ -74,6 +78,7 @@ describe('SectionsService test suite', () => { { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: TranslateService, useValue: getMockTranslateService() }, { provide: Store, useValue: store }, + { provide: FormService, useValue: formService }, SectionsService ] }).compileComponents(); @@ -98,22 +103,23 @@ describe('SectionsService test suite', () => { it('should dispatch a new FormAddError for each section\'s error', () => { service.checkSectionErrors(submissionId, sectionId, formId, sectionErrors[sectionId]); - expect(store.dispatch).toHaveBeenCalledWith(new FormAddError( + expect(formService.addError).toHaveBeenCalledWith( formId, - 'dc_contributor_author', + 'dc.contributor.author', 0, - 'error.validation.required')); + 'error.validation.required'); - expect(store.dispatch).toHaveBeenCalledWith(new FormAddError( + expect(formService.addError).toHaveBeenCalledWith( formId, - 'dc_title', + 'dc.title', 0, - 'error.validation.required')); + 'error.validation.required'); - expect(store.dispatch).toHaveBeenCalledWith(new FormAddError(formId, - 'dc_date_issued', + expect(formService.addError).toHaveBeenCalledWith( + formId, + 'dc.date.issued', 0, - 'error.validation.required')); + 'error.validation.required'); }); it('should dispatch a new FormRemoveErrorAction for each section\'s error that no longer exists', () => { @@ -123,21 +129,21 @@ describe('SectionsService test suite', () => { service.checkSectionErrors(submissionId, sectionId, formId, currentErrors, prevErrors); - expect(store.dispatch).toHaveBeenCalledWith(new FormAddError( + expect(formService.addError).toHaveBeenCalledWith( formId, - 'dc_contributor_author', + 'dc.contributor.author', 0, - 'error.validation.required')); + 'error.validation.required'); - expect(store.dispatch).toHaveBeenCalledWith(new FormAddError( + expect(formService.addError).toHaveBeenCalledWith( formId, - 'dc_title', + 'dc.title', 0, - 'error.validation.required')); - expect(store.dispatch).toHaveBeenCalledWith(new FormRemoveErrorAction( + 'error.validation.required'); + expect(formService.removeError).toHaveBeenCalledWith( formId, - 'dc_date_issued', - 0)); + 'dc.date.issued', + 0); }); }); @@ -417,7 +423,7 @@ describe('SectionsService test suite', () => { scheduler.schedule(() => service.updateSectionData(submissionId, sectionId, data, [])); scheduler.flush(); - expect(store.dispatch).toHaveBeenCalledWith(new UpdateSectionDataAction(submissionId, sectionId, data, [])); + expect(store.dispatch).toHaveBeenCalledWith(new UpdateSectionDataAction(submissionId, sectionId, data, [], [])); }); it('should dispatch a new UpdateSectionDataAction and display a new notification when section is not enabled', () => { @@ -429,7 +435,7 @@ describe('SectionsService test suite', () => { scheduler.schedule(() => service.updateSectionData(submissionId, sectionId, data, [])); scheduler.flush(); - expect(store.dispatch).toHaveBeenCalledWith(new UpdateSectionDataAction(submissionId, sectionId, data, [])); + expect(store.dispatch).toHaveBeenCalledWith(new UpdateSectionDataAction(submissionId, sectionId, data, [], [])); }); }); diff --git a/src/app/submission/sections/sections.service.ts b/src/app/submission/sections/sections.service.ts index 05e9a96267..dd68d42a87 100644 --- a/src/app/submission/sections/sections.service.ts +++ b/src/app/submission/sections/sections.service.ts @@ -1,11 +1,11 @@ import { Injectable } from '@angular/core'; import { combineLatest, Observable } from 'rxjs'; -import { distinctUntilChanged, filter, map, take } from 'rxjs/operators'; +import { distinctUntilChanged, filter, map, mergeMap, take } from 'rxjs/operators'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ScrollToConfigOptions, ScrollToService } from '@nicky-lenaers/ngx-scroll-to'; -import { findKey, isEqual } from 'lodash'; +import { findIndex, findKey, isEqual } from 'lodash'; import { SubmissionState } from '../submission.reducers'; import { hasValue, isEmpty, isNotEmpty, isNotUndefined } from '../../shared/empty.util'; @@ -27,11 +27,12 @@ import { submissionObjectFromIdSelector, submissionSectionDataFromIdSelector, submissionSectionErrorsFromIdSelector, - submissionSectionFromIdSelector + submissionSectionFromIdSelector, + submissionSectionServerErrorsFromIdSelector } from '../selectors'; import { SubmissionScopeType } from '../../core/submission/submission-scope-type'; import parseSectionErrorPaths, { SectionErrorPath } from '../utils/parseSectionErrorPaths'; -import { FormAddError, FormClearErrorsAction, FormRemoveErrorAction } from '../../shared/form/form.actions'; +import { FormClearErrorsAction } from '../../shared/form/form.actions'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { SubmissionService } from '../submission.service'; import { WorkspaceitemSectionDataType } from '../../core/submission/models/workspaceitem-sections.model'; @@ -39,6 +40,9 @@ import { SectionsType } from './sections-type'; import { normalizeSectionData } from '../../core/submission/submission-response-parsing.service'; import { SubmissionFormsModel } from '../../core/config/models/config-submission-forms.model'; import { parseReviver } from '@ng-dynamic-forms/core'; +import { FormService } from '../../shared/form/form.service'; +import { JsonPatchOperationPathCombiner } from '../../core/json-patch/builder/json-patch-operation-path-combiner'; +import { FormError } from '../../shared/form/form.reducer'; /** * A service that provides methods used in submission process. @@ -48,13 +52,15 @@ export class SectionsService { /** * Initialize service variables + * @param {FormService} formService * @param {NotificationsService} notificationsService * @param {ScrollToService} scrollToService * @param {SubmissionService} submissionService * @param {Store} store * @param {TranslateService} translate */ - constructor(private notificationsService: NotificationsService, + constructor(private formService: FormService, + private notificationsService: NotificationsService, private scrollToService: ScrollToService, private submissionService: SubmissionService, private store: Store, @@ -95,12 +101,9 @@ export class SectionsService { errorPaths.forEach((path: SectionErrorPath) => { if (path.fieldId) { - const fieldId = path.fieldId.replace(/\./g, '_'); - // Dispatch action to add form error to the state; - const formAddErrorAction = new FormAddError(formId, fieldId, path.fieldIndex, error.message); - this.store.dispatch(formAddErrorAction); - dispatchedErrors.push(fieldId); + this.formService.addError(formId, path.fieldId, path.fieldIndex, error.message); + dispatchedErrors.push(path.fieldId); } }); }); @@ -111,12 +114,9 @@ export class SectionsService { errorPaths.forEach((path: SectionErrorPath) => { if (path.fieldId) { - const fieldId = path.fieldId.replace(/\./g, '_'); - - if (!dispatchedErrors.includes(fieldId)) { + if (!dispatchedErrors.includes(path.fieldId)) { // Dispatch action to remove form error from the state; - const formRemoveErrorAction = new FormRemoveErrorAction(formId, fieldId, path.fieldIndex); - this.store.dispatch(formRemoveErrorAction); + this.formService.removeError(formId, path.fieldId, path.fieldIndex); } } }); @@ -174,7 +174,40 @@ export class SectionsService { } /** - * Return the error list object data for the specified section + * Get the list of validation errors present in the given section + * + * @param submissionId + * The submission id + * @param sectionId + * The section id + * @param sectionType + * The type of section for which retrieve errors + */ + getShownSectionErrors(submissionId: string, sectionId: string, sectionType: SectionsType): Observable { + let errorsState$: Observable; + if (sectionType !== SectionsType.SubmissionForm) { + errorsState$ = this.getSectionErrors(submissionId, sectionId); + } else { + errorsState$ = this.getSectionState(submissionId, sectionId, sectionType).pipe( + mergeMap((state: SubmissionSectionObject) => this.formService.getFormErrors(state.formId).pipe( + map((formErrors: FormError[]) => { + const pathCombiner = new JsonPatchOperationPathCombiner('sections', sectionId); + const sectionErrors = formErrors + .map((error) => ({ + path: pathCombiner.getPath(error.fieldId.replace(/\_/g, '.')).path, + message: error.message + } as SubmissionSectionError)) + .filter((sectionError: SubmissionSectionError) => findIndex(state.errorsToShow, {path: sectionError.path}) === -1); + return [...state.errorsToShow, ...sectionErrors]; + }) + )) + ); + } + + return errorsState$; + } + /** + * Return the error list to show for the specified section * * @param submissionId * The submission id @@ -188,6 +221,21 @@ export class SectionsService { distinctUntilChanged()); } + /** + * Return the error list detected by the server for the specified section + * + * @param submissionId + * The submission id + * @param sectionId + * The section id + * @return Observable + * observable of array of [SubmissionSectionError] + */ + public getSectionServerErrors(submissionId: string, sectionId: string): Observable { + return this.store.select(submissionSectionServerErrorsFromIdSelector(submissionId, sectionId)).pipe( + distinctUntilChanged()); + } + /** * Return the state object for the specified section * @@ -383,12 +431,23 @@ export class SectionsService { * The section id * @param data * The section data - * @param errors - * The list of section errors + * @param errorsToShow + * The list of the section's errors to show. It contains the error list + * to display when section is not pristine + * @param serverValidationErrors + * The list of the section's errors detected by the server. + * They may not be shown yet if section is pristine * @param metadata * The section metadata */ - public updateSectionData(submissionId: string, sectionId: string, data: WorkspaceitemSectionDataType, errors: SubmissionSectionError[] = [], metadata?: string[]) { + public updateSectionData( + submissionId: string, + sectionId: string, + data: WorkspaceitemSectionDataType, + errorsToShow: SubmissionSectionError[] = [], + serverValidationErrors: SubmissionSectionError[] = [], + metadata?: string[] + ) { if (isNotEmpty(data)) { const isAvailable$ = this.isSectionAvailable(submissionId, sectionId); const isEnabled$ = this.isSectionEnabled(submissionId, sectionId); @@ -397,7 +456,7 @@ export class SectionsService { take(1), filter(([available, enabled]: [boolean, boolean]) => available)) .subscribe(([available, enabled]: [boolean, boolean]) => { - this.store.dispatch(new UpdateSectionDataAction(submissionId, sectionId, data, errors, metadata)); + this.store.dispatch(new UpdateSectionDataAction(submissionId, sectionId, data, errorsToShow, serverValidationErrors, metadata)); }); } } diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 3275787984..96725f151e 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -244,9 +244,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges { if (metadataModel.type === DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER) { const date = new Date(accessCondition[key]); metadataModel.value = { - year: date.getFullYear(), - month: date.getMonth() + 1, - day: date.getDate() + year: date.getUTCFullYear(), + month: date.getUTCMonth() + 1, + day: date.getUTCDate() }; } else { metadataModel.value = accessCondition[key]; @@ -302,9 +302,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges { const min = new Date(accessCondition.maxStartDate); startDateModel.max = { - year: min.getFullYear(), - month: min.getMonth() + 1, - day: min.getDate() + year: min.getUTCFullYear(), + month: min.getUTCMonth() + 1, + day: min.getUTCDate() }; } if (accessCondition.hasEndDate) { @@ -314,9 +314,9 @@ export class SubmissionSectionUploadFileEditComponent implements OnChanges { const max = new Date(accessCondition.maxEndDate); endDateModel.max = { - year: max.getFullYear(), - month: max.getMonth() + 1, - day: max.getDate() + year: max.getUTCFullYear(), + month: max.getUTCMonth() + 1, + day: max.getUTCDate() }; } } diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.html b/src/app/submission/sections/upload/file/section-upload-file.component.html index 221d396a39..09c062d191 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.html +++ b/src/app/submission/sections/upload/file/section-upload-file.component.html @@ -13,8 +13,14 @@ - + - - + +