[ACS-5645]Added edit functionality for each panel and updated test cases

This commit is contained in:
Yasa-Nataliya
2023-10-13 16:28:58 +05:30
committed by Anukriti Singh
parent ea1ae97144
commit 92fb997bb0
8 changed files with 27 additions and 10 deletions
@@ -1,6 +1,5 @@
.adf-categories-management { .adf-categories-management {
padding-top: 12px; padding-top: 12px;
.adf-category-name-field { .adf-category-name-field {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -228,6 +228,8 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy {
const newCat = new Category({ id: newCatName, name: newCatName }); const newCat = new Category({ id: newCatName, name: newCatName });
this.categories.push(newCat); this.categories.push(newCat);
this.clearCategoryNameInput(); this.clearCategoryNameInput();
this.categoryNameControl.setValue('');
this.categoryNameControl.markAsUntouched();
this._existingCategories = null; this._existingCategories = null;
this.categoriesChange.emit(this.categories); this.categoriesChange.emit(this.categories);
} }
@@ -22,6 +22,7 @@
width: 80px; width: 80px;
} }
} }
}
.mat-expansion-panel:not([class*='mat-elevation-z']) { .mat-expansion-panel:not([class*='mat-elevation-z']) {
box-shadow: none; box-shadow: none;
@@ -100,7 +100,12 @@ describe('ContentMetadataComponent', () => {
const clickOnTagsSave = () => { const clickOnTagsSave = () => {
findSaveTagsButton().click(); findSaveTagsButton().click();
fixture.detectChanges(); fixture.detectChanges();
}; }
const clickOnTagsSave = () => {
findSaveTagsButton().click();
fixture.detectChanges();
}
const findTagsCreator = (): TagsCreatorComponent => fixture.debugElement.query(By.directive(TagsCreatorComponent))?.componentInstance; const findTagsCreator = (): TagsCreatorComponent => fixture.debugElement.query(By.directive(TagsCreatorComponent))?.componentInstance;
@@ -808,7 +813,6 @@ describe('ContentMetadataComponent', () => {
describe('Display properties with aspect oriented config', () => { describe('Display properties with aspect oriented config', () => {
let appConfig: AppConfigService; let appConfig: AppConfigService;
let classesApi: ClassesApi;
let expectedNode: Node; let expectedNode: Node;
const verResponse: PropertyGroup = { const verResponse: PropertyGroup = {
@@ -1149,6 +1153,7 @@ describe('ContentMetadataComponent', () => {
it('should render tags after loading tags in ngOnInit', () => { it('should render tags after loading tags in ngOnInit', () => {
spyOn(tagService, 'getTagsByNodeId').and.returnValue(of(tagPaging)); spyOn(tagService, 'getTagsByNodeId').and.returnValue(of(tagPaging));
component.ngOnInit(); component.ngOnInit();
fixture.whenStable();
fixture.detectChanges(); fixture.detectChanges();
const tagElements = findTagElements(); const tagElements = findTagElements();
expect(tagElements).toHaveSize(2); expect(tagElements).toHaveSize(2);
@@ -63,6 +63,16 @@ adf-tags-creator {
} }
} }
.adf-tag-search-field {
width: 752px;
background: var(--adf-metadata-tags-background-color);
height: 32px;
border-radius: 12px;
align-items: center;
display: flex;
padding: 0 12px;
}
.adf-create-tag-label { .adf-create-tag-label {
color: var(--theme-primary-color); color: var(--theme-primary-color);
cursor: pointer; cursor: pointer;
@@ -21,7 +21,7 @@ import { NotificationService } from '@alfresco/adf-core';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { MatError, MatFormField, MatFormFieldModule } from '@angular/material/form-field'; import { MatError, MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input'; import { MatInputModule } from '@angular/material/input';
import { ReactiveFormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
@@ -300,7 +300,7 @@ describe('TagsCreatorComponent', () => {
const tagNameField = fixture.debugElement.query(By.css(tagNameFieldSelector)); const tagNameField = fixture.debugElement.query(By.css(tagNameFieldSelector));
expect(tagNameField).toBeTruthy(); expect(tagNameField).toBeTruthy();
expect(tagNameField.nativeElement.hasAttribute('hidden')).toBeFalsy(); expect(tagNameField.nativeElement.hasAttribute('hidden')).toBeFalsy();
expect(tagNameField.query(By.directive(MatFormField))).toBeTruthy(); expect(tagNameField).toBeTruthy();
}); });
it('should input be autofocused', fakeAsync(() => { it('should input be autofocused', fakeAsync(() => {