[ADF-3191] Fix userprefrence oauth2 (#3488)

* remove user preference setting save

* fix host setting test

* remove userPreferences test

* fix title service test

* remove unused imports

* restore input align

* fix service import in test tag rating
This commit is contained in:
Eugenio Romano
2018-06-15 08:32:16 +01:00
committed by GitHub
parent af2cde0791
commit 8966e22487
43 changed files with 417 additions and 528 deletions

View File

@@ -6,7 +6,7 @@ import { ChartsModule } from 'ng2-charts';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppConfigService, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService } from '@alfresco/adf-core';
import { AppComponent } from './app.component';
import { AdfModule } from './adf.module';
import { MaterialModule } from './material.module';
@@ -43,7 +43,6 @@ import { MetadataDialogAdapterComponent } from './components/files/metadata-dial
import { BlobPreviewComponent } from './components/blob-preview/blob-preview.component';
import { ThemePickerModule } from './components/theme-picker/theme-picker';
import { DebugAppConfigService } from './services/debug-app-config.service';
import { routing } from './app.routes';
import { ReactiveFormsModule } from '@angular/forms';
@@ -110,7 +109,7 @@ import { NotificationsComponent } from './components/notifications/notifications
NotificationsComponent
],
providers: [
{ provide: AppConfigService, useClass: DebugAppConfigService },
{ provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production
{
provide: TRANSLATION_PROVIDER,
multi: true,
@@ -129,11 +128,7 @@ import { NotificationsComponent } from './components/notifications/notifications
},
PreviewService
],
entryComponents: [
VersionManagerDialogAdapterComponent,
MetadataDialogAdapterComponent
],
entryComponents: [VersionManagerDialogAdapterComponent, MetadataDialogAdapterComponent],
bootstrap: [AppComponent]
})
export class AppModule {
}
export class AppModule {}

View File

@@ -25,7 +25,7 @@ import { MatDialog } from '@angular/material';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry } from 'alfresco-js-api';
import {
AuthenticationService, ContentService, TranslationService,
AuthenticationService, AppConfigService, AppConfigValues, ContentService, TranslationService,
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
UploadService, DataColumn, DataRow, UserPreferencesService,
PaginationComponent, FormValues, DisplayMode, UserPreferenceValues, InfinitePaginationComponent
@@ -56,7 +56,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
displayMode = DisplayMode.List;
includeFields = ['isFavorite', 'isLocked', 'aspectNames'];
baseShareUrl = this.preference.ecmHost + '/preview/s/';
baseShareUrl = this.appConfig.get<string>(AppConfigValues.ECMHOST) + '/preview/s/';
toolbarColor = 'default';
@@ -188,6 +188,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
private translateService: TranslationService,
private router: Router,
private logService: LogService,
private appConfig: AppConfigService,
private preference: UserPreferencesService,
private preview: PreviewService,
@Optional() private route: ActivatedRoute,

View File

@@ -1,37 +0,0 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { AppConfigService, StorageService } from '@alfresco/adf-core';
@Injectable()
export class DebugAppConfigService extends AppConfigService {
constructor(private storage: StorageService, http: HttpClient) {
super(http);
}
/** @override */
get<T>(key: string, defaultValue?: T): T {
if (key === 'ecmHost' || key === 'bpmHost') {
return <T> (<any> this.storage.getItem(key) || super.get<T>(key));
}
return super.get<T>(key, defaultValue);
}
}