From f3cf1fbbb0cc59c92c43b1c8d157a4ef48540d8b Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Wed, 29 May 2024 16:25:41 +0200 Subject: [PATCH] js: add POST request to run button --- .../administration/search/JobRunsHeader.js | 5 ++++- .../search/JobSearchResultItemLayout.js | 20 +++++++++++++------ .../administration/search/RunButton.js | 20 +++++++++++++++---- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobRunsHeader.js b/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobRunsHeader.js index 83bc031..9c480f0 100644 --- a/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobRunsHeader.js +++ b/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobRunsHeader.js @@ -18,6 +18,9 @@ export async function JobRunsHeader(pidValue) { } const actions = document.getElementById("actions"); - ReactDOM.render(, actions); + ReactDOM.render( + , + actions + ); }); } diff --git a/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobSearchResultItemLayout.js b/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobSearchResultItemLayout.js index 1e62035..e799ffb 100644 --- a/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobSearchResultItemLayout.js +++ b/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/JobSearchResultItemLayout.js @@ -13,7 +13,7 @@ import React, { Component } from "react"; import { UserListItemCompact, toRelativeTime } from "react-invenio-forms"; import { withState } from "react-searchkit"; import { Popup, Table, Button, Icon } from "semantic-ui-react"; -import { RunButton } from "./RunButton"; +// import { RunButton } from "./RunButton"; import { StatusFormatter } from "./StatusFormatter"; import { http } from "react-invenio-forms"; @@ -93,11 +93,19 @@ class SearchResultItemComponent extends Component { : toRelativeTime(result.next_run, i18next.language) ?? "−"} - - {/* */} + + {/* */} ); diff --git a/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/RunButton.js b/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/RunButton.js index 6ec8043..1fd4ea6 100644 --- a/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/RunButton.js +++ b/invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/RunButton.js @@ -14,8 +14,9 @@ import { Form, FormInput, } from "semantic-ui-react"; +import { http } from "react-invenio-forms"; -export const RunButton = ({ config }) => { +export const RunButton = ({ jobId, config }) => { return ( { direction="left" > -
+ {Object.keys(config).map((key) => ( { onClick={(e) => e.stopPropagation()} /> ))} -