-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(edit-content) show files according to host/folder (#30612)
### Parent Issue #30216 ### Proposed Changes This pull request includes several changes across multiple files to enhance the functionality and organization of the `dot-site` and `dot-edit-content-file-field` components. The key changes involve adding a new method to fetch content by folder, refactoring imports for better modularity, and updating UI components for improved user interaction. ### Enhancements to `dot-site.service.ts`: * Added a new interface `ContentByFolderParams` to define parameters for fetching content by folder. * Introduced a new method `getContentByFolder` in `DotSiteService` to fetch content based on the provided parameters. ### Refactoring imports in `dot-edit-content-file-field` components: * Updated import paths to use more specific model files for better modularity in various components, including `dot-file-field-preview.component.ts`, `dot-file-field-ui-message.component.ts`, `dot-form-file-editor.component.ts`, `form-file-editor.store.ts`, `dot-form-import-url.component.spec.ts`, and `form-import-url.store.ts`. [[1]](diffhunk://#diff-9d3250303440cce67e959a59ed17f44ad49d690c04e36cbf4fadc011f206001eL29-R32) [[2]](diffhunk://#diff-fbc6f3568490a6db73eb7a1d91fb7d56c6195f18637a179b3e2e0a9a8971e65bL6-R6) [[3]](diffhunk://#diff-4e07289537a18f138b8657c2505e3416523ee356c698aeb38f3d519a2257dadaL24-R24) [[4]](diffhunk://#diff-5184979843abf3baa538afc8613a1fa040a7907c9614bfb64ddc472c31b4cfa7L13-R13) [[5]](diffhunk://#diff-0d18173fe874af517af41ad1e4422ff7681ba1c2ad4daf75c9806a07fa37e7b2L17-R17) [[6]](diffhunk://#diff-2e100516ca0ff5570c84b4cf072dd03ae77565e92c8c5de65d77505745955651L12-R12) ### UI Improvements in `dot-select-existing-file` components: * Enhanced `dot-dataview.component.html` to include better data binding and UI elements such as loading indicators, search functionality, and improved table structure. [[1]](diffhunk://#diff-f3ba4db0d4c81db7982bda57d151d7f05bbb2151eb78f5ce460ccd71184b4c7dR1-R41) [[2]](diffhunk://#diff-f3ba4db0d4c81db7982bda57d151d7f05bbb2151eb78f5ce460ccd71184b4c7dL27-R66) * Updated `dot-dataview.component.scss` to include styles for new UI elements like truncation and thumbnail display. * Refactored `dot-dataview.component.ts` to use new Angular features like signals and models for state management. * Improved `dot-sidebar.component.html` and `dot-sidebar.component.ts` to handle node selection and state management more effectively. [[1]](diffhunk://#diff-c3ff3590364bc12ded7173d7374838dfab13f67598f80daa198dfd96c935d459L5-R13) [[2]](diffhunk://#diff-b6e7f5a1ad7c221178b3ddf3f3dfc06021ba87b4e18ef9d7f6c6c9a6eab016d3R8-R11) [[3]](diffhunk://#diff-b6e7f5a1ad7c221178b3ddf3f3dfc06021ba87b4e18ef9d7f6c6c9a6eab016d3R22-R23) [[4]](diffhunk://#diff-b6e7f5a1ad7c221178b3ddf3f3dfc06021ba87b4e18ef9d7f6c6c9a6eab016d3R61-R62) [[5]](diffhunk://#diff-b6e7f5a1ad7c221178b3ddf3f3dfc06021ba87b4e18ef9d7f6c6c9a6eab016d3R71-R89) * Updated `dot-select-existing-file.component.html` and `dot-select-existing-file.component.ts` to handle folder loading and content selection more efficiently. [[1]](diffhunk://#diff-485fc35db79ca9cdecc82b1dde0499e2e25f88f07f9ce43a4624fac358ac7848R1-R16) [[2]](diffhunk://#diff-485fc35db79ca9cdecc82b1dde0499e2e25f88f07f9ce43a4624fac358ac7848L20-R27) [[3]](diffhunk://#diff-18bf6e06cc08560259db33d84f324194172c43e47220f07b1de0990cf71077acR13) [[4]](diffhunk://#diff-18bf6e06cc08560259db33d84f324194172c43e47220f07b1de0990cf71077acR41-R42) [[5]](diffhunk://#diff-18bf6e06cc08560259db33d84f324194172c43e47220f07b1de0990cf71077acL66-R70) These changes collectively enhance the functionality, modularity, and user experience of the `dot-site` and `dot-edit-content-file-field` components. ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Additional Info https://github.com/user-attachments/assets/5f9ed27e-1b74-41f8-aa37-612d96c043fa
- Loading branch information
Showing
36 changed files
with
370 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...nt-file-field/components/dot-file-field-ui-message/dot-file-field-ui-message.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 33 additions & 14 deletions
47
...eld/components/dot-select-existing-file/components/dot-dataview/dot-dataview.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,74 @@ | ||
import { DatePipe, NgOptimizedImage } from '@angular/common'; | ||
import { ChangeDetectionStrategy, Component, input } from '@angular/core'; | ||
import { DatePipe } from '@angular/common'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
CUSTOM_ELEMENTS_SCHEMA, | ||
input, | ||
model, | ||
output, | ||
signal | ||
} from '@angular/core'; | ||
|
||
import { ButtonModule } from 'primeng/button'; | ||
import { DataViewModule } from 'primeng/dataview'; | ||
import { IconFieldModule } from 'primeng/iconfield'; | ||
import { ImageModule } from 'primeng/image'; | ||
import { InputIconModule } from 'primeng/inputicon'; | ||
import { InputTextModule } from 'primeng/inputtext'; | ||
import { SkeletonModule } from 'primeng/skeleton'; | ||
import { TableModule } from 'primeng/table'; | ||
import { TagModule } from 'primeng/tag'; | ||
|
||
import { DotCMSContentlet } from '@dotcms/dotcms-models'; | ||
import { DotMessagePipe } from '@dotcms/ui'; | ||
|
||
import { Content } from '../../store/select-existing-file.store'; | ||
|
||
@Component({ | ||
selector: 'dot-dataview', | ||
standalone: true, | ||
imports: [ | ||
DataViewModule, | ||
TagModule, | ||
ButtonModule, | ||
TableModule, | ||
IconFieldModule, | ||
InputIconModule, | ||
InputTextModule, | ||
SkeletonModule, | ||
ImageModule, | ||
NgOptimizedImage, | ||
DatePipe, | ||
DotMessagePipe | ||
], | ||
templateUrl: './dot-dataview.component.html', | ||
styleUrls: ['./dot-dataview.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA] | ||
}) | ||
export class DotDataViewComponent { | ||
/** | ||
* Represents an observable stream of content data. | ||
* | ||
* @type {Observable<Content[]>} | ||
* @type {Observable<DotCMSContentlet[]>} | ||
* @alias data | ||
* @required | ||
*/ | ||
$data = input.required<Content[]>({ alias: 'data' }); | ||
$data = input.required<DotCMSContentlet[]>({ alias: 'data' }); | ||
/** | ||
* A boolean observable that indicates the loading state. | ||
* This is typically used to show or hide a loading indicator in the UI. | ||
* | ||
* @type {boolean} | ||
*/ | ||
$loading = input.required<boolean>({ alias: 'loading' }); | ||
|
||
/** | ||
* Signal representing the number of rows per page in the data view. | ||
* | ||
* @type {number} | ||
*/ | ||
$rowsPerPage = signal<number>(9); | ||
|
||
/** | ||
* Reactive model holding the currently selected product. | ||
* Can be a `DotCMSContentlet` or `null`. | ||
*/ | ||
$selectedProduct = model<DotCMSContentlet | null>(null); | ||
|
||
/** | ||
* Emits the selected `DotCMSContentlet` when a row is selected. | ||
*/ | ||
onRowSelect = output<DotCMSContentlet>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.