update: widget settings ui is now updated for RS, AL changes, Comm Coor, and IVANS widgets. it contains sections and a unified color scheme in the themes file in the popover recipe
This commit is contained in:
@@ -112,16 +112,16 @@ export default function IvansAlerts({ settings, widgetID }) {
|
|||||||
{/* This box needs to be at h="100%" for the pdf toolbar to appear */}
|
{/* This box needs to be at h="100%" for the pdf toolbar to appear */}
|
||||||
<Box w="100%" h="100%" p={1} borderBottomRadius="lg" bg="widgetItemExpandedBg">
|
<Box w="100%" h="100%" p={1} borderBottomRadius="lg" bg="widgetItemExpandedBg">
|
||||||
<Flex direction="column" gap={2} borderRadius="lg" p={2} align="start">
|
<Flex direction="column" gap={2} borderRadius="lg" p={2} align="start">
|
||||||
<Text w="fit" fontSize="sm" color="text" p={1} bg="widgetBadgeBg" borderRadius="md">Preparer: {item?.preparer}</Text>
|
<Text w="fit" fontSize="sm" color="text" p={1} bg="widgetInnerBadgeBg" borderRadius="md">Preparer: {item?.preparer}</Text>
|
||||||
<Text w="100%" h="100%" fontSize="sm" color="text" textAlign="left" whiteSpace="pre-line">{item?.summary}</Text>
|
<Text w="100%" h="100%" fontSize="sm" color="text" textAlign="left" whiteSpace="pre-line">{item?.summary}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
{item?.files?.map((file, index) => {
|
{item?.files?.map((file, index) => {
|
||||||
return (
|
return (
|
||||||
<Box w="100%" h="100%" key={index} >
|
<Box w="100%" h="100%" key={index} >
|
||||||
<Flex direction="row" w="100%">
|
<Flex direction="row" w="100%">
|
||||||
<Text w="100%" p={1} fontWeight="semibold" bg="widgetBadgeBg" borderLeftRadius="lg" fontSize="sm" color="text">File: </Text>
|
<Text w="100%" p={1} fontWeight="semibold" bg="widgetInnerBadgeBg" borderLeftRadius="lg" fontSize="sm" color="text">File: </Text>
|
||||||
<a href={`${file?.url}#view=FitV&toolbar=0`} target="_blank" rel="noopener noreferrer">
|
<a href={`${file?.url}#view=FitV&toolbar=0`} target="_blank" rel="noopener noreferrer">
|
||||||
<Text truncate w="100%" p={1} bg="widgetBadgeBg" borderRightRadius="lg" fontSize="sm" color="text">
|
<Text truncate w="100%" p={1} bg="widgetInnerBadgeBg" borderRightRadius="lg" fontSize="sm" color="text">
|
||||||
{file?.name}
|
{file?.name}
|
||||||
</Text>
|
</Text>
|
||||||
</a>
|
</a>
|
||||||
@@ -131,12 +131,12 @@ export default function IvansAlerts({ settings, widgetID }) {
|
|||||||
type="application/pdf"
|
type="application/pdf"
|
||||||
style={{ width: '100%', height: '100%', display: 'block' }}
|
style={{ width: '100%', height: '100%', display: 'block' }}
|
||||||
>
|
>
|
||||||
<Flex direction="column" w="100%" h="100%" align="center" p={4} color="widgetTextMuted" bg="widgetBadgeBg" borderRadius="md">
|
<Flex direction="column" w="100%" h="100%" align="center" p={4} mt={1} color="widgetTextMuted" bg="widgetInnerBadgeBg" borderRadius="lg">
|
||||||
<Text mb={2} fontSize="xs" color="red.300">
|
<Text mb={2} fontSize="xs" color="red.300">
|
||||||
Your browser cannot display this PDF directly.
|
Your browser cannot display this PDF directly.
|
||||||
</Text>
|
</Text>
|
||||||
<a href={file?.url} target="_blank" bg="widgetBadgeBg" rel="noopener noreferrer">
|
<a href={file?.url} target="_blank" bg="widgetBadgeBg" rel="noopener noreferrer">
|
||||||
<Text fontSize="xs" bg="widgetInnerBadgeBg" borderRadius="md" p={1}>Download PDF Instead</Text>
|
<Text fontSize="xs" bg="widgetBadgeBg" borderRadius="md" p={1}>Download PDF Instead</Text>
|
||||||
</a>
|
</a>
|
||||||
</Flex>
|
</Flex>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@@ -13,20 +13,22 @@ import {
|
|||||||
useFilter,
|
useFilter,
|
||||||
useListCollection,
|
useListCollection,
|
||||||
Wrap,
|
Wrap,
|
||||||
Badge
|
Badge, Separator, HStack, useSlotRecipe
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useDashboardStore } from "@/store/useDashboardStore.jsx";
|
import { useDashboardStore } from "@/store/useDashboardStore.jsx";
|
||||||
import { useState, useMemo } from "react";
|
import { useState, useMemo } from "react";
|
||||||
|
|
||||||
export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||||
|
// STYLING
|
||||||
|
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||||
|
const popoverStyles = popoverRecipe();
|
||||||
|
|
||||||
|
// STATE MANAGEMENT
|
||||||
const updateSettings = useDashboardStore(
|
const updateSettings = useDashboardStore(
|
||||||
(state) => state.updateWidgetSettings,
|
(state) => state.updateWidgetSettings,
|
||||||
);
|
);
|
||||||
const [startError, setStartError] = useState(null);
|
const [startError, setStartError] = useState(null);
|
||||||
const [endError, setEndError] = useState(null);
|
const [endError, setEndError] = useState(null);
|
||||||
|
|
||||||
console.log("currentSettings:", currentSettings);
|
|
||||||
|
|
||||||
const [selectedVolcanoes, setSelectedVolcanoes] = useState([]);
|
const [selectedVolcanoes, setSelectedVolcanoes] = useState([]);
|
||||||
const { startsWith } = useFilter({ sensitivity: "base" });
|
const { startsWith } = useFilter({ sensitivity: "base" });
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
limit: 10,
|
limit: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// FUNCTIONS
|
||||||
const handleValueChange = (details) => {
|
const handleValueChange = (details) => {
|
||||||
setSelectedVolcanoes(details.value)
|
setSelectedVolcanoes(details.value)
|
||||||
}
|
}
|
||||||
@@ -45,14 +48,11 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
<Fieldset.Root>
|
<Fieldset.Root>
|
||||||
<Fieldset.Content>
|
<Fieldset.Content>
|
||||||
{/* SELECTING DATE RANGE */}
|
{/* SELECTING DATE RANGE */}
|
||||||
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
<HStack>
|
||||||
<Flex direction="column">
|
<Text flexShrink="0" fontWeight="semibold">Date Range Selection</Text>
|
||||||
<Text w="100%" fontWeight="bold">
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
Date Range Selection
|
</HStack>
|
||||||
</Text>
|
<Flex direction="column" w="100%" h="100%" justify="center" gap={2} pr={1}>
|
||||||
<hr /> {/*line seperator*/}
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
{/* start date */}
|
{/* start date */}
|
||||||
<Field.Root invalid={!!startError}>
|
<Field.Root invalid={!!startError}>
|
||||||
<Flex
|
<Flex
|
||||||
@@ -68,8 +68,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
<Flex direction="column" w="100%">
|
<Flex direction="column" w="100%">
|
||||||
<Input
|
<Input
|
||||||
type="date"
|
type="date"
|
||||||
w="100%"
|
css={popoverStyles.date}
|
||||||
borderRadius="lg"
|
|
||||||
value={currentSettings?.startDate || ""}
|
value={currentSettings?.startDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -109,8 +108,8 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
<Flex direction="column" w="100%">
|
<Flex direction="column" w="100%">
|
||||||
<Input
|
<Input
|
||||||
type="date"
|
type="date"
|
||||||
w="100%"
|
css={popoverStyles.date}
|
||||||
borderRadius="lg"
|
|
||||||
value={currentSettings?.endDate || ""}
|
value={currentSettings?.endDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -137,18 +136,15 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
{/* FILTERS */}
|
{/* FILTERS */}
|
||||||
<CheckboxGroup w="100%">
|
<CheckboxGroup w="100%">
|
||||||
<Flex direction="column" w="100%" gap={2}>
|
<Flex direction="column" w="100%" gap={2}>
|
||||||
<Flex direction="column" w="100%">
|
<HStack>
|
||||||
<Text w="fit" fontWeight="bold">
|
<Text flexShrink="0" fontWeight="semibold">Filters</Text>
|
||||||
Filters
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
</Text>
|
</HStack>
|
||||||
<hr /> {/*line seperator*/}
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
{/* level increases */}
|
{/* level increases */}
|
||||||
<CheckboxCard.Root
|
<CheckboxCard.Root
|
||||||
size="sm"
|
css={popoverStyles.checkboxcard}
|
||||||
variant="surface"
|
|
||||||
borderRadius="lg"
|
|
||||||
defaultChecked={currentSettings?.filters?.levelIncreases}
|
defaultChecked={currentSettings?.filters?.levelIncreases}
|
||||||
onCheckedChange={(e) => {
|
onCheckedChange={(e) => {
|
||||||
updateSettings(widgetId, {
|
updateSettings(widgetId, {
|
||||||
@@ -167,15 +163,14 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
Level Increases
|
Level Increases
|
||||||
</CheckboxCard.Label>
|
</CheckboxCard.Label>
|
||||||
</CheckboxCard.Content>
|
</CheckboxCard.Content>
|
||||||
<CheckboxCard.Indicator />
|
<CheckboxCard.Indicator css={popoverStyles.checkbox} />
|
||||||
</CheckboxCard.Control>
|
</CheckboxCard.Control>
|
||||||
</CheckboxCard.Root>
|
</CheckboxCard.Root>
|
||||||
|
|
||||||
{/* level decreases */}
|
{/* level decreases */}
|
||||||
<CheckboxCard.Root
|
<CheckboxCard.Root
|
||||||
size="sm"
|
css={popoverStyles.checkboxcard}
|
||||||
variant="surface"
|
|
||||||
borderRadius="lg"
|
|
||||||
defaultChecked={currentSettings?.filters?.levelDecreases}
|
defaultChecked={currentSettings?.filters?.levelDecreases}
|
||||||
onCheckedChange={(e) => {
|
onCheckedChange={(e) => {
|
||||||
updateSettings(widgetId, {
|
updateSettings(widgetId, {
|
||||||
@@ -194,15 +189,14 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
Level Decreases
|
Level Decreases
|
||||||
</CheckboxCard.Label>
|
</CheckboxCard.Label>
|
||||||
</CheckboxCard.Content>
|
</CheckboxCard.Content>
|
||||||
<CheckboxCard.Indicator />
|
<CheckboxCard.Indicator css={popoverStyles.checkbox} />
|
||||||
</CheckboxCard.Control>
|
</CheckboxCard.Control>
|
||||||
</CheckboxCard.Root>
|
</CheckboxCard.Root>
|
||||||
|
|
||||||
{/* elevated levels */}
|
{/* elevated levels */}
|
||||||
<CheckboxCard.Root
|
<CheckboxCard.Root
|
||||||
size="sm"
|
css={popoverStyles.checkboxcard}
|
||||||
variant="surface"
|
|
||||||
borderRadius="lg"
|
|
||||||
defaultChecked={currentSettings?.filters?.elevatedLevels}
|
defaultChecked={currentSettings?.filters?.elevatedLevels}
|
||||||
onCheckedChange={(e) => {
|
onCheckedChange={(e) => {
|
||||||
updateSettings(widgetId, {
|
updateSettings(widgetId, {
|
||||||
@@ -221,7 +215,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
|||||||
Only Elevated Levels
|
Only Elevated Levels
|
||||||
</CheckboxCard.Label>
|
</CheckboxCard.Label>
|
||||||
</CheckboxCard.Content>
|
</CheckboxCard.Content>
|
||||||
<CheckboxCard.Indicator />
|
<CheckboxCard.Indicator css={popoverStyles.checkbox}/>
|
||||||
</CheckboxCard.Control>
|
</CheckboxCard.Control>
|
||||||
</CheckboxCard.Root>
|
</CheckboxCard.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
import {Button, Field, Flex, Input, Switch, Text, Fieldset, Separator, HStack} from "@chakra-ui/react";
|
import {Button, Field, Flex, Input, Switch, Text, Fieldset, Separator, HStack, useSlotRecipe} from "@chakra-ui/react";
|
||||||
import {useDashboardStore} from "@/store/useDashboardStore.jsx";
|
import {useDashboardStore} from "@/store/useDashboardStore.jsx";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
|
|
||||||
export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
||||||
|
// STYLING
|
||||||
|
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||||
|
const popoverStyles = popoverRecipe();
|
||||||
|
|
||||||
|
// STATE MANAGEMENT
|
||||||
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
||||||
const [startError, setStartError] = useState(null);
|
const [startError, setStartError] = useState(null);
|
||||||
const [endError, setEndError] = useState(null);
|
const [endError, setEndError] = useState(null);
|
||||||
|
|
||||||
|
// FUNCTIONS
|
||||||
const handleCopyToClipboard = () => {
|
const handleCopyToClipboard = () => {
|
||||||
updateSettings(widgetId, {copyToClipboard: true});
|
updateSettings(widgetId, {copyToClipboard: true});
|
||||||
}
|
}
|
||||||
@@ -19,12 +25,13 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
|||||||
<Flex flexDirection="column" justifyContent="space-between" gap={2} overflowY="auto">
|
<Flex flexDirection="column" justifyContent="space-between" gap={2} overflowY="auto">
|
||||||
<Fieldset.Root>
|
<Fieldset.Root>
|
||||||
<Fieldset.Content>
|
<Fieldset.Content>
|
||||||
|
{/* SELECTING DATE RANGE */}
|
||||||
<HStack>
|
<HStack>
|
||||||
<Text flexShrink="0" fontWeight="semibold">Date Range Selection</Text>
|
<Text flexShrink="0" fontWeight="semibold">Date Range Selection</Text>
|
||||||
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
</HStack>
|
</HStack>
|
||||||
{/* SELECTING DATE RANGE */}
|
<Flex direction="column" w="100%" h="100%" justify="center" gap={2} pr={1}>
|
||||||
<Flex direction="column" w="100%" h="100%" justify="center" gap="2">
|
{/* start date */}
|
||||||
<Field.Root invalid={!!startError}>
|
<Field.Root invalid={!!startError}>
|
||||||
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
||||||
<Text w="50%" align="center" justify="center" mt={2} color="text">
|
<Text w="50%" align="center" justify="center" mt={2} color="text">
|
||||||
@@ -33,6 +40,7 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
|||||||
<Flex direction="column" w="100%">
|
<Flex direction="column" w="100%">
|
||||||
<Input
|
<Input
|
||||||
w="100%"
|
w="100%"
|
||||||
|
css={popoverStyles.date}
|
||||||
type="date"
|
type="date"
|
||||||
value={currentSettings?.startDate || ""}
|
value={currentSettings?.startDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -51,6 +59,7 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Field.Root>
|
</Field.Root>
|
||||||
|
{/* end date */}
|
||||||
<Field.Root invalid={!!endError}>
|
<Field.Root invalid={!!endError}>
|
||||||
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
||||||
<Text w="50%" align="center" justify="center" mt={2} color="text">
|
<Text w="50%" align="center" justify="center" mt={2} color="text">
|
||||||
@@ -59,6 +68,7 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
|||||||
<Flex direction="column" w="100%">
|
<Flex direction="column" w="100%">
|
||||||
<Input
|
<Input
|
||||||
w="100%"
|
w="100%"
|
||||||
|
css={popoverStyles.date}
|
||||||
type="date"
|
type="date"
|
||||||
value={currentSettings?.endDate || ""}
|
value={currentSettings?.endDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -85,9 +95,9 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
|||||||
</HStack>
|
</HStack>
|
||||||
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
||||||
{/* COPY TO CLIPBOARD */}
|
{/* COPY TO CLIPBOARD */}
|
||||||
<Button w="100%" size="xs" borderRadius="lg" variant="subtle" onClick={handleCopyToClipboard}>Copy Report</Button>
|
<Button css={popoverStyles.button} onClick={handleCopyToClipboard}>Copy Report</Button>
|
||||||
{/* DOWNLOAD REPORT */}
|
{/* DOWNLOAD REPORT */}
|
||||||
<Button w="100%" size="xs" borderRadius="lg" variant="subtle" onClick={handleDownloadReport}>Download Report</Button>
|
<Button css={popoverStyles.button} onClick={handleDownloadReport}>Download Report</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Fieldset.Content>
|
</Fieldset.Content>
|
||||||
</Fieldset.Root>
|
</Fieldset.Root>
|
||||||
|
|||||||
@@ -15,14 +15,16 @@ import {useDashboardStore} from "../../../store/useDashboardStore.jsx";
|
|||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
|
|
||||||
export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||||
|
// STYLING
|
||||||
|
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||||
|
const popoverStyles = popoverRecipe();
|
||||||
|
|
||||||
|
// STATE MANAGEMENT
|
||||||
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
||||||
const [startError, setStartError] = useState(null);
|
const [startError, setStartError] = useState(null);
|
||||||
const [endError, setEndError] = useState(null);
|
const [endError, setEndError] = useState(null);
|
||||||
|
|
||||||
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
// FUNCTIONS
|
||||||
const popoverStyles = popoverRecipe();
|
|
||||||
|
|
||||||
|
|
||||||
const handleCopyToClipboard = () => {
|
const handleCopyToClipboard = () => {
|
||||||
updateSettings(widgetId, {copyToClipboard: true});
|
updateSettings(widgetId, {copyToClipboard: true});
|
||||||
}
|
}
|
||||||
@@ -40,13 +42,11 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
|||||||
<Fieldset.Root>
|
<Fieldset.Root>
|
||||||
<Fieldset.Content>
|
<Fieldset.Content>
|
||||||
{/* SELECTING DATE RANGE */}
|
{/* SELECTING DATE RANGE */}
|
||||||
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
|
||||||
<HStack>
|
<HStack>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
|
||||||
<Text flexShrink="0" fontWeight="semibold">Date Range Selection</Text>
|
<Text flexShrink="0" fontWeight="semibold">Date Range Selection</Text>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
</HStack>
|
</HStack>
|
||||||
|
<Flex direction="column" w="100%" h="100%" justify="center" gap={2} pr={1}>
|
||||||
{/* start date */}
|
{/* start date */}
|
||||||
<Field.Root invalid={!!startError}>
|
<Field.Root invalid={!!startError}>
|
||||||
<Flex
|
<Flex
|
||||||
@@ -64,7 +64,7 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
|||||||
type="date"
|
type="date"
|
||||||
w="100%"
|
w="100%"
|
||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
bg="widgetBadgeBg"
|
css={popoverStyles.date}
|
||||||
value={currentSettings?.startDate || ""}
|
value={currentSettings?.startDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -106,7 +106,7 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
|||||||
type="date"
|
type="date"
|
||||||
w="100%"
|
w="100%"
|
||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
bg="widgetBadgeBg"
|
css={popoverStyles.date}
|
||||||
value={currentSettings?.endDate || ""}
|
value={currentSettings?.endDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -132,20 +132,18 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
|||||||
|
|
||||||
{/* SORTS */}
|
{/* SORTS */}
|
||||||
<HStack>
|
<HStack>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
|
||||||
<Text flexShrink="0" fontWeight="semibold">Sorts</Text>
|
<Text flexShrink="0" fontWeight="semibold">Sorts</Text>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|
||||||
{/* time sort */}
|
{/* time sort */}
|
||||||
<Switch.Root
|
<Switch.Root
|
||||||
checked={currentSettings?.activeSorts?.timeSort === "asc"}
|
checked={currentSettings?.activeSorts?.timeSort === "asc"}
|
||||||
onCheckedChange={handleTimeSort}
|
onCheckedChange={handleTimeSort}
|
||||||
colorPalette="orange"
|
|
||||||
>
|
>
|
||||||
<Switch.HiddenInput />
|
<Switch.HiddenInput />
|
||||||
<Switch.Control>
|
<Switch.Control css={popoverStyles.switch}>
|
||||||
<Switch.Thumb />
|
<Switch.Thumb bg="white"/>
|
||||||
</Switch.Control>
|
</Switch.Control>
|
||||||
<Switch.Label fontWeight={400}>Oldest to Newest</Switch.Label>
|
<Switch.Label fontWeight={400}>Oldest to Newest</Switch.Label>
|
||||||
</Switch.Root>
|
</Switch.Root>
|
||||||
@@ -154,26 +152,23 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
|||||||
<Switch.Root
|
<Switch.Root
|
||||||
checked={currentSettings?.activeSorts?.volcanoSort}
|
checked={currentSettings?.activeSorts?.volcanoSort}
|
||||||
onCheckedChange={handleVolcanoSort}
|
onCheckedChange={handleVolcanoSort}
|
||||||
colorPalette="orange"
|
|
||||||
>
|
>
|
||||||
<Switch.HiddenInput />
|
<Switch.HiddenInput />
|
||||||
<Switch.Control>
|
<Switch.Control css={popoverStyles.switch}>
|
||||||
<Switch.Thumb />
|
<Switch.Thumb bg="white" />
|
||||||
</Switch.Control>
|
</Switch.Control>
|
||||||
<Switch.Label fontWeight={400}>Alphabetically by Volcano</Switch.Label>
|
<Switch.Label fontWeight={400}>Alphabetically by Volcano</Switch.Label>
|
||||||
</Switch.Root>
|
</Switch.Root>
|
||||||
|
|
||||||
<HStack>
|
<HStack>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
|
||||||
<Text flexShrink="0" fontWeight="semibold">Filters</Text>
|
<Text flexShrink="0" fontWeight="semibold">Filters</Text>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|
||||||
{/* elevated levels */}
|
{/* elevated levels */}
|
||||||
<CheckboxCard.Root
|
<CheckboxCard.Root
|
||||||
size="sm"
|
// size="sm"
|
||||||
variant="surface"
|
// variant="surface"
|
||||||
borderRadius="lg"
|
|
||||||
css={popoverStyles.checkboxcard}
|
css={popoverStyles.checkboxcard}
|
||||||
|
|
||||||
defaultChecked={currentSettings?.filters?.elevatedLevels}
|
defaultChecked={currentSettings?.filters?.elevatedLevels}
|
||||||
@@ -194,17 +189,21 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
|||||||
Only Elevated Levels
|
Only Elevated Levels
|
||||||
</CheckboxCard.Label>
|
</CheckboxCard.Label>
|
||||||
</CheckboxCard.Content>
|
</CheckboxCard.Content>
|
||||||
<CheckboxCard.Indicator css={popoverStyles.checkboxcard} />
|
<CheckboxCard.Indicator css={popoverStyles.checkbox} />
|
||||||
</CheckboxCard.Control>
|
</CheckboxCard.Control>
|
||||||
</CheckboxCard.Root>
|
</CheckboxCard.Root>
|
||||||
|
|
||||||
{/* COPY TO CLIPBOARD */}
|
{/* COPY TO CLIPBOARD */}
|
||||||
<HStack>
|
<HStack>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
|
||||||
<Text flexShrink="0" fontWeight="semibold">Tools</Text>
|
<Text flexShrink="0" fontWeight="semibold">Tools</Text>
|
||||||
<Separator flex="1" size="md"/> {/*line seperator*/}
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
</HStack>
|
</HStack>
|
||||||
<Button mt={-2} colorPalette="orange" w="100%" size="xs" borderRadius="lg" variant="subtle" onClick={handleCopyToClipboard}>Copy All IVANS</Button>
|
<Button mt={-2} w="100%" size="xs" borderRadius="lg" variant="subtle"
|
||||||
|
css={popoverStyles.button}
|
||||||
|
onClick={handleCopyToClipboard}
|
||||||
|
>
|
||||||
|
Copy All IVANS
|
||||||
|
</Button>
|
||||||
</Fieldset.Content>
|
</Fieldset.Content>
|
||||||
</Fieldset.Root>
|
</Fieldset.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
import {Button, Field, Flex, Input, Switch, Text} from "@chakra-ui/react";
|
import {Button, Field, Flex, HStack, Input, Separator, Switch, Text, useSlotRecipe, Fieldset} from "@chakra-ui/react";
|
||||||
import {useDashboardStore} from "@/store/useDashboardStore.jsx";
|
import {useDashboardStore} from "@/store/useDashboardStore.jsx";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
|
|
||||||
export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
||||||
|
// STYLING
|
||||||
|
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||||
|
const popoverStyles = popoverRecipe();
|
||||||
|
|
||||||
|
// STATE MANAGEMENT
|
||||||
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
||||||
const [startError, setStartError] = useState(null);
|
const [startError, setStartError] = useState(null);
|
||||||
const [endError, setEndError] = useState(null);
|
const [endError, setEndError] = useState(null);
|
||||||
|
|
||||||
|
// FUNCTIONS
|
||||||
const handleCopyToClipboard = () => {
|
const handleCopyToClipboard = () => {
|
||||||
updateSettings(widgetId, {copyToClipboard: true});
|
updateSettings(widgetId, {copyToClipboard: true});
|
||||||
}
|
}
|
||||||
@@ -21,44 +27,25 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexDirection="column" justifyContent="space-between" gap={2} overflowY="auto">
|
<Flex flexDirection="column" justifyContent="space-between" gap={2} overflowY="auto">
|
||||||
{/* COPYING TO CLIPBOARD */}
|
<Fieldset.Root>
|
||||||
<Button w="fit" size="xs" onClick={handleCopyToClipboard}>Copy All RS</Button>
|
<Fieldset.Content>
|
||||||
|
|
||||||
{/* SORTING */}
|
|
||||||
<Switch.Root
|
|
||||||
checked={currentSettings?.activeSorts?.timeSort === "asc"}
|
|
||||||
onCheckedChange={handleTimeSort}
|
|
||||||
colorPalette="blue"
|
|
||||||
>
|
|
||||||
<Switch.HiddenInput />
|
|
||||||
<Switch.Control>
|
|
||||||
<Switch.Thumb />
|
|
||||||
</Switch.Control>
|
|
||||||
<Switch.Label>Sort Oldest to Newest</Switch.Label>
|
|
||||||
</Switch.Root>
|
|
||||||
<Switch.Root
|
|
||||||
checked={currentSettings?.activeSorts?.volcanoSort}
|
|
||||||
onCheckedChange={handleVolcanoSort}
|
|
||||||
colorPalette="blue"
|
|
||||||
>
|
|
||||||
<Switch.HiddenInput />
|
|
||||||
<Switch.Control>
|
|
||||||
<Switch.Thumb />
|
|
||||||
</Switch.Control>
|
|
||||||
<Switch.Label>Sort by Volcano</Switch.Label>
|
|
||||||
</Switch.Root>
|
|
||||||
|
|
||||||
{/* SELECTING DATE RANGE */}
|
{/* SELECTING DATE RANGE */}
|
||||||
<Flex direction="column" w="100%" h="100%" align="center" justify="center" gap="2">
|
<HStack>
|
||||||
|
<Text flexShrink="0" fontWeight="semibold">Date Range Selection</Text>
|
||||||
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
|
</HStack>
|
||||||
|
<Flex direction="column" w="100%" h="100%" justify="center" gap={2} pr={1}>
|
||||||
|
{/* start date */}
|
||||||
<Field.Root invalid={!!startError}>
|
<Field.Root invalid={!!startError}>
|
||||||
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
||||||
<Text w="50%" align="center" justify="center" mt={2} color="gray.700">
|
<Text w="50%" align="center" justify="center" mt={2} color="text">
|
||||||
Start Date
|
Start Date
|
||||||
</Text>
|
</Text>
|
||||||
<Flex direction="column" w="100%">
|
<Flex direction="column" w="100%">
|
||||||
<Input
|
<Input
|
||||||
w="100%"
|
|
||||||
type="date"
|
type="date"
|
||||||
|
css={popoverStyles.date}
|
||||||
|
|
||||||
value={currentSettings?.startDate || ""}
|
value={currentSettings?.startDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -76,15 +63,18 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Field.Root>
|
</Field.Root>
|
||||||
|
|
||||||
|
{/* end date */}
|
||||||
<Field.Root invalid={!!endError}>
|
<Field.Root invalid={!!endError}>
|
||||||
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
<Flex direction="row" w="100%" h="100%" align="center" justify="center">
|
||||||
<Text w="50%" align="center" justify="center" mt={2} color="gray.700">
|
<Text w="50%" align="center" justify="center" mt={2} color="text">
|
||||||
End Date
|
End Date
|
||||||
</Text>
|
</Text>
|
||||||
<Flex direction="column" w="100%">
|
<Flex direction="column" w="100%">
|
||||||
<Input
|
<Input
|
||||||
w="100%"
|
|
||||||
type="date"
|
type="date"
|
||||||
|
css={popoverStyles.date}
|
||||||
|
|
||||||
value={currentSettings?.endDate || ""}
|
value={currentSettings?.endDate || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -103,6 +93,45 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Field.Root>
|
</Field.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
{/* SORTING */}
|
||||||
|
<HStack>
|
||||||
|
<Text flexShrink="0" fontWeight="semibold">Sorting</Text>
|
||||||
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
|
</HStack>
|
||||||
|
<Switch.Root
|
||||||
|
checked={currentSettings?.activeSorts?.timeSort === "asc"}
|
||||||
|
onCheckedChange={handleTimeSort}
|
||||||
|
>
|
||||||
|
<Switch.HiddenInput />
|
||||||
|
<Switch.Control css={popoverStyles.switch}>
|
||||||
|
<Switch.Thumb bg="white" />
|
||||||
|
</Switch.Control>
|
||||||
|
<Switch.Label>Oldest to Newest</Switch.Label>
|
||||||
|
</Switch.Root>
|
||||||
|
|
||||||
|
<Switch.Root
|
||||||
|
checked={currentSettings?.activeSorts?.volcanoSort}
|
||||||
|
onCheckedChange={handleVolcanoSort}
|
||||||
|
colorPalette="blue"
|
||||||
|
>
|
||||||
|
<Switch.HiddenInput />
|
||||||
|
<Switch.Control css={popoverStyles.switch}>
|
||||||
|
<Switch.Thumb bg="white"/>
|
||||||
|
</Switch.Control>
|
||||||
|
<Switch.Label>By Volcano</Switch.Label>
|
||||||
|
</Switch.Root>
|
||||||
|
|
||||||
|
{/* COPYING TO CLIPBOARD */}
|
||||||
|
<HStack>
|
||||||
|
<Text flexShrink="0" fontWeight="semibold">Tools</Text>
|
||||||
|
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||||
|
</HStack>
|
||||||
|
<Button css={popoverStyles.button} onClick={handleCopyToClipboard}>
|
||||||
|
Copy All RS
|
||||||
|
</Button>
|
||||||
|
</Fieldset.Content>
|
||||||
|
</Fieldset.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
+75
-16
@@ -68,8 +68,8 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
root: {
|
root: {
|
||||||
// 1. Semi-transparent backgrounds
|
// 1. Semi-transparent backgrounds
|
||||||
bg: {
|
bg: {
|
||||||
base: "linear-gradient(to bottom right, #97282880 20%, #EB7F3160 60%, #FCAD3840 100%)",
|
base: "linear-gradient(to bottom right, #B63B1F88 20%, #FF990060 70%, #FFBF0040 90%)",
|
||||||
_dark: "linear-gradient(to bottom right, #9900003C 20%, #FF66003C 60%, #FFC0003C 100%)"
|
_dark: "linear-gradient(to bottom right, #9900004C 20%, #FF66003C 60%, #FFAE003C 100%)"
|
||||||
},
|
},
|
||||||
|
|
||||||
// 2. The glass blur effect
|
// 2. The glass blur effect
|
||||||
@@ -346,7 +346,7 @@ const widgetRecipe = defineSlotRecipe({
|
|||||||
|
|
||||||
// 6. TRUE POPOVER: Compact floating card for 3-dots menus
|
// 6. TRUE POPOVER: Compact floating card for 3-dots menus
|
||||||
const glassPopoverRecipe = defineSlotRecipe({
|
const glassPopoverRecipe = defineSlotRecipe({
|
||||||
slots: ["content", "arrow", "positioner", "checkboxcard", "checkbox"],
|
slots: ["content", "arrow", "positioner", "date", "checkboxcard", "checkbox", "switch", "button"],
|
||||||
base: {
|
base: {
|
||||||
content: {
|
content: {
|
||||||
...glassSurface,
|
...glassSurface,
|
||||||
@@ -357,31 +357,90 @@ const glassPopoverRecipe = defineSlotRecipe({
|
|||||||
backdropFilter: "blur(15px)",
|
backdropFilter: "blur(15px)",
|
||||||
WebkitBackdropFilter: "blur(15px)",
|
WebkitBackdropFilter: "blur(15px)",
|
||||||
},
|
},
|
||||||
|
date: {
|
||||||
|
color: "text",
|
||||||
|
bg: "widgetBadgeBg",
|
||||||
|
borderRadius: "lg",
|
||||||
|
h: "2rem",
|
||||||
|
_focus: {
|
||||||
|
borderStyle: "none",
|
||||||
|
}
|
||||||
|
},
|
||||||
checkboxcard: {
|
checkboxcard: {
|
||||||
|
// applies to both dark & lt modes
|
||||||
|
w: "100%",
|
||||||
|
borderRadius: "lg",
|
||||||
|
color: "text",
|
||||||
|
|
||||||
|
"& div[data-part='control']": {
|
||||||
|
alignItems: "center",
|
||||||
|
padding: "6px",
|
||||||
|
},
|
||||||
|
|
||||||
bg: "widgetItemBg",
|
bg: "widgetItemBg",
|
||||||
_hover: {
|
|
||||||
bg: "widgetBadgeBg"
|
|
||||||
},
|
|
||||||
_checked: {
|
_checked: {
|
||||||
bg: "orange.700"
|
boxShadow: "none",
|
||||||
|
bg: "rgb(182 59 31 / 0.2)",
|
||||||
|
borderColor: "#B63B1F"
|
||||||
},
|
},
|
||||||
|
|
||||||
_dark: {
|
_dark: {
|
||||||
bg: "widgetBadgeBg",
|
bg: "widgetBadgeBg",
|
||||||
_hover: {
|
|
||||||
bg: "widgetInnerBadgeBg"
|
|
||||||
},
|
|
||||||
_checked: {
|
_checked: {
|
||||||
bg: "orange.700",
|
boxShadow: "none",
|
||||||
_hover: {
|
color: "text",
|
||||||
bg: "orange.700/50"
|
bg: "#503D40",
|
||||||
}
|
borderColor: "#B55038"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkbox: {
|
checkbox: {
|
||||||
bg: "widgetInnerBadgeBg",
|
bg: "widgetInnerBadgeBg",
|
||||||
_checked: {
|
_checked: {
|
||||||
bg: "orange"
|
bg: "#B63B1F",
|
||||||
|
borderColor: "#B63B1F"
|
||||||
|
},
|
||||||
|
|
||||||
|
_dark: {
|
||||||
|
bg: "widgetBadgeBg",
|
||||||
|
_checked: {
|
||||||
|
color: "text",
|
||||||
|
bg: "#B55038",
|
||||||
|
borderColor: "#B55038"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
switch: {
|
||||||
|
color: "text",
|
||||||
|
bg: "widgetBadgeBg",
|
||||||
|
|
||||||
|
_checked: {
|
||||||
|
bg: "#B63B1F",
|
||||||
|
|
||||||
|
_dark: {
|
||||||
|
bg: "#b55038"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
w: "100%",
|
||||||
|
fontSize: "xs",
|
||||||
|
h: "2rem",
|
||||||
|
borderRadius: "lg",
|
||||||
|
|
||||||
|
color: "white",
|
||||||
|
bg: "#B63B1F",
|
||||||
|
_hover: {
|
||||||
|
color: "text",
|
||||||
|
bg: "#B63B1F32"
|
||||||
|
},
|
||||||
|
|
||||||
|
_dark: {
|
||||||
|
bg: "#b55038",
|
||||||
|
color: "text",
|
||||||
|
_hover: {
|
||||||
|
bg: "#503D40"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -620,7 +679,7 @@ const config = defineConfig({
|
|||||||
widgetItemBg: { value: { base: "rgb(115 132 166 / 0.17)", _dark: "rgb(51 53 64)" } },
|
widgetItemBg: { value: { base: "rgb(115 132 166 / 0.17)", _dark: "rgb(51 53 64)" } },
|
||||||
widgetItemExpandedBg: { value: { base: "rgb(184 197 220 / 0.17)", _dark: "rgb(59 61 73)" } },
|
widgetItemExpandedBg: { value: { base: "rgb(184 197 220 / 0.17)", _dark: "rgb(59 61 73)" } },
|
||||||
widgetBadgeBg: { value: { base: "rgb(154 163 179 / 0.45)", _dark: "rgb(75 77 90)" } },
|
widgetBadgeBg: { value: { base: "rgb(154 163 179 / 0.45)", _dark: "rgb(75 77 90)" } },
|
||||||
widgetInnerBadgeBg: { value: { base: "rgb(154 163 179 / 0.45)", _dark: "rgb(100 103 119)" } },
|
widgetInnerBadgeBg: { value: { base: "rgb(224 226 232)", _dark: "rgb(100 103 119)" } },
|
||||||
widgetTextMuted: { value: { base: "#262627", _dark: "rgb(236 236 236 / 0.9)" } },
|
widgetTextMuted: { value: { base: "#262627", _dark: "rgb(236 236 236 / 0.9)" } },
|
||||||
|
|
||||||
// ALERT COLORS
|
// ALERT COLORS
|
||||||
|
|||||||
Reference in New Issue
Block a user