Skip to content

Commit d7770f6

Browse files
committed
[dashboard] Adjusted copy incl. default notification message
1 parent 81b081d commit d7770f6

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

components/dashboard/src/org-admin/AdminPage.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ const AdminPage: React.FC = () => {
3232

3333
return (
3434
<div className="flex flex-col w-full">
35-
<Header
36-
title="Organization Administration"
37-
subtitle="Manage your organization's infrastructure and settings."
38-
/>
35+
<Header title="Organization Administration" subtitle="Manage Infrastructure Rollouts." />
3936
<div className="app-container py-6">
4037
<h2 className="text-2xl font-semibold text-pk-content-primary mb-4">Infrastructure Rollout</h2>
4138

components/dashboard/src/org-admin/MaintenanceNotificationBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FC } from "react";
88
import Alert from "../components/Alert";
99
import { useMaintenanceNotification } from "../data/maintenande-mode/maintenance-notification-query";
1010
import { useMaintenanceMode } from "../data/maintenande-mode/maintenance-mode-query";
11+
import { DEFAULT_MESSAGE } from "./MaintenanceNotificationCard";
1112

1213
export const MaintenanceNotificationBanner: FC = () => {
1314
const { isNotificationEnabled, notificationMessage } = useMaintenanceNotification();
@@ -19,8 +20,7 @@ export const MaintenanceNotificationBanner: FC = () => {
1920
return null;
2021
}
2122

22-
const defaultMessage = "Maintenance is scheduled for this system. Please save your work.";
23-
const displayMessage = notificationMessage || defaultMessage;
23+
const displayMessage = notificationMessage || DEFAULT_MESSAGE;
2424

2525
return (
2626
<Alert type="warning" className="mb-2">

components/dashboard/src/org-admin/MaintenanceNotificationCard.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@ import Alert from "../components/Alert";
1313
import { ConfigurationSettingsField } from "../repositories/detail/ConfigurationSettingsField";
1414
import { Heading3 } from "@podkit/typography/Headings";
1515

16+
export const DEFAULT_MESSAGE =
17+
"On XX-YY-ZZZZ from HH:MM to HH:MM UTC. Workspaces will be stopped and cannot be started during this time.";
18+
1619
export const MaintenanceNotificationCard: FC = () => {
1720
const { isNotificationEnabled, notificationMessage, isLoading } = useMaintenanceNotification();
1821
const setMaintenanceNotificationMutation = useSetMaintenanceNotificationMutation();
19-
const [message, setMessage] = useState(notificationMessage);
22+
const [message, setMessage] = useState(notificationMessage || DEFAULT_MESSAGE);
2023
const [isEditing, setIsEditing] = useState(false);
2124
const toast = useToast();
2225

2326
// Update local state when the data from the API changes
2427
useEffect(() => {
25-
setMessage(notificationMessage);
28+
setMessage(notificationMessage || DEFAULT_MESSAGE);
2629
}, [notificationMessage]);
2730

2831
const toggleNotification = async () => {
@@ -104,7 +107,7 @@ export const MaintenanceNotificationCard: FC = () => {
104107
<Button
105108
variant="secondary"
106109
onClick={() => {
107-
setMessage(notificationMessage);
110+
setMessage(notificationMessage || DEFAULT_MESSAGE);
108111
setIsEditing(false);
109112
}}
110113
>
@@ -116,11 +119,7 @@ export const MaintenanceNotificationCard: FC = () => {
116119
) : (
117120
<div>
118121
<div className="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 min-h-[4rem]">
119-
{message || (
120-
<span className="text-gray-400 dark:text-gray-500 italic">
121-
Default message will be used
122-
</span>
123-
)}
122+
{message}
124123
</div>
125124
<div className="mt-2 flex justify-end">
126125
<Button variant="secondary" onClick={() => setIsEditing(true)}>
@@ -136,9 +135,7 @@ export const MaintenanceNotificationCard: FC = () => {
136135
<Alert type="warning" className="mb-0">
137136
<div className="flex items-center">
138137
<span className="font-semibold">Scheduled Maintenance:</span>
139-
<span className="ml-2">
140-
{message || "Maintenance is scheduled for this system. Please save your work."}
141-
</span>
138+
<span className="ml-2">{message}</span>
142139
</div>
143140
</Alert>
144141
</div>

0 commit comments

Comments
 (0)