From 698ebcc7452b9a2c7a0a8fa03ee37c21a66d95ba Mon Sep 17 00:00:00 2001 From: Nathan LeRoy Date: Thu, 25 Jul 2024 10:32:05 -0400 Subject: [PATCH] tweaks' --- pephub/routers/api/v1/project.py | 2 +- .../components/modals/add-view-options.tsx | 50 ++++++++++++------- .../components/project/project-interface.tsx | 25 +++++++++- .../project-validation-and-edit-buttons.tsx | 8 +-- web/src/components/project/view-selector.tsx | 5 ++ web/src/components/tables/sample-table.tsx | 33 ++++++------ 6 files changed, 81 insertions(+), 42 deletions(-) diff --git a/pephub/routers/api/v1/project.py b/pephub/routers/api/v1/project.py index 1a2a6dc8..628eecad 100644 --- a/pephub/routers/api/v1/project.py +++ b/pephub/routers/api/v1/project.py @@ -729,7 +729,7 @@ async def create_view_of_the_project( _LOGGER.error(f"Could not create view. Error: {e}") raise HTTPException( status_code=409, - detail="Could not create view", + detail="This view already exists in the project.", ) return JSONResponse( content={ diff --git a/web/src/components/modals/add-view-options.tsx b/web/src/components/modals/add-view-options.tsx index c075064b..c58baaff 100644 --- a/web/src/components/modals/add-view-options.tsx +++ b/web/src/components/modals/add-view-options.tsx @@ -81,7 +81,11 @@ export const ViewOptionsModal = (props: Props) => { noFail: false, }; - viewMutations.addViewMutation.mutate(createViewRequest); + viewMutations.addViewMutation.mutate(createViewRequest, { + onSuccess: () => { + onHide(); + }, + }); resetForm({}, { keepValues: false }); }; @@ -95,13 +99,13 @@ export const ViewOptionsModal = (props: Props) => { {filteredSamples ? (
Save View
-

+

Save the current filtered sample table state as a view by providing a name (required) and description (optional) for the view.

- Name + Name { message: "View Name must contain only alphanumeric characters, '-', or '_'.", }, })} - placeholder="..." type="text" - className="form-control text-xs" + className="form-control" id="view-name" aria-describedby="view-name-help" />
-
- Description - + +