Skip to content

Commit

Permalink
Merge pull request #4206 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy v9.5.0 to production
  • Loading branch information
kdid authored Nov 4, 2024
2 parents e632a63 + 76580cd commit 29dd192
Show file tree
Hide file tree
Showing 10 changed files with 423 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function WorkAdministrativeTabsGeneral({
className="break-word"
onClick={() =>
handlePassedInSearchTerm(
"administrativeMetadata.status.label",
"status",
status.label
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/components/Work/Tabs/Structure/Structure.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const WorkTabsStructure = ({ work }) => {
name="work-structure-form"
onSubmit={methods.handleSubmit(onSubmit)}
>
<UITabsStickyHeader title="Structure of Filesets">
<UITabsStickyHeader title="Access & Auxiliary Filesets">
{!isEditing && (
<Button
isPrimary
Expand Down
55 changes: 39 additions & 16 deletions app/assets/js/components/Work/Tabs/Structure/WebVTTModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function WorkTabsStructureWebVTTModal({ isActive }) {
const [parseErrors, setParseErrors] = React.useState();
const workState = useWorkState();
const [webVttValue, setWebVttValue] = React.useState("");
const [confirmDelete, setConfirmDelete] = React.useState(false);
const params = useParams();
const workId = params.id;

Expand All @@ -34,7 +35,7 @@ function WorkTabsStructureWebVTTModal({ isActive }) {
if (graphQLErrors?.length > 0) {
errorStrings = graphQLErrors.map(
({ message, details }) =>
`${message}: ${details && details.title ? details.title : ""}`
`${message}: ${details && details.title ? details.title : ""}`,
);
}
toastWrapper("is-danger", errorStrings.join(" \n "));
Expand Down Expand Up @@ -65,6 +66,7 @@ function WorkTabsStructureWebVTTModal({ isActive }) {
dispatch({ type: "toggleWebVttModal", fileSetId: null });
setParseErrors(null);
setWebVttValue("");
setConfirmDelete(false);
};

const handleSubmit = (structuralMetadata) => {
Expand All @@ -76,6 +78,12 @@ function WorkTabsStructureWebVTTModal({ isActive }) {
});
};

const handleDelete = () => {
setConfirmDelete(true);
setParseErrors("Are you sure you want to delete this WebVTT structure?");
setWebVttValue("");
};

return (
<div
className={classNames(["modal"], {
Expand All @@ -95,6 +103,12 @@ function WorkTabsStructureWebVTTModal({ isActive }) {
</header>

<section className="modal-card-body">
{confirmDelete && (
<Notification isDanger>
Are you sure you want to delete this WebVTT structure?
</Notification>
)}

{webVttValue?.trim().length > 0 &&
(parseErrors ? (
<Notification isDanger>{parseErrors.message}</Notification>
Expand All @@ -107,34 +121,43 @@ function WorkTabsStructureWebVTTModal({ isActive }) {
placeholder="Enter WebVTT text here"
ref={textAreaRef}
rows="10"
style={{ whiteSpace: "pre-wrap" }}
style={{
whiteSpace: "pre-wrap",
display: confirmDelete ? "none" : "block",
}}
value={webVttValue}
/>
</section>
<footer className="modal-card-foot buttons is-justify-content-space-between">
{webVttValue?.trim().length > 0 && (
{webVttValue?.trim().length > 0 && !confirmDelete && (
<Button
isText
onClick={() => handleSubmit({})}
onClick={() => handleDelete()}
css={{ backgroundColor: "transparent" }}
>
Delete WebVTT
</Button>
)}
<div className="is-flex is-justify-content-flex-end is-flex-grow-1">
<Button onClick={handleClose}>Cancel</Button>
<Button
isPrimary
onClick={() =>
handleSubmit({
type: "WEBVTT",
value: webVttValue,
})
}
disabled={parseErrors}
>
Submit
</Button>
{confirmDelete ? (
<Button isPrimary onClick={() => handleSubmit({})}>
Yes, delete
</Button>
) : (
<Button
isPrimary
onClick={() =>
handleSubmit({
type: "WEBVTT",
value: webVttValue,
})
}
disabled={parseErrors}
>
Submit
</Button>
)}
</div>
</footer>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/components/Work/Tabs/Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const WorkTabs = ({ work }) => {
data-testid="tab-structure"
onClick={handleTabClick}
>
Structure
Access files
</a>
</li>
<AuthDisplayAuthorized>
Expand Down
7 changes: 7 additions & 0 deletions app/assets/js/services/reactive-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ export const FACET_SENSORS = [
showSearch: true,
title: "Subject",
},
{
...defaultListItemValues,
componentId: "Status",
dataField: "status",
showSearch: true,
title: "Status",
},
{
...defaultListItemValues,
componentId: "StylePeriod",
Expand Down
Loading

0 comments on commit 29dd192

Please sign in to comment.