Compare commits
2
Commits
7b3e7d3d0c
...
b7a5ae2ae2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7a5ae2ae2 | ||
|
|
5798b90ab7 |
@@ -114,19 +114,22 @@ export default function CommCoorReport({ settings, widgetID }) {
|
||||
}
|
||||
}, [settings, widgetID, updateSettings, apiData]);
|
||||
|
||||
if (isLoading) return (
|
||||
if (isLoading)
|
||||
return (
|
||||
<Flex w="100%" h="100%" align="center" justify="center" borderRadius="lg" bg="transparent">
|
||||
<Spinner size="xl" color="blue.400" thickness="4px"/>
|
||||
</Flex>
|
||||
);
|
||||
|
||||
if (error) return (
|
||||
if (error)
|
||||
return (
|
||||
<Flex w="100%" h="100%" align="center" justify="center" textAlign="center" borderRadius="lg" bg="transparent">
|
||||
<Text color="red.400">{error}</Text>
|
||||
</Flex>
|
||||
);
|
||||
|
||||
if (!apiData) return (
|
||||
if (!apiData)
|
||||
return (
|
||||
<Flex w="100%" h="100%" align="center" justify="center" borderRadius="lg" bg="transparent">
|
||||
<Text textAlign="center" color="gray.400">No data</Text>
|
||||
</Flex>
|
||||
|
||||
@@ -112,33 +112,31 @@ export default function IvansAlerts({ settings, widgetID }) {
|
||||
{/* 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">
|
||||
<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>
|
||||
</Flex>
|
||||
{item?.files?.map((file, index) => {
|
||||
return (
|
||||
<Box w="100%" h="100%" key={index} p={1}>
|
||||
<Flex direction="row" mb={2} gap={1} justify="space-between">
|
||||
<Box w="100%" h="100%" key={index} >
|
||||
<Flex direction="row" w="100%">
|
||||
<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">
|
||||
<Text mr={1} truncate p={1} bg="widgetBadgeBg" borderRadius="lg" fontSize="sm" color="text">
|
||||
File: {file?.name}
|
||||
<Text truncate w="100%" p={1} bg="widgetInnerBadgeBg" borderRightRadius="lg" fontSize="sm" color="text">
|
||||
{file?.name}
|
||||
</Text>
|
||||
</a>
|
||||
{/*<Box borderRadius="lg" bg="widgetBadgeBg" color="text" p={1} fontSize="sm" asChild>*/}
|
||||
{/* Open*/}
|
||||
{/*</Box>*/}
|
||||
</Flex>
|
||||
<object
|
||||
data={`${file?.url}#view=FitH&toolbar=1`}
|
||||
type="application/pdf"
|
||||
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">
|
||||
Your browser cannot display this PDF directly.
|
||||
</Text>
|
||||
<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>
|
||||
</Flex>
|
||||
</object>
|
||||
|
||||
@@ -13,20 +13,22 @@ import {
|
||||
useFilter,
|
||||
useListCollection,
|
||||
Wrap,
|
||||
Badge
|
||||
Badge, Separator, HStack, useSlotRecipe
|
||||
} from "@chakra-ui/react";
|
||||
import { useDashboardStore } from "@/store/useDashboardStore.jsx";
|
||||
import { useState, useMemo } from "react";
|
||||
|
||||
export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
// STYLING
|
||||
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||
const popoverStyles = popoverRecipe();
|
||||
|
||||
// STATE MANAGEMENT
|
||||
const updateSettings = useDashboardStore(
|
||||
(state) => state.updateWidgetSettings,
|
||||
);
|
||||
const [startError, setStartError] = useState(null);
|
||||
const [endError, setEndError] = useState(null);
|
||||
|
||||
console.log("currentSettings:", currentSettings);
|
||||
|
||||
const [selectedVolcanoes, setSelectedVolcanoes] = useState([]);
|
||||
const { startsWith } = useFilter({ sensitivity: "base" });
|
||||
|
||||
@@ -36,6 +38,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
limit: 10,
|
||||
});
|
||||
|
||||
// FUNCTIONS
|
||||
const handleValueChange = (details) => {
|
||||
setSelectedVolcanoes(details.value)
|
||||
}
|
||||
@@ -45,14 +48,11 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
<Fieldset.Root>
|
||||
<Fieldset.Content>
|
||||
{/* SELECTING DATE RANGE */}
|
||||
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
||||
<Flex direction="column">
|
||||
<Text w="100%" fontWeight="bold">
|
||||
Date Range Selection
|
||||
</Text>
|
||||
<hr /> {/*line seperator*/}
|
||||
</Flex>
|
||||
|
||||
<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}>
|
||||
<Flex
|
||||
@@ -68,8 +68,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
<Flex direction="column" w="100%">
|
||||
<Input
|
||||
type="date"
|
||||
w="100%"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.date}
|
||||
value={currentSettings?.startDate || ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -109,8 +108,8 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
<Flex direction="column" w="100%">
|
||||
<Input
|
||||
type="date"
|
||||
w="100%"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.date}
|
||||
|
||||
value={currentSettings?.endDate || ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -137,18 +136,15 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
{/* FILTERS */}
|
||||
<CheckboxGroup w="100%">
|
||||
<Flex direction="column" w="100%" gap={2}>
|
||||
<Flex direction="column" w="100%">
|
||||
<Text w="fit" fontWeight="bold">
|
||||
Filters
|
||||
</Text>
|
||||
<hr /> {/*line seperator*/}
|
||||
</Flex>
|
||||
<HStack>
|
||||
<Text flexShrink="0" fontWeight="semibold">Filters</Text>
|
||||
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||
</HStack>
|
||||
|
||||
{/* level increases */}
|
||||
<CheckboxCard.Root
|
||||
size="sm"
|
||||
variant="surface"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.checkboxcard}
|
||||
|
||||
defaultChecked={currentSettings?.filters?.levelIncreases}
|
||||
onCheckedChange={(e) => {
|
||||
updateSettings(widgetId, {
|
||||
@@ -167,15 +163,14 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
Level Increases
|
||||
</CheckboxCard.Label>
|
||||
</CheckboxCard.Content>
|
||||
<CheckboxCard.Indicator />
|
||||
<CheckboxCard.Indicator css={popoverStyles.checkbox} />
|
||||
</CheckboxCard.Control>
|
||||
</CheckboxCard.Root>
|
||||
|
||||
{/* level decreases */}
|
||||
<CheckboxCard.Root
|
||||
size="sm"
|
||||
variant="surface"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.checkboxcard}
|
||||
|
||||
defaultChecked={currentSettings?.filters?.levelDecreases}
|
||||
onCheckedChange={(e) => {
|
||||
updateSettings(widgetId, {
|
||||
@@ -194,15 +189,14 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
Level Decreases
|
||||
</CheckboxCard.Label>
|
||||
</CheckboxCard.Content>
|
||||
<CheckboxCard.Indicator />
|
||||
<CheckboxCard.Indicator css={popoverStyles.checkbox} />
|
||||
</CheckboxCard.Control>
|
||||
</CheckboxCard.Root>
|
||||
|
||||
{/* elevated levels */}
|
||||
<CheckboxCard.Root
|
||||
size="sm"
|
||||
variant="surface"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.checkboxcard}
|
||||
|
||||
defaultChecked={currentSettings?.filters?.elevatedLevels}
|
||||
onCheckedChange={(e) => {
|
||||
updateSettings(widgetId, {
|
||||
@@ -221,7 +215,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) {
|
||||
Only Elevated Levels
|
||||
</CheckboxCard.Label>
|
||||
</CheckboxCard.Content>
|
||||
<CheckboxCard.Indicator />
|
||||
<CheckboxCard.Indicator css={popoverStyles.checkbox}/>
|
||||
</CheckboxCard.Control>
|
||||
</CheckboxCard.Root>
|
||||
</Flex>
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import {Button, Field, Flex, Input, Switch, Text} 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 {useState} from "react";
|
||||
|
||||
export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
||||
// STYLING
|
||||
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||
const popoverStyles = popoverRecipe();
|
||||
|
||||
// STATE MANAGEMENT
|
||||
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
||||
const [startError, setStartError] = useState(null);
|
||||
const [endError, setEndError] = useState(null);
|
||||
|
||||
// FUNCTIONS
|
||||
const handleCopyToClipboard = () => {
|
||||
updateSettings(widgetId, {copyToClipboard: true});
|
||||
}
|
||||
@@ -17,22 +23,24 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
||||
|
||||
return (
|
||||
<Flex flexDirection="column" justifyContent="space-between" gap={2} overflowY="auto">
|
||||
{/* COPY TO CLIPBOARD */}
|
||||
<Button w="fit" size="xs" onClick={handleCopyToClipboard}>Copy Report</Button>
|
||||
|
||||
{/* DOWNLOAD REPORT */}
|
||||
<Button w="fit" size="xs" onClick={handleDownloadReport}>Download Report</Button>
|
||||
|
||||
<Fieldset.Root>
|
||||
<Fieldset.Content>
|
||||
{/* 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}>
|
||||
<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
|
||||
</Text>
|
||||
<Flex direction="column" w="100%">
|
||||
<Input
|
||||
w="100%"
|
||||
css={popoverStyles.date}
|
||||
type="date"
|
||||
value={currentSettings?.startDate || ""}
|
||||
onChange={(e) => {
|
||||
@@ -51,14 +59,16 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Field.Root>
|
||||
{/* end date */}
|
||||
<Field.Root invalid={!!endError}>
|
||||
<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
|
||||
</Text>
|
||||
<Flex direction="column" w="100%">
|
||||
<Input
|
||||
w="100%"
|
||||
css={popoverStyles.date}
|
||||
type="date"
|
||||
value={currentSettings?.endDate || ""}
|
||||
onChange={(e) => {
|
||||
@@ -78,6 +88,19 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) {
|
||||
</Flex>
|
||||
</Field.Root>
|
||||
</Flex>
|
||||
|
||||
<HStack>
|
||||
<Text flexShrink="0" fontWeight="semibold">Tools</Text>
|
||||
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||
</HStack>
|
||||
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
||||
{/* COPY TO CLIPBOARD */}
|
||||
<Button css={popoverStyles.button} onClick={handleCopyToClipboard}>Copy Report</Button>
|
||||
{/* DOWNLOAD REPORT */}
|
||||
<Button css={popoverStyles.button} onClick={handleDownloadReport}>Download Report</Button>
|
||||
</Flex>
|
||||
</Fieldset.Content>
|
||||
</Fieldset.Root>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
@@ -1,12 +1,30 @@
|
||||
import {Button, Field, Flex, Input, Switch, Text, Fieldset, CheckboxCard} from "@chakra-ui/react";
|
||||
import {
|
||||
Button,
|
||||
Field,
|
||||
Flex,
|
||||
Input,
|
||||
Switch,
|
||||
Text,
|
||||
Fieldset,
|
||||
CheckboxCard,
|
||||
Separator,
|
||||
HStack,
|
||||
useSlotRecipe
|
||||
} from "@chakra-ui/react";
|
||||
import {useDashboardStore} from "../../../store/useDashboardStore.jsx";
|
||||
import {useState} from "react";
|
||||
|
||||
export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
// STYLING
|
||||
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||
const popoverStyles = popoverRecipe();
|
||||
|
||||
// STATE MANAGEMENT
|
||||
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
||||
const [startError, setStartError] = useState(null);
|
||||
const [endError, setEndError] = useState(null);
|
||||
|
||||
// FUNCTIONS
|
||||
const handleCopyToClipboard = () => {
|
||||
updateSettings(widgetId, {copyToClipboard: true});
|
||||
}
|
||||
@@ -24,14 +42,11 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
<Fieldset.Root>
|
||||
<Fieldset.Content>
|
||||
{/* SELECTING DATE RANGE */}
|
||||
<Flex direction="column" w="100%" h="100%" justify="center" gap={2}>
|
||||
<Flex direction="column">
|
||||
<Text w="100%" fontWeight="bold">
|
||||
Date Range Selection
|
||||
</Text>
|
||||
<hr style={{borderColor: "red.700"}} /> {/*line seperator*/}
|
||||
</Flex>
|
||||
|
||||
<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}>
|
||||
<Flex
|
||||
@@ -49,6 +64,7 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
type="date"
|
||||
w="100%"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.date}
|
||||
value={currentSettings?.startDate || ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -90,6 +106,7 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
type="date"
|
||||
w="100%"
|
||||
borderRadius="lg"
|
||||
css={popoverStyles.date}
|
||||
value={currentSettings?.endDate || ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -114,22 +131,19 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
</Flex>
|
||||
|
||||
{/* SORTS */}
|
||||
<Flex direction="column">
|
||||
<Text w="100%" fontWeight="bold">
|
||||
Sorts
|
||||
</Text>
|
||||
<hr /> {/*line seperator*/}
|
||||
</Flex>
|
||||
<HStack>
|
||||
<Text flexShrink="0" fontWeight="semibold">Sorts</Text>
|
||||
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||
</HStack>
|
||||
|
||||
{/* time sort */}
|
||||
<Switch.Root
|
||||
checked={currentSettings?.activeSorts?.timeSort === "asc"}
|
||||
onCheckedChange={handleTimeSort}
|
||||
colorPalette="blue"
|
||||
>
|
||||
<Switch.HiddenInput />
|
||||
<Switch.Control>
|
||||
<Switch.Thumb />
|
||||
<Switch.Control css={popoverStyles.switch}>
|
||||
<Switch.Thumb bg="white"/>
|
||||
</Switch.Control>
|
||||
<Switch.Label fontWeight={400}>Oldest to Newest</Switch.Label>
|
||||
</Switch.Root>
|
||||
@@ -138,27 +152,25 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
<Switch.Root
|
||||
checked={currentSettings?.activeSorts?.volcanoSort}
|
||||
onCheckedChange={handleVolcanoSort}
|
||||
colorPalette="blue"
|
||||
>
|
||||
<Switch.HiddenInput />
|
||||
<Switch.Control>
|
||||
<Switch.Thumb />
|
||||
<Switch.Control css={popoverStyles.switch}>
|
||||
<Switch.Thumb bg="white" />
|
||||
</Switch.Control>
|
||||
<Switch.Label fontWeight={400}>Alphabetically by Volcano</Switch.Label>
|
||||
</Switch.Root>
|
||||
|
||||
<Flex direction="column">
|
||||
<Text w="100%" fontWeight="bold">
|
||||
Filters
|
||||
</Text>
|
||||
<hr /> {/*line seperator*/}
|
||||
</Flex>
|
||||
<HStack>
|
||||
<Text flexShrink="0" fontWeight="semibold">Filters</Text>
|
||||
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||
</HStack>
|
||||
|
||||
{/* elevated levels */}
|
||||
<CheckboxCard.Root
|
||||
size="sm"
|
||||
variant="surface"
|
||||
borderRadius="lg"
|
||||
// size="sm"
|
||||
// variant="surface"
|
||||
css={popoverStyles.checkboxcard}
|
||||
|
||||
defaultChecked={currentSettings?.filters?.elevatedLevels}
|
||||
onCheckedChange={(e) => {
|
||||
updateSettings(widgetId, {
|
||||
@@ -177,18 +189,21 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) {
|
||||
Only Elevated Levels
|
||||
</CheckboxCard.Label>
|
||||
</CheckboxCard.Content>
|
||||
<CheckboxCard.Indicator />
|
||||
<CheckboxCard.Indicator css={popoverStyles.checkbox} />
|
||||
</CheckboxCard.Control>
|
||||
</CheckboxCard.Root>
|
||||
|
||||
{/* COPY TO CLIPBOARD */}
|
||||
<Flex direction="column">
|
||||
<Text w="100%" fontWeight="bold">
|
||||
Tools
|
||||
</Text>
|
||||
<hr /> {/*line seperator*/}
|
||||
<Button mt={2} w="100%" size="xs" borderRadius="lg" variant="subtle" onClick={handleCopyToClipboard}>Copy All IVANS</Button>
|
||||
</Flex>
|
||||
<HStack>
|
||||
<Text flexShrink="0" fontWeight="semibold">Tools</Text>
|
||||
<Separator flex="1" size="sm"/> {/*line seperator*/}
|
||||
</HStack>
|
||||
<Button mt={-2} w="100%" size="xs" borderRadius="lg" variant="subtle"
|
||||
css={popoverStyles.button}
|
||||
onClick={handleCopyToClipboard}
|
||||
>
|
||||
Copy All IVANS
|
||||
</Button>
|
||||
</Fieldset.Content>
|
||||
</Fieldset.Root>
|
||||
</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 {useState} from "react";
|
||||
|
||||
export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
||||
// STYLING
|
||||
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||
const popoverStyles = popoverRecipe();
|
||||
|
||||
// STATE MANAGEMENT
|
||||
const updateSettings = useDashboardStore(state => state.updateWidgetSettings);
|
||||
const [startError, setStartError] = useState(null);
|
||||
const [endError, setEndError] = useState(null);
|
||||
|
||||
// FUNCTIONS
|
||||
const handleCopyToClipboard = () => {
|
||||
updateSettings(widgetId, {copyToClipboard: true});
|
||||
}
|
||||
@@ -21,44 +27,25 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
||||
|
||||
return (
|
||||
<Flex flexDirection="column" justifyContent="space-between" gap={2} overflowY="auto">
|
||||
{/* COPYING TO CLIPBOARD */}
|
||||
<Button w="fit" size="xs" onClick={handleCopyToClipboard}>Copy All RS</Button>
|
||||
|
||||
{/* 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>
|
||||
|
||||
<Fieldset.Root>
|
||||
<Fieldset.Content>
|
||||
{/* 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}>
|
||||
<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
|
||||
</Text>
|
||||
<Flex direction="column" w="100%">
|
||||
<Input
|
||||
w="100%"
|
||||
type="date"
|
||||
css={popoverStyles.date}
|
||||
|
||||
value={currentSettings?.startDate || ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -76,15 +63,18 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Field.Root>
|
||||
|
||||
{/* end date */}
|
||||
<Field.Root invalid={!!endError}>
|
||||
<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
|
||||
</Text>
|
||||
<Flex direction="column" w="100%">
|
||||
<Input
|
||||
w="100%"
|
||||
type="date"
|
||||
css={popoverStyles.date}
|
||||
|
||||
value={currentSettings?.endDate || ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
@@ -103,6 +93,45 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) {
|
||||
</Flex>
|
||||
</Field.Root>
|
||||
</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>
|
||||
)
|
||||
}
|
||||
+90
-4
@@ -68,8 +68,8 @@ const sidebarRecipe = defineSlotRecipe({
|
||||
root: {
|
||||
// 1. Semi-transparent backgrounds
|
||||
bg: {
|
||||
base: "linear-gradient(to bottom right, #97282880 20%, #EB7F3160 60%, #FCAD3840 100%)",
|
||||
_dark: "linear-gradient(to bottom right, #9900003C 20%, #FF66003C 60%, #FFC0003C 100%)"
|
||||
base: "linear-gradient(to bottom right, #B63B1F88 20%, #FF990060 70%, #FFBF0040 90%)",
|
||||
_dark: "linear-gradient(to bottom right, #9900004C 20%, #FF66003C 60%, #FFAE003C 100%)"
|
||||
},
|
||||
|
||||
// 2. The glass blur effect
|
||||
@@ -346,7 +346,7 @@ const widgetRecipe = defineSlotRecipe({
|
||||
|
||||
// 6. TRUE POPOVER: Compact floating card for 3-dots menus
|
||||
const glassPopoverRecipe = defineSlotRecipe({
|
||||
slots: ["content", "arrow", "positioner"],
|
||||
slots: ["content", "arrow", "positioner", "date", "checkboxcard", "checkbox", "switch", "button"],
|
||||
base: {
|
||||
content: {
|
||||
...glassSurface,
|
||||
@@ -357,6 +357,92 @@ const glassPopoverRecipe = defineSlotRecipe({
|
||||
backdropFilter: "blur(15px)",
|
||||
WebkitBackdropFilter: "blur(15px)",
|
||||
},
|
||||
date: {
|
||||
color: "text",
|
||||
bg: "widgetBadgeBg",
|
||||
borderRadius: "lg",
|
||||
h: "2rem",
|
||||
_focus: {
|
||||
borderStyle: "none",
|
||||
}
|
||||
},
|
||||
checkboxcard: {
|
||||
// applies to both dark & lt modes
|
||||
w: "100%",
|
||||
borderRadius: "lg",
|
||||
color: "text",
|
||||
|
||||
"& div[data-part='control']": {
|
||||
alignItems: "center",
|
||||
padding: "6px",
|
||||
},
|
||||
|
||||
bg: "widgetItemBg",
|
||||
_checked: {
|
||||
boxShadow: "none",
|
||||
bg: "rgb(182 59 31 / 0.2)",
|
||||
borderColor: "#B63B1F"
|
||||
},
|
||||
|
||||
_dark: {
|
||||
bg: "widgetBadgeBg",
|
||||
_checked: {
|
||||
boxShadow: "none",
|
||||
color: "text",
|
||||
bg: "#503D40",
|
||||
borderColor: "#B55038"
|
||||
}
|
||||
}
|
||||
},
|
||||
checkbox: {
|
||||
bg: "widgetInnerBadgeBg",
|
||||
_checked: {
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -593,7 +679,7 @@ const config = defineConfig({
|
||||
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)" } },
|
||||
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)" } },
|
||||
|
||||
// ALERT COLORS
|
||||
|
||||
Reference in New Issue
Block a user