mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Rebased ADF Migration PR
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
input {
|
||||
background-color: transparent;
|
||||
padding: 7px 8px 8px 8px;
|
||||
padding: 7px 8px 8px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
.adf-new-version-uploader-dialog-content {
|
||||
padding: 1px 2px 0 2px;
|
||||
padding: 1px 2px 0;
|
||||
flex: 1 1 auto;
|
||||
position: relative;
|
||||
max-height: 100vh;
|
||||
|
@@ -21,7 +21,6 @@ import { fakeAuthorityClearanceApiResponse } from './mock/security-authorities.m
|
||||
import { fakeGroupsApiResponse, createNewSecurityGroupMock } from './mock/security-groups.mock';
|
||||
import { fakeMarksApiResponse, createNewSecurityMarkMock } from './mock/security-marks.mock';
|
||||
import { SecurityGroupBody, SecurityMarkBody, SecurityMarkEntry } from '@alfresco/js-api';
|
||||
import { SecurityControlsServiceModule } from './security-controls-service.module';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -40,7 +39,7 @@ describe('SecurityControlsService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, SecurityControlsServiceModule]
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule]
|
||||
});
|
||||
|
||||
service = TestBed.inject(SecurityControlsService);
|
||||
|
@@ -23,12 +23,13 @@ import { By } from '@angular/platform-browser';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness, MatChipListboxHarness} from '@angular/material/chips/testing';
|
||||
import { MatChipHarness, MatChipListboxHarness } from '@angular/material/chips/testing';
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
import { MatIconHarness } from '@angular/material/icon/testing';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('CardViewArrayItemComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
|
@@ -28,6 +28,7 @@ import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('CardViewSelectItemComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
|
@@ -1,9 +1,16 @@
|
||||
<div [ngSwitch]="templateType">
|
||||
<div *ngSwitchDefault>
|
||||
<mat-form-field subscriptSizing="dynamic" class="adf-property-field adf-card-textitem-field"
|
||||
[ngClass]="{'adf-property-read-only': !isEditable }"
|
||||
[floatLabel]="'always'">
|
||||
<mat-label *ngIf="showProperty || isEditable" [attr.data-automation-id]="'card-textitem-label-' + property.key" class="adf-property-label"
|
||||
<mat-form-field
|
||||
class="adf-property-field adf-card-textitem-field"
|
||||
[ngClass]="{
|
||||
'adf-property-read-only': !isEditable
|
||||
}"
|
||||
[floatLabel]="'always'"
|
||||
>
|
||||
<mat-label
|
||||
*ngIf="showProperty || isEditable"
|
||||
[attr.data-automation-id]="'card-textitem-label-' + property.key"
|
||||
class="adf-property-label"
|
||||
[ngClass]="{
|
||||
'adf-property-value-editable': editable,
|
||||
'adf-property-readonly-value': isReadonlyProperty
|
||||
@@ -37,9 +44,9 @@
|
||||
*ngIf="property.multiline"
|
||||
title="{{ property.label | translate }}"
|
||||
[cdkTextareaAutosize]="true"
|
||||
[cdkAutosizeMaxRows]="1"
|
||||
[cdkAutosizeMaxRows]="5"
|
||||
class="adf-property-value"
|
||||
cdkAutosizeMinRows="1"
|
||||
cdkAutosizeMaxRows="5"
|
||||
[ngClass]="{
|
||||
'adf-property-value-editable': editable,
|
||||
'adf-property-readonly-value': isReadonlyProperty
|
||||
@@ -66,21 +73,20 @@
|
||||
>
|
||||
{{ property.label | translate }}
|
||||
</mat-label>
|
||||
<mat-chip-grid #chipList
|
||||
class="adf-textitem-chip-list">
|
||||
<mat-chip-row *ngFor="let propertyValue of editedValue; let idx = index"
|
||||
[removable]="isEditable"
|
||||
(removed)="removeValueFromList(idx)">
|
||||
<mat-chip-grid #chipList class="adf-textitem-chip-list">
|
||||
<mat-chip-row *ngFor="let propertyValue of editedValue; let idx = index" [removable]="isEditable" (removed)="removeValueFromList(idx)">
|
||||
{{ propertyValue }}
|
||||
<mat-icon *ngIf="isEditable"
|
||||
matChipRemove>cancel</mat-icon>
|
||||
<mat-icon *ngIf="isEditable" matChipRemove>cancel</mat-icon>
|
||||
</mat-chip-row>
|
||||
</mat-chip-grid>
|
||||
|
||||
<mat-form-field subscriptSizing="dynamic" [hidden]="!isEditable"
|
||||
<mat-form-field
|
||||
*ngIf="isEditable"
|
||||
class="adf-property-field adf-textitem-chip-list-input"
|
||||
[ngClass]="{ 'adf-property-read-only': !isEditable }">
|
||||
<input matInput
|
||||
[ngClass]="{ 'adf-property-read-only': !isEditable }"
|
||||
>
|
||||
<input
|
||||
matInput
|
||||
class="adf-property-value"
|
||||
[ngClass]="{
|
||||
'adf-property-value-editable': editable,
|
||||
@@ -103,9 +109,16 @@
|
||||
class="adf-textitem-clickable"
|
||||
[ngClass]="{ 'adf-property-read-only': !isEditable }"
|
||||
[attr.data-automation-id]="'card-textitem-toggle-' + property.key"
|
||||
(click)="clicked()">
|
||||
<mat-form-field subscriptSizing="dynamic" class="adf-property-field adf-card-textitem-field">
|
||||
<mat-label *ngIf="showProperty || isEditable" [attr.data-automation-id]="'card-textitem-label-' + property.key" class="adf-property-label">
|
||||
tabindex="0"
|
||||
(keyup.enter)="clicked()"
|
||||
(click)="clicked()"
|
||||
>
|
||||
<mat-form-field class="adf-property-field adf-card-textitem-field">
|
||||
<mat-label
|
||||
*ngIf="showProperty || isEditable"
|
||||
[attr.data-automation-id]="'card-textitem-label-' + property.key"
|
||||
class="adf-property-label"
|
||||
>
|
||||
{{ property.label | translate }}
|
||||
</mat-label>
|
||||
<input
|
||||
|
@@ -34,6 +34,7 @@ import { MatChipGridHarness, MatChipHarness } from '@angular/material/chips/test
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslationService } from '../../../translation';
|
||||
import { TranslationMock } from '../../../mock';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
@@ -10,6 +10,7 @@
|
||||
<img matListItemLine class="adf-attach-widget__icon"
|
||||
*ngIf="!selectedNode || element.id !== selectedNode.id" [id]="'file-'+element?.id+'-icon'"
|
||||
(click)="onRowClicked(element)"
|
||||
(keyup.enter)="onRowClicked(element)"
|
||||
[src]="element.content ? getIcon(element.content.mimeType) : getIcon(element['mimeType'])"
|
||||
[alt]="mimeTypeIcon" role="button" tabindex="0" />
|
||||
</td>
|
||||
|
@@ -73,7 +73,7 @@ describe('GroupCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), CoreTestingModule, ProcessServiceCloudTestingModule, GroupCloudModule]
|
||||
imports: [CoreTestingModule, ProcessServiceCloudTestingModule, GroupCloudModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(GroupCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -32,6 +32,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('TaskAttachmentList', () => {
|
||||
let component: TaskAttachmentListComponent;
|
||||
@@ -310,7 +311,7 @@ describe('Custom CustomEmptyTemplateComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), ProcessTestingModule],
|
||||
imports: [ProcessTestingModule],
|
||||
declarations: [CustomEmptyTemplateComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
@@ -615,10 +615,9 @@ describe('TaskListComponent', () => {
|
||||
const selectTask1 = await loader.getHarness(MatCheckboxHarness.with({ ancestor: '[data-automation-id="datatable-row-0"]' }));
|
||||
const selectTask2 = await loader.getHarness(MatCheckboxHarness.with({ ancestor: '[data-automation-id="datatable-row-1"]' }));
|
||||
await selectTask1.toggle();
|
||||
await selectTask1.toggle();
|
||||
await selectTask2.toggle();
|
||||
|
||||
expect(component.selectedInstances.length).toBe(2);
|
||||
expect(component.selectedInstances.length).toBe(1);
|
||||
});
|
||||
|
||||
it('should change selected row after clicking on different row', async () => {
|
||||
|
Reference in New Issue
Block a user