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
0558e92efffa
Commit
0558e92efffa
authored
1 year ago
by
Arnaud Vergnet
Browse files
Options
Downloads
Patches
Plain Diff
feat(frontend): add button to download import process shacl reports
parent
f51fd48d5aef
No related branches found
No related tags found
1 merge request
!28
feat(frontend): add button to download import process shacl reports
Pipeline
#229898
passed
1 year ago
Stage: install
Stage: lint
Stage: build
Stage: tests
Stage: release
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/api/cubicweb.ts
+12
-9
12 additions, 9 deletions
frontend/src/api/cubicweb.ts
frontend/src/components/ImportProcessTable.tsx
+38
-0
38 additions, 0 deletions
frontend/src/components/ImportProcessTable.tsx
frontend/src/types.ts
+2
-0
2 additions, 0 deletions
frontend/src/types.ts
with
52 additions
and
9 deletions
frontend/src/api/cubicweb.ts
+
12
−
9
View file @
0558e92e
...
...
@@ -306,6 +306,6 @@
// the state to fetch the TrInfo which leads to this state, and with the TrInfo entity you do have the
// creation_date, the comment and so on
return
(
"
Any X, MAX(VAL_DATE), VAL_RECIPE, VAL_PROJECT, VAL_STATE
"
+
"
GROUPBY X, VAL_RECIPE, VAL_PROJECT, VAL_STATE
"
+
"
Any X, MAX(VAL_DATE), VAL_RECIPE, VAL_PROJECT, VAL_STATE
, ATTR_SHACL_VALID
"
+
"
GROUPBY X, VAL_RECIPE, VAL_PROJECT, VAL_STATE
, ATTR_SHACL_VALID
"
+
"
ORDERBY MAX(VAL_DATE) DESC
"
+
...
...
@@ -311,5 +311,5 @@
"
ORDERBY MAX(VAL_DATE) DESC
"
+
"
WHERE X is ImportProcess,
"
+
"
WHERE X is ImportProcess,
X shacl_valid ATTR_SHACL_VALID,
"
+
getImportRecipePart
(
hasDataService
,
hasRecipe
)
+
getImportProcedurePart
(
hasProject
)
+
"
X in_state S, S name VAL_STATE,
"
+
...
...
@@ -341,8 +341,8 @@
// TODO fetch files for all import processes
// See https://forge.extranet.logilab.fr/cubicweb/RQL/-/merge_requests/99
const
dataLogQuery
=
transaction
.
push
(
"
Any X, DATA.download_url(), LOG.download_url() WHERE X eid %(eid)s,
"
+
"
X has_output_dataset DATA?, X import_report LOG?
"
,
"
Any X, DATA.download_url(), LOG.download_url()
, SHACL.download_url()
WHERE X eid %(eid)s,
"
+
"
X has_output_dataset DATA?, X import_report LOG?
, X shacl_report SHACL?
"
,
{
eid
:
importProcessListQuery
.
ref
().
row
(
0
).
column
(
0
)
},
);
const
result
=
await
client
.
executeTransaction
(
transaction
);
...
...
@@ -353,8 +353,9 @@
for
(
const
result
of
importProcessListResult
)
{
const
dataLog
=
dataLogListResult
.
find
((
e
)
=>
e
[
0
]
===
result
[
0
]);
if
(
dataLog
!=
undefined
)
{
result
[
5
]
=
dataLog
[
1
];
result
[
6
]
=
dataLog
[
2
];
result
[
6
]
=
dataLog
[
1
];
result
[
7
]
=
dataLog
[
2
];
result
[
8
]
=
dataLog
[
3
];
}
}
return
importProcessListResultSetToObject
(
importProcessListResult
);
...
...
@@ -378,8 +379,10 @@
recipe
:
r
[
2
],
project
:
r
[
3
],
state
:
r
[
4
],
dataset_url
:
r
[
5
],
log_url
:
r
[
6
],
shacl_valid
:
r
[
5
],
dataset_url
:
r
[
6
],
log_url
:
r
[
7
],
shacl_report_url
:
r
[
8
],
}
as
ImportProcess
;
});
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/ImportProcessTable.tsx
+
38
−
0
View file @
0558e92e
...
...
@@ -9,6 +9,8 @@
CircularProgress
,
Typography
,
IconButton
,
Tooltip
,
Box
,
}
from
"
@mui/material
"
;
import
CheckIcon
from
"
@mui/icons-material/Check
"
;
import
CloseIcon
from
"
@mui/icons-material/Close
"
;
...
...
@@ -32,6 +34,8 @@
if
(
url
)
{
const
fileToOpen
=
await
downloadFile
(
url
);
openFile
(
fileToOpen
);
}
else
{
console
.
error
(
"
No file to open
"
);
}
}
...
...
@@ -73,6 +77,7 @@
<
TableCell
>
Projet
</
TableCell
>
<
TableCell
width
=
{
50
}
>
Dataset
</
TableCell
>
<
TableCell
width
=
{
50
}
>
Log
</
TableCell
>
<
TableCell
width
=
{
50
}
>
SHACL
</
TableCell
>
</
TableRow
>
</
TableHead
>
<
TableBody
>
...
...
@@ -134,7 +139,8 @@
</
IconButton
>
</
ButtonTooltip
>
</
TableCell
>
<
ShaclButton
importProcess
=
{
importProcess
}
/>
</
TableRow
>
);
}
...
...
@@ -137,7 +143,39 @@
</
TableRow
>
);
}
function
ShaclButton
({
importProcess
}:
{
importProcess
:
ImportProcess
})
{
if
(
importProcess
.
shacl_valid
)
{
return
(
<
TableCell
>
<
Tooltip
title
=
"La validation SHACL a réussi"
>
<
Box
style
=
{
{
display
:
"
flex
"
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
}
}
>
<
CheckIcon
/>
</
Box
>
</
Tooltip
>
</
TableCell
>
);
}
return
(
<
TableCell
>
<
ButtonTooltip
title
=
{
"
Voir le rapport d'erreur SHACL
"
}
>
<
IconButton
color
=
"primary"
onClick
=
{
()
=>
showFile
(
importProcess
.
shacl_report_url
)
}
>
<
Visibility
color
=
"warning"
/>
</
IconButton
>
</
ButtonTooltip
>
</
TableCell
>
);
}
function
StateIcon
({
state
}:
{
state
:
ImportProcess
[
"
state
"
]
})
{
if
(
state
===
"
successful
"
)
{
return
<
CheckIcon
/>;
...
...
This diff is collapsed.
Click to expand it.
frontend/src/types.ts
+
2
−
0
View file @
0558e92e
...
...
@@ -41,4 +41,6 @@
state
:
"
waiting
"
|
"
ongoing
"
|
"
error
"
|
"
successful
"
;
dataset_url
?:
string
;
log_url
?:
string
;
shacl_valid
:
boolean
;
shacl_report_url
?:
string
;
};
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