Skip to content

Commit

Permalink
feat: implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
olloz26 committed Sep 2, 2024
1 parent 29b9d3c commit 12fb579
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
"onloadend",
"onopen",
"openapi",
"openbis",
"papermill",
"pathname",
"pdfjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import {
parseCloudStorageConfiguration,
} from "../../utils/projectCloudStorage.utils";
import { ExternalLink } from "../../../../components/ExternalLinks";
import { WarnAlert } from "../../../../components/Alert";
import { InfoAlert, WarnAlert } from "../../../../components/Alert";

import styles from "./CloudStorage.module.scss";

Expand Down Expand Up @@ -1011,11 +1011,7 @@ function AddStorageOptions({
Please fill in all the options required to connect to your storage. Mind
that the specific fields required depend on your storage configuration.
</p>
{(selectedSchema &&
"convenientMode" in selectedSchema &&
selectedSchema.convenientMode) || (
<AddStorageAdvancedToggle state={state} setState={setState} />
)}
<AddStorageAdvancedToggle state={state} setState={setState} />
{sourcePath}
{optionItems}
{(selectedSchema &&
Expand Down Expand Up @@ -1171,21 +1167,31 @@ function AddStorageMount({
}}
value=""
checked={storage.readOnly ?? false}
readOnly={(selectedSchema && selectedSchema.readOnly) ?? false}
/>
)}
rules={{ required: true }}
/>
{!storage.readOnly && (
{(selectedSchema && selectedSchema.readOnly && (
<div className="mt-1">
<WarnAlert dismissible={false}>
<InfoAlert dismissible={false}>
<p className="mb-0">
You are mounting this storage in read-write mode. If you have
read-only access, please check the box to prevent errors with
some storage types.
This cloud storage only supports read-only access.
</p>
</WarnAlert>
</InfoAlert>
</div>
)}
)) ||
(!storage.readOnly && (
<div className="mt-1">
<WarnAlert dismissible={false}>
<p className="mb-0">
You are mounting this storage in read-write mode. If you have
read-only access, please check the box to prevent errors with
some storage types.
</p>
</WarnAlert>
</div>
))}
<div className={cx("form-text", "text-muted")}>
Check this box to mount the storage in read-only mode. You should
always check this if you do not have credentials to write. You can use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export interface CloudStorageSchema {
hide?: boolean;
prefix: string; // ? weird naming; it's the machine readable name
position?: number;
convenientMode?: boolean; // ? Disables the advanced mode
readOnly?: boolean; // ? Forces read-only access
convenientMode?: boolean; // ? Disables the Rclone full options list, forces read-only access where necessary, ...
readOnly?: boolean; // ? Forces read-only access e.g. for storage that do not support write access
options: CloudStorageSchemaOptions[];
}

Expand Down

0 comments on commit 12fb579

Please sign in to comment.