From b515c2fb1ee828914885d3a3d926b2bf50ec4830 Mon Sep 17 00:00:00 2001 From: Lauren Davidson <32903719+1aurend@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:16:30 -0800 Subject: [PATCH] [B] Only show warning if user not established --- client/src/backend/containers/users/Edit.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/client/src/backend/containers/users/Edit.js b/client/src/backend/containers/users/Edit.js index 2ab3f33006..c48729b636 100644 --- a/client/src/backend/containers/users/Edit.js +++ b/client/src/backend/containers/users/Edit.js @@ -107,14 +107,14 @@ export class UsersEditContainer extends PureComponent { verifyUser = () => { const t = this.props.t; - const verified = this.user.attributes.admin_verified; + const verified = this.user.attributes.adminVerified; const heading = verified ? t("modals.unverify") : t("modals.verify"); const message = verified ? t("modals.unverify_body") : t("modals.verify_body"); this.props.confirm(heading, message, () => { const adjustedUser = { ...this.user }; - adjustedUser.attributes.admin_verified = !verified; + adjustedUser.attributes.adminVerified = !verified; const call = usersAPI.update(this.user.id, adjustedUser); const options = { notificationScope: "drawer" }; @@ -151,6 +151,13 @@ export class UsersEditContainer extends PureComponent { const user = this.user; const t = this.props.t; + const establishedWarningProps = !user.attributes.established + ? { + instructions: t("records.users.not_established_warning"), + instructionsAreWarning: true + } + : {}; + return (
{this.state.resetPassword ? ( @@ -166,7 +173,7 @@ export class UsersEditContainer extends PureComponent { { onClick: this.verifyUser, icon: "privacy24", - label: user.attributes.admin_verified + label: user.attributes.adminVerified ? t("records.users.block") : t("records.users.verify") }, @@ -187,9 +194,8 @@ export class UsersEditContainer extends PureComponent { className: "utility-button__icon--notice" } ]} - instructions={t("records.users.not_established_warning")} - instructionsAreWarning buttonLayout="grid" + {...establishedWarningProps} />