diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js
index 04736c470..4184fe3c9 100644
--- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js
+++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js
@@ -5,11 +5,13 @@
// under the terms of the MIT License; see LICENSE file for more details.
import React from "react";
-import { Dropdown } from "semantic-ui-react";
+import { Dropdown, Modal, Button, Message } from "semantic-ui-react";
import { i18next } from "@translations/invenio_app_rdm/i18next";
import PropTypes from "prop-types";
+import { http } from "react-invenio-forms";
+import { APIRoutes } from "../administration/users/api/routes";
-export const ManageButton = ({ recid, recordOwnerUsername }) => {
+export const ManageButton = ({ recid, recordOwnerUsername, recordOwnerId }) => {
return (
{
key="manage_user"
text={i18next.t("Manage user")}
/>
+
+ {recordOwnerId && }
);
@@ -43,4 +47,62 @@ export const ManageButton = ({ recid, recordOwnerUsername }) => {
ManageButton.propTypes = {
recid: PropTypes.string.isRequired,
recordOwnerUsername: PropTypes.string.isRequired,
+ recordOwnerId: PropTypes.string.isRequired,
+};
+
+const BlockUserItem = ({ recordOwnerId }) => {
+ const [modalOpen, setModalOpen] = React.useState(false);
+ const handleOpen = () => setModalOpen(true);
+ const handleClose = () => setModalOpen(false);
+ const blockUser = () => {
+ http.post(APIRoutes.block({ id: recordOwnerId }));
+ handleClose();
+ };
+
+ return (
+ <>
+
+
+ {i18next.t("Block User")}
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+BlockUserItem.propTypes = {
+ recordOwnerId: PropTypes.string.isRequired,
};
diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js
index 810406ba2..30b2c002a 100644
--- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js
+++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js
@@ -36,7 +36,14 @@ export class RecordManagement extends Component {
groupsEnabled,
} = this.props;
const { error } = this.state;
- const { id: recid } = record;
+ const {
+ id: recid,
+ parent: {
+ access: {
+ owned_by: { user: recordOwnerId },
+ },
+ },
+ } = record;
const handleError = (errorMessage) => {
console.error(errorMessage);
this.setState({ error: errorMessage });
@@ -46,7 +53,11 @@ export class RecordManagement extends Component {
{permissions.can_moderate && (
-
+
)}
{permissions.can_edit && !isDraft && (