-
Notifications
You must be signed in to change notification settings - Fork 467
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
chore(edit-content): For Image Field only image files should be displayed. #30712
Conversation
There was a problem hiding this comment.
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
…f github.com:dotCMS/core into 30060-image-field-select-existing-file-functionality
There was a problem hiding this comment.
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;
...t-content-file-field/components/dot-select-existing-file/store/select-existing-file.store.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
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
core-web/libs/edit-content/src/lib/models/dot-edit-content-file.model.ts
Show resolved
Hide resolved
...-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
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 newFileInfo
type, updates to theDotFileFieldPreviewComponent
, and modifications to theDotSelectExistingFileComponent
and its store.Refactoring and Type Definitions:
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.ts
: IntroducedFileInfo
type to consolidate file-related properties and updated the component to use this new type. [1] [2]core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-form-import-url/dot-form-import-url.component.ts
: AddedDialogData
type for better type safety in dialog configurations. [1] [2]Component Updates:
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.html
: Refactored to usefileInfo
instead of multiple individual variables for file properties. [1] [2] [3]core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.ts
: Updated the component initialization and methods to work with the newFileInfo
type. [1] [2]Store and Service Updates:
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-select-existing-file/store/select-existing-file.store.ts
: AddedmimeTypes
state and related methods to handle file type filtering. [1] [2] [3] [4]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
: Updated tests to useeditContentService
instead ofservice
for better clarity and consistency. [1] [2] [3] [4] [5]Configuration Changes:
core-web/libs/edit-content/jest.config.ts
: Added@happy-dom/jest-environment
as the test environment for better compatibility with DOM-related tests.Checklist
Result
2024-11-20.11-11-38.mp4
This PR fixes: #30060