Skip to content

Edit bitstream page refactor #4102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

AAwouters
Copy link
Contributor

@AAwouters AAwouters commented Mar 20, 2025

References

Description

This PR refactors the edit-bitstream-page component to make it easier to theme.

Instructions for Reviewers

This PR makes very little functional changes, almost all of it is simply an improvement to the development experience.
The only change in functionality is that the bitstream format correctly updates when immediately going back to the edit-bitstream-page once redirected from that page after changing the format.

List of changes in this PR:

  • Introduces the observablesDictionary utility type with explanation on how to use it.
    This utilty type allows the developer to structure their code better while using the type system when dealing with multiple observables.

  • Makes use of the observablesDictionary to split the large methods of the edit-bitstream-page component into smaller, easier extendable, methods.

Making use of the observablesDictionary does force the developer to think about names for the additional methods and interfaces, but I consider this to be a positive.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • 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 ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • 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 or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

AAwouters added 17 commits June 12, 2024 11:44
 - Introduced 'setFields' method
 - Applied more consistency in using fields vs parameters in methods
 - Split up methods related to iiif
Splitting the creation of the form into multiple methods that do one
specific thing (e.g. updating the form model, creating the form group,
prefilling data in the form, ...) allows for easier theming of the form
itself.
Without this fix the form showed old data when immediately going back
to the edit page after changing the primary bitstream or format.
Moved the creation of the update observables to their own methods and
unified the handling of their results in a single subscription
…age-refactor-9.0

# Conflicts:
#	src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html
#	src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts
#	src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit-bitstream-page component is difficult to theme
1 participant