Skip to content

Commit

Permalink
[ADF-5305] - Updated the js-api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Feb 3, 2021
1 parent 900be48 commit f8354e1
Show file tree
Hide file tree
Showing 19 changed files with 193 additions and 5,762 deletions.
6 changes: 3 additions & 3 deletions lib/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dist": "rm -rf ./dist/ && npm run build && cp -R ./bin ./dist/ && cp -R ./resources ./dist && cp -R ./templates ./dist && cp ./package.json ./dist/"
},
"dependencies": {
"@alfresco/js-api": "4.3.0-61350fee919fbeb2b6c949621161b6b076d44133",
"@alfresco/js-api": "4.3.0-367c03bf7de7ba15652c2d211137600a8fd3063d",
"commander": "^4.0.0",
"ejs": "^2.6.1",
"license-checker": "^25.0.1",
Expand Down
2 changes: 1 addition & 1 deletion lib/content-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@angular/forms": ">=10.0.2",
"@angular/material": ">=10.0.1",
"@angular/router": ">=10.0.2",
"@alfresco/js-api": "4.2.0",
"@alfresco/js-api": "4.3.0-367c03bf7de7ba15652c2d211137600a8fd3063d",
"@alfresco/adf-core": "4.2.0",
"@ngx-translate/core": ">=13.0.0",
"moment": ">=2.22.2"
Expand Down
104 changes: 0 additions & 104 deletions lib/content-services/src/lib/aspect-list/apect.model.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,75 +24,45 @@ import { ContentTestingModule } from '../testing/content.testing.module';
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
import { NodesApiService } from 'core';
import { AspectListService } from './aspect-list.service';
import { AspectEntryModel } from './apect.model';
import { delay } from 'rxjs/operators';
import { AspectEntry } from '@alfresco/js-api';

const aspectListMock: AspectEntryModel[] = [{
const aspectListMock: AspectEntry[] = [{
entry: {
parentname: 'frs:aspectZero',
name: 'FirstAspect',
prefixedname: 'frs:AspectOne',
parentId: 'frs:aspectZero',
id: 'frs:AspectOne',
description: 'First Aspect with random description',
title: 'First aspect show',
title: 'FirstAspect',
properties: [
{
name: 'channelPassword',
prefixedname: 'pub:channelPassword',
id: 'channelPassword',
title: 'The authenticated channel password',
dataType: 'd:encrypted',
facetable: 'UNSET',
indexTokenisationMode: 'TRUE',
multiValued: false,
mandatoryEnforced: false,
mandatory: false,
indexed: true
dataType: 'd:encrypted'
},
{
name: 'channelUsername',
prefixedname: 'pub:channelUsername',
id: 'channelUsername',
title: 'The authenticated channel username',
dataType: 'd:encrypted',
facetable: 'UNSET',
indexTokenisationMode: 'TRUE',
multiValued: false,
mandatoryEnforced: false,
mandatory: false,
indexed: true
dataType: 'd:encrypted'
}
]
}
},
{
entry: {
parentname: 'frs:AspectZer',
name: 'SecondAspect',
prefixedname: 'frs:SecondAspect',
parentId: 'frs:AspectZer',
id: 'frs:SecondAspect',
description: 'Second Aspect description',
title: 'Aspect number 2',
title: 'SecondAspect',
properties: [
{
name: 'assetId',
prefixedname: 'pub:assetId',
id: 'assetId',
title: 'Published Asset Id',
dataType: 'd:text',
facetable: 'UNSET',
indexTokenisationMode: 'TRUE',
multiValued: false,
mandatoryEnforced: false,
mandatory: false,
indexed: true
dataType: 'd:text'
},
{
name: 'assetUrl',
prefixedname: 'pub:assetUrl',
id: 'assetUrl',
title: 'Published Asset URL',
dataType: 'd:text',
facetable: 'UNSET',
indexTokenisationMode: 'TRUE',
multiValued: false,
mandatoryEnforced: false,
mandatory: false,
indexed: true
dataType: 'd:text'
}
]
}
Expand Down Expand Up @@ -175,7 +145,7 @@ describe('AspectListDialogComponent', () => {
});

it('should update the counter when an option is selcted and unselected', async () => {
const firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-FirstAspectcheck-input');
const firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-0-check-input');
expect(firstAspectCheckbox).toBeDefined();
expect(firstAspectCheckbox).not.toBeNull();
let selectionCounter = fixture.nativeElement.querySelector('#aspect-list-dialog-counter');
Expand All @@ -199,7 +169,7 @@ describe('AspectListDialogComponent', () => {
});

it('should clear all the value when Reset button is clicked', async () => {
let firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-FirstAspectcheck-input');
let firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-0-check-input');
expect(firstAspectCheckbox).toBeDefined();
expect(firstAspectCheckbox).not.toBeNull();
firstAspectCheckbox.click();
Expand All @@ -211,12 +181,12 @@ describe('AspectListDialogComponent', () => {
resetButton.click();
fixture.detectChanges();
await fixture.whenStable();
firstAspectCheckbox = fixture.nativeElement.querySelector('#aspect-list-FirstAspectcheck-input');
firstAspectCheckbox = fixture.nativeElement.querySelector('#aspect-list-0-check-input');
expect(firstAspectCheckbox.checked).toBeFalsy();
});

it('should clear all the value when Clear button is clicked', async () => {
let firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-FirstAspectcheck-input');
let firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-0-check-input');
expect(firstAspectCheckbox).toBeDefined();
expect(firstAspectCheckbox).not.toBeNull();
firstAspectCheckbox.click();
Expand All @@ -228,7 +198,7 @@ describe('AspectListDialogComponent', () => {
clearButton.click();
fixture.detectChanges();
await fixture.whenStable();
firstAspectCheckbox = fixture.nativeElement.querySelector('#aspect-list-FirstAspectcheck-input');
firstAspectCheckbox = fixture.nativeElement.querySelector('#aspect-list-0-check-input');
expect(firstAspectCheckbox.checked).toBeFalsy();
});

Expand Down Expand Up @@ -292,7 +262,7 @@ describe('AspectListDialogComponent', () => {
it('should show checked the current aspects of the node', async () => {
fixture.detectChanges();
await fixture.whenRenderingDone();
const firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-FirstAspectcheck-input');
const firstAspectCheckbox: HTMLInputElement = fixture.nativeElement.querySelector('#aspect-list-0-check-input');
expect(firstAspectCheckbox).toBeDefined();
expect(firstAspectCheckbox).not.toBeNull();
expect(firstAspectCheckbox.checked).toBeTruthy();
Expand Down
20 changes: 10 additions & 10 deletions lib/content-services/src/lib/aspect-list/aspect-list.component.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<div id="aspect-list-container" class="adf-aspect-list-container">
<mat-accordion class="adf-accordion-aspect-list">
<mat-expansion-panel *ngFor="let aspect of (aspects$ | async); let colIndex = index" [id]="'aspect-list-'+aspect?.entry?.name">
<mat-expansion-panel-header [id]="'aspect-list-'+aspect?.entry?.name+'header'">
<mat-expansion-panel *ngFor="let aspect of (aspects$ | async); let colIndex = index" [id]="'aspect-list-'+aspect?.entry?.title">
<mat-expansion-panel-header [id]="'aspect-list-'+aspect?.entry?.title+'header'">
<mat-panel-title>
<mat-checkbox class="adf-aspect-list-check-button" [id]="'aspect-list-'+aspect?.entry?.name+'check'"
[checked]="nodeAspects?.includes(aspect?.entry?.prefixedname)"
<mat-checkbox class="adf-aspect-list-check-button" [id]="'aspect-list-'+colIndex+'-check'"
[checked]="nodeAspects?.includes(aspect?.entry?.id)"
(click)="onCheckBoxClick($event)"
(change)="onChange($event, aspect?.entry?.prefixedname)">
(change)="onChange($event, aspect?.entry?.id)">
</mat-checkbox>
<p class="adf-aspect-list-element-title">{{aspect?.entry?.name}}</p>
<p class="adf-aspect-list-element-title">{{aspect?.entry?.title}}</p>
</mat-panel-title>
<mat-panel-description [id]="'aspect-list-'+aspect?.entry?.name+'title'"
<mat-panel-description [id]="'aspect-list-'+colIndex+'-title'"
[matTooltip]="aspect?.entry?.title">
{{aspect?.entry?.title}}
</mat-panel-description>
</mat-expansion-panel-header>
<p class="adf-property-paragraph" [id]="'aspect-list-'+aspect?.entry?.name+'description'"> {{aspect?.entry?.description}}</p>
<p class="adf-property-paragraph" [id]="'aspect-list-'+colIndex+'-description'"> {{aspect?.entry?.description}}</p>

<table mat-table [dataSource]="aspect?.entry?.properties" *ngIf="aspect?.entry?.properties?.length > 0" class="adf-aspect-property-table" [id]="'aspect-list-'+aspect?.entry?.name+'properties-table'">
<table mat-table [dataSource]="aspect?.entry?.properties" *ngIf="aspect?.entry?.properties?.length > 0" class="adf-aspect-property-table" [id]="'aspect-list-'+colIndex+'-properties-table'">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> {{'ADF-ASPECT-LIST.PROPERTY_NAME' | translate}} </th>
<td mat-cell *matCellDef="let property"> {{property.name}} </td>
<td mat-cell *matCellDef="let property"> {{property.id}} </td>
</ng-container>
<ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef> {{'ADF-ASPECT-LIST.DESCRIPTION' | translate}} </th>
Expand Down
Loading

0 comments on commit f8354e1

Please sign in to comment.