Skip to content

Commit f93d71e

Browse files
feat: show a prominent warning on certain DC visibility/access combinations (#3881)
1 parent 55f3c39 commit f93d71e

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

client/src/features/dataConnectorsV2/components/DataConnectorModal/DataConnectorModalBody.tsx

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
import KeywordBadge from "~/components/keywords/KeywordBadge";
3333
import KeywordContainer from "~/components/keywords/KeywordContainer";
3434
import ChevronFlippedIcon from "../../../../components/icons/ChevronFlippedIcon";
35-
import { WarnAlert } from "../../../../components/Alert";
35+
import { ErrorAlert, WarnAlert } from "../../../../components/Alert";
3636
import { Loader } from "../../../../components/Loader";
3737
import useAppDispatch from "../../../../utils/customHooks/useAppDispatch.hook";
3838
import useAppSelector from "../../../../utils/customHooks/useAppSelector.hook";
@@ -548,16 +548,26 @@ export function DataConnectorMount({
548548
)}
549549
rules={{ required: true }}
550550
/>
551-
{!flatDataConnector.readOnly && (
552-
<div className="mt-1">
553-
<WarnAlert dismissible={false}>
554-
<p className="mb-0">
555-
You are mounting this storage in read-write mode. If you have
556-
read-only access, please select &quot;Read Only&quot; to
557-
prevent errors with some storage types.
558-
</p>
559-
</WarnAlert>
560-
</div>
551+
{!flatDataConnector.readOnly &&
552+
!hasPasswordFieldWithInput &&
553+
flatDataConnector.visibility === "public" ? (
554+
<ErrorAlert className="mt-1" dismissible={false}>
555+
<p className="mb-0">
556+
Data security warning: This public and writable data connector
557+
is not protected by a password. Anyone on RenkuLab will be able
558+
to edit the data connected here. Protect your data with a
559+
password, select private visibility, or limit access to
560+
read-only.
561+
</p>
562+
</ErrorAlert>
563+
) : (
564+
<WarnAlert className="mt-1" dismissible={false}>
565+
<p className="mb-0">
566+
You are mounting this storage in read-write mode. If you have
567+
read-only access, please select &quot;Read Only&quot; to prevent
568+
errors with some storage types.
569+
</p>
570+
</WarnAlert>
561571
)}
562572
<div className={cx("form-text", "text-muted")}>
563573
Select &quot;Read Only&quot; to mount the storage without write

0 commit comments

Comments
 (0)