refactor(dockscanning): more work on the dock door scanning
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m47s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m47s
ref #12
This commit is contained in:
@@ -13,16 +13,23 @@ import AdminSidebar from "./AdminBar";
|
||||
import DocBar from "./DocBar";
|
||||
import MobileBar from "./MobileBar";
|
||||
import TransportationBar from "./TransportationBar";
|
||||
import WarehouseBar from "./Warhouse";
|
||||
|
||||
export function AppSidebar() {
|
||||
const { data: session } = useSession();
|
||||
const { data: settings, isLoading } = useSuspenseQuery(getSettings());
|
||||
const { data: canRead = false } = useQuery(
|
||||
const { data: canReadOpenDock = false } = useQuery(
|
||||
permissionQuery({
|
||||
openDock: ["read"],
|
||||
}),
|
||||
);
|
||||
|
||||
const { data: canReadWarehouse = false } = useQuery(
|
||||
permissionQuery({
|
||||
warehouse: ["read"],
|
||||
}),
|
||||
);
|
||||
|
||||
return (
|
||||
<Sidebar
|
||||
variant="sidebar"
|
||||
@@ -42,7 +49,12 @@ export function AppSidebar() {
|
||||
{!isLoading &&
|
||||
settings.filter((n: any) => n.name === "opendock_sync")[0]
|
||||
?.active &&
|
||||
canRead && <TransportationBar />}
|
||||
canReadOpenDock && <TransportationBar />}
|
||||
|
||||
{!isLoading &&
|
||||
settings.filter((n: any) => n.name === "dockDoorScanning")[0]
|
||||
?.active &&
|
||||
canReadWarehouse && <WarehouseBar />}
|
||||
|
||||
{session &&
|
||||
(session.user.role === "admin" ||
|
||||
|
||||
Reference in New Issue
Block a user