[affected:*][ci:force] Fixing rebase

This commit is contained in:
Vito Albano
2024-03-07 17:12:22 +00:00
committed by VitoAlbano
parent 9ed7c59ab0
commit a4ed406859
4 changed files with 53 additions and 55 deletions

View File

@@ -56,18 +56,26 @@
</adf-card-view> </adf-card-view>
</mat-expansion-panel> </mat-expansion-panel>
<ng-container *ngIf="displayTags"> <ng-container *ngIf="displayTags">
<mat-expansion-panel hideToggle [(expanded)]="isTagPanelExpanded" class="adf-content-metadata-panel"> <mat-expansion-panel
<mat-expansion-panel-header class="adf-metadata-properties-header" hideToggle
[class.adf-metadata-properties-header-expanded]='isTagPanelExpanded'> [expanded]="currentPanel.panelTitle === DefaultPanels.TAGS && currentPanel.expanded"
<adf-content-metadata-header [title]="'METADATA.BASIC.TAGS'" [expanded]="isTagPanelExpanded"> (opened)="expandPanel(DefaultPanels.TAGS)"
<button *ngIf="canEditTags" (closed)="closePanel(DefaultPanels.TAGS)"
mat-icon-button class="adf-content-metadata-panel"
(click)="onToggleTagsEdit($event)" data-automation-id="adf-content-metadata-tags-panel">
[attr.title]="'CORE.METADATA.ACTIONS.EDIT' | translate" <mat-expansion-panel-header
[attr.aria-label]="'CORE.METADATA.ACCESSIBILITY.EDIT' | translate" class="adf-metadata-properties-header"
data-automation-id="showing-tag-input-button" [class.adf-metadata-properties-header-expanded]="currentPanel.panelTitle === DefaultPanels.TAGS && currentPanel.expanded">
class="adf-edit-icon-buttons"> <adf-content-metadata-header [title]="'METADATA.BASIC.TAGS'" [expanded]="currentPanel.panelTitle === DefaultPanels.TAGS && currentPanel.expanded">
<button
*ngIf="!readOnly && !isPanelEditing(DefaultPanels.TAGS)"
mat-icon-button
(click)="toggleGroupEditing(DefaultPanels.TAGS, $event)"
[attr.title]="'CORE.METADATA.ACTIONS.EDIT' | translate"
[attr.aria-label]="'CORE.METADATA.ACCESSIBILITY.EDIT' | translate"
data-automation-id="showing-tag-input-button"
class="adf-edit-icon-buttons">
<mat-icon>mode_edit</mat-icon> <mat-icon>mode_edit</mat-icon>
</button> </button>
<div *ngIf="isPanelEditing(DefaultPanels.TAGS)" class="adf-metadata-action-buttons"> <div *ngIf="isPanelEditing(DefaultPanels.TAGS)" class="adf-metadata-action-buttons">

View File

