From fd9a3aeb6fcaffffb5856c7f99e919c2547db93c Mon Sep 17 00:00:00 2001 From: Sayan Mondal Date: Mon, 28 Jun 2021 10:46:02 +0530 Subject: [PATCH] Fixed Table FormControl active colors + updated workflow pills + minor ux fixes (#2943) Signed-off-by: Sayan Mondal --- .../public/locales/en/translation.yaml | 2 +- .../src/components/UserDetails/index.tsx | 12 +++--- .../Table/TableToolbar.tsx | 28 +++++++------- .../ApplicationDashboards/Table/styles.ts | 6 +-- .../WorkflowGraphs/index.tsx | 2 +- .../WorkflowGraphs/styles.ts | 1 + .../ChaosWorkflows/BrowseSchedule/index.tsx | 13 +------ .../ChaosWorkflows/BrowseSchedule/styles.ts | 1 + .../ChaosWorkflows/Runs/HeaderSection.tsx | 4 +- .../views/ChaosWorkflows/Runs/TableData.tsx | 13 ++++--- .../src/views/ChaosWorkflows/Runs/styles.ts | 6 ++- .../Targets/BrowseCluster/HeaderSection.tsx | 37 +++++++------------ .../src/views/Targets/BrowseCluster/styles.ts | 13 +++---- 13 files changed, 59 insertions(+), 79 deletions(-) diff --git a/litmus-portal/frontend/public/locales/en/translation.yaml b/litmus-portal/frontend/public/locales/en/translation.yaml index 34b84dd49..dce6b8b4b 100644 --- a/litmus-portal/frontend/public/locales/en/translation.yaml +++ b/litmus-portal/frontend/public/locales/en/translation.yaml @@ -1057,7 +1057,7 @@ createWorkflow: errYaml: Error in CRD Yaml. codeIsFine: Your code is fine. youCanMoveOn: You can move on ! - workflowNameValidationMessage: Workflow name can only be alpha numeric and should not contain capital letters + workflowNameValidationMessage: Workflow name can only be lowercase characters and alpha numeric subjectValidationMessage: Subject can only have alphanumeric characters and - . _ in-between test: test YAML: YAML diff --git a/litmus-portal/frontend/src/components/UserDetails/index.tsx b/litmus-portal/frontend/src/components/UserDetails/index.tsx index 2e9cc8001..d9e474520 100644 --- a/litmus-portal/frontend/src/components/UserDetails/index.tsx +++ b/litmus-portal/frontend/src/components/UserDetails/index.tsx @@ -1,4 +1,4 @@ -import { Avatar, Button, Typography } from '@material-ui/core'; +import { Avatar, Typography } from '@material-ui/core'; import { ButtonOutlined, InputField, Modal } from 'litmus-ui'; import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -37,9 +37,9 @@ const UserDetails: React.FC = ({ // avatar image source string const [avatar, setAvatar] = useState('./avatars/default.svg'); - const handleOpen = () => { - setOpen(true); - }; + // const handleOpen = () => { + // setOpen(true); + // }; const handleClose = () => { setOpen(false); @@ -61,9 +61,9 @@ const UserDetails: React.FC = ({ className={classes.avatarBackground} src={avatar} /> - + */} = ({ -
- { - history.push({ - pathname: '/analytics/dashboard/create', - search: `?projectID=${projectID}&projectRole=${projectRole}`, - }); - }} - > - - {t('analyticsDashboard.dashboardTable.addDashboard')} - - -
+ { + history.push({ + pathname: '/analytics/dashboard/create', + search: `?projectID=${projectID}&projectRole=${projectRole}`, + }); + }} + > + + {t('analyticsDashboard.dashboardTable.addDashboard')} + + ({ }, dateRangeDefault: { - height: '2rem', - textDecoration: 'none', - textTransform: 'none', padding: theme.spacing(1), }, addButton: { - marginRight: theme.spacing(3), - marginLeft: theme.spacing(1), + margin: theme.spacing(0, 2), }, icon: { diff --git a/litmus-portal/frontend/src/views/Analytics/WorkflowDashboard/WorkflowGraphs/index.tsx b/litmus-portal/frontend/src/views/Analytics/WorkflowDashboard/WorkflowGraphs/index.tsx index 2d661387a..b8cc10b51 100644 --- a/litmus-portal/frontend/src/views/Analytics/WorkflowDashboard/WorkflowGraphs/index.tsx +++ b/litmus-portal/frontend/src/views/Analytics/WorkflowDashboard/WorkflowGraphs/index.tsx @@ -54,7 +54,7 @@ const WorkflowGraphs: React.FC = ({ data }) => { ]; return (
- + { {/* Select Cluster */} - + Target Agent = ({ data, refetchQuery }) => { const getVariant = (variant: string | undefined) => { switch (variant) { case 'succeeded': - return 'success'; + return 'succeeded'; case 'failed': - return 'danger'; + return 'failed'; case 'running': - return 'warning'; + return 'running'; default: - return undefined; + return 'pending'; } }; @@ -237,7 +237,8 @@ const TableData: React.FC = ({ data, refetchQuery }) => { - diff --git a/litmus-portal/frontend/src/views/ChaosWorkflows/Runs/styles.ts b/litmus-portal/frontend/src/views/ChaosWorkflows/Runs/styles.ts index 62f9551be..3422003ea 100644 --- a/litmus-portal/frontend/src/views/ChaosWorkflows/Runs/styles.ts +++ b/litmus-portal/frontend/src/views/ChaosWorkflows/Runs/styles.ts @@ -35,6 +35,7 @@ const useStyles = makeStyles((theme) => ({ selectText: { height: '2.5rem', + color: theme.palette.text.primary, padding: theme.spacing(0.5), }, @@ -44,10 +45,11 @@ const useStyles = makeStyles((theme) => ({ height: '2.5rem', minWidth: '9rem', border: '0.125rem solid', - borderRadius: 4, - borderColor: theme.palette.primary.main, marginRight: theme.spacing(3.75), textTransform: 'none', + '&:focus': { + borderColor: theme.palette.primary.main, + }, }, displayDate: { marginLeft: theme.spacing(1), diff --git a/litmus-portal/frontend/src/views/Targets/BrowseCluster/HeaderSection.tsx b/litmus-portal/frontend/src/views/Targets/BrowseCluster/HeaderSection.tsx index a1f2a8aef..9f7045fcb 100644 --- a/litmus-portal/frontend/src/views/Targets/BrowseCluster/HeaderSection.tsx +++ b/litmus-portal/frontend/src/views/Targets/BrowseCluster/HeaderSection.tsx @@ -9,16 +9,16 @@ import { Select, Typography, } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown'; import SearchIcon from '@material-ui/icons/Search'; import { ButtonOutlined } from 'litmus-ui'; import React, { useState } from 'react'; import { DateRangePicker } from 'react-date-range'; -import { useTranslation } from 'react-i18next'; -import { useTheme } from '@material-ui/core/styles'; import 'react-date-range/dist/styles.css'; // main css file import 'react-date-range/dist/theme/default.css'; // theme css file +import { useTranslation } from 'react-i18next'; import useStyles from './styles'; interface HeaderSectionProps { @@ -97,12 +97,7 @@ const HeaderSection: React.FC = ({ /> {/* Select Workflow */} - + {t('workflowCluster.header.status')} @@ -128,12 +123,7 @@ const HeaderSection: React.FC = ({ {/* Select Cluster */} - + {t('workflowCluster.header.target')} @@ -154,16 +144,15 @@ const HeaderSection: React.FC = ({ -
- - - {displayDate} - - {isOpen ? : } - - - -
+ + + + {displayDate} + + {isOpen ? : } + + + ({ }, selectText: { height: '2.5rem', + color: theme.palette.text.primary, padding: theme.spacing(0.5), }, - selectDate: { + selectRange: { display: 'flex', flexDirection: 'row', height: '2.5rem', minWidth: '9rem', - border: '1.7px solid', - borderRadius: '2rem', - borderColor: theme.palette.secondary.main, + borderColor: theme.palette.border.main, marginRight: theme.spacing(3.75), textTransform: 'none', + '&:focus': { + borderColor: theme.palette.primary.main, + }, }, displayDate: { marginLeft: theme.spacing(1), @@ -198,9 +200,6 @@ const useStyles = makeStyles((theme) => ({ justifyContent: 'space-between', gap: '1rem', }, - dateBtn: { - marginRight: theme.spacing(2.5), - }, w7: { width: '7rem' }, // delete user delDiv: {