general improvements & fixes
This commit is contained in:
parent
ea2e3340fe
commit
7a11d3bb58
|
@ -33,7 +33,6 @@ export class DynamicFormComponent implements OnInit {
|
||||||
this.form = this.qcs.toFormGroup(new Array(), new Array());
|
this.form = this.qcs.toFormGroup(new Array(), new Array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getSubForm(subformName) {
|
getSubForm(subformName) {
|
||||||
return this.form.controls[subformName];
|
return this.form.controls[subformName];
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
<div>{{field.description}}</div>
|
<div>{{field.description}}</div>
|
||||||
|
|
||||||
<input *ngSwitchCase="'textbox'" class="form-control" [formControlName]="field.key" [id]="field.key" [type]="field.type"
|
<input *ngSwitchCase="'textbox'" class="form-control" [formControlName]="field.key" [id]="field.key" [type]="field.type"
|
||||||
[(ngModel)]="field.value" [required]="field.required" [pattern] = "field.regex" (blur) = "toggleVisibility($event, field)">
|
[(ngModel)]="field.value" [required]="field.required" [pattern] = "field.regex" (ngModelChange) = "toggleVisibility($event, field)"> <!--input or change event
|
||||||
|
on change event the listener is triggered on blur -->
|
||||||
|
|
||||||
<select *ngSwitchCase="'dropdown'" class="form-control" [id]="field.key" [formControlName]="field.key" [(ngModel)]="field.value" [required]="field.required">
|
<select *ngSwitchCase="'dropdown'" class="form-control" [id]="field.key" [formControlName]="field.key" [(ngModel)]="field.value" [required]="field.required">
|
||||||
<option *ngFor="let opt of field.options" [value]="opt.key">{{opt.value}}</option>
|
<option *ngFor="let opt of field.options" [value]="opt.key">{{opt.value}}</option>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { DataModel } from '../../entities/DataModel';
|
import { DataModel } from '../../entities/DataModel';
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormGroup, ValidatorFn, AbstractControl, Validators } from '@angular/forms';
|
import { FormGroup, ValidatorFn, AbstractControl, Validators } from '@angular/forms';
|
||||||
import { ActivatedRoute} from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { FieldBase } from './field-base';
|
import { FieldBase } from './field-base';
|
||||||
import { GroupBase } from '../../form/dynamic-form-group/group-base';
|
import { GroupBase } from '../../form/dynamic-form-group/group-base';
|
||||||
|
@ -21,7 +21,11 @@ export class DynamicFormFieldComponent {
|
||||||
|
|
||||||
private fragment: string;
|
private fragment: string;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute){}
|
constructor(private route: ActivatedRoute) { }
|
||||||
|
|
||||||
|
ngOnChanges(changeRecord) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
get isValid() {
|
get isValid() {
|
||||||
return this.form.controls[this.field.key].valid;
|
return this.form.controls[this.field.key].valid;
|
||||||
|
@ -52,9 +56,9 @@ export class DynamicFormFieldComponent {
|
||||||
|
|
||||||
ngAfterViewChecked(): void { //navigate to certain section of the page
|
ngAfterViewChecked(): void { //navigate to certain section of the page
|
||||||
try {
|
try {
|
||||||
document.querySelector('#' + this.fragment).scrollIntoView();
|
document.querySelector('#' + this.fragment).scrollIntoView();
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
ruleVisibleMethod(field, rule, dataModel) { //visibility rule -- checks if target field is visible
|
ruleVisibleMethod(field, rule, dataModel) { //visibility rule -- checks if target field is visible
|
||||||
dataModel.fields.forEach(fld => {
|
dataModel.fields.forEach(fld => {
|
||||||
if (fld.label == rule._target && fld.visible == true)
|
if (fld.label == rule._target && fld.visible == true)
|
||||||
|
@ -65,73 +69,72 @@ export class DynamicFormFieldComponent {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
FieldValueRuleMethod(field, rule) { //fieldValue rule -- checks the value of target and apply rules, at the same time when the field becomes visible
|
FieldValueRuleMethod(field, rule) { //fieldValue rule -- checks the value of target and apply rules, at the same time when the field becomes visible
|
||||||
if (rule._ruleStyle == "range") { //calling the AddvalidationRules we apply the validation rules for the new field
|
var targetField = this.dataModel.getFieldByKey(rule._target); //calling the AddvalidationRules we apply the validation rules for the new field
|
||||||
var targetField = this.dataModel.getFieldByKey(rule._target);
|
if (rule._ruleStyle == "range") {
|
||||||
if (parseInt(rule._from) < parseInt(field.value) && parseInt(field.value)< parseInt(rule._to)) {
|
if (parseInt(rule._from) < parseInt(field.value) && parseInt(field.value) < parseInt(rule._to)) {
|
||||||
console.log("visible" + field.value)
|
console.log("visible" + field.value)
|
||||||
targetField.visible = true;
|
targetField.visible = true;
|
||||||
this.AddvalidationRules(rule._target);
|
this.AddvalidationRules(rule._target);
|
||||||
}else{
|
} else {
|
||||||
targetField.visible = false;
|
this.hideField(targetField, rule);
|
||||||
this.form.controls[rule._target].clearValidators(); // when a field is hidden must clear the validators and the errors
|
|
||||||
this.form.controls[rule._target].updateValueAndValidity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (rule._ruleStyle == "boolean") { //boolean Decision field
|
if (rule._ruleStyle == "boolean") { //boolean Decision field
|
||||||
let ruleValue = rule.value.__text;
|
let ruleValue = rule.value.__text;
|
||||||
if (field.value.value.toString() == ruleValue) {
|
if (field.value.value.toString() == ruleValue) {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = true;
|
targetField.visible = true;
|
||||||
this.AddvalidationRules(rule._target);
|
this.AddvalidationRules(rule._target);
|
||||||
} else {
|
} else {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = false;
|
this.hideField(targetField, rule);
|
||||||
this.form.controls[rule._target].clearValidators(); // when a field is hidden must clear the validators and the errors
|
|
||||||
this.form.controls[rule._target].updateValueAndValidity();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rule._ruleStyle == "checked") { //checkbox field
|
if (rule._ruleStyle == "checked") { //checkbox field
|
||||||
if (field.value == true) {
|
if (field.value == true) {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = true;
|
targetField.visible = true;
|
||||||
this.AddvalidationRules(rule._target);
|
this.AddvalidationRules(rule._target);
|
||||||
} else {
|
} else {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = false;
|
this.hideField(targetField, rule);
|
||||||
this.form.controls[rule._target].clearValidators();
|
|
||||||
this.form.controls[rule._target].updateValueAndValidity();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rule._ruleStyle == "existence") {
|
if (rule._ruleStyle == "existence") {
|
||||||
if (field.visible == "true" || field.visible == true) {
|
if (field.visible == "true" || field.visible == true) {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = true;
|
targetField.visible = true;
|
||||||
this.AddvalidationRules(rule._target);
|
this.AddvalidationRules(rule._target);
|
||||||
} else {
|
} else {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = false;
|
this.hideField(targetField, rule);
|
||||||
this.form.controls[rule._target].clearValidators();
|
|
||||||
this.form.controls[rule._target].updateValueAndValidity();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rule._ruleStyle == "regex") {
|
if (rule._ruleStyle == "regex") {
|
||||||
if (new RegExp(rule.__cdata).test(field.value)) {
|
if (new RegExp(rule.__cdata).test(field.value)) {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = true;
|
targetField.visible = true;
|
||||||
this.AddvalidationRules(rule._target);
|
this.AddvalidationRules(rule._target);
|
||||||
} else {
|
} else {
|
||||||
this.dataModel.getFieldByKey(rule._target).visible = false;
|
this.hideField(targetField, rule);
|
||||||
this.form.controls[rule._target].clearValidators();
|
|
||||||
this.form.controls[rule._target].updateValueAndValidity();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hideField(targetField, rule) {
|
||||||
|
targetField.visible = false;
|
||||||
|
targetField.value = ' ';
|
||||||
|
if (this.form.controls[rule._target].hasError("pattern"))
|
||||||
|
this.form.controls[rule._target].reset(); //the regex error message didn't remove without field reset
|
||||||
|
this.form.controls[rule._target].clearValidators(); // when a field is hidden must clear the validators and the errors
|
||||||
|
this.form.controls[rule._target].updateValueAndValidity();
|
||||||
|
}
|
||||||
|
|
||||||
toggleVisibility(e, field, ckb) { //ckb the checkbox only send this parameter, it's essential to change the field value
|
toggleVisibility(e, field, ckb) { //ckb the checkbox only send this parameter, it's essential to change the field value
|
||||||
if (ckb)
|
if (ckb)
|
||||||
field.value = ckb.checked;
|
field.value = ckb.checked;
|
||||||
if(field.rules.length != undefined && field.rules.length > 1)
|
if (field.rules.length != undefined && field.rules.length > 1)
|
||||||
field.rules.forEach(rule => {
|
field.rules.forEach(rule => {
|
||||||
if (rule._type == "fieldValue") {
|
if (rule._type == "fieldValue") {
|
||||||
this.FieldValueRuleMethod(field, rule);
|
this.FieldValueRuleMethod(field, rule);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
else if(field.rules._type == "fieldValue"){
|
else if (field.rules._type == "fieldValue") {
|
||||||
this.FieldValueRuleMethod(field,field.rules);
|
this.FieldValueRuleMethod(field, field.rules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,22 +142,22 @@ export class DynamicFormFieldComponent {
|
||||||
if (this.dataModel.getFieldByKey(field).attributes.validation != undefined) {
|
if (this.dataModel.getFieldByKey(field).attributes.validation != undefined) {
|
||||||
let arrayVal = new Array();
|
let arrayVal = new Array();
|
||||||
this.dataModel.getFieldByKey(field).attributes.validation.forEach(rule => {
|
this.dataModel.getFieldByKey(field).attributes.validation.forEach(rule => {
|
||||||
if (rule.ruleStyle.toString() == RuleStyle[RuleStyle.existence]){
|
if (rule.ruleStyle.toString() == RuleStyle[RuleStyle.existence]) {
|
||||||
this.dataModel.getFieldByKey(field).required = true;
|
this.dataModel.getFieldByKey(field).required = true;
|
||||||
arrayVal.push(Validators.required);
|
arrayVal.push(Validators.required);
|
||||||
}
|
|
||||||
if (rule.ruleStyle.toString() == RuleStyle[RuleStyle.regex]){
|
|
||||||
this.dataModel.getFieldByKey(field).regex = rule.regex;
|
|
||||||
arrayVal.push(Validators.pattern(rule.regex));
|
|
||||||
}
|
|
||||||
if (rule.ruleStyle.toString() == RuleStyle[RuleStyle.customValidation]){
|
|
||||||
arrayVal.push(this.forbiddenNameValidator(/nothing/i));
|
|
||||||
}
|
}
|
||||||
|
if (rule.ruleStyle.toString() == RuleStyle[RuleStyle.regex]) {
|
||||||
|
this.dataModel.getFieldByKey(field).regex = rule.regex;
|
||||||
|
arrayVal.push(Validators.pattern(rule.regex));
|
||||||
|
}
|
||||||
|
if (rule.ruleStyle.toString() == RuleStyle[RuleStyle.customValidation]) {
|
||||||
|
arrayVal.push(this.forbiddenNameValidator(/nothing/i));
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
this.form.controls[field].setValidators(arrayVal); //Multiple Validators, Usage of array because setValidator override any validators that are provided during initialistaion
|
this.form.controls[field].setValidators(arrayVal); //Multiple Validators, Usage of array because setValidator override any validators that are provided during initialistaion
|
||||||
this.form.controls[field].updateValueAndValidity(); //hide--> visible must update the validators
|
this.form.controls[field].updateValueAndValidity(); //hide--> visible must update the validators
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -165,4 +168,6 @@ export class DynamicFormFieldComponent {
|
||||||
return forbidden ? { 'forbiddenName': { value: control.value } } : null;
|
return forbidden ? { 'forbiddenName': { value: control.value } } : null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
||||||
})
|
})
|
||||||
export class LoginComponent implements OnInit{
|
export class LoginComponent implements OnInit{
|
||||||
returnUrl: string;
|
returnUrl: string;
|
||||||
|
public static token : string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
@ -26,15 +27,17 @@ export class LoginComponent implements OnInit{
|
||||||
}
|
}
|
||||||
private myClientId: string = '524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com';
|
private myClientId: string = '524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com';
|
||||||
|
|
||||||
onGoogleSignInSuccess(event: GoogleSignInSuccess) { debugger;
|
onGoogleSignInSuccess(event: GoogleSignInSuccess) {
|
||||||
let googleUser: gapi.auth2.GoogleUser = event.googleUser;
|
let googleUser: gapi.auth2.GoogleUser = event.googleUser;
|
||||||
let id: string = googleUser.getId();
|
let id: string = googleUser.getId();
|
||||||
let profile: gapi.auth2.BasicProfile = googleUser.getBasicProfile();
|
let profile: gapi.auth2.BasicProfile = googleUser.getBasicProfile();
|
||||||
console.log('ID: ' +
|
LoginComponent.token = googleUser.getAuthResponse().id_token;
|
||||||
profile
|
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
|
||||||
.getId()); // Do not send to your backend! Use an ID token instead.
|
|
||||||
console.log('Name: ' + profile.getName());
|
console.log('Name: ' + profile.getName());
|
||||||
|
console.log('token: ' + LoginComponent.token);
|
||||||
localStorage.setItem('currentUser', JSON.stringify(googleUser));
|
localStorage.setItem('currentUser', JSON.stringify(googleUser));
|
||||||
|
var currentUser = JSON.parse(localStorage.getItem('currentUser'));
|
||||||
|
console.log('current user local storage:' +currentUser)
|
||||||
//this.router.navigateByUrl('dynamic-form');
|
//this.router.navigateByUrl('dynamic-form');
|
||||||
this.ngZone.run(() => this.router.navigateByUrl('projects'));
|
this.ngZone.run(() => this.router.navigateByUrl('projects'));
|
||||||
//this.router.navigate(['/projects']);
|
//this.router.navigate(['/projects']);
|
||||||
|
|
|
@ -25,8 +25,7 @@ export class ProjectDetailComponent implements OnInit {
|
||||||
private router: Router,
|
private router: Router,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
debugger;
|
|
||||||
// this.hero$ = this.route.paramMap
|
// this.hero$ = this.route.paramMap
|
||||||
// .switchMap((params: ParamMap) =>
|
// .switchMap((params: ParamMap) =>
|
||||||
// this.service.getHero(params.get('id')));
|
// this.service.getHero(params.get('id')));
|
||||||
|
|
|
@ -34,7 +34,7 @@ export class ProjectsComponent implements OnInit{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {debugger;
|
ngOnInit() {
|
||||||
this.projects = this.serverService.getDummyProjects()
|
this.projects = this.serverService.getDummyProjects()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,7 @@ export class dataModelBuilder {
|
||||||
if (attr.validation.rule._ruleStyle == "customValidation"){
|
if (attr.validation.rule._ruleStyle == "customValidation"){
|
||||||
rule.method= attr.validation.rule._method;
|
rule.method= attr.validation.rule._method;
|
||||||
functions.forEach(fnc => {
|
functions.forEach(fnc => {
|
||||||
if(fnc._id == rule.method) debugger;
|
if(fnc._id == rule.method)
|
||||||
rule.methodJs = fnc.__cdata;
|
rule.methodJs = fnc.__cdata;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -272,7 +272,6 @@ export class dataModelBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(newAttribute);
|
|
||||||
attribute.push(newAttribute);
|
attribute.push(newAttribute);
|
||||||
fields.find(x => x.key == newAttribute.id).attributes.sources = newAttribute.sources;
|
fields.find(x => x.key == newAttribute.id).attributes.sources = newAttribute.sources;
|
||||||
fields.find(x => x.key == newAttribute.id).attributes.validation = newAttribute.validation;
|
fields.find(x => x.key == newAttribute.id).attributes.validation = newAttribute.validation;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {Injectable, ReflectiveInjector, Injector} from '@angular/core';
|
import {Injectable, ReflectiveInjector, Injector} from '@angular/core';
|
||||||
import {Headers, Http, Response} from '@angular/http';
|
import {Headers, Http, Response} from '@angular/http';
|
||||||
|
import { HttpClient , HttpHeaders, HttpParams} from '@angular/common/http';
|
||||||
import 'rxjs/Rx';
|
import 'rxjs/Rx';
|
||||||
import {FieldBase} from '../../app/form/fields/field-base';
|
import {FieldBase} from '../../app/form/fields/field-base';
|
||||||
import {JsonObjest} from '../../app/entities/JsonObject.class';
|
import {JsonObjest} from '../../app/entities/JsonObject.class';
|
||||||
|
@ -7,7 +8,7 @@ import {dataModelBuilder} from '../../app/services/dataModelBuilder.service';
|
||||||
import { DatasetProfile } from '../entities/datasetprofile';
|
import { DatasetProfile } from '../entities/datasetprofile';
|
||||||
import {DataModel} from '../entities/DataModel';
|
import {DataModel} from '../entities/DataModel';
|
||||||
import {Project} from '../entities/model/project';
|
import {Project} from '../entities/model/project';
|
||||||
|
import {LoginComponent} from '../../app/login/login-page';
|
||||||
|
|
||||||
import './../../assets/xml2json.min.js';
|
import './../../assets/xml2json.min.js';
|
||||||
|
|
||||||
|
@ -20,7 +21,8 @@ export class ServerService {
|
||||||
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a868dbbb-ee37-4ce6-81c8-27048e0599a9';
|
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a868dbbb-ee37-4ce6-81c8-27048e0599a9';
|
||||||
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a71a6a92-5c23-40d7-ab87-e30bc860f5a4';//include rules!
|
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a71a6a92-5c23-40d7-ab87-e30bc860f5a4';//include rules!
|
||||||
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/d597c26e-3d8b-416a-bc07-1734d68c79c9';//include sections! + 3groupfields
|
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/d597c26e-3d8b-416a-bc07-1734d68c79c9';//include sections! + 3groupfields
|
||||||
fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/9a4a4a57-4d01-465e-9887-254534f31600';
|
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/dmps/9a4a4a57-4d01-465e-9887-254534f31600'; με το security
|
||||||
|
fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend-no-sec/rest/dmps/9a4a4a57-4d01-465e-9887-254534f31600';
|
||||||
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/6c845c42-dc09-42ed-9959-cceb3b616364';
|
//fetchURL: string = 'http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/6c845c42-dc09-42ed-9959-cceb3b616364';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -31,7 +33,7 @@ export class ServerService {
|
||||||
|
|
||||||
data: any;
|
data: any;
|
||||||
|
|
||||||
constructor(private http: Http) {
|
constructor(private http: Http) { //private http: Http
|
||||||
this.xml2jsonOBJ = new X2JS();
|
this.xml2jsonOBJ = new X2JS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +43,9 @@ export class ServerService {
|
||||||
if(this.data != null)
|
if(this.data != null)
|
||||||
return this.data; //use the already loaded one
|
return this.data; //use the already loaded one
|
||||||
|
|
||||||
|
//let headers = new HttpHeaders();
|
||||||
|
let headers = new HttpHeaders().set("google-token", LoginComponent.token);
|
||||||
|
|
||||||
return this.http.get(this.fetchURL)
|
return this.http.get(this.fetchURL)
|
||||||
.map(
|
.map(
|
||||||
(response: Response) => {
|
(response: Response) => {
|
||||||
|
@ -61,34 +65,6 @@ export class ServerService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getFields() {
|
|
||||||
|
|
||||||
|
|
||||||
//return this.http.get('http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/6c845c42-dc09-42ed-9959-cceb3b616364')
|
|
||||||
return this.http.get('http://dl010.madgik.di.uoa.gr:8080/dmp-backend/rest/DMP/a868dbbb-ee37-4ce6-81c8-27048e0599a9')
|
|
||||||
.map(
|
|
||||||
(response: Response) => {
|
|
||||||
const data = response.json();
|
|
||||||
let obj: JsonObjest = new JsonObjest();
|
|
||||||
|
|
||||||
//let test = new FieldBase(data);
|
|
||||||
|
|
||||||
//replace the xmls {model,view,rule} definitions with json -- https://github.com/abdmob/x2js library
|
|
||||||
data.dataset.profile.definition = this.xml2jsonOBJ.xml_str2json(data.dataset.profile.definition);
|
|
||||||
data.dataset.profile.ruleset.definition = this.xml2jsonOBJ.xml_str2json(data.dataset.profile.ruleset.definition);
|
|
||||||
data.dataset.profile.viewstyle.definition = this.xml2jsonOBJ.xml_str2json(data.dataset.profile.viewstyle.definition);
|
|
||||||
//can be converted back to xml (which shouldn't be needed) with this.xml2jsonOBJ.json2xml_str
|
|
||||||
obj.fields = data.dataset.profile.viewstyle.definition.root.fields.field;
|
|
||||||
|
|
||||||
console.log("obj.fields");
|
|
||||||
console.log(obj.fields);
|
|
||||||
|
|
||||||
return obj.fields; //return data;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
getDummyProjects(){
|
getDummyProjects(){
|
||||||
let projects :Project[] =[];
|
let projects :Project[] =[];
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
function signOut() {debugger;
|
function signOut() {
|
||||||
var auth2 = gapi.auth2.getAuthInstance();
|
var auth2 = gapi.auth2.getAuthInstance();
|
||||||
auth2.signOut().then(function () {
|
auth2.signOut().then(function () {
|
||||||
console.log('User signed out.');
|
console.log('User signed out.');
|
||||||
|
|
Loading…
Reference in New Issue