Skip to content

Commit

Permalink
Merge pull request #8 from bekk/Styling-New
Browse files Browse the repository at this point in the history
Styling new
  • Loading branch information
johannabjoremo authored Aug 31, 2023
2 parents c90b098 + 4e182a2 commit b31a54a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 5 deletions.
16 changes: 16 additions & 0 deletions db-scheduler-ui-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions db-scheduler-ui-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@tanstack/react-query": "^4.33.0",
"date-fns": "^2.30.0",
"framer-motion": "^10.15.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
3 changes: 2 additions & 1 deletion db-scheduler-ui-frontend/src/components/DotButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export const DotButton: React.FC<TaskProps> = ({
onClick={(event) => event.stopPropagation()}
/>

<MenuList>
<MenuList padding={0}>
<MenuItem
rounded={6}
minBlockSize={10}
onClick={(event) => {
event.stopPropagation();
setIsOpen(true);
Expand Down
3 changes: 1 addition & 2 deletions db-scheduler-ui-frontend/src/components/SortButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ export const SortButton: React.FC<{
flex="2"
textAlign="left"
fontSize={'sm'}
_active={{ color: '#000000', fontWeight: 'semibold' }}
onClick={() =>
currentSort === name ? setSortAsc(!sortAsc) : setCurrentSort(name)
}
fontWeight={currentSort === name ? 'bold' : 'normal'}
>
{title}
<ChevronDownIcon
fontSize={'xl'}
transform={
sortAsc || currentSort !== name ? 'rotate(0deg)' : 'rotate(180deg)'
}
color={currentSort === name ? '#000000' : '#ababab'}
transition="transform 0.3s ease-in-out"
/>
</Text>
Expand Down
1 change: 1 addition & 0 deletions db-scheduler-ui-frontend/src/components/StatusBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const StatusBox: React.FC<StatusBoxProps> = ({
<Box
borderRadius={4}
mr={4}
width={115}
borderColor={borderColor}
backgroundColor={backgroundColor}
color={color}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { StatusBox } from 'src/components/StatusBox';
import { TaskRunButton } from 'src/components/TaskRunButton';
import React from 'react';
import { DotButton } from 'src/components/DotButton';
import { dateFormatText } from 'src/components/dateFormatText';

interface TaskAccordionButtonProps {
taskName: string;
Expand Down Expand Up @@ -51,8 +52,7 @@ export const TaskAccordionButton: React.FC<TaskAccordionButtonProps> = ({
justifyContent={'flex-end'}
flexDirection={'row'}
>

<Box flex="1">{new Date(executionTime)?.toLocaleString()}</Box>
<Box flex={1}>{dateFormatText(new Date(executionTime))}</Box>
<TaskRunButton
taskName={taskName}
taskInstance={taskInstance}
Expand Down
1 change: 1 addition & 0 deletions db-scheduler-ui-frontend/src/components/TaskRunButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const TaskRunButton: React.FC<TaskRunButtonProps> = ({
runTask(taskInstance, taskName).then(() => refetch());
}}
iconSpacing={2}
width={100}
bgColor={consecutiveFailures > 0 ? '#5068F6' : '#E9ECFE'}
textColor={consecutiveFailures > 0 ? '#FFFFFF' : '#002FA7'}
_hover={{
Expand Down
4 changes: 4 additions & 0 deletions db-scheduler-ui-frontend/src/components/dateFormatText.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { format } from 'date-fns';
export function dateFormatText(date: Date) {
return format(date, 'dd. MMM yy, H:mm:ss');
}

0 comments on commit b31a54a

Please sign in to comment.