diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 21:43:37 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 22:38:14 +0100 |
commit | 0f2773364006751bb5a59cf53caea3b62146cc8d (patch) | |
tree | e7e0c1858ddbb861a6a82a9f3a996ab6af3cb5ef /webapp | |
parent | fce0932dba3ca1b2c436400774821ef14fe32fe5 (diff) |
Fixed webapp build in production mode
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'webapp')
4 files changed, 3 insertions, 182 deletions
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 @@ <input type="url" class="form-control" [ngClass]="{ 'form-control-danger': !server?.connected }" id="inputServerUrl" [(ngModel)]="xdsServerUrl" name="serverUrl" (ngModelChange)="configFormChanged=true" [disabled]="applying"> </div> <div class="col-sm-1"> - <span class="fa fa-fw fa-exchange faa-burst fa-size-x2 vcenter" [ngClass]="{'animated': applying}" [style.color]="(server?.connected && !animated)?'green':'red'" ></span> + <span class="fa fa-fw fa-exchange faa-burst fa-size-x2 vcenter" [ngClass]="{'animated': applying}" [style.color]="(server?.connected && !applying)?'green':'red'" ></span> </div> </div> <div class="form-group row"> 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: ` - <template #popTemplate> - <h3>Install xds-agent:</h3> - <ul> - <li>On Linux machine <a href="{{url_OS_Linux}}" target="_blank"> - <span class="fa fa-external-link"></span></a></li> - - <li>On Windows machine <a href="{{url_OS_Other}}" target="_blank"><span class="fa fa-external-link"></span></a></li> - - <li>On MacOS machine <a href="{{url_OS_Other}}" target="_blank"><span class="fa fa-external-link"></span></a></li> - </ul> - <button type="button" class="btn btn-sm" (click)="pop.hide()"> Cancel </button> - </template> - <button type="button" class="btn btn-link fa fa-download fa-size-x2" - [popover]="popTemplate" - #pop="bs-popover" - placement="left"> - </button> - `, - 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'; -} |