Skip to content

Commit

Permalink
Address feedback from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
bmquinn committed Jun 26, 2024
1 parent 5d5748b commit 4d32fab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 36 deletions.
21 changes: 4 additions & 17 deletions app/assets/js/components/Work/Tabs/Preservation/FileSetModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ const modalCss = css`
z-index: 100;
`;

const sectionHeaderCss = css`
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 1rem;
`;

const sectionCss = css`
margin-bottom: 2rem;
padding: 1rem;
border: 1px solid #ddd;
border-radius: 4px;
`;

function WorkTabsPreservationFileSetModal({
closeModal,
isVisible,
Expand Down Expand Up @@ -252,8 +239,8 @@ function WorkTabsPreservationFileSetModal({

{watchRole && (
<>
<div css={sectionCss}>
<h3 css={sectionHeaderCss}>Option 1: Drag and Drop File</h3>
<div class="box">
<h3>Option 1: Drag and Drop File</h3>
<WorkTabsPreservationFileSetDropzone
currentFile={currentFile}
acceptedFileTypes={acceptedFileTypes}
Expand All @@ -266,8 +253,8 @@ function WorkTabsPreservationFileSetModal({
/>
</div>

<div css={sectionCss}>
<h3 css={sectionHeaderCss}>Option 2: Choose from S3 Ingest Bucket</h3>
<div class="box">
<h3>Option 2: Choose from S3 Ingest Bucket</h3>
<S3ObjectPicker
onFileSelect={handleSelectS3Object}
fileSetRole={watchRole}
Expand Down
21 changes: 4 additions & 17 deletions app/assets/js/components/Work/Tabs/Preservation/ReplaceFileSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ import UIIconText from "../../../UI/IconText";
import WorkTabsPreservationFileSetDropzone from "@js/components/Work/Tabs/Preservation/FileSetDropzone";
import S3ObjectPicker from "@js/components/Work/Tabs/Preservation/S3ObjectPicker"

const sectionHeaderCss = css`
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 1rem;
`;

const sectionCss = css`
margin-bottom: 2rem;
padding: 1rem;
border: 1px solid #ddd;
border-radius: 4px;
`;

function WorkTabsPreservationReplaceFileSet({
closeModal,
fileset,
Expand Down Expand Up @@ -226,8 +213,8 @@ function WorkTabsPreservationReplaceFileSet({
)}
{error && <Error error={error} />}

<div css={sectionCss}>
<h3 css={sectionHeaderCss}>Option 1: Drag and Drop File</h3>
<div class="box">
<h3>Option 1: Drag and Drop File</h3>
<WorkTabsPreservationFileSetDropzone
currentFile={currentFile}
fileSetRole={fileset?.role?.id}
Expand All @@ -239,8 +226,8 @@ function WorkTabsPreservationReplaceFileSet({
/>
</div>

<div css={sectionCss}>
<h3 css={sectionHeaderCss}>Option 2: Choose from S3 Ingest Bucket</h3>
<div class="box">
<h3>Option 2: Choose from S3 Ingest Bucket</h3>
<S3ObjectPicker
onFileSelect={handleSelectS3Object}
fileSetRole={fileset?.role?.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const S3ObjectPicker = ({ onFileSelect, fileSetRole, workTypeId, defaultPrefix =
refetch({ prefix: defaultPrefix });
};

const handlePrefixChange = (e) => {
const handlePrefixChange = async (e) => {
const inputValue = e.target.value;
const newPrefix = inputValue.startsWith(defaultPrefix) ? inputValue : defaultPrefix + inputValue;
setPrefix(newPrefix);
refetch({ prefix: newPrefix });
await refetch({ prefix: newPrefix });
};

const handleRefresh = async () => {
Expand Down

0 comments on commit 4d32fab

Please sign in to comment.