-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3cf1fb
commit f5fefa7
Showing
6 changed files
with
88 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/StopButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// This file is part of InvenioRDM | ||
// Copyright (C) 2024 CERN | ||
// | ||
// Invenio RDM Records is free software; you can redistribute it and/or modify it | ||
// under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
import React, { useState } from "react"; | ||
import { Icon, Button } from "semantic-ui-react"; | ||
import { i18next } from "@translations/invenio_app_rdm/i18next"; | ||
import { http } from "react-invenio-forms"; | ||
import PropTypes from "prop-types"; | ||
|
||
export const StopButton = ({ stopURL }) => { | ||
const [loading, setLoading] = useState(false); | ||
|
||
const handleClick = async () => { | ||
setLoading(true); | ||
try { | ||
await http.post(stopURL); | ||
setLoading(false); | ||
} catch (error) { | ||
setLoading(false); | ||
// onError(error.response.data.message); | ||
} | ||
}; | ||
|
||
return ( | ||
<Button | ||
fluid | ||
className="error outline" | ||
size="medium" | ||
onClick={handleClick} | ||
loading={loading} | ||
icon | ||
labelPosition="left" | ||
> | ||
<Icon name="stop" /> | ||
{i18next.t("Stop")} | ||
</Button> | ||
); | ||
}; | ||
|
||
StopButton.propTypes = { | ||
stopURL: PropTypes.string.isRequired, | ||
}; |
53 changes: 0 additions & 53 deletions
53
invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/SystemRunActions.js
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
invenio_jobs/assets/semantic-ui/js/invenio_jobs/administration/search/api.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// This file is part of Invenio | ||
// Copyright (C) 2024 CERN. | ||
// | ||
// Invenio RDM is free software; you can redistribute it and/or modify it | ||
// under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
import { http } from "react-invenio-forms"; | ||
import React from "react"; | ||
|
||
import { ErrorMessage } from "@js/invenio_administration"; | ||
|
||
export const stopRun = async (url) => { | ||
try { | ||
await http.post(url); | ||
} catch (error) { | ||
console.error(error); | ||
return ( | ||
<ErrorMessage | ||
{...error} | ||
id="error" | ||
header="hello" | ||
content="errormessage" | ||
/> | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters