Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dad
FFDS-register-front
Commits
d81a86f9
Commit
d81a86f9
authored
Jul 09, 2020
by
cazenave
Browse files
qq modifs
parent
642bcd21
Changes
20
Hide whitespace changes
Inline
Side-by-side
src/app/AppConfiguration.ts
0 → 100644
View file @
d81a86f9
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
@
Injectable
()
export
class
AppConfiguration
{
fdpurl
:
string
;
fdpemail
:
string
;
fdppassword
:
string
;
constructor
(
private
httpClient
:
HttpClient
){};
public
ensureInit
():
Promise
<
any
>
{
return
new
Promise
((
r
,
e
)
=>
{
this
.
httpClient
.
get
(
"
assets/conf/fdpsetting.json
"
)
.
subscribe
(
(
content
:
AppConfiguration
)
=>
{
Object
.
assign
(
this
,
content
);
r
(
this
);
},
reason
=>
e
(
reason
));
});
};
}
src/app/api.service.spec.ts
0 → 100644
View file @
d81a86f9
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
ApiService
}
from
'
./api.service
'
;
describe
(
'
ApiService
'
,
()
=>
{
let
service
:
ApiService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
ApiService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/api.service.ts
0 → 100644
View file @
d81a86f9
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
ApiService
{
constructor
()
{
}
}
src/app/app-routing.module.ts
View file @
d81a86f9
...
...
@@ -25,8 +25,6 @@ const routes: Routes = [
{
path
:
'
settingfdp
'
,
component
:
SettingfdpComponent
},
{
path
:
'
settingsmartapi
'
,
component
:
SettingsmartapiComponent
},
{
path
:
'
swaggerapi
'
,
component
:
SwaggereditorComponent
}
];
@
NgModule
({
...
...
src/app/app.component.html
View file @
d81a86f9
...
...
@@ -147,14 +147,12 @@
<button
mat-menu-item
[matMenuTriggerFor]=
"subMenuDataset"
>
Describe access to datasets
</button>
<mat-menu
#subMenuDataset
="
matMenu
"
>
<button
mat-menu-item
routerLink=
"/swaggerapi"
routerLinkActive=
"active"
>
Swagger API editor
</button>
<button
mat-menu-item
routerLink=
"/swaggerapi"
routerLinkActive=
"active"
>
Swagger
Open
API editor
</button>
<button
mat-menu-item
routerLink=
"/datasets"
routerLinkActive=
"active"
>
Select your datasets to publish
</button>
</mat-menu>
<mat-divider></mat-divider>
<button
mat-menu-item
routerLink=
"/ontologie"
routerLinkActive=
"active"
>
Ontologie mapping
</button>
<mat-divider></mat-divider>
<button
mat-menu-item
routerLink=
"/publish"
routerLinkActive=
"active"
>
Publish in FFDS
</button>
<button
mat-menu-item
routerLink=
"/ontologie"
routerLinkActive=
"active"
>
Metadata mapping
</button>
<mat-divider></mat-divider>
<button
mat-menu-item
routerLink=
"/settingfdp"
routerLinkActive=
"active"
>
FDP setting
</button>
<button
mat-menu-item
routerLink=
"/settingsmartapi"
routerLinkActive=
"active"
>
SmartAPI setting
</button>
...
...
src/app/app.module.ts
View file @
d81a86f9
import
{
BrowserModule
}
from
'
@angular/platform-browser
'
;
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
NgModule
,
APP_INITIALIZER
}
from
'
@angular/core
'
;
import
{
AppRoutingModule
}
from
'
./app-routing.module
'
;
...
...
@@ -27,9 +27,12 @@ import {FormsModule} from '@angular/forms';
import
{
RepositoryinfoComponent
}
from
'
./repositoryinfo/repositoryinfo.component
'
;
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
HttpClientModule
,
HttpClient
}
from
'
@angular/common/http
'
;
import
{
FileSaverModule
}
from
'
ngx-filesaver
'
;
import
{
SwaggereditorComponent
}
from
'
./swaggereditor/swaggereditor.component
'
;
import
{
AppConfiguration
}
from
'
./AppConfiguration
'
@
NgModule
({
declarations
:
[
...
...
@@ -45,7 +48,7 @@ import { SwaggereditorComponent } from './swaggereditor/swaggereditor.component'
UserComponent
,
RepositoryinfoComponent
,
SwaggereditorComponent
],
],
imports
:
[
BrowserModule
,
AppRoutingModule
,
...
...
@@ -62,7 +65,17 @@ import { SwaggereditorComponent } from './swaggereditor/swaggereditor.component'
FileSaverModule
],
providers
:
[],
providers
:
[
AppConfiguration
,
{
provide
:
APP_INITIALIZER
,
useFactory
:
AppConfigurationFactory
,
deps
:
[
AppConfiguration
,
HttpClient
],
multi
:
true
},
],
bootstrap
:
[
AppComponent
]
})
export
class
AppModule
{
}
export
function
AppConfigurationFactory
(
appConfig
:
AppConfiguration
)
{
return
()
=>
appConfig
.
ensureInit
();
}
\ No newline at end of file
src/app/datasets/datasets.component.html
View file @
d81a86f9
<p>
datasets works!
</p>
<h3>
Here list of datasets directly from the openapi GET
</h3>
<h3>
where you can choose what to publish in FDP
</h3>
src/app/login/login.component.html
View file @
d81a86f9
<h3>
AAI EOSC-Pillar (to integrate)
</h3>
<mat-card
class=
"example-card"
>
<mat-card-header>
<mat-card-title>
Login
</mat-card-title>
...
...
@@ -15,7 +17,7 @@
</tr>
<tr>
<td><mat-form-field
class=
"example-full-width"
>
<input
matInput
placeholder=
"Password"
[(ngModel)]=
"password"
type=
"password"
name=
"password"
required
>
<input
matInput
placeholder=
"Password"
[(ngModel)]=
"password"
type=
"password"
name=
"password"
required
>
</mat-form-field></td>
</tr>
<tr>
...
...
src/app/ontologie/ontologie.component.html
View file @
d81a86f9
<p>
ontologie works!
</p>
<h2>
FAIRify your data:
</h2>
<h3>
1 - map your metadata schema with FDP schema
</h3>
<h3>
2 - add missing informations
</h3>
<h3>
3 - and align with ontologies
</h3>
src/app/repository/repository.component.html
View file @
d81a86f9
...
...
@@ -34,5 +34,9 @@
<br>
<button
type=
"submit"
(click)=
"repositorytoyaml('submit')"
class=
"btn btn-primary"
>
Save repository description file
</button>
</div>
<div>
<br>
<button
type=
"submit"
(click)=
"repositorytoyaml('publish')"
class=
"btn btn-success"
>
Publish catalog description in FDP
</button>
</div>
</form>
src/app/repository/repository.component.ts
View file @
d81a86f9
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Validators
}
from
'
@angular/forms
'
;
import
{
FormArray
}
from
'
@angular/forms
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
HttpClient
,
HttpHeaders
}
from
'
@angular/common/http
'
;
import
{
FileSaverService
}
from
'
ngx-filesaver
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
FormGroup
}
from
'
@angular/forms
'
;
import
{
AppConfiguration
}
from
'
../AppConfiguration
'
;
@
Component
({
...
...
@@ -30,7 +30,8 @@ export class RepositoryComponent implements OnInit {
constructor
(
private
_httpClient
:
HttpClient
,
private
appConfig
:
AppConfiguration
,
private
http
:
HttpClient
,
private
_FileSaverService
:
FileSaverService
,
)
{
}
...
...
@@ -42,13 +43,13 @@ if (buttonType == 'submit') {
let
data
:
string
;
data
=
'
\
repository:
\n\
title:
'
+
this
.
Form
.
value
.
reponame
+
'
\n\
description:
'
+
this
.
Form
.
value
.
repodescription
+
'
\n\
url:
'
+
this
.
Form
.
value
.
repourl
+
'
\n\
repository:
\n\
title:
'
+
this
.
Form
.
value
.
reponame
+
'
\n\
description:
'
+
this
.
Form
.
value
.
repodescription
+
'
\n\
url:
'
+
this
.
Form
.
value
.
repourl
+
'
\n\
version:
'
+
this
.
Form
.
value
.
repoversion
+
'
\n\
licence:
'
+
this
.
Form
.
value
.
repolicence
+
'
\n\
language:
'
+
this
.
Form
.
value
.
repolanguage
+
'
\n\
licence:
'
+
this
.
Form
.
value
.
repolicence
+
'
\n\
language:
'
+
this
.
Form
.
value
.
repolanguage
+
'
\n\
'
const
fileName
=
`repository.yaml`
;
...
...
@@ -88,9 +89,36 @@ repository: \n\
}
fileReader
.
readAsText
(
this
.
importFile
);
}
if
(
buttonType
==
'
publish
'
)
{
let
data
:
string
;
data
=
'
\
@prefix dcat: <http://www.w3.org/ns/dcat#>.
\n\
@prefix dct: <http://purl.org/dc/terms/>.
\n\
@prefix fdp: <http://fdp-api.default.svc.cluster.local/>.
\n\n
fdp:new
\n\
a dcat:Catalog, dcat:Resource;
\n\
dct:description "
'
+
this
.
Form
.
value
.
repodescription
+
'
";
\n\
dct:hasVersion "
'
+
this
.
Form
.
value
.
repoversion
+
'
";
\n\
dct:isPartOf <http://fdp-api.default.svc.cluster.local>;
\n\
dct:title "
'
+
this
.
Form
.
value
.
reponame
+
'
".
\n
'
const
httpOptions
=
{
headers
:
new
HttpHeaders
({
'
Accept
'
:
'
text/turtle
'
,
'
Content-Type
'
:
'
text/turtle
'
,
'
Authorization
'
:
'
Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwOGY4YjNiNC01Nzc1LTQyYmQtYjlmMy0zMTFhZDVkNGFiODgiLCJpYXQiOjE1OTQxOTQwMzYsImV4cCI6MTU5NTQwMzYzNn0.p2ygh7D36NziWOSTpBplcyn4jLp_vKKoUUcg27M3hIo
'
})
};
return
this
.
http
.
post
(
this
.
appConfig
.
fdpurl
+
"
/catalog
"
,
data
,
httpOptions
)
.
subscribe
(
(
r
)
=>
{
console
.
log
(
'
got r
'
,
r
)})
;
}
}
}
...
...
src/app/repositoryinfo/repositoryinfo.component.html
View file @
d81a86f9
<
p>
repositoryin
fo works!
</p
>
<
h3>
Filling the SDT for publishing your
repository
in
the national registry
</h3
>
src/app/settingfdp/settingfdp.component.html
View file @
d81a86f9
<p>
settingfdp works!
</p>
<form
[formGroup]=
"Form"
(ngSubmit)=
"SaveFdpSetting()"
>
<div
class=
"form-group"
>
<label>
FAIR data point Url
<input
matInput
placeholder=
"fdp url http://"
type=
"text"
class=
"form-control"
formControlName=
"fdpurl"
required
>
</label>
</div>
<div
class=
"form-group"
>
<label>
Email
<input
matInput
placeholder=
"fdp email"
type=
"text"
class=
"form-control"
formControlName=
"fdpemail"
required
>
</label>
</div>
<div
class=
"form-group"
>
<label>
Password
<input
matInput
placeholder=
"fdp password"
type=
"password"
class=
"form-control"
formControlName=
"fdppassword"
required
>
</label>
</div>
<div>
<br>
<button
type=
"submit"
class=
"btn btn-primary"
>
Save fdp setting
</button>
</div>
</form>
src/app/settingfdp/settingfdp.component.ts
View file @
d81a86f9
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
AppConfiguration
}
from
'
../AppConfiguration
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
FileSaverService
}
from
'
ngx-filesaver
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
FormGroup
}
from
'
@angular/forms
'
;
@
Component
({
selector
:
'
app-settingfdp
'
,
templateUrl
:
'
./settingfdp.component.html
'
,
styleUrls
:
[
'
./settingfdp.component.scss
'
]
})
export
class
SettingfdpComponent
implements
OnInit
{
Form
=
new
FormGroup
({
fdpurl
:
new
FormControl
(),
fdpemail
:
new
FormControl
(),
fdppassword
:
new
FormControl
(),
});
constructor
()
{
}
constructor
(
private
appConfig
:
AppConfiguration
,
private
http
:
HttpClient
,
private
_FileSaverService
:
FileSaverService
)
{}
ngOnInit
()
{
this
.
Form
.
setValue
({
fdpurl
:
this
.
appConfig
.
fdpurl
,
fdpemail
:
this
.
appConfig
.
fdpemail
,
fdppassword
:
this
.
appConfig
.
fdppassword
});
}
}
SaveFdpSetting
()
{
let
data
:
string
;
data
=
'
\
{
\n\
fdpurl: "
'
+
this
.
appConfig
.
fdpurl
+
'
"
\n\
fdpemail: "
'
+
this
.
appConfig
.
fdpemail
+
'
"
\n\
fdppassword: "
'
+
this
.
appConfig
.
fdppassword
+
'
"
\n\
}
'
console
.
log
(
data
);
return
this
.
http
.
post
(
"
/api/fdpsetting
"
,
data
).
subscribe
(
(
r
)
=>
{
console
.
log
(
'
got r
'
,
r
)})
;
};
}
src/app/swaggereditor/swaggereditor.component.html
0 → 100644
View file @
d81a86f9
<div
id=
"swagger-editor"
></div>
src/app/swaggereditor/swaggereditor.component.scss
0 → 100644
View file @
d81a86f9
src/app/swaggereditor/swaggereditor.component.spec.ts
0 → 100644
View file @
d81a86f9
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
SwaggereditorComponent
}
from
'
./swaggereditor.component
'
;
describe
(
'
SwaggereditorComponent
'
,
()
=>
{
let
component
:
SwaggereditorComponent
;
let
fixture
:
ComponentFixture
<
SwaggereditorComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
SwaggereditorComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
SwaggereditorComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/swaggereditor/swaggereditor.component.ts
0 → 100644
View file @
d81a86f9
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
declare
const
SwaggerEditorBundle
:
any
;
declare
const
SwaggerEditorStandalonePreset
:
any
;
@
Component
({
selector
:
'
app-swaggereditor
'
,
templateUrl
:
'
./swaggereditor.component.html
'
,
styleUrls
:
[
'
./swaggereditor.component.scss
'
]
})
export
class
SwaggereditorComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
const
editor
=
SwaggerEditorBundle
({
dom_id
:
'
#swagger-editor
'
,
layout
:
'
StandaloneLayout
'
,
presets
:
[
SwaggerEditorStandalonePreset
],
url
:
'
http://rackerlabs.github.io/wadl2swagger/openstack/swagger/dbaas.json
'
});
}
}
src/assets/conf/fdpsetting.json
0 → 100644
View file @
d81a86f9
{
"fdpurl"
:
"http://6ddrvi64oo.lb.c1.gra7.k8s.ovh.net"
,
"fdpemail"
:
"admin@cines-lab.fr"
,
"fdppassword"
:
"adminadmin"
,
"Authorization"
:
"Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwOGY4YjNiNC01Nzc1LTQyYmQtYjlmMy0zMTFhZDVkNGFiODgiLCJpYXQiOjE1OTQyNzY2MjEsImV4cCI6MTU5NTQ4NjIyMX0.pxCJO_yCK01uLAtlScVMHStTwFE34Ic2CxOijP8Ubcw"
}
\ No newline at end of file
tsconfig.json
View file @
d81a86f9
{
"compileOnSave"
:
fals
e
,
"compileOnSave"
:
tru
e
,
"compilerOptions"
:
{
"baseUrl"
:
"./"
,
"outDir"
:
"./dist/out-tsc"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment