diff --git a/docs/content-services/components/categories-management.component.md b/docs/content-services/components/categories-management.component.md index dc2f8c985b..b5fc334960 100644 --- a/docs/content-services/components/categories-management.component.md +++ b/docs/content-services/components/categories-management.component.md @@ -42,3 +42,32 @@ Component allows to both assign/unassign categories to content and create multip | ---- | ---- | ----------- | | categoriesChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Category`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Category.md)`>` | Emitted when categories list changes. | | categoryNameControlVisibleChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when category name control visibility changes. | + +## Method: `get isNameCategoryVisible(): boolean` + +### Description +This method calculates and returns a boolean value indicating whether the category name control should be visible in the Categories Management Component. The visibility is determined by a specific condition based on the component's internal state. + +### Return Value +- Type: `boolean` +- `true` if the category name control should be visible. +- `false` if the category name control should not be visible. + +### Usage +You can access this method to determine the visibility of the category name control within the Categories Management Component. The method is used to control the display of the category name input field based on the following condition: + +```typescript +return (!this.categoryNameControlVisible && this.categories?.length > 0) || this.categoryNameControlVisible; +``` +## Method: `isCategoryEmpty(): boolean` + +### Description +The `isCategoryEmpty` method is used within the Categories Management Component to determine whether the list of categories is empty. It returns a boolean value indicating the presence or absence of categories. + +### Return Value +- Type: `boolean` +- `true` if the list of categories is not empty. +- `false` if the list of categories is empty. + +### Usage +You can use this method to check whether there are categories present in the Categories Management Component. It's particularly useful when you need to conditionally display or hide elements based on the presence of categories. diff --git a/docs/content-services/components/tags-creator.component.md b/docs/content-services/components/tags-creator.component.md index 30d5919833..4d3162b7ab 100644 --- a/docs/content-services/components/tags-creator.component.md +++ b/docs/content-services/components/tags-creator.component.md @@ -37,3 +37,29 @@ Allows to create multiple tags. That component contains input and two lists. Top | existingTagsPanelVisibilityChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when bottom list is showing or hiding. | | tagNameControlVisibleChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when input is showing or hiding. | | tagsChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when tags in top list are changed. | + +## Method: `get isNameTagsVisible(): boolean` + +### Description +The `isNameTagsVisible` method is used within the Tags Creator Component to determine whether the tag name control should be visible. It calculates a boolean value based on specific conditions that take into account the visibility of the tag name control and the presence of tags in the component. + +### Return Value +- Type: `boolean` +- `true` if the tag name control should be visible. +- `false` if the tag name control should not be visible. + +### Usage +You can use this method to control the visibility of the tag name input field within the Tags creator Component. It provides a way to dynamically show or hide the input field based on certain criteria. + +## Method: `get isTagsEmpty(): boolean` + +### Description +The `isTagsEmpty` method is a utility method used within the Tags creator Component to check whether the list of tags is empty or not. It returns a boolean value, indicating whether there are tags present in the component. + +### Return Value +- Type: `boolean` +- `true` if the list of tags is not empty. +- `false` if the list of tags is empty. + +### Usage +You can use this method to programmatically determine whether there are tags available in the Tags creator Component. It is particularly useful when you need to conditionally display messages, elements, or take specific actions based on the presence or absence of tags. diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts index 3151c5e378..81ff20bcf7 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts @@ -441,7 +441,7 @@ describe('ContentMetadataComponent', () => { describe('toggleEdit', () => { let mockEvent: MouseEvent; - let mockGroup: CardViewGroup = { + const mockGroup: CardViewGroup = { editable: false, expanded: false, title: '',