Merge branch 'Development' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into Development
# Conflicts: # dmp-admin/src/app/field-form/field-form.component.ts
This commit is contained in:
commit
368ffc3bdb
|
@ -15,7 +15,7 @@
|
|||
<label>View style</label>
|
||||
<select class="form-control" formControlName="renderStyle">
|
||||
<option value="textarea">textarea</option>
|
||||
<option value="booleanDesicion">booleanDesicion</option>
|
||||
<option value="booleanDecision">booleanDecision</option>
|
||||
<option value='combobox'>combobox</option>
|
||||
<option value="checkBox">checkBox</option>
|
||||
<option value="freetext">freetext</option>
|
||||
|
|
|
@ -66,14 +66,17 @@ export class FormComponent {
|
|||
(<FormArray>this.form.get("sections")).removeAt(index)
|
||||
}
|
||||
|
||||
updateForm(data) {
|
||||
createForm(data) {
|
||||
return this.restBase.post("/admin/addDmp", data);
|
||||
}
|
||||
|
||||
updateForm(id,data) {
|
||||
return this.restBase.post("/admin/addDmp/"+id, data);
|
||||
}
|
||||
onSubmit() {
|
||||
debugger;
|
||||
let data = this.form.value;
|
||||
this.updateForm(data).subscribe();
|
||||
|
||||
if(this.profileID) this.updateForm(this.profileID, data).subscribe();
|
||||
else this.createForm(data).subscribe();
|
||||
}
|
||||
|
||||
}
|
|
@ -34,7 +34,7 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
|
|||
this.defaultValue = new JsonSerializer<DefaultValue>().fromJSONObject(item.defaultValue, DefaultValue);
|
||||
this.description = item.description;
|
||||
this.extendedDescription = item.extendedDescription;
|
||||
this.defaultVisibility = item.defaultVisibility;
|
||||
this.defaultVisibility = item.defaultVisibility ? item.defaultVisibility : true;
|
||||
this.page = item.page;
|
||||
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.ordinal = item.ordinal;
|
||||
|
@ -70,6 +70,8 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
|
|||
//formGroup.addControl("data",this.data? this.data.buildForm():this.formBuilder.group({}));
|
||||
if(this.data)formGroup.addControl("data",this.data.buildForm());
|
||||
|
||||
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -53,6 +53,8 @@ export class FieldGroup extends BaseModel implements Serializable<FieldGroup>, F
|
|||
}
|
||||
formGroup.addControl('compositeFields', this.formBuilder.array(compositeFieldsFormArray));
|
||||
|
||||
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -50,6 +50,9 @@ export class Section extends BaseModel implements Serializable<Section>, FormGen
|
|||
formGroup.addControl('title', new FormControl(this.title));
|
||||
formGroup.addControl('description', new FormControl(this.description));
|
||||
formGroup.addControl('ordinal', new FormControl(this.ordinal));
|
||||
|
||||
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -13,7 +13,6 @@ export class RuleFormComponent {
|
|||
@Input() dataModel: FormGroup;
|
||||
|
||||
TargetValidation(){
|
||||
debugger;
|
||||
}
|
||||
|
||||
}
|
|
@ -35,45 +35,8 @@ export class AppComponent implements OnInit {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
//this.initiateExternalProviders();
|
||||
}
|
||||
|
||||
initiateExternalProviders(){
|
||||
|
||||
|
||||
//initiate google
|
||||
var clientId = '1010962018903-glegmqudqtl1lub0150vacopbu06lgsg.apps.googleusercontent.com';
|
||||
var scope = [
|
||||
'profile',
|
||||
'email'
|
||||
].join(' ');
|
||||
|
||||
if(gapi.auth2 == undefined){
|
||||
|
||||
gapi.load('auth2', () => {
|
||||
|
||||
gapi.auth2.init({
|
||||
client_id: clientId,
|
||||
cookiepolicy: 'single_host_origin',
|
||||
scope: scope
|
||||
});
|
||||
|
||||
|
||||
|
||||
//RE-Render the button (due to known issues of google-button with angular's lifecycle)
|
||||
gapi.signin2.render('googleBtn');
|
||||
|
||||
//var buttonElement = this.element.nativeElement.querySelector('#googleBtn');
|
||||
//this.attachSignin(buttonElement);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
slideNav(){
|
||||
|
||||
$("#appSidebar").toggleClass("expanded");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<table class="table">
|
||||
<tbody>
|
||||
<tr align="center">
|
||||
<div class="g-signin2" id="googleBtn"></div>
|
||||
<div class="g-signin2" id="googleBtn"></div>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -14,7 +14,7 @@ declare function simple_notifier(type: string, title: string, message:string): a
|
|||
templateUrl: './googgle-sign-in.component.html',
|
||||
styleUrls: ['./googgle-sign-in.component.css']
|
||||
})
|
||||
export class GooggleSignInComponent implements OnInit, AfterViewInit, Injectable {
|
||||
export class GooggleSignInComponent implements OnInit, Injectable {
|
||||
|
||||
|
||||
|
||||
|
@ -22,17 +22,47 @@ export class GooggleSignInComponent implements OnInit, AfterViewInit, Injectable
|
|||
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.initiateExternalProviders();
|
||||
}
|
||||
|
||||
initiateExternalProviders(){
|
||||
|
||||
var clientId = '1010962018903-glegmqudqtl1lub0150vacopbu06lgsg.apps.googleusercontent.com';
|
||||
var scope = [
|
||||
'profile',
|
||||
'email'
|
||||
].join(' ');
|
||||
|
||||
if(gapi.auth2 == undefined){
|
||||
|
||||
gapi.load('auth2', () => {
|
||||
|
||||
gapi.auth2.init({
|
||||
client_id: clientId,
|
||||
cookiepolicy: 'single_host_origin',
|
||||
scope: scope
|
||||
}).then(()=>this.renderButton());
|
||||
|
||||
});
|
||||
|
||||
}else{
|
||||
gapi.auth2.init({
|
||||
client_id: clientId,
|
||||
cookiepolicy: 'single_host_origin',
|
||||
scope: scope
|
||||
}).then(()=>this.renderButton());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
|
||||
renderButton() {
|
||||
|
||||
//RE-Render the button (due to known issues of google-button with angular's lifecycle)
|
||||
gapi.signin2.render('googleBtn');
|
||||
var buttonElement = this.element.nativeElement.querySelector('#googleBtn');
|
||||
this.attachSignin(buttonElement);
|
||||
if(buttonElement)this.attachSignin(buttonElement);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import { NativeLoginService } from '../../services/login/native-login.service';
|
|||
import { TokenService, TokenProvider } from '../../services/login/token.service';
|
||||
import {Router} from '@angular/router';
|
||||
import {MenuItem} from 'primeng/primeng';
|
||||
declare const gapi: any;
|
||||
|
||||
import '../../../assets/custom.js';
|
||||
declare function simple_notifier(type: string, title: string, message:string): any;
|
||||
|
|
Loading…
Reference in New Issue