Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Publisher] Admin Panel: Update copy for the copy-superagency-metric-settings checkbox and warning message to add more specificity #1185

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions publisher/src/components/AdminPanel/AdminPanel.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export const InputLabelContainer = styled.div`

export const InputLabelWrapper = styled.div<{
flexRow?: boolean;
wrapLabelText?: boolean;
topSpacing?: boolean;
inputWidth?: number;
noBottomSpacing?: boolean;
Expand Down Expand Up @@ -281,7 +282,8 @@ export const InputLabelWrapper = styled.div<{
color: ${palette.highlight.grey8};
margin-top: 5px;
padding: 0 3px;
white-space: nowrap;
white-space: ${({ wrapLabelText }) =>
wrapLabelText ? "normal" : "nowrap"};
}

${({ required }) =>
Expand Down Expand Up @@ -822,8 +824,21 @@ export const GraphicLines = styled.div<{ type?: SaveConfirmationType }>`
}
`;

export const WarningMessage = styled.p`
export const WarningMessage = styled.div`
${typography.sizeCSS.small}
max-width: 350px;
color: ${palette.solid.red};
margin-top: 5px;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
border: 1px solid ${palette.solid.red};
border-radius: 4px;
padding: 16px;
margin-left: 12px;

p {
text-align: center;
}
`;
21 changes: 14 additions & 7 deletions publisher/src/components/AdminPanel/AgencyProvisioning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =============================================================================

import alertIcon from "@justice-counts/common/assets/alert-icon.png";
import { Button } from "@justice-counts/common/components/Button";
import { Dropdown } from "@justice-counts/common/components/Dropdown";
import { MiniLoader } from "@justice-counts/common/components/MiniLoader";
Expand Down Expand Up @@ -870,7 +871,7 @@ export const AgencyProvisioning: React.FC<ProvisioningProps> = observer(
</Styled.InputLabelWrapper>

{hasSystems && hasChildAgencies && (
<Styled.InputLabelWrapper flexRow>
<Styled.InputLabelWrapper flexRow wrapLabelText>
<input
id="copy-superagency-metric-settings"
name="copy-superagency-metric-settings"
Expand All @@ -883,15 +884,21 @@ export const AgencyProvisioning: React.FC<ProvisioningProps> = observer(
checked={isCopySuperagencyMetricSettingsSelected}
/>
<label htmlFor="copy-superagency-metric-settings">
Copy all metric settings to child agencies
Copy all metric settings to child agencies across
all sectors
</label>
{isCopySuperagencyMetricSettingsSelected && (
<Styled.WarningMessage>
Warning! This action cannot be undone. After
clicking <strong>Save</strong>, the copying
process will begin and you will receive an email
confirmation once the metrics settings have been
copied over.
<img src={alertIcon} alt="" width="24px" />
<p>
WARNING! This action cannot be undone. This
will OVERWRITE all metric settings in all
child agencies. After clicking{" "}
<strong>Save</strong>, the copying process
will begin and you will receive an email
confirmation once the metrics settings have
been copied over.
</p>
</Styled.WarningMessage>
)}
</Styled.InputLabelWrapper>
Expand Down
Loading