Skip to content

Commit 57d5e4f

Browse files
guan404mingkaxil
authored andcommitted
Fix timezone selection and dashboard layout (#50463)
(cherry picked from commit d73d5fa)
1 parent 2fe9f01 commit 57d5e4f

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

airflow-core/src/airflow/ui/src/components/Assets/AssetEvent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const AssetEvent = ({
4545
}
4646

4747
return (
48-
<Box borderBottomWidth={1} fontSize={13} mt={1} p={2}>
48+
<Box borderBottomWidth={1} fontSize={13} pb={2}>
4949
<Text fontWeight="bold">
5050
<Time datetime={event.timestamp} />
5151
</Text>

airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import { Box, Heading, Flex, HStack, Skeleton } from "@chakra-ui/react";
19+
import { Box, Heading, Flex, HStack, Skeleton, Separator } from "@chakra-ui/react";
2020
import type { BoxProps } from "@chakra-ui/react";
2121
import { createListCollection } from "@chakra-ui/react/collection";
2222
import { FiDatabase } from "react-icons/fi";
@@ -65,8 +65,8 @@ export const AssetEvents = ({
6565
});
6666

6767
return (
68-
<Box borderBottomWidth={0} borderRadius={5} borderWidth={1} ml={2} {...rest}>
69-
<Flex justify="space-between" mr={1} mt={0} pl={3} pt={1}>
68+
<Box borderBottomWidth={0} borderRadius={5} borderWidth={1} ml={2} p={4} py={2} {...rest}>
69+
<Flex alignItems="center" justify="space-between">
7070
<HStack>
7171
<StateBadge colorPalette="blue" fontSize="md" variant="solid">
7272
<FiDatabase />
@@ -83,6 +83,7 @@ export const AssetEvents = ({
8383
data-testid="asset-sort-duration"
8484
defaultValue={["-timestamp"]}
8585
onValueChange={(option) => setOrderBy(option.value[0] as string)}
86+
size="sm"
8687
width={130}
8788
>
8889
<Select.Trigger>
@@ -99,6 +100,7 @@ export const AssetEvents = ({
99100
</Select.Root>
100101
)}
101102
</Flex>
103+
<Separator mt={2.5} />
102104
<DataTable
103105
cardDef={cardDef(assetId)}
104106
columns={[]}

airflow-core/src/airflow/ui/src/layouts/Nav/TimezoneSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const TimezoneSelector: React.FC = () => {
6666
value={options.find((option) => option.value === selectedTimezone)}
6767
/>
6868
</Field.Root>
69-
<Box borderRadius="md" boxShadow="md" p={6}>
69+
<Box borderRadius="md" boxShadow="sm" display="flex" flexDirection="column" gap={2} p={6}>
7070
<Text fontSize="lg" fontWeight="bold">
7171
Current time in {selectedTimezone}:
7272
</Text>

airflow-core/src/airflow/ui/src/pages/Dashboard/Dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ export const Dashboard = () => {
3838
<Accordion.Item key="ui_alerts" value="ui_alerts">
3939
{alerts.map((alert: UIAlert, index) =>
4040
index === 0 ? (
41-
<Accordion.ItemTrigger key={alert.text}>
41+
<Accordion.ItemTrigger key={alert.text} mb={2}>
4242
<Alert status={alert.category}>
4343
<ReactMarkdown>{alert.text}</ReactMarkdown>
4444
</Alert>
4545
</Accordion.ItemTrigger>
4646
) : (
47-
<Accordion.ItemContent key={alert.text} paddingRight="8">
47+
<Accordion.ItemContent key={alert.text} pr={8}>
4848
<Alert status={alert.category}>
4949
<ReactMarkdown>{alert.text}</ReactMarkdown>
5050
</Alert>

airflow-core/src/airflow/ui/src/pages/Dashboard/HistoricalMetrics/DagRunMetrics.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const DagRunMetrics = ({ dagRunStates, endDate, startDate, total }: DagRu
4747
</RouterLink>
4848
<Heading size="md">Dag Runs</Heading>
4949
</HStack>
50-
<Separator my={2} />
50+
<Separator my={3} />
5151
<Stack gap={4}>
5252
{DAGRUN_STATES.map((state) => (
5353
<MetricSection

airflow-core/src/airflow/ui/src/pages/Dashboard/HistoricalMetrics/TaskInstanceMetrics.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const TaskInstanceMetrics = ({
6666
</RouterLink>
6767
<Heading size="md">Task Instances</Heading>
6868
</HStack>
69-
<Separator my={2} />
69+
<Separator my={3} />
7070
<Stack gap={4}>
7171
{TASK_STATES.sort((stateA, stateB) =>
7272
taskInstanceStates[stateA] > taskInstanceStates[stateB] ? -1 : 1,

0 commit comments

Comments
 (0)