Skip to content
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

Generalized DialogViewComponent wrapper to display forms in popup #2069

Closed
2 tasks done
sleidig opened this issue Nov 8, 2023 · 4 comments · Fixed by #2304
Closed
2 tasks done

Generalized DialogViewComponent wrapper to display forms in popup #2069

sleidig opened this issue Nov 8, 2023 · 4 comments · Fixed by #2304
Assignees
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release) Type: Refactoring / Technical Enh. Technical Enhancement without changes for the user

Comments

@sleidig
Copy link
Member

sleidig commented Nov 8, 2023

We repeatedly need similar logic when displaying forms in a dialog/popup. To ensure the UX is consistent and make implementations simpler, a generic wrapper component that helps to display any component as a dialog would be useful.
Similar to the RoutedViewComponent, this new DialogViewComponent could allow us to implement the actual functionalities in components that only use @Input() and @Output() properties - which can then be used in both routed and dialog wrapped views.

Common functionality for all dialog forms should be:

  • "x" (top right) to close the dialog
  • confirmation message before closing, when changes would be discarded
  • save + cancel button
  • save process that marks all fields as dirty and check if form is valid (and aborts the saving if invalid)

image
[source]


concrete use cases / samples:

  • allow NoteDetails to be opened via RoutedViewComponent
  • allow EntityDetails to be opened via FormDialogService
@sleidig sleidig added the Type: Refactoring / Technical Enh. Technical Enhancement without changes for the user label Nov 8, 2023
@TheSlimvReal
Copy link
Collaborator

If you are talking about forms, isn't FormDialogService.openFormPopup() allowing to easily create these forms with the requirements you describe?

@sleidig
Copy link
Member Author

sleidig commented Nov 10, 2023

If you are talking about forms, isn't FormDialogService.openFormPopup() allowing to easily create these forms with the requirements you describe?

Yes and no. It does, but any Component you pass in as a parameter still needs to handle a lot of common stuff. e.g. both RowDetailsComponent and NoteDetailsComponent need to inject MAT_DIALOG_DATA (and therefore can't be used as a "routed view"). And both need to add standard stuff like the app-dialog-close ("x" icon), although we have encapsulated that nicely in a component that just needs to be added to the template.

In the long run, I would love to have components like NoteDetailsComponent (so that would probably include also the generic EntityDetailsComponent) that can be used both in dialogs and in main (routed) views. The biggest challenge there is probably how/where we handle the save buttons+actions.

@sleidig sleidig moved this from Triage / Analysis to Planned (current "sprint") in All Tasks & Issues Mar 14, 2024
@sleidig sleidig moved this from Planned (current "sprint") to In Progress in All Tasks & Issues Mar 14, 2024
@sleidig sleidig self-assigned this Mar 14, 2024
@sleidig sleidig mentioned this issue Mar 18, 2024
21 tasks
@sleidig sleidig moved this from In Progress to Planned (current "sprint") in All Tasks & Issues Mar 20, 2024
@sleidig sleidig moved this from Planned (current "sprint") to In Progress in All Tasks & Issues Mar 25, 2024
@sleidig sleidig moved this from In Progress to In Review in All Tasks & Issues Mar 27, 2024
sleidig added a commit that referenced this issue Apr 12, 2024
…d views (#2304)

* migrated special config appConfig:note-details to a standard view:note/:id
* adapted building blocks to be more flexible (app-view-title, app-dialog-buttons)
* extracted basics from EntityDetailsComponent into a new AbstractEntityDetailsComponent to be reused
* implemented DialogViewComponent similar to RoutedViewComponent
* generalized NoteDetailsComponent (and to some extend EntityDetailsComponent) to be usable in both dialogs and routed views
* ChildrenList & NotesManager take actual inputs instead of the full config object
* add an app-view-actions wrapper to align DialogButtons and Actions placed on top in routed views

closes #2069
@github-project-automation github-project-automation bot moved this from In Review to Done in All Tasks & Issues Apr 12, 2024
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.35.0-master.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released on @master managed by CI (semantic-release) label Apr 12, 2024
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.35.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released managed by CI (semantic-release) label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release) Type: Refactoring / Technical Enh. Technical Enhancement without changes for the user
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants