diff --git a/components/appbar/ControlBar.jsx b/components/appbar/ControlBar.jsx index 6b967938..21a3bd32 100644 --- a/components/appbar/ControlBar.jsx +++ b/components/appbar/ControlBar.jsx @@ -130,6 +130,7 @@ export function ControlBar({ const url = new URL(window.location.href); const params = new URLSearchParams(url.search); params.set("branch", newBranch.name); + params.set("edit", "true"); url.search = params.toString(); window.location.href = url.toString(); } diff --git a/components/appbar/ControlBarComponent.jsx b/components/appbar/ControlBarComponent.jsx index d725a1ef..16c70efd 100644 --- a/components/appbar/ControlBarComponent.jsx +++ b/components/appbar/ControlBarComponent.jsx @@ -11,7 +11,7 @@ import { Stack, Autocomplete, Button, - Snackbar + Snackbar, } from "@mui/material"; import PrintIcon from "@mui/icons-material/Print"; import SlideshowIcon from "@mui/icons-material/Slideshow"; @@ -19,8 +19,8 @@ import AddCircleIcon from "@mui/icons-material/AddCircle"; // import { useSelector, useDispatch } from 'react-redux' // import { setBranch } from '@/lib/redux/reducers/branchSlice' import ApprovalIcon from "@mui/icons-material/Approval"; -import MuiAlert from '@mui/material/Alert'; -import CircularProgress from '@mui/material/CircularProgress'; +import MuiAlert from "@mui/material/Alert"; +import CircularProgress from "@mui/material/CircularProgress"; export function ControlBarComponent({ open, @@ -48,7 +48,8 @@ export function ControlBarComponent({ console.log("ControlBarComponent:collection: ", collection); console.log("ControlBarComponent:editMode: ", editMode); const [isLoading, setIsLoading] = useState(false); - const [showError, setShowError] = useState(''); + const [showError, setShowError] = useState(""); + const [showPRSuccess, setShowPRSuccess] = useState(false); useEffect(() => { if (context.branch != collection.branch) { @@ -135,6 +136,7 @@ export function ControlBarComponent({ try { // Replace this with your actual function await handlePR(); + setShowPRSuccess(true); } catch (error) { setShowError(error.message); } finally { @@ -228,7 +230,9 @@ export function ControlBarComponent({ } label="" - /> + />)} + {editMode && changeBranch && collection && ( + <>