Skip to content

Conversation

@Atmire-Kristof
Copy link
Contributor

@Atmire-Kristof Atmire-Kristof commented Jul 2, 2020

References

This PR closes #662

Description

This PR adds the ability to edit the template item of collections.
This PR is something we created a while back, but was never completely finished due to the reduced priority of the item template feature. However, this PR fixes issue #662, so we'd like to contribute this now.

Instructions for Reviewers

Changes made:

  • Added ItemTemplateDataService
  • Added EditItemTemplatePageComponent at route /collection/${collection-uuid}/itemtemplate. This page displays the metadata of the collection's template item and the ability to edit them (similar to edit metadata of a regular item, it uses the same child component)
  • Added template item section on top of the edit metadata page of a collection. When no template item is present yet, an "Add" button is displayed. Clicking this button will create a template item and redirect the user to the edit page. When a template item is present, an "Edit" and "Delete" button will be displayed.

How to test:

  • Go to a collection's edit page
  • Create a new template item and edit some of its metadata
  • Go back to the collection's edit page, it should now show an "Edit" and "Delete" button
  • Clicking "Edit" should bring you back to the edit metadata page of the template item
  • Clicking "Delete" should delete the template item
  • Starting a new submission in a collection that contains a template item should fill in the metadata from the template item automatically into the new submission. But that doesn't work at the moment: Collection template item metadata not used in the submission UI #748. That's unrelated to this PR

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes TSLint validation using yarn run lint
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs for any bug fixes, improvements or new features. A few reminders about what constitutes good tests:
    • Include tests for different user types (if behavior differs), including: (1) Anonymous user, (2) Logged in user (non-admin), and (3) Administrator.
    • Include tests for error scenarios, e.g. when errors/warnings should appear (or buttons should be disabled).
    • For bug fixes, include a test that reproduces the bug and proves it is fixed. For clarity, it may be useful to provide the test in a separate commit from the bug fix.
  • If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

Conflicts:
	resources/i18n/en.json5
	src/app/+collection-page/collection-page-routing.module.ts
	src/app/+collection-page/collection-page.module.ts
	src/app/core/core.module.ts
	src/app/core/data/data.service.ts
	src/app/shared/shared.module.ts
Conflicts:
	resources/i18n/en.json5
	src/app/+collection-page/collection-page.module.ts
	src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.html
	src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts
	src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts
	src/app/core/core.module.ts
	src/app/core/data/data.service.ts
	src/app/shared/shared.module.ts
… keep them stored in the object-updates store
Conflicts:
	src/app/+collection-page/collection-page-routing.module.ts
	src/app/+item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts
	src/app/+item-page/edit-item-page/edit-item-page.module.ts
	src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts
	src/app/core/cache/server-sync-buffer.effects.ts
	src/app/core/core.module.ts
	src/app/core/data/data.service.ts
	src/app/core/data/dso-change-analyzer.service.ts
	src/app/core/data/object-updates/object-updates.service.ts
Conflicts:
	src/app/+collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts
	src/app/+item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts
	src/app/+item-page/edit-item-page/edit-item-page.module.ts
	src/app/+item-page/edit-item-page/item-metadata/item-metadata.component.ts
	src/app/core/core.module.ts
	src/app/core/data/data.service.ts
Conflicts:
	src/app/core/auth/auth-request.service.ts
	src/app/core/core.module.ts
@lgtm-com
Copy link

lgtm-com bot commented Jul 2, 2020

This pull request introduces 3 alerts and fixes 7 when merging b77fd69 into 2fe9965 - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

fixed alerts:

  • 7 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Jul 2, 2020

This pull request fixes 10 alerts when merging 92e47de into 2fe9965 - view on LGTM.com

fixed alerts:

  • 10 for Unused variable, import, function or class

@tdonohue tdonohue added this to the 7.0beta3 milestone Jul 2, 2020
@tdonohue tdonohue self-requested a review July 2, 2020 14:13
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Jul 2, 2020
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me. I've tested and this both fixes #662 and adds in Item Template functionality. The Item Template functionality works as described, though there are two known bugs (already created): #750 (which is referenced by TODOs in the code) and #748 (which is out of scope for this PR)

