diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.html b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.html index da524a1b00e2..711c4245e58d 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.html +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.html @@ -59,6 +59,6 @@ } -} @else { +} @else if (!$isInitialState) { } diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.ts index dd3df0bc3eae..66e44429b111 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-category-list/dot-category-field-category-list.component.ts @@ -98,6 +98,11 @@ export class DotCategoryFieldCategoryListComponent { */ $isLoading = input(true, { alias: 'isLoading' }); + /** + * Represents a variable indicating if the component is in initial state. + */ + $isInitialState = input(true, { alias: 'isInitialState' }); + /** * Represents the breadcrumbs to display */ diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-sidebar/dot-category-field-sidebar.component.html b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-sidebar/dot-category-field-sidebar.component.html index 546e2e94927e..25f90123198d 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-sidebar/dot-category-field-sidebar.component.html +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/components/dot-category-field-sidebar/dot-category-field-sidebar.component.html @@ -32,16 +32,15 @@
@if (store.mode() === 'list') { - @if (store.isListLoaded()) { - - } + } @else { { it('should initialize with default state', () => { expect(store.categories()).toEqual(EMPTY_ARRAY); expect(store.keyParentPath()).toEqual(EMPTY_ARRAY); - expect(store.state()).toEqual(ComponentStatus.IDLE); + expect(store.state()).toEqual(ComponentStatus.INIT); expect(store.selected()).toEqual(EMPTY_ARRAY); expect(store.mode()).toEqual('list'); }); diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/store/content-category-field.store.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/store/content-category-field.store.ts index 4b2363429754..cb41e3ef7705 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/store/content-category-field.store.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-category-field/store/content-category-field.store.ts @@ -50,7 +50,7 @@ export const initialState: CategoryFieldState = { selected: [], categories: [], keyParentPath: [], - state: ComponentStatus.IDLE, + state: ComponentStatus.INIT, mode: 'list', filter: '', searchCategories: [] @@ -101,7 +101,7 @@ export const CategoryFieldStore = signalStore( /** * Determines if the store state is currently loaded. */ - isListLoaded: computed(() => store.state() === ComponentStatus.LOADED), + isInitSate: computed(() => store.state() === ComponentStatus.INIT), /** * Determines if the search mode is currently loading. */