[ACA-2302] upgrade to ADF 3.2.0 beta (#1049)

* upgrade to ADF 3.2.0 beta 2

* remove deprecated extension classes

* fix some DL style issues

* update class names

* update cell classes

* update viewer

* fix test

* update angular dependencies

* cleanup login component

* update tests

* fix selector

* fix document list cell selector

* fix viewer extension test

* upgrade to beta3

* fix some tests and disable tests until regression is fixed on ADF side

* disable hyperlink e2e for now

* upgrade to latest alpha

* restore tests
This commit is contained in:
Denys Vuika
2019-03-30 16:48:15 +00:00
committed by GitHub
parent 1d349c68fd
commit 672d6a75b1
32 changed files with 3483 additions and 2251 deletions

View File

@@ -100,7 +100,7 @@ export class ContextActionsDirective implements OnInit, OnDestroy {
}
private getTarget(event: MouseEvent): Element {
return this.findAncestor(<Element>event.target, 'adf-datatable-table-cell');
return this.findAncestor(<Element>event.target, 'adf-datatable-cell');
}
private isSelected(target): boolean {

View File

@@ -45,8 +45,7 @@ describe('ContextActionsDirective', () => {
it('should call service to render context menu', fakeAsync(() => {
const el = document.createElement('div');
el.className =
'adf-data-table-cell adf-datatable-table-cell adf-datatable-row';
el.className = 'adf-data-table-cell adf-datatable-cell adf-datatable-row';
const fragment = document.createDocumentFragment();
fragment.appendChild(el);

View File

@@ -2,7 +2,7 @@
[copyrightText]="'application.copyright' | adfAppConfig | translate"
providers="ECM"
successRoute="/personal-files"
[logoImageUrl]="'./assets/images/alfresco-logo.svg'"
logoImageUrl="./assets/images/alfresco-logo.svg"
[showRememberMe]="false"
[showLoginActions]="false"
>

View File

@@ -1,83 +0,0 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2019 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { Router } from '@angular/router';
import { Location } from '@angular/common';
import { TestBed, ComponentFixture } from '@angular/core/testing';
import {
AuthenticationService,
UserPreferencesService,
AppConfigPipe
} from '@alfresco/adf-core';
import { LoginComponent } from './login.component';
import { AppTestingModule } from '../../testing/app-testing.module';
describe('LoginComponent', () => {
let fixture: ComponentFixture<LoginComponent>;
let router: Router;
let userPreference: UserPreferencesService;
let auth: AuthenticationService;
let location: Location;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule],
declarations: [LoginComponent, AppConfigPipe],
providers: [Location],
schemas: [NO_ERRORS_SCHEMA]
});
fixture = TestBed.createComponent(LoginComponent);
router = TestBed.get(Router);
spyOn(router, 'navigateByUrl');
location = TestBed.get(Location);
spyOn(location, 'forward');
auth = TestBed.get(AuthenticationService);
spyOn(auth, 'getRedirect').and.returnValue('/some-url');
userPreference = TestBed.get(UserPreferencesService);
spyOn(userPreference, 'setStoragePrefix');
});
describe('OnInit()', () => {
it('should perform normal login when user is not logged in', () => {
spyOn(auth, 'isEcmLoggedIn').and.returnValue(false);
fixture.detectChanges();
expect(location.forward).not.toHaveBeenCalled();
});
it('should redirect when user is logged in', () => {
spyOn(auth, 'isEcmLoggedIn').and.returnValue(true);
fixture.detectChanges();
expect(location.forward).toHaveBeenCalled();
});
});
});

View File

@@ -23,29 +23,9 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { AuthenticationService } from '@alfresco/adf-core';
import { ActivatedRoute, Params } from '@angular/router';
import { Component } from '@angular/core';
@Component({
templateUrl: './login.component.html'
})
export class LoginComponent implements OnInit {
constructor(
private location: Location,
private auth: AuthenticationService,
private route: ActivatedRoute
) {}
ngOnInit() {
if (this.auth.isEcmLoggedIn()) {
this.location.forward();
} else {
this.route.queryParams.subscribe((params: Params) => {
const redirectUrl = params['redirectUrl'];
this.auth.setRedirect({ provider: 'ECM', url: redirectUrl });
});
}
}
}
export class LoginComponent {}

View File

@@ -12,7 +12,7 @@
flex: 1;
.adf-datatable-permission {
.adf-data-table-cell--icon {
.adf-datatable-cell--icon {
width: auto;
}
}

View File

@@ -31,20 +31,5 @@
<aca-toolbar-action [actionRef]="action"></aca-toolbar-action>
</ng-container>
</adf-viewer-toolbar-actions>
<ng-container *ngFor="let ext of contentExtensions">
<adf-viewer-extension [supportedExtensions]="[ext.fileExtension]">
<ng-template let-url="urlFileContent" let-extension="extension">
<app-preview-extension
[id]="ext.component"
[node]="selection.file?.entry"
[url]="url"
[extension]="extension"
[attr.data-automation-id]="ext.component"
>
</app-preview-extension>
</ng-template>
</adf-viewer-extension>
</ng-container>
</adf-viewer>
</ng-container>

View File

@@ -149,7 +149,6 @@ export class PreviewComponent extends PageComponent
]);
this.openWith = this.extensions.openWithActions;
this.contentExtensions = this.extensions.viewerContentExtensions;
}
ngOnDestroy() {

View File

@@ -76,7 +76,7 @@
<data-column
*ngIf="!isSmallScreen && (user$ | async)?.isAdmin"
class="adf-data-table-cell--ellipsis"
class="adf-ellipsis-cell adf-expand-cell-5"
key="archivedByUser.displayName"
title="APP.DOCUMENT_LIST.COLUMNS.DELETED_BY"
>