@@ -36,12 +36,13 @@ import {
TagsCreatorMode, TagsCreatorMode,
TagService TagService
} from '@alfresco/adf-content-services'; } from '@alfresco/adf-content-services';
import { MatExpansionPanel } from '@angular/material/expansion';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http';
import { MatDialogModule } from '@angular/material/dialog'; import { MatDialogModule } from '@angular/material/dialog';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatTooltipModule } from '@angular/material/tooltip';
describe('ContentMetadataComponent', () => { describe('ContentMetadataComponent', () => {
let component: ContentMetadataComponent; let component: ContentMetadataComponent;
@@ -285,15 +286,11 @@ describe('ContentMetadataComponent', () => {
})); }));
it('should save changedProperties on save click', fakeAsync(() => { it('should save changedProperties on save click', fakeAsync(() => {
spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue( getGroupedPropertiesSpy.and.returnValue(of([{
of([ editable: true,
{ title: 'test',
editable: true, properties: []
title: 'test', }]));
properties: []
}
])
);
updateService.itemUpdated$.next({ updateService.itemUpdated$.next({
changed: {} changed: {}
} as UpdateNotification); } as UpdateNotification);
@@ -474,15 +471,11 @@ describe('ContentMetadataComponent', () => {
beforeEach(() => { beforeEach(() => {
showErrorSpy = spyOn(notificationService, 'showError').and.stub(); showErrorSpy = spyOn(notificationService, 'showError').and.stub();
spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue( getGroupedPropertiesSpy.and.returnValue(of([{
of([ editable: true,
{ title: 'test',
editable: true, properties: []
title: 'test', }]));
properties: []
}
])
);
component.displayCategories = true; component.displayCategories = true;
component.displayTags = true; component.displayTags = true;
component.ngOnInit(); component.ngOnInit();
@@ -630,15 +623,11 @@ describe('ContentMetadataComponent', () => {
}); });
it('should reset group edit ability on reset click', () => { it('should reset group edit ability on reset click', () => {
spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue( getGroupedPropertiesSpy.and.returnValue(of([{
of([ editable: true,
{ title: 'test',
editable: true, properties: []
title: 'test', }]));
properties: []
}
])
);
component.ngOnInit(); component.ngOnInit();
component.readOnly = false; component.readOnly = false;
fixture.detectChanges(); fixture.detectChanges();
@@ -702,6 +691,8 @@ describe('ContentMetadataComponent', () => {
}); });
it('should load the group properties on node change', () => { it('should load the group properties on node change', () => {
getGroupedPropertiesSpy.and.stub();
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
expect(contentMetadataService.getGroupedProperties).toHaveBeenCalledWith(expectedNode, 'custom-preset'); expect(contentMetadataService.getGroupedProperties).toHaveBeenCalledWith(expectedNode, 'custom-preset');
@@ -724,6 +715,7 @@ describe('ContentMetadataComponent', () => {
} }
]; ];
component.preset = presetConfig; component.preset = presetConfig;
getGroupedPropertiesSpy.and.stub();
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
@@ -794,15 +786,11 @@ describe('ContentMetadataComponent', () => {
}); });
it('should reload properties for group panel on cancel', () => { it('should reload properties for group panel on cancel', () => {
const getGroupedPropertiesSpy = spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue( getGroupedPropertiesSpy.and.returnValue(of([{
of([ editable: true,
{ title: 'test',
editable: true, properties: []
title: 'test', }]));
properties: []
}
])
);
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
component.readOnly = false; component.readOnly = false;
fixture.detectChanges(); fixture.detectChanges();

View File

@@ -83,9 +83,9 @@ describe('DynamicChipListComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
await fixture.whenStable(); await fixture.whenStable();
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-0').innerHTML).toBe('test1'); expect(element.querySelector('#adf-dynamic-chip-list-chip-name-0')?.innerHTML).toBe('test1');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-1').innerHTML).toBe('test2'); expect(element.querySelector('#adf-dynamic-chip-list-chip-name-1')?.innerHTML).toBe('test2');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-2').innerHTML).toBe('test3'); expect(element.querySelector('#adf-dynamic-chip-list-chip-name-2')?.innerHTML).toBe('test3');
expect(element.querySelector('#adf-dynamic-chip-list-delete-test1')).not.toBe(null); expect(element.querySelector('#adf-dynamic-chip-list-delete-test1')).not.toBe(null);
expect(element.querySelector('#adf-dynamic-chip-list-delete-test2')).not.toBe(null); expect(element.querySelector('#adf-dynamic-chip-list-delete-test2')).not.toBe(null);
@@ -182,6 +182,10 @@ describe('DynamicChipListComponent', () => {
element.style.maxWidth = '309px'; element.style.maxWidth = '309px';
}); });
afterEach(() =>{
fixture.destroy();
});
it('should render view more button when limiting is enabled', fakeAsync(() => { it('should render view more button when limiting is enabled', fakeAsync(() => {
renderChips(); renderChips();
component.ngOnChanges({ component.ngOnChanges({

View File

@@ -18,9 +18,7 @@
import { DebugElement } from '@angular/core'; import { DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { RichTextEditorComponent } from './rich-text-editor.component'; import { RichTextEditorComponent } from './rich-text-editor.component';
import { take } from 'rxjs';
describe('RichTextEditorComponent', () => { describe('RichTextEditorComponent', () => {
let component: RichTextEditorComponent; let component: RichTextEditorComponent;