Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rodolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
cubicweb
cubes
Rodolf
Commits
7e3a95822571
Commit
7e3a95822571
authored
1 year ago
by
Olivier Giorgis
Browse files
Options
Downloads
Patches
Plain Diff
fix: display only once projects that use the dataservice in several of these recipes
parent
1c8318f9e53d
No related branches found
No related tags found
1 merge request
!22
Export data into SPARQL endpoint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/app/data-service/[eid]/page.tsx
+13
-1
13 additions, 1 deletion
frontend/src/app/data-service/[eid]/page.tsx
with
13 additions
and
1 deletion
frontend/src/app/data-service/[eid]/page.tsx
+
13
−
1
View file @
7e3a9582
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
import
{
useState
}
from
"
react
"
;
import
{
useState
}
from
"
react
"
;
import
{
useRouter
}
from
"
next/navigation
"
;
import
{
useRouter
}
from
"
next/navigation
"
;
import
{
useGetDataService
}
from
"
@/hooks/useGetDataService
"
;
import
{
useGetDataService
}
from
"
@/hooks/useGetDataService
"
;
import
{
Project
}
from
"
@/types
"
;
export
default
function
DataService
({
export
default
function
DataService
({
params
:
{
eid
},
params
:
{
eid
},
...
@@ -44,6 +45,17 @@
...
@@ -44,6 +45,17 @@
return
<
ErrorScreen
/>;
return
<
ErrorScreen
/>;
}
}
// get projects that use this dataservice at least once
// FIXME fix RQL to get projets only once juste
const
uniqueProjs
:
Project
[]
=
[];
const
uniqueProjNames
:
string
[]
=
[];
data
.
projects
?.
map
((
p
)
=>
{
if
(
!
uniqueProjNames
.
includes
(
p
.
name
))
{
uniqueProjs
.
push
(
p
);
uniqueProjNames
.
push
(
p
.
name
);
}
});
return
(
return
(
<
Container
>
<
Container
>
<
BreadcrumbsMenu
page
=
"Data Service"
/>
<
BreadcrumbsMenu
page
=
"Data Service"
/>
...
@@ -62,7 +74,7 @@
...
@@ -62,7 +74,7 @@
</
Typography
>
</
Typography
>
</
Stack
>
</
Stack
>
<
CardList
loading
=
{
false
}
emptyText
=
"Aucun projet"
>
<
CardList
loading
=
{
false
}
emptyText
=
"Aucun projet"
>
{
data
.
project
s
?.
map
((
p
,
i
)
=>
(
{
uniqueProj
s
?.
map
((
p
,
i
)
=>
(
<
ProjectCard
<
ProjectCard
key
=
{
i
}
key
=
{
i
}
name
=
{
p
.
name
}
name
=
{
p
.
name
}
...
...
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