@tdonohue tdonohue merged commit b731301 into DSpace:master Jul 2, 2020
kosarko pushed a commit to ufal/dspace-angular that referenced this pull request Dec 4, 2024
…it was changed in the autocomplete enhnancement (DSpace#749)
kosarko added a commit to ufal/dspace-angular that referenced this pull request Jun 25, 2025
* Removed dynamic overflow because every content must be scrollable.. (DSpace#716)

* add tar for preview (DSpace#713)

* add tar for preview

* UFAL/Enhanced type-bind feature (DSpace#714)

* The type-bind is loaded from the cfg and correctly rendered

* Done some refactoring

* Update tests following the type-bind enhancement

* Fixed linting error.

* Removed unwanted changes and fixed wrong refactored code.

* Updated error message when tests failed

* Update README.md

* UFAL/Show sesznam license on approval page (DSpace#722)

* Added static files from the SEZNAM license.

* Refactored fetching html content from the static files. The logic was moved into the common service.

* Show Seznam static license on approval page.

* Updated constant name LICENSE_NAME_SEZNAM - added the _CZ to make it more clear that is Czech license

* UFAL/share submission by email (DSpace#720)

* Added share submission button into workspaceitem actions page.

* Added notification about the success of the sharing the submission.

* Created share submission module, page with routing. That page could access only the administrator.

* WIP - created a new page `change-submitter-page`.

* Created page when the user could take the workspace item as its own.

* Pretified the code and added some docs

* Updated tests following the new feature

* Fixed unwanted changes, updated docs

* UFAL/Autocomplete enhancement (DSpace#718)

* Added support for searching results from specific solr indexes.

Updated autocomplete component to search values from custom solr index. The autocomplete component could have attribute for resolving the custom index from the submission-forms definition.

* Show suggestions for `solr-handle_title_ac` and `solr-subject_ac`

* Fixed tests

* Formatted language suggestions, added docs and fixed tests.

* Refactored the code following the review requirements.

* Fixed type in the word pretify

* UFAL/License page - wrong layout in Firefox (DSpace#721)

* Removed flex class and used width style instead of col

* Removed unsued class

* Changed style in the html into classes

* Migrated Vanilla cs messages into clarin 7.6.1. cs messages (DSpace#669)

* Migrated Vanilla cs messages into clarin 7.6.1. cs messages

* updated translation

* Updated cs localization for subcommunities and subcollections

* Changed `prispeveku` to `prispevku`

* Updated messages for the 'supervised' and 'claim' sentenses

---------

Co-authored-by: Ondrej Kosarko <[email protected]>

* UFAL/Share submission with user not only admin (DSpace#728)

* The submitter information cannot be displayed in some cases, but show a few information about the Item

* Added missing trailing comma

* Fixed docs

* Updated messages following last commit to upstream. (DSpace#731)

* Updated dspace prefix to lindat (DSpace#734)

* Added notification when the shibboleth authentication is failed (DSpace#732)

* Removed two IT: (DSpace#737)

1. Author does not have a two input fields.
2. Test for checking the notice step will be transformed into UI test, because we do not want to keep such specific collection for generic IT.

* Update all static licenses (DSpace#726)

* added licenses from ufal commit dcbe87e02931dee78b13c4b3995a6cef3aeacd32

* added missing static licenses

* remove static from licenses path

* no_static_ as const

* checkstyle

* Use NAMESPACES from the .env (DSpace#727)

* Use NAMESPACES from the .env

* Created symbolic link for the tomcat folder

* Updated docker compose files - can load more properties from the `.env`

* Update deploy.yml to increase timeout (DSpace#738)

Because some tests were canceled during processing.

* Use only 4000, not the {UI_PORT} from the .env because in the container it is always 4000 (DSpace#740)

* Update docker-compose-rest.yml

Uncommented /repository/ namespace in the docker-compose.yml.
It is only for one deploy.

* Update docker-compose-rest.yml

Undo exposing server on the /repository/ path

* Use only / and /server namespaces, not the values from the .env because in the container it is always `/` and `/server` (DSpace#741)

* Expose tomcat `/server` on `/repository/server`

* Take a customized docker-compose-rest.yml which exposes the server on /repository/server

* Updated a path to take right docker-compose files

* Undo using only default namespaced `/` and `/server`

* Use custom `docker-compose.yml` from the testing server

* UFAL/Shibboleth fixed wrong redirect after login with verification token (DSpace#733)

* Used hardredirect instead of the standard router.redirect because the user could be stucked on the loading page

* Added doc why

* Added missing whitespace

* Use path `./assets` instead of `/assets` (DSpace#742)

* new download instruction for cmd using zip from backend (DSpace#739)

* Get UI base URL from BE (DSpace#744)

* Check that the custom type bind field in configured in the `submission-forms` when it is configured in the cfg property (DSpace#745)

* Searching by type is changed to 'type' instead of 'itemtype' because it was changed in the autocomplete enhnancement (DSpace#749)

* Use `autoLogin` method (DSpace#747)

* UFAL/Matomo statistics using angulartics2 (DSpace#748)

* Modified matomo tracking in footer component

* Do not use routerless Matomo because we want to track view on every page redirect

* The Matomo statistics are tracked properly.

* Prettyfied the code

* Fix linting error

* Fixed unit tests following the matomo statistics update

* Fixed linting error

* Added a document title in the footer

* Added category to the eventTrack because it is required for the Matomo.

* Refactored using matomo statistics - added into browser init service, because the Matomo statistics wasn't rendered on production

* Changed matomo-settings location

---------

Co-authored-by: Matus Kasak <[email protected]>

* Update db-import action

Try a commit when the import worked.

* Update import-db action - use main branch

* Added a translation for the searching filter `subjectFirstValue` (redirect from home page). (DSpace#752)

* Ensure the redirect URL starts with a slash (DSpace#753)

* Added volume into docker-compose (DSpace#754)

* UFAL/Load the matomo configuration from the environment (DSpace#755)

* Added volume into docker-compose

* Take a matomo configuration from the environment

* Fetch the matomo properties from the config, not from the environment (DSpace#756)

* Load the szn license in oninit method (DSpace#757)

* UFAL/Temporary fix for the type-bind. The form automatically refreshes after the type is changed. (DSpace#761)

* The Save action is automatically dispatched when the type is changed

* Updated the handleFormSave method name to `dispatchFormSaveAndReinitialize`

* Added missing function to mock object

* Execute autoregistration component only in client side (DSpace#762)

* The Autocomplete Component is dynamically loaded as a standalone component only in the browser using the Loader component. (DSpace#763)

* UFAL/footer header images (DSpace#760)

* Footer images upload to assets/images/footer/ and change of images src attributes

* Changed src paths to start with ./

---------

Co-authored-by: Juraj Roka <[email protected]>

* ufal/customize the footer (DSpace#759)

* Footer details update by Lindat live instance's footer

* Copied UI tests fix from the dtq-dev

---------

Co-authored-by: Juraj Roka <[email protected]>
Co-authored-by: milanmajchrak <[email protected]>

---------

Co-authored-by: Paurikova2 <[email protected]>
Co-authored-by: Jozef Misutka <[email protected]>
Co-authored-by: Ondrej Kosarko <[email protected]>
Co-authored-by: Matus Kasak <[email protected]>
Co-authored-by: jurinecko <[email protected]>
Co-authored-by: Juraj Roka <[email protected]>
kosarko added a commit to ufal/dspace-angular that referenced this pull request Jun 25, 2025
* Removed dynamic overflow because every content must be scrollable.. (DSpace#716)

* add tar for preview (DSpace#713)

* UFAL/Enhanced type-bind feature (DSpace#714)

* The type-bind is loaded from the cfg and correctly rendered

* Done some refactoring

* Update tests following the type-bind enhancement

* Removed unwanted changes and fixed wrong refactored code.

* Updated error message when tests failed

* Update README.md

* UFAL/Show sesznam license on approval page (DSpace#722)

* Added static files from the SEZNAM license.

* Refactored fetching html content from the static files. The logic was moved into the common service.

* Show Seznam static license on approval page.

* Updated constant name LICENSE_NAME_SEZNAM - added the _CZ to make it more clear that is Czech license

* UFAL/share submission by email (DSpace#720)

* Added share submission button into workspaceitem actions page.

* Added notification about the success of the sharing the submission.

* Created share submission module, page with routing. That page could access only the administrator.

* WIP - created a new page `change-submitter-page`.

* Created page when the user could take the workspace item as its own.

* Pretified the code and added some docs

* Updated tests following the new feature

* Fixed unwanted changes, updated docs

* UFAL/Autocomplete enhancement (DSpace#718)

* Added support for searching results from specific solr indexes.

* Updated autocomplete component to search values from custom solr index. The autocomplete component could have attribute for resolving the custom index from the submission-forms definition.

* Show suggestions for `solr-handle_title_ac` and `solr-subject_ac`

* Formatted language suggestions, added docs and fixed tests.

* Refactored the code following the review requirements.

* Fixed type in the word prettify

* UFAL/License page - wrong layout in Firefox (DSpace#721)

* Removed flex class and used width style instead of col

* Removed unused class

* Changed style in the html into classes

* Migrated Vanilla cs messages into clarin 7.6.1. cs messages (DSpace#669)

* Migrated Vanilla cs messages into clarin 7.6.1. cs messages

* updated translation

* Updated cs localization for subcommunities and subcollections

* Changed `prispeveku` to `prispevku`

* Updated messages for the 'supervised' and 'claim' sentenses

---------

Co-authored-by: Ondrej Kosarko <[email protected]>

* UFAL/Share submission with user not only admin (DSpace#728)

* The submitter information cannot be displayed in some cases, but show a few information about the Item

* Added missing trailing comma

* Updated messages following last commit to upstream. (DSpace#731)

* Updated dspace prefix to lindat (DSpace#734)

* Added notification when the shibboleth authentication is failed (DSpace#732)

* Removed two IT: (DSpace#737)

1. Author does not have a two input fields.
2. Test for checking the notice step will be transformed into UI test, because we do not want to keep such specific collection for generic IT.

* Update all static licenses (DSpace#726)

* added licenses from ufal commit dcbe87e02931dee78b13c4b3995a6cef3aeacd32

* added missing static licenses

* remove static from licenses path

* no_static_ as const

* Use NAMESPACES from the .env (DSpace#727)

* Created symbolic link for the tomcat folder

* Updated docker compose files - can load more properties from the `.env`

* Update deploy.yml to increase timeout (DSpace#738)

Because some tests were canceled during processing.

* Use only 4000, not the {UI_PORT} from the .env because in the container it is always 4000 (DSpace#740)

* Update docker-compose-rest.yml

Uncommented /repository/ namespace in the docker-compose.yml.
It is only for one deploy.

* Update docker-compose-rest.yml

Undo exposing server on the /repository/ path

* Use only / and /server namespaces, not the values from the .env because in the container it is always `/` and `/server` (DSpace#741)

* Expose tomcat `/server` on `/repository/server`

* Take a customized docker-compose-rest.yml which exposes the server on /repository/server

* Updated a path to take right docker-compose files

* Undo using only default namespaced `/` and `/server`

* Use custom `docker-compose.yml` from the testing server

* UFAL/Shibboleth fixed wrong redirect after login with verification token (DSpace#733)

* Used hardredirect instead of the standard router.redirect because the user could be stucked on the loading page

* Added missing whitespace

* Use path `./assets` instead of `/assets` (DSpace#742)

* new download instruction for cmd using zip from backend (DSpace#739)

* Get UI base URL from BE (DSpace#744)

* Check that the custom type bind field in configured in the `submission-forms` when it is configured in the cfg property (DSpace#745)

* Searching by type is changed to 'type' instead of 'itemtype' because it was changed in the autocomplete enhnancement (DSpace#749)

* Use `autoLogin` method (DSpace#747)

* UFAL/Matomo statistics using angulartics2 (DSpace#748)

* Modified matomo tracking in footer component

* Do not use routerless Matomo because we want to track view on every page redirect

* The Matomo statistics are tracked properly.

* Prettified the code

* Fixed unit tests following the matomo statistics update

* Added a document title in the footer

* Added category to the eventTrack because it is required for the Matomo.

* Refactored using matomo statistics - added into browser init service, because the Matomo statistics wasn't rendered on production

* Changed matomo-settings location

---------

Co-authored-by: Matus Kasak <[email protected]>

* Update db-import action

Try a commit when the import worked.

* Update import-db action - use main branch

* Added a translation for the searching filter `subjectFirstValue` (redirect from home page). (DSpace#752)

* Ensure the redirect URL starts with a slash (DSpace#753)

* Added volume into docker-compose (DSpace#754)

* UFAL/Load the matomo configuration from the environment (DSpace#755)

* Added volume into docker-compose

* Take a matomo configuration from the environment

* Fetch the matomo properties from the config, not from the environment (DSpace#756)

* Load the szn license in oninit method (DSpace#757)

* UFAL/Temporary fix for the type-bind. The form automatically refreshes after the type is changed. (DSpace#761)

* The Save action is automatically dispatched when the type is changed

* Updated the handleFormSave method name to `dispatchFormSaveAndReinitialize`

* Added missing function to mock object

* Execute autoregistration component only in client side (DSpace#762)

* The Autocomplete Component is dynamically loaded as a standalone component only in the browser using the Loader component. (DSpace#763)

* UFAL/footer header images (DSpace#760)

* Footer images upload to assets/images/footer/ and change of images src attributes

* Changed src paths to start with ./

---------

Co-authored-by: Juraj Roka <[email protected]>

* ufal/customize the footer (DSpace#759)

* Footer details update by Lindat live instance's footer

* Copied UI tests fix from the dtq-dev

---------

Co-authored-by: Juraj Roka <[email protected]>
Co-authored-by: milanmajchrak <[email protected]>

* Copied fixes from the lindat branch (DSpace#770)

* Used root URL to compose download URL with namespace (DSpace#768)

* Cherry-picked docker compose rest

* The dtq-dev is run on /repository branch

* Waiting for the http://dev-5.pc:8$INSTANCE/server/api changed to http://dev-5.pc:8$INSTANCE/repository/server/api

* Added `repository` namespace to discojuice

* Run UI integration tests every hour

* Update actions/upload-artifact@v3 to v4

Because it was deprecated and UI tests cannot be run

* Run build CRON every 4 hours

* Update deploy.yml - changed runner

* Update deploy.yml - updated runner everywhere

* Update deploy.yml - use `dspace-dep-1` runner again

* Fixed failing Integration tests (DSpace#773)

* Commented out sometimes failing accessibility tests and added wait method to the submission ui test

* Cherry picked fix for unique artifact name.

---------

Co-authored-by: Tim Donohue <[email protected]>

* Update import action.yml - use `/repository` namespace in the import action

* Merge pull request DSpace#2694 from hutattedonmyarm/dspace-7_x (DSpace#777)

[Port dspace-7_x]  Enable type-bind for checkbox inputs during submission

Co-authored-by: Tim Donohue <[email protected]>

* Update build.yml - added a option to manually run build action

* print log file name for check

* renamed log file -> added 'log' at the end of the name

* Ufal/License issues (DSpace#779)

* Fixed pagination when searching licenses by the name.

* Fixed Editing license: 1. wrong checked checkboxes for the required info and extended license labels and removed errors from the console.

---------

Co-authored-by: Paurikova2 <[email protected]>
Co-authored-by: Jozef Misutka <[email protected]>
Co-authored-by: Ondrej Kosarko <[email protected]>
Co-authored-by: Matus Kasak <[email protected]>
Co-authored-by: jurinecko <[email protected]>
Co-authored-by: Juraj Roka <[email protected]>
Co-authored-by: Tim Donohue <[email protected]>
Co-authored-by: Paurikova2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit item's metadata doesn't work

3 participants