Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFDS-register-front
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EOSC-Pillar
FFDS
FFDS-register-front
Commits
a115dac6
Commit
a115dac6
authored
3 years ago
by
Baptiste Toulemonde
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/repository-description' into 'master'
bug fix See merge request
!31
parents
ff9bffc7
57107b4d
No related branches found
No related tags found
1 merge request
!31
bug fix
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/publishapi/publishapi.component.html
+2
-2
2 additions, 2 deletions
src/app/publishapi/publishapi.component.html
src/app/publishapi/publishapi.component.ts
+64
-2
64 additions, 2 deletions
src/app/publishapi/publishapi.component.ts
with
66 additions
and
4 deletions
src/app/publishapi/publishapi.component.html
+
2
−
2
View file @
a115dac6
...
...
@@ -52,8 +52,8 @@
<div
class=
"field"
>
<label
for=
"x-result"
>
x-result
</label>
<div>
<input
*ngIf=
"openApi.info['x-format'] !== 'ISO 19115' "
name=
"x-result"
[(ngModel)]=
"openApi.info['x-result']"
value=
"json"
fullWidth
nbInput
disabled
/>
<input
*ngIf=
"openApi.info['x-format'] === 'ISO 19115' "
name=
"x-result"
[(ngModel)]=
"openApi.info['x-result']"
value=
"xml"
fullWidth
nbInput
disabled
/>
<input
*ngIf=
"openApi.info['x-format'] !== 'ISO 19115' "
name=
"x-result"
[(ngModel)]=
"openApi.info['x-result']"
value=
"json"
fullWidth
nbInput
/>
<input
*ngIf=
"openApi.info['x-format'] === 'ISO 19115' "
name=
"x-result"
[(ngModel)]=
"openApi.info['x-result']"
value=
"xml"
fullWidth
nbInput
/>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/app/publishapi/publishapi.component.ts
+
64
−
2
View file @
a115dac6
...
...
@@ -34,7 +34,7 @@ export class PublishApiComponent implements OnInit {
parametersTypes
:
string
[];
shemaTypes
:
string
[];
httpStatusCodes
:
string
[];
catalogList
:
{
title
:
string
,
catId
:
string
,
server
:
string
,
type
:
string
}[]
=
[];
catalogList
:
{
title
:
string
,
catId
:
string
,
server
:
string
,
type
:
string
,
version
?:
string
,
description
?:
string
,
result
?:
string
}[]
=
[];
canNext
=
false
;
type
:
string
;
initLabelThree
=
false
;
...
...
@@ -59,13 +59,16 @@ export class PublishApiComponent implements OnInit {
const
titlePromises
:
Promise
<
any
>
[]
=
[];
response
.
forEach
((
catalog
)
=>
{
titlePromises
.
push
(
this
.
catalogService
.
getCatalogContentById
(
catalog
.
catId
).
toPromise
().
then
(
(
response2
)
=>
{
this
.
catalogList
.
push
({
catId
:
catalog
.
catId
,
title
:
this
.
getTitleFromFdpApi
(
response2
),
server
:
this
.
getServerFromFdpApi
(
response2
),
type
:
this
.
getTypeFromFdpApi
(
response2
)
type
:
this
.
getTypeFromFdpApi
(
response2
),
description
:
this
.
getDescriptionFromFdpApi
(
response2
),
version
:
this
.
getVersionFromFdpApi
(
response2
),
});
}).
catch
(
(
error
)
=>
{
...
...
@@ -103,6 +106,11 @@ export class PublishApiComponent implements OnInit {
},
error
:
()
=>
{
this
.
openApi
=
new
OpenApi
(
catId
,
this
.
getServer
(
catId
));
this
.
openApi
.
info
[
'
x-format
'
]
=
this
.
getType
(
catId
);
this
.
openApi
.
info
[
'
title
'
]
=
this
.
getTitle
(
catId
);
this
.
openApi
.
info
[
'
version
'
]
=
this
.
getVersion
(
catId
);
this
.
openApi
.
info
[
'
description
'
]
=
this
.
getDescription
(
catId
);
this
.
openApi
.
info
[
'
x-result
'
]
=
this
.
getResult
(
catId
);
this
.
openApi
.
paths
.
push
(
this
.
openApiDTOMappingService
.
getEmptyPath
(
OpenApiTag
.
search
));
this
.
openApi
.
paths
.
push
(
this
.
openApiDTOMappingService
.
getEmptyPath
(
OpenApiTag
.
dataset
));
this
.
canNext
=
true
;
...
...
@@ -144,6 +152,24 @@ export class PublishApiComponent implements OnInit {
return
''
;
}
getDescriptionFromFdpApi
(
fdpApiResponse
:
FdpApiResponseItem
[]):
string
{
for
(
const
item
of
fdpApiResponse
)
{
if
(
item
.
predicate
.
localName
===
'
description
'
)
{
return
item
.
object
.
label
;
}
}
return
''
;
}
getVersionFromFdpApi
(
fdpApiResponse
:
FdpApiResponseItem
[]):
string
{
for
(
const
item
of
fdpApiResponse
)
{
if
(
item
.
predicate
.
localName
===
'
hasVersion
'
)
{
return
item
.
object
.
label
;
}
}
return
''
;
}
getServer
(
catId
:
string
):
string
{
for
(
const
catalog
of
this
.
catalogList
)
{
if
(
catalog
.
catId
===
catId
)
{
...
...
@@ -162,6 +188,42 @@ export class PublishApiComponent implements OnInit {
return
null
;
}
getTitle
(
catId
:
string
):
string
{
for
(
const
catalog
of
this
.
catalogList
)
{
if
(
catalog
.
catId
===
catId
)
{
return
catalog
.
title
;
}
}
return
null
;
}
getVersion
(
catId
:
string
):
string
{
for
(
const
catalog
of
this
.
catalogList
)
{
if
(
catalog
.
catId
===
catId
)
{
return
catalog
.
version
;
}
}
return
null
;
}
getDescription
(
catId
:
string
):
string
{
for
(
const
catalog
of
this
.
catalogList
)
{
if
(
catalog
.
catId
===
catId
)
{
return
catalog
.
description
;
}
}
return
null
;
}
getResult
(
catId
:
string
):
string
{
for
(
const
catalog
of
this
.
catalogList
)
{
if
(
catalog
.
catId
===
catId
)
{
return
(
catalog
.
type
===
"
ISO 19115
"
)
?
'
xml
'
:
'
json
'
;
}
}
return
null
;
}
savePublication
()
{
this
.
openApiService
.
publishOpenApi
(
this
.
openApi
).
subscribe
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment