diff --git a/frontend/src/api/cubicweb.ts b/frontend/src/api/cubicweb.ts index 0f3e807f14b3e84b10e9184e7dd150823d94f52e_ZnJvbnRlbmQvc3JjL2FwaS9jdWJpY3dlYi50cw==..1c8318f9e53dd1efedb407fc7fc776d9bf338435_ZnJvbnRlbmQvc3JjL2FwaS9jdWJpY3dlYi50cw== 100644 --- a/frontend/src/api/cubicweb.ts +++ b/frontend/src/api/cubicweb.ts @@ -193,7 +193,7 @@ }); const eidRef = insertQuery.ref().row(0).column(0); transaction.push(setDataServiceRql, { - dataservice: data.dataservice, + dataservice: data.dataservice.eid, eid: eidRef, }); transaction.push(setProjectRql, { @@ -212,8 +212,8 @@ "X virtuoso_password ATTR_VIRTUOSO_PASSWORD, X activated ATTR_ACTIVATED, X ontology_file REL_ONTOLOGY?, X shacl_files REL_SHACL?"; const recipeListRql = - "Any X, ATTR_NAME, ATTR_GRAPH_URI, ATTR_PROCESS_TYPE ,REL_DATASERVICE " + - "WHERE X is ImportRecipe, X name ATTR_NAME, X graph_uri ATTR_GRAPH_URI, X process_type ATTR_PROCESS_TYPE, X dataservice REL_DATASERVICE, O import_recipes X, O eid %(eid)s"; + "Any X, ATTR_NAME, ATTR_GRAPH_URI, ATTR_PROCESS_TYPE ,REL_DATASERVICE, REL_DATASERVICE_NAME " + + "WHERE X is ImportRecipe, X name ATTR_NAME, X graph_uri ATTR_GRAPH_URI, X process_type ATTR_PROCESS_TYPE, X dataservice REL_DATASERVICE, REL_DATASERVICE name REL_DATASERVICE_NAME, O import_recipes X, O eid %(eid)s"; return async (eid: number) => { try { @@ -235,7 +235,7 @@ name: r[1], process_type: r[2], graph_uri: r[3], - dataservice: r[4], + dataservice: { eid: r[4], name: r[5] }, }) as Recipe, ); diff --git a/frontend/src/app/project/[eid]/page.tsx b/frontend/src/app/project/[eid]/page.tsx index 0f3e807f14b3e84b10e9184e7dd150823d94f52e_ZnJvbnRlbmQvc3JjL2FwcC9wcm9qZWN0L1tlaWRdL3BhZ2UudHN4..1c8318f9e53dd1efedb407fc7fc776d9bf338435_ZnJvbnRlbmQvc3JjL2FwcC9wcm9qZWN0L1tlaWRdL3BhZ2UudHN4 100644 --- a/frontend/src/app/project/[eid]/page.tsx +++ b/frontend/src/app/project/[eid]/page.tsx @@ -92,6 +92,7 @@ key={i} name={d.name} processType={d.process_type} + dataserviceName={d.dataservice.name} onOpen={() => { if (selectedRecipeEid !== d.eid) { setSelectedRecipeEid(d.eid); diff --git a/frontend/src/components/RecipeModal.tsx b/frontend/src/components/RecipeModal.tsx index 0f3e807f14b3e84b10e9184e7dd150823d94f52e_ZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUmVjaXBlTW9kYWwudHN4..1c8318f9e53dd1efedb407fc7fc776d9bf338435_ZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUmVjaXBlTW9kYWwudHN4 100644 --- a/frontend/src/components/RecipeModal.tsx +++ b/frontend/src/components/RecipeModal.tsx @@ -104,6 +104,6 @@ render={({ field, fieldState: { error } }) => ( <Autocomplete disabled={saving} - {...field} - inputValue={data?.find((d) => d.eid === field.value)?.name} + {...field.value} + inputValue={data?.find((d) => d === field.value)?.name} onChange={(_, newValue) => field.onChange(newValue)} @@ -109,5 +109,5 @@ onChange={(_, newValue) => field.onChange(newValue)} - options={data ? data.map((d) => d.eid) : []} + options={data ? data : []} loading={loading} renderInput={(params) => ( <TextField @@ -123,7 +123,7 @@ )} getOptionLabel={ data - ? (option) => data.find((d) => d.eid === option)?.name ?? "" + ? (option) => data.find((d) => d === option)?.name ?? "" : () => "" } /> diff --git a/frontend/src/components/cards/RecipeCard.tsx b/frontend/src/components/cards/RecipeCard.tsx index 0f3e807f14b3e84b10e9184e7dd150823d94f52e_ZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvY2FyZHMvUmVjaXBlQ2FyZC50c3g=..1c8318f9e53dd1efedb407fc7fc776d9bf338435_ZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvY2FyZHMvUmVjaXBlQ2FyZC50c3g= 100644 --- a/frontend/src/components/cards/RecipeCard.tsx +++ b/frontend/src/components/cards/RecipeCard.tsx @@ -14,6 +14,7 @@ interface RecipeCardProps { name: string; processType: "default" | "default-dryrun"; + dataserviceName: string; lastProcessDate?: Date; lastProcessSuccess?: boolean; selected: boolean; @@ -26,6 +27,7 @@ lastProcessDate, lastProcessSuccess, processType, + dataserviceName, selected, onOpen, onDelete, @@ -73,6 +75,7 @@ </> ) : null} <Typography variant="body2">Process type: {processType}</Typography> + <Typography variant="body2">Data Service: {dataserviceName}</Typography> </CardContent> </BaseCard> ); diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 0f3e807f14b3e84b10e9184e7dd150823d94f52e_ZnJvbnRlbmQvc3JjL3R5cGVzLnRz..1c8318f9e53dd1efedb407fc7fc776d9bf338435_ZnJvbnRlbmQvc3JjL3R5cGVzLnRz 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -28,7 +28,7 @@ export type Recipe = { eid: number; name: string; - dataservice: number; + dataservice: { eid: number; name: string }; graph_uri: string; process_type: "default" | "default-dryrun"; };