diff --git a/docs/core/components/dynamic-chip-list.component.md b/docs/core/components/dynamic-chip-list.component.md
index 43aadccb34..5654a2ee29 100644
--- a/docs/core/components/dynamic-chip-list.component.md
+++ b/docs/core/components/dynamic-chip-list.component.md
@@ -32,6 +32,7 @@ This component shows dynamic list of chips which render depending on free space.
|---------------------|---------------------------------------------------------------------------------|---------------|----------------------------------------------------------------|
| limitChipsDisplayed | `boolean` | false | Should limit number of chips displayed. |
| showDelete | `boolean` | true | Show delete button. |
+| disableDelete | `boolean` | false | Disable delete button. |
| roundUpChips | `boolean` | false | Round up chips increasing the border radius of a chip to 20px. |
| pagination | [`Pagination`](../../../lib/js-api/src/api/content-rest-api/docs/Pagination.md) | | Provide if you want to use paginated chips. |
| chips | [`Chip`](../../../lib/core/src/lib/dynamic-chip-list/chip.ts)`[]` | | List of chips to display. |
diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html
index 8e3e8b8da0..ee75a8fb76 100644
--- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html
+++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html
@@ -98,10 +98,9 @@
-
-
- {{ tag }}
-
+
{{ 'METADATA.BASIC.NO_TAGS_ADDED' | translate }}
diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.scss b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.scss
index 452a917c14..57c55e5b5c 100644
--- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.scss
+++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.scss
@@ -84,18 +84,8 @@ $panel-properties-height: 56px !default;
}
&-tags {
- adf-tags-creator {
- .adf-tags-creation {
- padding-right: 0;
- }
-
- &.adf-creator-with-existing-tags-panel {
- background: var(--adf-theme-background-dialog-color);
- }
- }
-
- [hidden] {
- visibility: hidden;
+ .adf-dynamic-chip-list-chip {
+ padding: 0;
}
}
}
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 90c60aacbb..f577bae534 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
@@ -23,20 +23,20 @@ import { ContentMetadataComponent } from './content-metadata.component';
import { ContentMetadataService } from '../../services/content-metadata.service';
import { AppConfigService, CardViewBaseItemModel, CardViewComponent, NotificationService, UpdateNotification } from '@alfresco/adf-core';
import { NodesApiService } from '../../../common/services/nodes-api.service';
-import { EMPTY, of, throwError } from 'rxjs';
-import { CardViewContentUpdateService } from '../../../common/services/card-view-content-update.service';
-import { PropertyGroup } from '../../interfaces/property-group.interface';
-import { PropertyDescriptorsService } from '../../services/property-descriptors.service';
-import { MatExpansionPanel } from '@angular/material/expansion';
-import { MatDialogModule } from '@angular/material/dialog';
-import { MatSnackBarModule } from '@angular/material/snack-bar';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatChipHarness } from '@angular/material/chips/testing';
+import { MatDialogModule } from '@angular/material/dialog';
+import { MatExpansionPanel } from '@angular/material/expansion';
+import { MatSnackBarModule } from '@angular/material/snack-bar';
+import { EMPTY, of, throwError } from 'rxjs';
+import { CategoriesManagementComponent, CategoriesManagementMode } from '../../../category';
+import { TagsCreatorComponent, TagsCreatorMode } from '../../../tag';
+import { ContentTestingModule } from '../../../testing/content.testing.module';
+import { PropertyGroup } from '../../interfaces/property-group.interface';
+import { PropertyDescriptorsService } from '../../services/property-descriptors.service';
import { TagService } from '../../../tag/services/tag.service';
import { CategoryService } from '../../../category/services/category.service';
-import { TagsCreatorComponent, TagsCreatorMode } from '../../../tag';
-import { CategoriesManagementComponent, CategoriesManagementMode } from '../../../category';
-import { ContentTestingModule } from '../../../testing/content.testing.module';
+import { CardViewContentUpdateService } from '../../../common/services/card-view-content-update.service';
describe('ContentMetadataComponent', () => {
let component: ContentMetadataComponent;
@@ -71,11 +71,16 @@ describe('ContentMetadataComponent', () => {
const category1 = new Category({ id: 'test', name: 'testCat' });
const category2 = new Category({ id: 'test2', name: 'testCat2' });
- const categoryPagingResponse: CategoryPaging = { list: { pagination: {}, entries: [{ entry: category1 }, { entry: category2 }] } };
+ const categoryPagingResponse: CategoryPaging = {
+ list: {
+ pagination: {},
+ entries: [{ entry: category1 }, { entry: category2 }]
+ }
+ };
const findTagElements = async (): Promise => {
const matChipHarnessList = await TestbedHarnessEnvironment.loader(fixture).getAllHarnesses(
- MatChipHarness.with({ selector: '[data-automation-id="metadata-properties-tag-chip"]' })
+ MatChipHarness.with({ selector: '.adf-dynamic-chip-list-chip' })
);
const tags = [];
for (const matChip of matChipHarnessList) {
@@ -269,7 +274,11 @@ describe('ContentMetadataComponent', () => {
}));
it('nodeAspectUpdate', fakeAsync(() => {
- const fakeNode = { id: 'fake-minimal-node', aspectNames: ['ft:a', 'ft:b', 'ft:c'], name: 'fake-node' } as Node;
+ const fakeNode = {
+ id: 'fake-minimal-node',
+ aspectNames: ['ft:a', 'ft:b', 'ft:c'],
+ name: 'fake-node'
+ } as Node;
getGroupedPropertiesSpy.and.stub();
spyOn(contentMetadataService, 'getBasicProperties').and.stub();
updateService.updateNodeAspect(fakeNode);
@@ -1321,7 +1330,8 @@ describe('ContentMetadataComponent', () => {
toggleEditModeForTags();
fixture.detectChanges();
- expect(await findTagElements()).toHaveSize(0);
+ const noEditableTagsContainer = fixture.debugElement.query(By.css('div.adf-metadata-properties-tags'));
+ expect(noEditableTagsContainer).toBeNull();
});
});
diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts
index 5cc86ba60e..cd3c7cfa4d 100644
--- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts
+++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts
@@ -23,6 +23,8 @@ import {
CardViewBaseItemModel,
CardViewComponent,
CardViewItem,
+ Chip,
+ DynamicChipListComponent,
NotificationService,
TranslationService,
UpdateNotification
@@ -39,17 +41,17 @@ import { CategoriesManagementMode } from '../../../category/categories-managemen
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
import { ContentService } from '../../../common/services/content.service';
import { CommonModule } from '@angular/common';
-import { MatExpansionModule } from '@angular/material/expansion';
-import { ContentMetadataHeaderComponent } from './content-metadata-header.component';
import { MatButtonModule } from '@angular/material/button';
-import { TranslateModule } from '@ngx-translate/core';
-import { MatIconModule } from '@angular/material/icon';
import { MatChipsModule } from '@angular/material/chips';
-import { CategoriesManagementComponent } from '../../../category';
-import { DynamicExtensionComponent } from '@alfresco/adf-extensions';
+import { MatExpansionModule } from '@angular/material/expansion';
+import { MatIconModule } from '@angular/material/icon';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { TagsCreatorComponent } from '../../../tag';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { TranslateModule } from '@ngx-translate/core';
+import { ContentMetadataHeaderComponent } from './content-metadata-header.component';
+import { CategoriesManagementComponent } from '../../../category/categories-management/categories-management.component';
+import { DynamicExtensionComponent } from '@alfresco/adf-extensions';
const DEFAULT_SEPARATOR = ', ';
@@ -74,7 +76,8 @@ enum DefaultPanels {
DynamicExtensionComponent,
MatProgressBarModule,
TagsCreatorComponent,
- CardViewComponent
+ CardViewComponent,
+ DynamicChipListComponent
],
templateUrl: './content-metadata.component.html',
styleUrls: ['./content-metadata.component.scss'],
@@ -153,6 +156,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit {
basicProperties$: Observable;
groupedProperties$: Observable;
+ tagsToDisplay: Chip[];
changedProperties = {};
hasMetadataChanged = false;
assignedCategories: Category[] = [];
@@ -215,6 +219,11 @@ export class ContentMetadataComponent implements OnChanges, OnInit {
return this._assignedTags;
}
+ set tags(tags: string[]) {
+ this._tags = tags;
+ this.tagsToDisplay = this.tags.map((tag) => ({ id: tag, name: tag }));
+ }
+
get tags(): string[] {
return this._tags;
}
@@ -309,7 +318,8 @@ export class ContentMetadataComponent implements OnChanges, OnInit {
* @param tags array of tags to register, they are not saved yet until we click save button.
*/
storeTagsToAssign(tags: string[]) {
- this._tags = tags;
+ this.tags = tags;
+ this._assignedTags = tags;
this.hasMetadataChanged = true;
}
@@ -512,8 +522,8 @@ export class ContentMetadataComponent implements OnChanges, OnInit {
private loadTagsForNode(id: string) {
this.tagService.getTagsByNodeId(id).subscribe((tagPaging) => {
this.assignedTagsEntries = tagPaging.list.entries;
- this._tags = tagPaging.list.entries.map((tagEntry) => tagEntry.entry.tag);
- this._assignedTags = [...this._tags];
+ this.tags = tagPaging.list.entries.map((tagEntry) => tagEntry.entry.tag);
+ this._assignedTags = [...this.tags];
});
}
diff --git a/lib/content-services/src/lib/i18n/en.json b/lib/content-services/src/lib/i18n/en.json
index aee5071e6d..f4af2c839c 100644
--- a/lib/content-services/src/lib/i18n/en.json
+++ b/lib/content-services/src/lib/i18n/en.json
@@ -142,7 +142,7 @@
},
"TAGS_CREATOR": {
"EXISTING_TAGS": "Existing tags:",
- "EXISTING_TAGS_SELECTION": "Select an existing tag:",
+ "EXISTING_TAGS_SELECTION": "Select an existing Tag:",
"NO_TAGS_CREATED": "No Tags Created",
"NO_EXISTING_TAGS": "No Existing Tags",
"TITLE": "Create Tags",
@@ -152,7 +152,6 @@
"EXISTING_TAG": "Tag already exists",
"ALREADY_ADDED_TAG": "Tag is already added",
"EMPTY_TAG": "Tag name can't contain only spaces",
- "REQUIRED": "Tag name is required",
"FETCH_TAGS": "Error while fetching the tags",
"CREATE_TAGS": "Error while creating the tags",
"SPECIAL_CHARACTERS": "Tag name cannot contain prohibited characters"
@@ -172,7 +171,7 @@
"DELETE_CATEGORY": "Delete Category",
"EXISTING_CATEGORIES": "Existing Categories:",
"SELECT_EXISTING_CATEGORY": "Select an existing Category:",
- "NO_EXISTING_CATEGORIES": "No existing Categories",
+ "NO_EXISTING_CATEGORIES": "No Existing Categories",
"GENERIC_CREATE": "Create: {{name}}",
"NAME": "Category name",
"LOADING": "Loading",
diff --git a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.html b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.html
index 4baa0f2e86..16b0e20ce8 100644
--- a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.html
+++ b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.html
@@ -10,26 +10,21 @@
adf-auto-focus
placeholder="{{ 'TAG.TAGS_CREATOR.TAG_SEARCH_PLACEHOLDER' | translate }}"
/>
- {{ tagNameErrorMessageKey | translate }}
+
+ {{ tagNameErrorMessageKey | translate }}
+
{{ 'TAG.TAGS_CREATOR.NO_TAGS_CREATED' | translate }}