diff --git a/demo-shell-ng2/app/app.component.html b/demo-shell-ng2/app/app.component.html index 463e250c35..2c5c803b42 100644 --- a/demo-shell-ng2/app/app.component.html +++ b/demo-shell-ng2/app/app.component.html @@ -1,68 +1,70 @@
-
-
- - Demo Application - -
+
+
+
+ + Demo Application + +
- - + + - - + + - - - - - -
    -
  • -
  • -
  • - - -
  • -
+
+ -
-
- Components List - - ECM host - - BPM host -
diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index 1b186c1fcc..849f6ac69c 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -19,9 +19,9 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { - AlfrescoSettingsService, AlfrescoTranslationService, - AlfrescoAuthenticationService + AlfrescoAuthenticationService, + AlfrescoSettingsService } from 'ng2-alfresco-core'; declare var document: any; @@ -40,29 +40,16 @@ export class AppComponent { constructor(public auth: AlfrescoAuthenticationService, public router: Router, - translate: AlfrescoTranslationService, - public alfrescoSettingsService: AlfrescoSettingsService) { + public alfrescoSettingsService: AlfrescoSettingsService, + translate: AlfrescoTranslationService) { this.setEcmHost(); this.setBpmHost(); + this.setProvider(); this.translate = translate; this.translate.addTranslationFolder(); } - public onChangeECMHost(event: KeyboardEvent): void { - console.log((event.target).value); - this.ecmHost = (event.target).value; - this.alfrescoSettingsService.ecmHost = this.ecmHost; - localStorage.setItem(`ecmHost`, this.ecmHost); - } - - public onChangeBPMHost(event: KeyboardEvent): void { - console.log((event.target).value); - this.bpmHost = (event.target).value; - this.alfrescoSettingsService.bpmHost = this.bpmHost; - localStorage.setItem(`bpmHost`, this.bpmHost); - } - isLoggedIn(): boolean { return this.auth.isLoggedIn(); } @@ -120,4 +107,10 @@ export class AppComponent { this.alfrescoSettingsService.bpmHost = this.bpmHost; } } + + private setProvider() { + if (localStorage.getItem(`providers`)) { + this.alfrescoSettingsService.setProviders(localStorage.getItem(`providers`)); + } + } } diff --git a/demo-shell-ng2/app/app.module.ts b/demo-shell-ng2/app/app.module.ts index a1d7fcf93e..37e34f4dcb 100644 --- a/demo-shell-ng2/app/app.module.ts +++ b/demo-shell-ng2/app/app.module.ts @@ -47,7 +47,8 @@ import { TagComponent, AboutComponent, FilesComponent, - FormNodeViewer + FormNodeViewer, + SettingComponent } from './components/index'; @NgModule({ @@ -82,7 +83,8 @@ import { TagComponent, AboutComponent, FilesComponent, - FormNodeViewer + FormNodeViewer, + SettingComponent ], providers: [], bootstrap: [ AppComponent ] diff --git a/demo-shell-ng2/app/app.routes.ts b/demo-shell-ng2/app/app.routes.ts index 49208adfb3..234bfcdc6f 100644 --- a/demo-shell-ng2/app/app.routes.ts +++ b/demo-shell-ng2/app/app.routes.ts @@ -28,7 +28,8 @@ import { TagComponent, AboutComponent, FormViewer, - FormNodeViewer + FormNodeViewer, + SettingComponent } from './components/index'; import { UploadButtonComponent } from 'ng2-alfresco-upload'; @@ -47,7 +48,8 @@ export const appRoutes: Routes = [ { path: 'activiti/tasksnode/:id', component: FormNodeViewer }, { path: 'webscript', component: WebscriptComponent }, { path: 'tag', component: TagComponent }, - { path: 'about', component: AboutComponent } + { path: 'about', component: AboutComponent }, + { path: 'settings', component: SettingComponent } ]; export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/demo-shell-ng2/app/components/index.ts b/demo-shell-ng2/app/components/index.ts index 0b97f97311..28ca7a9b56 100644 --- a/demo-shell-ng2/app/components/index.ts +++ b/demo-shell-ng2/app/components/index.ts @@ -26,3 +26,4 @@ export { TagComponent } from './tag/tag.component'; export { AboutComponent } from './about/about.component'; export { FilesComponent } from './files/files.component'; export { FormNodeViewer } from './activiti/form-node-viewer.component'; +export { SettingComponent } from './setting/setting.component'; diff --git a/demo-shell-ng2/app/components/login/login-demo.component.css b/demo-shell-ng2/app/components/login/login-demo.component.css index e0d26ce54f..d3b186c7c4 100644 --- a/demo-shell-ng2/app/components/login/login-demo.component.css +++ b/demo-shell-ng2/app/components/login/login-demo.component.css @@ -7,4 +7,8 @@ .toggle { width:120px;margin: 20px; -} \ No newline at end of file +} + +.setting-button { + position: absolute; right: 10px; top: 10px; z-index: 1; +} diff --git a/demo-shell-ng2/app/components/login/login-demo.component.html b/demo-shell-ng2/app/components/login/login-demo.component.html index 8f732a3b28..b77993525d 100644 --- a/demo-shell-ng2/app/components/login/login-demo.component.html +++ b/demo-shell-ng2/app/components/login/login-demo.component.html @@ -1,27 +1,35 @@


- +

+ + + + .mdl-card__title { + color: #fff; + background: bottom right 15% no-repeat #1fbcd2; +} + +.setting-card-padding { + width: 50%; + display: table-cell; + vertical-align: middle; + margin: 0; +} + +.setting-container { + display: table; + border-collapse: collapse; + border-spacing: 0; + width: 100%; +} + +.icon-margin { + margin-right: 9px; + } diff --git a/demo-shell-ng2/app/components/setting/setting.component.html b/demo-shell-ng2/app/components/setting/setting.component.html new file mode 100644 index 0000000000..60d372d4e8 --- /dev/null +++ b/demo-shell-ng2/app/components/setting/setting.component.html @@ -0,0 +1,30 @@ +
+
+
+
+
+

SETTINGS

+
+
+
+ ECM host URL configuration +
+ + +
+ BPM host URL configuration +
+ +
+
+
+
+
diff --git a/demo-shell-ng2/app/components/setting/setting.component.ts b/demo-shell-ng2/app/components/setting/setting.component.ts new file mode 100644 index 0000000000..abd7c43a6a --- /dev/null +++ b/demo-shell-ng2/app/components/setting/setting.component.ts @@ -0,0 +1,55 @@ +/*! + * @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 { Component } from '@angular/core'; +import { + AlfrescoSettingsService +} from 'ng2-alfresco-core'; + +declare let __moduleName: string; + +@Component({ + moduleId: __moduleName, + selector: 'alfresco-setting-demo', + templateUrl: './setting.component.html', + styleUrls: ['./setting.component.css'] +}) +export class SettingComponent { + + ecmHost: string; + bpmHost: string; + + constructor(public alfrescoSettingsService: AlfrescoSettingsService) { + this.ecmHost = this.alfrescoSettingsService.ecmHost; + this.bpmHost = this.alfrescoSettingsService.bpmHost + } + + public onChangeECMHost(event: KeyboardEvent): void { + console.log((event.target).value); + this.ecmHost = (event.target).value; + this.alfrescoSettingsService.ecmHost = this.ecmHost; + localStorage.setItem(`ecmHost`, this.ecmHost); + } + + public onChangeBPMHost(event: KeyboardEvent): void { + console.log((event.target).value); + this.bpmHost = (event.target).value; + this.alfrescoSettingsService.bpmHost = this.bpmHost; + localStorage.setItem(`bpmHost`, this.bpmHost); + } + +}