Added autoFocus on Sds and MissionLog
This commit is contained in:
@@ -12,7 +12,11 @@ import { useDispatchConnectionStore } from "_store/dispatch/connectionStore";
|
||||
|
||||
export const SituationBoard = () => {
|
||||
const { setSituationTabOpen, situationTabOpen } = useLeftMenuStore();
|
||||
const dispatcherConnected = useDispatchConnectionStore((state) => state.status === "connected");
|
||||
const { status, setHideDraftMissions, hideDraftMissions } = useDispatchConnectionStore(
|
||||
(state) => state,
|
||||
);
|
||||
const dispatcherConnected = status === "connected";
|
||||
|
||||
const { data: missions } = useQuery({
|
||||
queryKey: ["missions", "missions-on-stations"],
|
||||
queryFn: () =>
|
||||
@@ -34,6 +38,11 @@ export const SituationBoard = () => {
|
||||
},
|
||||
),
|
||||
});
|
||||
|
||||
const filteredMissions = missions?.filter(
|
||||
(mission) => !hideDraftMissions || mission.state !== "draft",
|
||||
);
|
||||
|
||||
const { data: connectedAircrafts } = useQuery({
|
||||
queryKey: ["aircrafts"],
|
||||
queryFn: () => getConnectedAircraftsAPI(),
|
||||
@@ -60,8 +69,21 @@ export const SituationBoard = () => {
|
||||
<div className="card-body flex flex-row gap-4">
|
||||
<div className="flex-1">
|
||||
<h2 className="inline-flex items-center gap-2 text-lg font-bold mb-2">
|
||||
<ListCollapse /> Einsatzliste
|
||||
<ListCollapse /> Einsatzliste{" "}
|
||||
</h2>
|
||||
<div>
|
||||
<div className="form-control mb-2">
|
||||
<label className="label cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-sm"
|
||||
checked={hideDraftMissions}
|
||||
onChange={() => setHideDraftMissions(!hideDraftMissions)}
|
||||
/>
|
||||
<span className="label-text text-sm">vorgeplante Einsätze verbergen</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="table table-xs">
|
||||
{/* head */}
|
||||
@@ -74,8 +96,7 @@ export const SituationBoard = () => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{/* row 1 */}
|
||||
{missions?.map(
|
||||
{filteredMissions?.map(
|
||||
(mission) =>
|
||||
(dispatcherConnected || mission.state !== "draft") && (
|
||||
<tr
|
||||
|
||||
Reference in New Issue
Block a user