[ACS-4126] viewer allow assigning tags to content basic (#8417)

* ACS-4126 Moved component for tags creation from applications to ADF, putting that component into Viewer

* ACS-4126 Assigning tags to node and removed reference to modal from component for tags creating

* ACS-4126 Started working on assigning existing tags to node

* ACS-4126 Added newest changes for tags creation component

* ACS-4126 Usage of MatSelectionList, possibility for selecting existing tag

* ACS-4126 Allow to pass already assigned tags to tags creator as default top list

* ACS-4126 Fixed some css issues like aligning of icons, hiden add input icon when input is already visible

* ACS-4126 Allow to unlink tags from content

* ACS-4126 Allow for discard changes and fixed some validation issues

* ACS-4126 Integrate with changes for removing pagination

* ACS-4126 Autoscroll to input, remove scrollbar from search list

* ACS-4126 Code formatting

* ACS-4126 Renamed prefix for tags and style classes

* ACS-4126 Refreshing assigned tags after linking them, disable some operations during saving

* ACS-4126 Remove scrollbar from create label for long text, corrected some validations, use p tag instead of card view for displaying already assigned tags

* ACS-4126 Removed redundant code from tags creator component

* ACS-4126 Corrected translations

* ACS-4126 Hide input during saving

* ACS-4126 Unit tests for ContentMetadataComponent

* ACS-4126 Unit tests for TagService

* ACS-4126 Fixed unit tests for TagsCreator

* ACS-4126 Added documentation

* ACS-4126 Added additional unit tests

* ACS-4126 Fixed lint issues

* ACS-4126 Remove tags from files and folders list when taggable is unchecked

* ACS-4126 Small correction in styles

* ACS-4126 Corrected type for assigning single tag

* ACS-4126 Updated docs

* ACS-4126 Updated docs

* ACS-4126 Fixed some unit tests

* ACS-4126 Fixed lint issues

* ACS-4126 Updated jsdoc

* ACS-4126 Reverted one unwanted line

* ACS-4126 Removed space which caused lint issue

* ACS-4126 Fixed unit tests

* ACS-4126 Restored change

* ACS-4126 Fixed unit tests

* ACS-4126 Small correction
This commit is contained in:
AleksanderSklorz
2023-03-30 08:47:09 +02:00
committed by GitHub
parent d761966a59
commit 3e2683e06b
23 changed files with 2067 additions and 35 deletions

View File

@@ -0,0 +1,40 @@
---
Title: Tags Creator component
Added: v6.0.0-A.3
Status: Active
Last reviewed: 2023-03-27
---
# [Tags Creator component](../../../lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts "Defined in tags-creator.component.ts")
Allows to create multiple tags. That component contains input and two lists. Top list is all created tags, bottom list is searched tags based on input's value.
## Basic Usage
```html
<adf-tags-creator
[(tagNameControlVisible)]="tagNameControlVisible"
(tagsChange)="tags = $event"
[mode]="tagsCreatorMode">
</adf-tags-creator>
```
## Class members
### Properties
| Name | Type | Default value | Description |
|-----------------------|-------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------|
| mode | `TagsCreatorMode` | | Create mode if only new tags can be created or Create And Assign mode if new tags can be created and existing tags can be selected. |
| disabledTagsRemoving | `boolean` | false | False if tags can be removed from top list, true otherwise. |
| tags | `string[]` | | Default top list. |
| tagNameControlVisible | `boolean` | false | True if input should be visible, false otherwise. | |
### Events
| Name | Type | Description |
|-----------------------------------|------------------------------------------------------------------------|--------------------------------------------------|
| existingTagsPanelVisibilityChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when bottom list is showing or hiding. |
| tagsChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string[]>` | Emitted when tags in top list are changed. |
| tagNameControlVisibleChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when input is showing or hiding. |

View File

@@ -61,6 +61,11 @@ Manages tags in Content Services.
Find tag which name matches exactly to passed name.
- _name:_ `string` - Value for name which should be used during finding exact tag.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<TagEntry>` - Found tag which name matches exactly to passed name.
- **assignTagsToNode**(nodeId: `string`, tags: `TagBody[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TagPaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/TagPaging.md)`|`[`TagEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/TagEntry.md)`>`<br/>
Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned.
- _nodeId:_ `string` - Id of node to which tags should be assigned.
- _tags:_ `TagBody[]` - List of tags to create and assign or just assign if they already exist.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TagPaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/TagPaging.md)`|`[`TagEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/TagEntry.md)`>` - Just linked tags to node or single tag if linked only one tag.
## Details