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

chore(edit-content): For Image Field only image files should be displayed. #30712

Merged
merged 14 commits into from
Nov 22, 2024

Conversation

nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Nov 19, 2024

Parent Isssue

#30060

Proposed Changes

This pull request includes several updates to the core-web/libs/edit-content library, focusing on refactoring and improving the file field preview and selection components. The most important changes include the introduction of a new FileInfo type, updates to the DotFileFieldPreviewComponent, and modifications to the DotSelectExistingFileComponent and its store.

Refactoring and Type Definitions:

Component Updates:

Store and Service Updates:

Configuration Changes:

Checklist

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

Result

  1. Image Field: When the user clicks on the “Select Existing File” option, only image files should be displayed.
  2. File Field: When the user clicks on the “Select Existing File” option, all types of content should be displayed.
2024-11-20.11-11-38.mp4

This PR fixes: #30060

@nicobytes nicobytes changed the title chore(edit-content): Filter images #30060 chore(edit-content): For Image Field show only Images Types #30060 Nov 20, 2024
@nicobytes nicobytes changed the title chore(edit-content): For Image Field show only Images Types #30060 chore(edit-content): For Image Field show only Images Types Nov 20, 2024

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 9 changed files in this pull request and generated no suggestions.

Files not reviewed (4)
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-form-import-url/dot-form-import-url.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.const.ts: Evaluated as low risk
@nicobytes nicobytes marked this pull request as ready for review November 20, 2024 15:10

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 12 changed files in this pull request and generated no suggestions.

Files not reviewed (7)
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/store/select-existing-file.store.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/utils/index.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/services/dot-edit-content.service.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/test-setup.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-form-import-url/dot-form-import-url.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/store/select-existing-file.store.test.ts: Evaluated as low risk
Comments skipped due to low confidence (2)

core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/dot-select-existing-file.component.ts:77

  • [nitpick] The 'inputType' comparison should use a constant or enum value instead of a hardcoded string 'Image' for better maintainability.
const inputType = data?.inputType === 'Image' ? ['image'] : [];

core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/dot-select-existing-file.component.ts:22

  • [nitpick] The 'DialogData' type should include 'acceptedFiles' to match the usage in other parts of the code.
inputType: INPUT_TYPES;
@nicobytes nicobytes changed the title chore(edit-content): For Image Field show only Images Types chore(edit-content): For Image Field only image files should be displayed. Nov 20, 2024

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 15 changed files in this pull request and generated no suggestions.

Files not reviewed (9)
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-ui-message/dot-file-field-ui-message.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-ui-message/dot-file-field-ui-message.component.spec.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-form-import-url/dot-form-import-url.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/services/dot-edit-content.service.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/utils/index.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/store/select-existing-file.store.test.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/store/file-field.store.ts: Evaluated as low risk
@nicobytes nicobytes added this pull request to the merge queue Nov 22, 2024
Merged via the queue into main with commit 874d5e8 Nov 22, 2024
23 checks passed
@nicobytes nicobytes deleted the 30060-image-field-select-existing-file-functionality branch November 22, 2024 22:19
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.

Image Field: "Select Existing File" functionality
5 participants