Upgrade to latest ADF (alpha) (#361)

* upgrade libs

* update libs

* upgrade page title management

* restore app config

* use 'title' property

* update libs

* disble cypress

* update libs

* disable irrelevant tests
This commit is contained in:
Denys Vuika
2018-05-21 12:27:12 +01:00
committed by GitHub
parent 829b421108
commit b78f97c79d
6 changed files with 39 additions and 46 deletions

View File

@@ -26,7 +26,7 @@
import { Component, OnInit, EventEmitter } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import {
TranslationService, PageTitleService, UserPreferencesService, AppConfigService,
PageTitleService, UserPreferencesService, AppConfigService,
FileModel, UploadService
} from '@alfresco/adf-core';
import { ElectronService } from '@ngstack/electron';
@@ -41,7 +41,6 @@ export class AppComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private pageTitle: PageTitleService,
private translateService: TranslationService,
preferences: UserPreferencesService,
config: AppConfigService,
private electronService: ElectronService,
@@ -67,13 +66,7 @@ export class AppComponent implements OnInit {
const snapshot: any = currentRoute.snapshot || {};
const data: any = snapshot.data || {};
if (data.i18nTitle) {
pageTitle.setTitle(
this.translateService.instant(data.i18nTitle)
);
} else {
pageTitle.setTitle(data.title || '');
}
pageTitle.setTitle(data.title || '');
});
this.electronService.on('app:navigateRoute', (event: any, ...args: string[]) => {

View File

@@ -47,14 +47,14 @@ export const APP_ROUTES: Routes = [
path: 'login',
component: LoginComponent,
data: {
i18nTitle: 'APP.SIGN_IN'
title: 'APP.SIGN_IN'
}
},
{
path: 'settings',
component: SettingsComponent,
data: {
i18nTitle: 'Settings'
title: 'Settings'
}
},
{
@@ -76,14 +76,14 @@ export const APP_ROUTES: Routes = [
path: '',
component: FavoritesComponent,
data: {
i18nTitle: 'APP.BROWSE.FAVORITES.TITLE'
title: 'APP.BROWSE.FAVORITES.TITLE'
}
},
{
path: 'preview/:nodeId',
component: PreviewComponent,
data: {
i18nTitle: 'APP.PREVIEW.TITLE',
title: 'APP.PREVIEW.TITLE',
navigateMultiple: true,
navigateSource: 'favorites'
}
@@ -99,13 +99,13 @@ export const APP_ROUTES: Routes = [
path: '',
component: LibrariesComponent,
data: {
i18nTitle: 'APP.BROWSE.LIBRARIES.TITLE'
title: 'APP.BROWSE.LIBRARIES.TITLE'
}
}, {
path: ':folderId',
component: FilesComponent,
data: {
i18nTitle: 'APP.BROWSE.LIBRARIES.TITLE',
title: 'APP.BROWSE.LIBRARIES.TITLE',
preferencePrefix: 'libraries-files'
}
},
@@ -113,7 +113,7 @@ export const APP_ROUTES: Routes = [
path: ':folderId/preview/:nodeId',
component: PreviewComponent,
data: {
i18nTitle: 'APP.PREVIEW.TITLE',
title: 'APP.PREVIEW.TITLE',
navigateMultiple: true,
navigateSource: 'libraries'
}
@@ -130,7 +130,7 @@ export const APP_ROUTES: Routes = [
path: '',
component: FilesComponent,
data: {
i18nTitle: 'APP.BROWSE.PERSONAL.TITLE',
title: 'APP.BROWSE.PERSONAL.TITLE',
defaultNodeId: '-my-'
}
},
@@ -138,14 +138,14 @@ export const APP_ROUTES: Routes = [
path: ':folderId',
component: FilesComponent,
data: {
i18nTitle: 'APP.BROWSE.PERSONAL.TITLE'
title: 'APP.BROWSE.PERSONAL.TITLE'
}
},
{
path: 'preview/:nodeId',
component: PreviewComponent,
data: {
i18nTitle: 'APP.PREVIEW.TITLE',
title: 'APP.PREVIEW.TITLE',
navigateMultiple: true,
navigateSource: 'personal-files'
}
@@ -154,7 +154,7 @@ export const APP_ROUTES: Routes = [
path: ':folderId/preview/:nodeId',
component: PreviewComponent,
data: {
i18nTitle: 'APP.PREVIEW.TITLE',
title: 'APP.PREVIEW.TITLE',
navigateMultiple: true,
navigateSource: 'personal-files'
}
@@ -171,14 +171,14 @@ export const APP_ROUTES: Routes = [
path: '',
component: RecentFilesComponent,
data: {
i18nTitle: 'APP.BROWSE.RECENT.TITLE'
title: 'APP.BROWSE.RECENT.TITLE'
}
},
{
path: 'preview/:nodeId',
component: PreviewComponent,
data: {
i18nTitle: 'APP.PREVIEW.TITLE',
title: 'APP.PREVIEW.TITLE',
navigateMultiple: true,
navigateSource: 'recent-files'
}
@@ -195,14 +195,14 @@ export const APP_ROUTES: Routes = [
path: '',
component: SharedFilesComponent,
data: {
i18nTitle: 'APP.BROWSE.SHARED.TITLE'
title: 'APP.BROWSE.SHARED.TITLE'
}
},
{
path: 'preview/:nodeId',
component: PreviewComponent,
data: {
i18nTitle: 'APP.PREVIEW.TITLE',
title: 'APP.PREVIEW.TITLE',
navigateMultiple: true,
navigateSource: 'shared'
}
@@ -213,7 +213,7 @@ export const APP_ROUTES: Routes = [
path: 'trashcan',
component: TrashcanComponent,
data: {
i18nTitle: 'APP.BROWSE.TRASHCAN.TITLE',
title: 'APP.BROWSE.TRASHCAN.TITLE',
preferencePrefix: 'trashcan'
}
},
@@ -221,7 +221,7 @@ export const APP_ROUTES: Routes = [
path: 'about',
component: AboutComponent,
data: {
i18nTitle: 'APP.BROWSE.ABOUT.TITLE'
title: 'APP.BROWSE.ABOUT.TITLE'
}
},
{

View File

@@ -78,7 +78,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
const { route, contentManagementService, contentService, nodeActionsService, uploadService } = this;
const { data } = route.snapshot;
this.title = data.i18nTitle;
this.title = data.title;
route.params.subscribe(({ folderId }: Params) => {
const nodeId = folderId || data.defaultNodeId;