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

feat(edit-content): Show restrictions based on the relationship. #30976

Conversation

nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Dec 19, 2024

Parent Issue

#30928

Proposed Changes

This pull request includes several changes to improve the functionality and maintainability of the dot-select-existing-content component and its associated files. The most important changes include enhancements to the selection mode, updates to the dialog behavior, and improvements to the component's initialization and testing.

Enhancements to selection mode:

  • Added support for dynamic selection mode in the dot-select-existing-content.component.html file, allowing for both multiple and single selection modes. [1] [2] [3] [4] [5] [6]

Updates to dialog behavior:

  • Modified the dot-select-existing-content.component.ts to include the DynamicDialogConfig and DynamicDialogRef services for better dialog management. [1] [2] [3] [4]
  • Updated the dot-select-existing-content.component.spec.ts to include tests for dialog initialization, closing behavior, and selection mode validation. [1] [2] [3] [4] [5]

Improvements to initialization and testing:

  • Added initialization logic in the dot-select-existing-content.component.ts to ensure the component starts with the correct configuration.
  • Enhanced the test suite in dot-select-existing-content.component.spec.ts to cover various scenarios, including initialization, dialog behavior, and item selection. [1] [2] [3] [4] [5]

Minor adjustments:

  • Updated the SCSS file _radiobutton.scss to include a new class for styling radio buttons.
  • Added readonly properties for injected services in the dot-select-existing-file.component.ts to improve code readability and maintainability. [1] [2]

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

This PR fixes: #30928

@nicobytes nicobytes marked this pull request as ready for review December 24, 2024 15:23
@nicobytes nicobytes changed the title chore(edit-content): handle 1-1 with radio button feat(edit-content): Show restrictions based on the relationship. Dec 24, 2024
@nicobytes nicobytes requested a review from Copilot December 24, 2024 15:25

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 15 changed files in this pull request and generated no comments.

Files not reviewed (10)
  • core-web/libs/dotcms-scss/angular/dotcms-theme/components/form/_radiobutton.scss: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/header/header.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.scss: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/dot-select-existing-file.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/store/existing-content.store.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/store/relationship-field.store.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.constants.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)

core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.ts:229

  • Ensure there is a test case that verifies selectionMode is correctly set before calling showExistingContentDialog.
selectionMode: this.store.selectionMode()
@nicobytes
Copy link
Contributor Author

QA Notes:

Behavior

radio.mp4

Dialog height

Screenshot 2024-12-27 at 11 24 22 AM

@nicobytes nicobytes enabled auto-merge December 27, 2024 15:25
@nicobytes nicobytes added this pull request to the merge queue Dec 27, 2024
Merged via the queue into main with commit cf6f800 Dec 27, 2024
22 checks passed
@nicobytes nicobytes deleted the 30928-relationship-field-allow-choosing-content-according-to-the-relationship branch December 27, 2024 18:09
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.

Relationship Field: Allow Choosing Content According to the Relationship
3 participants