Commit b6722dcb authored by cazenave's avatar cazenave
Browse files

Merge branch 'feature/setting' into 'master'

ffds title in setting

See merge request !1
parents c9cb766a f00f48cb
...@@ -4,6 +4,7 @@ import { environment } from 'src/environments/environment.prod'; ...@@ -4,6 +4,7 @@ import { environment } from 'src/environments/environment.prod';
@Injectable() @Injectable()
export class AppConfiguration { export class AppConfiguration {
title: string;
fdpurl: string; fdpurl: string;
fdpemail: string; fdpemail: string;
fdppassword: string; fdppassword: string;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<a routerLink="/" routerLinkActive="active"> <a routerLink="/" routerLinkActive="active">
<img width="80"alt="Angular Logo" src="assets/images/logo.png"/> <img width="80"alt="Angular Logo" src="assets/images/logo.png"/>
</a> </a>
<h3 style="width: 100%;text-align: center;"> <strong>EOSC-Pillar Federated FAIR Data Space</strong></h3> <h3 style="width: 100%;text-align: center;"> <strong>{{settingtitle}}</strong></h3>
<nb-user style="white-space: pre;" name="Paulo Pimenta" <nb-user style="white-space: pre;" name="Paulo Pimenta"
......
import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ChangeDetectionStrategy, Component } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NbMenuItem, NbSidebarService } from '@nebular/theme'; import { NbMenuItem, NbSidebarService } from '@nebular/theme';
import { AppConfiguration } from './AppConfiguration';
@Component({ @Component({
...@@ -10,7 +11,9 @@ import { NbMenuItem, NbSidebarService } from '@nebular/theme'; ...@@ -10,7 +11,9 @@ import { NbMenuItem, NbSidebarService } from '@nebular/theme';
}) })
export class AppComponent { export class AppComponent {
title = 'register-front'; title = 'register-front';
settingtitle = this.appConfig.title ;
items: NbMenuItem[] = [ items: NbMenuItem[] = [
{ {
title: 'Home', title: 'Home',
...@@ -67,8 +70,10 @@ export class AppComponent { ...@@ -67,8 +70,10 @@ export class AppComponent {
}, },
]; ];
constructor(private readonly sidebarService: NbSidebarService) { constructor(
} private readonly sidebarService: NbSidebarService,
private appConfig: AppConfiguration
) {}
toggleSidebar(): boolean { toggleSidebar(): boolean {
this.sidebarService.toggle(true); this.sidebarService.toggle(true);
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
<form [formGroup]="Form" (ngSubmit)="SaveFdpSetting()"> <form [formGroup]="Form" (ngSubmit)="SaveFdpSetting()">
<div class="form-group"> <div class="form-group">
<label>FFDS Title
<input matInput placeholder="FFDS title" type="text" class="form-control" formControlName="title" required>
</label>
<label>FAIR data point Url <label>FAIR data point Url
<input matInput placeholder="fdp url http://" type="text" class="form-control" formControlName="fdpurl" required> <input matInput placeholder="fdp url http://" type="text" class="form-control" formControlName="fdpurl" required>
</label> </label>
......
...@@ -16,6 +16,7 @@ import { environment } from 'src/environments/environment.prod'; ...@@ -16,6 +16,7 @@ import { environment } from 'src/environments/environment.prod';
export class SettingfdpComponent implements OnInit { export class SettingfdpComponent implements OnInit {
Form = new FormGroup({ Form = new FormGroup({
title: new FormControl(),
fdpurl: new FormControl(), fdpurl: new FormControl(),
fdpemail: new FormControl(), fdpemail: new FormControl(),
fdppassword: new FormControl(), fdppassword: new FormControl(),
...@@ -29,6 +30,7 @@ export class SettingfdpComponent implements OnInit { ...@@ -29,6 +30,7 @@ export class SettingfdpComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.Form.setValue({ this.Form.setValue({
title: this.appConfig.title ,
fdpurl: this.appConfig.fdpurl , fdpurl: this.appConfig.fdpurl ,
fdpemail: this.appConfig.fdpemail , fdpemail: this.appConfig.fdpemail ,
fdppassword: this.appConfig.fdppassword fdppassword: this.appConfig.fdppassword
...@@ -40,6 +42,7 @@ export class SettingfdpComponent implements OnInit { ...@@ -40,6 +42,7 @@ export class SettingfdpComponent implements OnInit {
let data: string; let data: string;
data ='\ data ='\
{\n\ {\n\
"title": "'+ this.Form.value.title + '", \n\
"fdpurl": "'+ this.Form.value.fdpurl + '", \n\ "fdpurl": "'+ this.Form.value.fdpurl + '", \n\
"fdpemail": "'+ this.Form.value.fdpemail + '", \n\ "fdpemail": "'+ this.Form.value.fdpemail + '", \n\
"fdppassword": "'+ this.Form.value.fdppassword + '", \n\ "fdppassword": "'+ this.Form.value.fdppassword + '", \n\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment