From 0f2773364006751bb5a59cf53caea3b62146cc8d Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Wed, 29 Nov 2017 21:43:37 +0100 Subject: Fixed webapp build in production mode Signed-off-by: Sebastien Douheret --- .../components/tiny-mce/tiny-mce.component.ts | 2 + .../build-settings-modal.component.ts | 143 --------------------- .../config/config-xds/config-xds.component.html | 2 +- .../config-xds/downloadXdsAgent.component.ts | 38 ------ 4 files changed, 3 insertions(+), 182 deletions(-) delete mode 100644 webapp/src/app/pages/build/settings-modal/build-settings-modal.component.ts delete mode 100644 webapp/src/app/pages/config/config-xds/downloadXdsAgent.component.ts (limited to 'webapp') diff --git a/webapp/src/app/@theme/components/tiny-mce/tiny-mce.component.ts b/webapp/src/app/@theme/components/tiny-mce/tiny-mce.component.ts index c54685b..5b391ae 100644 --- a/webapp/src/app/@theme/components/tiny-mce/tiny-mce.component.ts +++ b/webapp/src/app/@theme/components/tiny-mce/tiny-mce.component.ts @@ -1,3 +1,4 @@ +/* MODS_XDS: not used for now import { Component, OnDestroy, AfterViewInit, Output, EventEmitter, ElementRef } from '@angular/core'; @Component({ @@ -31,3 +32,4 @@ export class TinyMCEComponent implements OnDestroy, AfterViewInit { tinymce.remove(this.editor); } } +*/ diff --git a/webapp/src/app/pages/build/settings-modal/build-settings-modal.component.ts b/webapp/src/app/pages/build/settings-modal/build-settings-modal.component.ts deleted file mode 100644 index fd1b904..0000000 --- a/webapp/src/app/pages/build/settings-modal/build-settings-modal.component.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { Component, Input, ViewChild, OnInit } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { FormControl, FormGroup, Validators, ValidationErrors, FormBuilder, ValidatorFn, AbstractControl } from '@angular/forms'; - -// Import RxJs required methods -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/filter'; -import 'rxjs/add/operator/debounceTime'; - -import { AlertService, IAlert } from '../../../@core-xds/services/alert.service'; -import { ProjectService, IProject, ProjectType, ProjectTypes } from '../../../@core-xds/services/project.service'; -import { XDSConfigService } from '../../../@core-xds/services/xds-config.service'; - - -@Component({ - selector: 'xds-build-settings-modal', - templateUrl: 'build-settings-modal.component.html', - styleUrls: ['build-settings-modal.component.scss'], -}) -export class BuildSettingsModalComponent implements OnInit { - // @Input('server-id') serverID: string; - private serverID: string; - - cancelAction = false; - userEditedLabel = false; - projectTypes = ProjectTypes; - - addProjectForm: FormGroup; - typeCtrl: FormControl; - pathCliCtrl: FormControl; - pathSvrCtrl: FormControl; - - constructor( - private alert: AlertService, - private projectSvr: ProjectService, - private XdsConfigSvr: XDSConfigService, - private fb: FormBuilder, - private activeModal: NgbActiveModal, - ) { - // Define types (first one is special/placeholder) - this.projectTypes.unshift({ value: ProjectType.UNSET, display: '--Select a type--' }); - - this.typeCtrl = new FormControl(this.projectTypes[0].value, this.validatorProjType); - this.pathCliCtrl = new FormControl('', this.validatorProjPath); - this.pathSvrCtrl = new FormControl({ value: '', disabled: true }, this.validatorProjPath); - - this.addProjectForm = fb.group({ - type: this.typeCtrl, - pathCli: this.pathCliCtrl, - pathSvr: this.pathSvrCtrl, - label: ['', Validators.nullValidator], - }); - } - - - ngOnInit() { - // Update server ID - this.serverID = this.XdsConfigSvr.getCurServer().id; - this.XdsConfigSvr.onCurServer().subscribe(svr => this.serverID = svr.id); - - // Auto create label name - this.pathCliCtrl.valueChanges - .debounceTime(100) - .filter(n => n) - .map(n => { - const last = n.split('/'); - let nm = n; - if (last.length > 0) { - nm = last.pop(); - if (nm === '' && last.length > 0) { - nm = last.pop(); - } - } - return 'Project_' + nm; - }) - .subscribe(value => { - if (value && !this.userEditedLabel) { - this.addProjectForm.patchValue({ label: value }); - } - }); - - // Handle disabling of Server path - this.typeCtrl.valueChanges - .debounceTime(500) - .subscribe(valType => { - const dis = (valType === String(ProjectType.SYNCTHING)); - this.pathSvrCtrl.reset({ value: '', disabled: dis }); - }); - } - - closeModal() { - this.activeModal.close(); - } - - onKeyLabel(event: any) { - this.userEditedLabel = (this.addProjectForm.value.label !== ''); - } - - onChangeLocalProject(e) { - } - - onSubmit() { - if (this.cancelAction) { - return; - } - - const formVal = this.addProjectForm.value; - - const type = formVal['type'].value; - this.projectSvr.add({ - serverId: this.serverID, - label: formVal['label'], - pathClient: formVal['pathCli'], - pathServer: formVal['pathSvr'], - type: formVal['type'], - // FIXME: allow to set defaultSdkID from New Project config panel - }) - .subscribe(prj => { - this.alert.info('Project ' + prj.label + ' successfully created.'); - this.closeModal(); - - // Reset Value for the next creation - this.addProjectForm.reset(); - const selectedType = this.projectTypes[0].value; - this.addProjectForm.patchValue({ type: selectedType }); - - }, - err => { - this.alert.error(err, 60); - this.closeModal(); - }); - } - - private validatorProjType(g: FormGroup): ValidationErrors | null { - return (g.value !== ProjectType.UNSET) ? null : { validatorProjType: { valid: false } }; - } - - private validatorProjPath(g: FormGroup): ValidationErrors | null { - return (g.disabled || g.value !== '') ? null : { validatorProjPath: { valid: false } }; - } - -} diff --git a/webapp/src/app/pages/config/config-xds/config-xds.component.html b/webapp/src/app/pages/config/config-xds/config-xds.component.html index e4bd0d5..a2506ce 100644 --- a/webapp/src/app/pages/config/config-xds/config-xds.component.html +++ b/webapp/src/app/pages/config/config-xds/config-xds.component.html @@ -10,7 +10,7 @@
- +
diff --git a/webapp/src/app/pages/config/config-xds/downloadXdsAgent.component.ts b/webapp/src/app/pages/config/config-xds/downloadXdsAgent.component.ts deleted file mode 100644 index 556316c..0000000 --- a/webapp/src/app/pages/config/config-xds/downloadXdsAgent.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'xds-dwnl-agent', - template: ``, - /* FIXME SEB: to be reworked - template: ` - - - `, - styles: [` - .fa-size-x2 { - font-size: 20px; - } - `], - */ -}) - -export class DwnlAgentComponent { - - public url_OS_Linux = 'https://en.opensuse.org/LinuxAutomotive#Installation_AGL_XDS'; - public url_OS_Other = 'https://github.com/iotbzh/xds-agent#how-to-install-on-other-platform'; -} -- cgit 1.2.3-korg