mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-5645]Added edit functionality for each panel and updated test cases
This commit is contained in:
committed by
Anukriti Singh
parent
ea1ae97144
commit
92fb997bb0
+4
-4
@@ -17,7 +17,7 @@
|
|||||||
<span
|
<span
|
||||||
*ngFor="let category of categories"
|
*ngFor="let category of categories"
|
||||||
[class.adf-categories-padded]="!isCRUDMode"
|
[class.adf-categories-padded]="!isCRUDMode"
|
||||||
class="adf-assigned-categories">
|
class="adf-assigned-categories">
|
||||||
{{ category.name }}
|
{{ category.name }}
|
||||||
<button
|
<button
|
||||||
data-automation-id="categories-remove-category-button"
|
data-automation-id="categories-remove-category-button"
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="adf-existing-categories-panel" *ngIf="existingCategoriesPanelVisible">
|
<div class="adf-existing-categories-panel" *ngIf="existingCategoriesPanelVisible">
|
||||||
<ng-container *ngIf="isCRUDMode && (!existingCategoriesLoading || existingCategories)">
|
<ng-container *ngIf="isCRUDMode && (!existingCategoriesLoading || existingCategories)">
|
||||||
<span class="adf-create-category-label"
|
<span class="adf-create-category-label"
|
||||||
(click)="addCategory()"
|
(click)="addCategory()"
|
||||||
[hidden]="categoryNameControl.invalid || typing">
|
[hidden]="categoryNameControl.invalid || typing">
|
||||||
{{ 'CATEGORIES_MANAGEMENT.GENERIC_CREATE' | translate : { name: categoryNameControl.value } }}
|
{{ 'CATEGORIES_MANAGEMENT.GENERIC_CREATE' | translate : { name: categoryNameControl.value } }}
|
||||||
</span>
|
</span>
|
||||||
@@ -62,8 +62,8 @@
|
|||||||
</mat-selection-list>
|
</mat-selection-list>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<mat-spinner
|
<mat-spinner
|
||||||
*ngIf="existingCategoriesLoading"
|
*ngIf="existingCategoriesLoading"
|
||||||
[diameter]="50"
|
[diameter]="50"
|
||||||
[attr.aria-label]="'CATEGORIES_MANAGEMENT.LOADING' | translate">
|
[attr.aria-label]="'CATEGORIES_MANAGEMENT.LOADING' | translate">
|
||||||
</mat-spinner>
|
</mat-spinner>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
-1
@@ -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;
|
||||||
|
|||||||
+1
-1
@@ -324,7 +324,7 @@ describe('CategoriesManagementComponent', () => {
|
|||||||
it('should have no required validator set for category control', () => {
|
it('should have no required validator set for category control', () => {
|
||||||
expect(component.categoryNameControl.hasValidator(Validators.required)).toBeFalse();
|
expect(component.categoryNameControl.hasValidator(Validators.required)).toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display validation error when searching for empty category', fakeAsync(() => {
|
it('should display validation error when searching for empty category', fakeAsync(() => {
|
||||||
typeCategory(' ');
|
typeCategory(' ');
|
||||||
|
|
||||||
|
|||||||
+2
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -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;
|
||||||
|
|||||||
+7
-2
@@ -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(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user