basic docs on extensibility apis (#543)

basic docs on extensibility apis
This commit is contained in:
Denys Vuika
2018-08-04 08:26:33 +01:00
committed by GitHub
parent 744b03d22e
commit 22eac50d27
13 changed files with 934 additions and 150 deletions

View File

@@ -36,15 +36,12 @@ import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { ExtensionService } from './extensions/extension.service';
import {
SetAppNameAction,
SetHeaderColorAction,
SetLanguagePickerAction,
SetLogoPathAction,
SetSharedUrlAction,
SnackbarErrorAction,
SetCurrentUrlAction
SetCurrentUrlAction,
SetInitialStateAction
} from './store/actions';
import { AppStore } from './store/states/app.state';
import { AppStore, AppState, INITIAL_APP_STATE } from './store/states/app.state';
@Component({
selector: 'app-root',
@@ -103,24 +100,18 @@ export class AppComponent implements OnInit {
}
private loadAppSettings() {
const headerColor = this.config.get<string>('headerColor');
if (headerColor) {
this.store.dispatch(new SetHeaderColorAction(headerColor));
}
const appName = this.config.get<string>('application.name');
if (appName) {
this.store.dispatch(new SetAppNameAction(appName));
}
const logoPath = this.config.get<string>('application.logo');
if (logoPath) {
this.store.dispatch(new SetLogoPathAction(logoPath));
}
const languagePicker = this.config.get<boolean>('languagePicker');
this.store.dispatch(new SetLanguagePickerAction(languagePicker));
const sharedPreviewUrl =
this.config.get<string>('ecmHost') + '/#/preview/s/';
this.store.dispatch(new SetSharedUrlAction(sharedPreviewUrl));
const state: AppState = {
... INITIAL_APP_STATE,
appName: this.config.get<string>('application.name'),
headerColor: this.config.get<string>('headerColor'),
logoPath: this.config.get<string>('application.logo'),
sharedUrl: this.config.get<string>('ecmHost') + '/#/preview/s/'
};
this.store.dispatch(new SetInitialStateAction(state));
}
onFileUploadedError(error: FileUploadErrorEvent) {