Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show dataIcon i AccordionButton when data in Task #18

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { TaskRunButton } from 'src/components/TaskRunButton';
import React from 'react';
import { DotButton } from 'src/components/DotButton';
import { dateFormatText } from 'src/components/dateFormatText';
import { AttachmentIcon } from '@chakra-ui/icons';

interface TaskAccordionButtonProps {
taskName: string;
executionTime: Date;
consecutiveFailures: number;
picked: boolean;
taskInstance: string;
taskData: string | null;
refetch: () => void;
}

Expand All @@ -21,6 +23,7 @@ export const TaskAccordionButton: React.FC<TaskAccordionButtonProps> = ({
consecutiveFailures,
picked,
taskInstance,
taskData,
refetch,
}) => {
return (
Expand All @@ -38,6 +41,7 @@ export const TaskAccordionButton: React.FC<TaskAccordionButtonProps> = ({
}
consecutiveFailures={consecutiveFailures}
/>
{taskData != 'null' && <AttachmentIcon />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blir taskData stringen faktisk stringen 'null'? Eller verdien null?
Javascript er ganske spesielt, fordi både tom string '' og null blir false. Så derfor kan du egentlig forkorte dette litt: taskData && <AttachmentIcon />

</Box>
<Box flex="2" textAlign="left">
{taskName}
Expand Down
1 change: 1 addition & 0 deletions db-scheduler-ui-frontend/src/components/TaskCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const TaskCard: React.FC<TaskCardProps> = ({
taskName={taskName}
consecutiveFailures={consecutiveFailures}
executionTime={executionTime}
taskData={taskData}
refetch={refetch}
/>
<Divider color={'#E0E0E0'} />
Expand Down