CSS and other bug fixes for 2.0 beta 1 (#2535)
* bug fixes for beta 1 Signed-off-by: ishangupta-ds <ishan@chaosnative.com> * modal bug fixes for beta 1 Signed-off-by: ishangupta-ds <ishan@chaosnative.com>
This commit is contained in:
parent
d8abba9b62
commit
22f1306496
|
Before Width: | Height: | Size: 773 B After Width: | Height: | Size: 773 B |
|
|
@ -46,6 +46,7 @@ quickActionCard:
|
||||||
quickSurvey: Take a quick survey
|
quickSurvey: Take a quick survey
|
||||||
readDocs: Read the Litmus docs
|
readDocs: Read the Litmus docs
|
||||||
readAPIDocs: Read the Litmus Portal API docs
|
readAPIDocs: Read the Litmus Portal API docs
|
||||||
|
addDashboard: Add a Dashboard
|
||||||
addDataSource: Add a Data Source
|
addDataSource: Add a Data Source
|
||||||
addAgent: Add an agent
|
addAgent: Add an agent
|
||||||
connectNewAgent: Connect a new agent
|
connectNewAgent: Connect a new agent
|
||||||
|
|
@ -207,7 +208,7 @@ analyticsDashboard:
|
||||||
overviewTabdataSourceTable: Connected Data Sources
|
overviewTabdataSourceTable: Connected Data Sources
|
||||||
applicationDashboard: Application Dashboards
|
applicationDashboard: Application Dashboards
|
||||||
connectedDataSources: Connected Data Sources
|
connectedDataSources: Connected Data Sources
|
||||||
datasource: Data source
|
dataSource: Data sources
|
||||||
dataSourceTable:
|
dataSourceTable:
|
||||||
tableHead1: Status
|
tableHead1: Status
|
||||||
tableHead2: Data Source Name
|
tableHead2: Data Source Name
|
||||||
|
|
@ -845,4 +846,4 @@ customWorkflow:
|
||||||
viewYAML:
|
viewYAML:
|
||||||
view: View the YAML here
|
view: View the YAML here
|
||||||
backBtn:
|
backBtn:
|
||||||
back: Back
|
back: Back
|
||||||
|
|
@ -14,7 +14,7 @@ const CustomBreadcrumbs: React.FC<CustomBreadcrumbsProps> = ({ location }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Breadcrumbs aria-label="breadcrumb">
|
<Breadcrumbs aria-label="breadcrumb" className={classes.marker}>
|
||||||
{pathname.map((path) => {
|
{pathname.map((path) => {
|
||||||
if (path) {
|
if (path) {
|
||||||
intermediateRoutes += path;
|
intermediateRoutes += path;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
},
|
},
|
||||||
|
marker: {
|
||||||
|
color: theme.palette.text.disabled,
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ const AntSwitch = withStyles((theme: Theme) =>
|
||||||
color: theme.palette.common.white,
|
color: theme.palette.common.white,
|
||||||
'& + $track': {
|
'& + $track': {
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
backgroundColor: theme.palette.secondary.dark,
|
backgroundColor: theme.palette.primary.main,
|
||||||
borderColor: theme.palette.secondary.dark,
|
borderColor: theme.palette.primary.main,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { Checkbox, withStyles } from '@material-ui/core';
|
||||||
|
|
||||||
|
const CheckBox = withStyles((theme) => ({
|
||||||
|
root: {
|
||||||
|
color: theme.palette.text.hint,
|
||||||
|
},
|
||||||
|
}))(Checkbox);
|
||||||
|
|
||||||
|
export default CheckBox;
|
||||||
|
|
@ -37,13 +37,13 @@ const InfoFilledWrap: React.FC = () => {
|
||||||
statType: 'Total Experiments',
|
statType: 'Total Experiments',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: theme.palette.primary.dark,
|
color: theme.palette.secondary.main,
|
||||||
value: parseInt(communityData.google.operatorInstalls, 10),
|
value: parseInt(communityData.google.operatorInstalls, 10),
|
||||||
statType: 'Operator Installed',
|
statType: 'Operator Installed',
|
||||||
plus: true,
|
plus: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: theme.palette.primary.light,
|
color: theme.palette.primary.main,
|
||||||
value: parseInt(communityData.google.totalRuns, 10),
|
value: parseInt(communityData.google.totalRuns, 10),
|
||||||
statType: 'Total Experiment Runs',
|
statType: 'Total Experiment Runs',
|
||||||
plus: true,
|
plus: true,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
marginRight: theme.spacing(3),
|
marginRight: theme.spacing(3),
|
||||||
borderRadius: 3,
|
borderRadius: 3,
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
width: theme.spacing(40),
|
width: '15rem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
infoFilledWrap: {
|
infoFilledWrap: {
|
||||||
|
|
|
||||||
|
|
@ -42,16 +42,16 @@ const useStyles = makeStyles((theme) => ({
|
||||||
margin: theme.spacing(1),
|
margin: theme.spacing(1),
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
border: `1px solid ${theme.palette.text.hint}`,
|
border: `1px solid ${theme.palette.border.main}`,
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
border: `1px solid ${theme.palette.secondary.dark}`,
|
border: `1px solid ${theme.palette.primary.main}`,
|
||||||
boxShadow: `0px 4px 4px ${theme.palette.primary.light}`,
|
boxShadow: `0px 4px 4px ${theme.palette.primary.light}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
cardFocused: {
|
cardFocused: {
|
||||||
border: `1px solid ${theme.palette.secondary.dark}`,
|
border: `1px solid ${theme.palette.primary.main}`,
|
||||||
boxShadow: `0px 4px 4px ${theme.palette.primary.light}`,
|
boxShadow: `0px 4px 4px ${theme.palette.primary.light}`,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
margin: '0 auto',
|
margin: '0 auto',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
border: `1px solid ${theme.palette.secondary.dark}`,
|
border: `1px solid ${theme.palette.primary.main}`,
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -134,7 +134,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
totalRunsSelected: {
|
totalRunsSelected: {
|
||||||
color: theme.palette.secondary.dark,
|
color: theme.palette.primary.main,
|
||||||
fontSize: '0.875rem',
|
fontSize: '0.875rem',
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
marginTop: theme.spacing(0.375),
|
marginTop: theme.spacing(0.375),
|
||||||
|
|
@ -155,7 +155,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
expCountSelected: {
|
expCountSelected: {
|
||||||
backgroundColor: theme.palette.secondary.dark,
|
backgroundColor: theme.palette.primary.main,
|
||||||
color: theme.palette.secondary.contrastText,
|
color: theme.palette.secondary.contrastText,
|
||||||
borderRadius: 3,
|
borderRadius: 3,
|
||||||
paddingTop: theme.spacing(0.275),
|
paddingTop: theme.spacing(0.275),
|
||||||
|
|
@ -173,7 +173,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
moreDetails: {
|
moreDetails: {
|
||||||
color: theme.palette.primary.dark,
|
color: theme.palette.primary.main,
|
||||||
},
|
},
|
||||||
|
|
||||||
horizontalLine: {
|
horizontalLine: {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
},
|
},
|
||||||
stepper: {
|
stepper: {
|
||||||
marginTop: theme.spacing(5),
|
marginTop: theme.spacing(5),
|
||||||
|
paddingTop: theme.spacing(10),
|
||||||
},
|
},
|
||||||
backButton: {
|
backButton: {
|
||||||
marginRight: theme.spacing(1),
|
marginRight: theme.spacing(1),
|
||||||
|
|
@ -16,6 +17,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: '1rem',
|
gap: '1rem',
|
||||||
marginLeft: '9%',
|
marginLeft: '9%',
|
||||||
|
paddingBottom: theme.spacing(3),
|
||||||
},
|
},
|
||||||
yamlError: {
|
yamlError: {
|
||||||
marginTop: theme.spacing(1.5),
|
marginTop: theme.spacing(1.5),
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import React, { useEffect, useState } from 'react';
|
import { Box, Button, Typography, useTheme } from '@material-ui/core';
|
||||||
import { Typography, Button, Box } from '@material-ui/core';
|
|
||||||
import Divider from '@material-ui/core/Divider';
|
import Divider from '@material-ui/core/Divider';
|
||||||
import GetAppTwoToneIcon from '@material-ui/icons/GetAppTwoTone';
|
import Fade from '@material-ui/core/Fade';
|
||||||
|
import Tooltip from '@material-ui/core/Tooltip';
|
||||||
|
import ErrorTwoToneIcon from '@material-ui/icons/ErrorTwoTone';
|
||||||
import FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';
|
import FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';
|
||||||
import FindInPageTwoToneIcon from '@material-ui/icons/FindInPageTwoTone';
|
import FindInPageTwoToneIcon from '@material-ui/icons/FindInPageTwoTone';
|
||||||
import FindReplaceTwoToneIcon from '@material-ui/icons/FindReplaceTwoTone';
|
import FindReplaceTwoToneIcon from '@material-ui/icons/FindReplaceTwoTone';
|
||||||
import UndoTwoToneIcon from '@material-ui/icons/UndoTwoTone';
|
import GetAppTwoToneIcon from '@material-ui/icons/GetAppTwoTone';
|
||||||
import RedoTwoToneIcon from '@material-ui/icons/RedoTwoTone';
|
import RedoTwoToneIcon from '@material-ui/icons/RedoTwoTone';
|
||||||
|
import SelectAllTwoToneIcon from '@material-ui/icons/SelectAllTwoTone';
|
||||||
|
import UndoTwoToneIcon from '@material-ui/icons/UndoTwoTone';
|
||||||
import UnfoldLessTwoToneIcon from '@material-ui/icons/UnfoldLessTwoTone';
|
import UnfoldLessTwoToneIcon from '@material-ui/icons/UnfoldLessTwoTone';
|
||||||
import UnfoldMoreTwoToneIcon from '@material-ui/icons/UnfoldMoreTwoTone';
|
import UnfoldMoreTwoToneIcon from '@material-ui/icons/UnfoldMoreTwoTone';
|
||||||
import SelectAllTwoToneIcon from '@material-ui/icons/SelectAllTwoTone';
|
|
||||||
import ErrorTwoToneIcon from '@material-ui/icons/ErrorTwoTone';
|
|
||||||
import Tooltip from '@material-ui/core/Tooltip';
|
|
||||||
import Fade from '@material-ui/core/Fade';
|
|
||||||
import AceEditor from 'react-ace';
|
import AceEditor from 'react-ace';
|
||||||
import 'brace/mode/yaml';
|
|
||||||
import 'brace/theme/cobalt';
|
|
||||||
import 'ace-builds/src-min-noconflict/ext-searchbox';
|
|
||||||
import 'ace-builds/src-min-noconflict/ext-beautify';
|
import 'ace-builds/src-min-noconflict/ext-beautify';
|
||||||
import 'ace-builds/src-min-noconflict/ext-code_lens';
|
import 'ace-builds/src-min-noconflict/ext-code_lens';
|
||||||
import 'ace-builds/src-min-noconflict/ext-elastic_tabstops_lite';
|
import 'ace-builds/src-min-noconflict/ext-elastic_tabstops_lite';
|
||||||
|
|
@ -30,6 +26,7 @@ import 'ace-builds/src-min-noconflict/ext-modelist';
|
||||||
import 'ace-builds/src-min-noconflict/ext-options';
|
import 'ace-builds/src-min-noconflict/ext-options';
|
||||||
import 'ace-builds/src-min-noconflict/ext-prompt';
|
import 'ace-builds/src-min-noconflict/ext-prompt';
|
||||||
import 'ace-builds/src-min-noconflict/ext-rtl';
|
import 'ace-builds/src-min-noconflict/ext-rtl';
|
||||||
|
import 'ace-builds/src-min-noconflict/ext-searchbox';
|
||||||
import 'ace-builds/src-min-noconflict/ext-spellcheck';
|
import 'ace-builds/src-min-noconflict/ext-spellcheck';
|
||||||
import 'ace-builds/src-min-noconflict/ext-split';
|
import 'ace-builds/src-min-noconflict/ext-split';
|
||||||
import 'ace-builds/src-min-noconflict/ext-static_highlight';
|
import 'ace-builds/src-min-noconflict/ext-static_highlight';
|
||||||
|
|
@ -37,11 +34,14 @@ import 'ace-builds/src-min-noconflict/ext-statusbar';
|
||||||
import 'ace-builds/src-min-noconflict/ext-textarea';
|
import 'ace-builds/src-min-noconflict/ext-textarea';
|
||||||
import 'ace-builds/src-min-noconflict/ext-themelist';
|
import 'ace-builds/src-min-noconflict/ext-themelist';
|
||||||
import 'ace-builds/src-min-noconflict/ext-whitespace';
|
import 'ace-builds/src-min-noconflict/ext-whitespace';
|
||||||
|
import 'brace/mode/yaml';
|
||||||
|
import 'brace/theme/cobalt';
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
import YAML from 'yaml';
|
import YAML from 'yaml';
|
||||||
import { AceValidations, parseYamlValidations } from './Validations';
|
|
||||||
import useStyles from './styles';
|
|
||||||
import useActions from '../../redux/actions';
|
import useActions from '../../redux/actions';
|
||||||
import * as WorkflowActions from '../../redux/actions/workflow';
|
import * as WorkflowActions from '../../redux/actions/workflow';
|
||||||
|
import useStyles from './styles';
|
||||||
|
import { AceValidations, parseYamlValidations } from './Validations';
|
||||||
|
|
||||||
interface YamlEditorProps {
|
interface YamlEditorProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -61,6 +61,7 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
readOnly,
|
readOnly,
|
||||||
}) => {
|
}) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
const { palette } = useTheme();
|
||||||
|
|
||||||
const workflow = useActions(WorkflowActions);
|
const workflow = useActions(WorkflowActions);
|
||||||
|
|
||||||
|
|
@ -105,7 +106,7 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
'ace_gutter-cell'
|
'ace_gutter-cell'
|
||||||
)[stateObject.annotations[0].row - 1] as any).style;
|
)[stateObject.annotations[0].row - 1] as any).style;
|
||||||
nodeStyleError.background = 'red';
|
nodeStyleError.background = 'red';
|
||||||
nodeStyleError.color = '#FFFFFF';
|
nodeStyleError.color = palette.secondary.contrastText;
|
||||||
} else {
|
} else {
|
||||||
setIsValid(true);
|
setIsValid(true);
|
||||||
setErrors({
|
setErrors({
|
||||||
|
|
@ -118,8 +119,10 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
'ace_gutter-cell'
|
'ace_gutter-cell'
|
||||||
);
|
);
|
||||||
for (let i = 0; i < nodeStyleErrorList.length; i += 1) {
|
for (let i = 0; i < nodeStyleErrorList.length; i += 1) {
|
||||||
(nodeStyleErrorList[i] as any).style.backgroundColor = '#1C1C1C';
|
(nodeStyleErrorList[i] as any).style.backgroundColor =
|
||||||
(nodeStyleErrorList[i] as any).style.color = 'rgba(255, 255, 255, 0.4)';
|
palette.common.black;
|
||||||
|
(nodeStyleErrorList[i] as any).style.color =
|
||||||
|
palette.secondary.contrastText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setModifiedYaml(value);
|
setModifiedYaml(value);
|
||||||
|
|
@ -496,14 +499,14 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
editor.setAnimatedScroll(true);
|
editor.setAnimatedScroll(true);
|
||||||
editor.setShowInvisibles(false);
|
editor.setShowInvisibles(false);
|
||||||
editor.setFontSize('0.98rem');
|
editor.setFontSize('0.98rem');
|
||||||
editor.container.style.background = '#1C1C1C';
|
editor.container.style.background = palette.common.black;
|
||||||
editor.container.style.lineHeight = '160%';
|
editor.container.style.lineHeight = '160%';
|
||||||
const nodeStyle = (document.getElementsByClassName(
|
const nodeStyle = (document.getElementsByClassName(
|
||||||
'ace_gutter'
|
'ace_gutter'
|
||||||
)[0] as any).style;
|
)[0] as any).style;
|
||||||
nodeStyle.color = 'rgba(255, 255, 255, 0.4)';
|
nodeStyle.color = palette.secondary.contrastText;
|
||||||
nodeStyle.borderRight = 0;
|
nodeStyle.borderRight = 0;
|
||||||
nodeStyle.background = '#1C1C1C';
|
nodeStyle.background = palette.common.black;
|
||||||
}}
|
}}
|
||||||
onCursorChange={(selection) => {
|
onCursorChange={(selection) => {
|
||||||
(YamlAce.current!.editor as any).setOptions({
|
(YamlAce.current!.editor as any).setOptions({
|
||||||
|
|
@ -516,9 +519,9 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
);
|
);
|
||||||
for (let i = 0; i < nodeStyleActiveList.length; i += 1) {
|
for (let i = 0; i < nodeStyleActiveList.length; i += 1) {
|
||||||
(nodeStyleActiveList[i] as any).style.backgroundColor =
|
(nodeStyleActiveList[i] as any).style.backgroundColor =
|
||||||
'#1C1C1C';
|
palette.common.black;
|
||||||
(nodeStyleActiveList[i] as any).style.color =
|
(nodeStyleActiveList[i] as any).style.color =
|
||||||
'rgba(255, 255, 255, 0.4)';
|
palette.secondary.contrastText;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -529,8 +532,8 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
const nodeStyleActive = (document.getElementsByClassName(
|
const nodeStyleActive = (document.getElementsByClassName(
|
||||||
'ace_gutter-cell'
|
'ace_gutter-cell'
|
||||||
)[selection.cursor.row] as any).style;
|
)[selection.cursor.row] as any).style;
|
||||||
nodeStyleActive.backgroundColor = '#5B44BA';
|
nodeStyleActive.backgroundColor = palette.primary.main;
|
||||||
nodeStyleActive.color = '#FFFFFF';
|
nodeStyleActive.color = palette.secondary.contrastText;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
annotations={editorState.annotations}
|
annotations={editorState.annotations}
|
||||||
|
|
@ -553,10 +556,8 @@ const YamlEditor: React.FC<YamlEditorProps> = ({
|
||||||
<img
|
<img
|
||||||
src="/icons/fullscreen.svg"
|
src="/icons/fullscreen.svg"
|
||||||
alt="Full Screen"
|
alt="Full Screen"
|
||||||
color="#FFFFFF"
|
color={palette.secondary.contrastText}
|
||||||
width="25px"
|
className={classes.fullScreenIcon}
|
||||||
height="25px"
|
|
||||||
margin-right="25px"
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
webkitBoxShadow: `inset 0 0 6px ${theme.palette.common.black}`,
|
webkitBoxShadow: `inset 0 0 6px ${theme.palette.common.black}`,
|
||||||
},
|
},
|
||||||
'&::-webkit-scrollbar-thumb': {
|
'&::-webkit-scrollbar-thumb': {
|
||||||
backgroundColor: theme.palette.secondary.dark,
|
backgroundColor: theme.palette.primary.main,
|
||||||
},
|
},
|
||||||
[theme.breakpoints.down('xl')]: {
|
[theme.breakpoints.down('xl')]: {
|
||||||
height: '84vh',
|
height: '84vh',
|
||||||
|
|
@ -259,11 +259,17 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fullScreenIcon: {
|
||||||
|
width: '1.5625rem',
|
||||||
|
height: '1.5625rem',
|
||||||
|
marginRight: '1.5625rem',
|
||||||
|
},
|
||||||
|
|
||||||
// Validations
|
// Validations
|
||||||
|
|
||||||
validationError: {
|
validationError: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
background: 'rgba(202, 44, 44, 0.2)',
|
background: theme.palette.error.light,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,6 @@ const Routes: React.FC<RoutesProps> = ({ isOwner, isProjectAvailable }) => {
|
||||||
<Redirect exact path="/login" to="/" />
|
<Redirect exact path="/login" to="/" />
|
||||||
<Redirect exact path="/workflows/schedule" to="/workflows" />
|
<Redirect exact path="/workflows/schedule" to="/workflows" />
|
||||||
<Redirect exact path="/workflows/template" to="/workflows" />
|
<Redirect exact path="/workflows/template" to="/workflows" />
|
||||||
<Redirect exact path="/workflows/analytics" to="/workflows" />
|
|
||||||
|
|
||||||
<Redirect exact path="/analytics/overview" to="/analytics" />
|
<Redirect exact path="/analytics/overview" to="/analytics" />
|
||||||
<Redirect exact path="/analytics/litmusdashboard" to="/analytics" />
|
<Redirect exact path="/analytics/litmusdashboard" to="/analytics" />
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ export interface DashboardDetails {
|
||||||
panelGroups?: PanelGroupResponse[];
|
panelGroups?: PanelGroupResponse[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChaosEngineNamesAndNamespacesMap {
|
export interface ChaosResultNamesAndNamespacesMap {
|
||||||
engineName: string;
|
resultName: string;
|
||||||
engineNamespace: string;
|
resultNamespace: string;
|
||||||
workflowName: string;
|
workflowName: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@ const AnalyticsDashboard = () => {
|
||||||
label={t('analyticsDashboard.applicationDashboard')}
|
label={t('analyticsDashboard.applicationDashboard')}
|
||||||
data-cy="kubernetesDashboard"
|
data-cy="kubernetesDashboard"
|
||||||
/>
|
/>
|
||||||
|
<StyledTab
|
||||||
|
label={t('analyticsDashboard.dataSource')}
|
||||||
|
data-cy="data source"
|
||||||
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
|
|
||||||
|
|
@ -73,9 +77,9 @@ const AnalyticsDashboard = () => {
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel value={analyticsTabValue} index={2}>
|
<TabPanel value={analyticsTabValue} index={2}>
|
||||||
<DashboardTable />
|
<DashboardTable />
|
||||||
<div className={classes.dataSourceTable}>
|
</TabPanel>
|
||||||
<DataSourceTable />
|
<TabPanel value={analyticsTabValue} index={3}>
|
||||||
</div>
|
<DataSourceTable />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</Scaffold>
|
</Scaffold>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ const useStyles = makeStyles((theme) => ({
|
||||||
boxShadow: 'none',
|
boxShadow: 'none',
|
||||||
paddingLeft: theme.spacing(1.5),
|
paddingLeft: theme.spacing(1.5),
|
||||||
},
|
},
|
||||||
dataSourceTable: {
|
|
||||||
marginTop: theme.spacing(10),
|
|
||||||
},
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ const useStyles = makeStyles((theme) => ({
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
marginLeft: theme.spacing(8),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
paper: {
|
paper: {
|
||||||
|
|
@ -137,7 +136,9 @@ const useStyles = makeStyles((theme) => ({
|
||||||
|
|
||||||
quickActionCard: {
|
quickActionCard: {
|
||||||
height: '21.25rem',
|
height: '21.25rem',
|
||||||
width: '20rem',
|
width: '15rem',
|
||||||
|
marginLeft: theme.spacing(3),
|
||||||
|
marginRight: theme.spacing(7),
|
||||||
[theme.breakpoints.down('md')]: {
|
[theme.breakpoints.down('md')]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
width: '15rem',
|
width: '15rem',
|
||||||
|
|
@ -145,8 +146,9 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
margin: 0,
|
||||||
marginTop: theme.spacing(5),
|
marginTop: theme.spacing(5),
|
||||||
width: '25rem',
|
width: '20rem',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { useQuery } from '@apollo/client';
|
||||||
import { CardActionArea, Typography, useTheme } from '@material-ui/core';
|
import { CardActionArea, Typography, useTheme } from '@material-ui/core';
|
||||||
import Backdrop from '@material-ui/core/Backdrop/Backdrop';
|
import Backdrop from '@material-ui/core/Backdrop/Backdrop';
|
||||||
import IconButton from '@material-ui/core/IconButton';
|
import IconButton from '@material-ui/core/IconButton';
|
||||||
import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
|
|
||||||
import { ButtonFilled, LitmusCard } from 'litmus-ui';
|
import { ButtonFilled, LitmusCard } from 'litmus-ui';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
@ -29,6 +28,7 @@ import * as UserActions from '../../redux/actions/user';
|
||||||
import * as WorkflowActions from '../../redux/actions/workflow';
|
import * as WorkflowActions from '../../redux/actions/workflow';
|
||||||
import configureStore, { history } from '../../redux/configureStore';
|
import configureStore, { history } from '../../redux/configureStore';
|
||||||
import { RootState } from '../../redux/reducers';
|
import { RootState } from '../../redux/reducers';
|
||||||
|
import { ReactComponent as Arrow } from '../../svg/arrow.svg';
|
||||||
import { getUsername } from '../../utils/auth';
|
import { getUsername } from '../../utils/auth';
|
||||||
import ReturningHome from '../../views/Home/ReturningHome';
|
import ReturningHome from '../../views/Home/ReturningHome';
|
||||||
import useStyles from './style';
|
import useStyles from './style';
|
||||||
|
|
@ -66,7 +66,7 @@ const CreateWorkflowCard: React.FC = () => {
|
||||||
<Typography className={classes.createWorkflowTitle}>
|
<Typography className={classes.createWorkflowTitle}>
|
||||||
{t('home.workflow.info')}
|
{t('home.workflow.info')}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ArrowForwardIcon className={classes.arrowForwardIcon} />
|
<Arrow className={classes.arrowForwardIconCard} />
|
||||||
</CardActionArea>
|
</CardActionArea>
|
||||||
</div>
|
</div>
|
||||||
</LitmusCard>
|
</LitmusCard>
|
||||||
|
|
@ -193,7 +193,7 @@ const HomePage: React.FC = () => {
|
||||||
<img src="icons/applause.png" alt="Applause icon" />
|
<img src="icons/applause.png" alt="Applause icon" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className={classes.workflowCardDiv}>
|
||||||
<CreateWorkflowCard data-cy="CreateWorkflowCard" />
|
<CreateWorkflowCard data-cy="CreateWorkflowCard" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -207,6 +207,8 @@ const HomePage: React.FC = () => {
|
||||||
</Typography>
|
</Typography>
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.seeAllBtn}
|
className={classes.seeAllBtn}
|
||||||
|
disableRipple
|
||||||
|
disableFocusRipple
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
history.push('/community');
|
history.push('/community');
|
||||||
|
|
@ -216,7 +218,7 @@ const HomePage: React.FC = () => {
|
||||||
<Typography className={classes.btnText}>
|
<Typography className={classes.btnText}>
|
||||||
{t('home.analytics.moreInfo')}
|
{t('home.analytics.moreInfo')}
|
||||||
</Typography>
|
</Typography>
|
||||||
<img src="icons/next.png" alt="next" />
|
<Arrow className={classes.arrowForwardIcon} />
|
||||||
</div>
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,19 @@ const useStyles = makeStyles((theme) => ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
marginRight: theme.spacing(6.5),
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
width: '20rem',
|
width: '95%',
|
||||||
|
flexDirection: 'column',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
workflowCardDiv: {
|
||||||
|
marginRight: theme.spacing(10),
|
||||||
|
[theme.breakpoints.down('sm')]: {
|
||||||
|
marginTop: theme.spacing(3),
|
||||||
|
height: '20rem',
|
||||||
|
width: '95%',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -67,6 +78,13 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
arrowForwardIcon: {
|
arrowForwardIcon: {
|
||||||
|
color: theme.palette.primary.main,
|
||||||
|
marginLeft: theme.spacing(1),
|
||||||
|
height: '1.65rem',
|
||||||
|
width: '1.65rem',
|
||||||
|
},
|
||||||
|
|
||||||
|
arrowForwardIconCard: {
|
||||||
color: theme.palette.primary.main,
|
color: theme.palette.primary.main,
|
||||||
marginLeft: theme.spacing(22.5),
|
marginLeft: theme.spacing(22.5),
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
|
@ -105,19 +123,22 @@ const useStyles = makeStyles((theme) => ({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
marginTop: theme.spacing(3.75),
|
marginTop: theme.spacing(3.75),
|
||||||
marginBottom: theme.spacing(2),
|
marginBottom: theme.spacing(2),
|
||||||
[theme.breakpoints.down('md')]: {
|
[theme.breakpoints.down(1150)]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
statDiv: {
|
statDiv: {
|
||||||
width: '50rem',
|
width: '70%',
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
backgroundColor: theme.palette.cards.background,
|
backgroundColor: theme.palette.cards.background,
|
||||||
borderRadius: 3,
|
borderRadius: 3,
|
||||||
|
[theme.breakpoints.down(1150)]: {
|
||||||
|
width: '90%',
|
||||||
|
},
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
width: '18rem',
|
width: '95%',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -164,6 +185,8 @@ const useStyles = makeStyles((theme) => ({
|
||||||
marginTop: theme.spacing(1.5),
|
marginTop: theme.spacing(1.5),
|
||||||
marginRight: theme.spacing(6),
|
marginRight: theme.spacing(6),
|
||||||
marginLeft: 'auto',
|
marginLeft: 'auto',
|
||||||
|
backgroundColor: 'transparent !important',
|
||||||
|
cursor: 'pointer',
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
marginTop: theme.spacing(0.2),
|
marginTop: theme.spacing(0.2),
|
||||||
marginBottom: theme.spacing(1),
|
marginBottom: theme.spacing(1),
|
||||||
|
|
@ -179,7 +202,8 @@ const useStyles = makeStyles((theme) => ({
|
||||||
btnText: {
|
btnText: {
|
||||||
paddingRight: theme.spacing(1.25),
|
paddingRight: theme.spacing(1.25),
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
color: theme.palette.secondary.dark,
|
color: theme.palette.primary.main,
|
||||||
|
fontSize: '1rem',
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,8 +279,8 @@ const DashboardPage: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{dataSourceStatus !== 'ACTIVE' ? (
|
{dataSourceStatus !== 'ACTIVE' ? (
|
||||||
<Modal open onClose={() => {}}>
|
<Modal open onClose={() => {}} width="60%">
|
||||||
<div>
|
<div className={classes.modal}>
|
||||||
<Typography align="center">
|
<Typography align="center">
|
||||||
<CrossMarkIcon className={classes.icon} />
|
<CrossMarkIcon className={classes.icon} />
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,10 @@ const useStyles = makeStyles((theme) => ({
|
||||||
loader: {
|
loader: {
|
||||||
padding: '22%',
|
padding: '22%',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
modal: {
|
||||||
|
padding: theme.spacing(15, 0),
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import {
|
||||||
WorkflowYaml,
|
WorkflowYaml,
|
||||||
} from '../../models/chaosWorkflowYaml';
|
} from '../../models/chaosWorkflowYaml';
|
||||||
import {
|
import {
|
||||||
ChaosEngineNamesAndNamespacesMap,
|
ChaosResultNamesAndNamespacesMap,
|
||||||
DashboardDetails,
|
DashboardDetails,
|
||||||
} from '../../models/dashboardsData';
|
} from '../../models/dashboardsData';
|
||||||
import {
|
import {
|
||||||
|
|
@ -124,7 +124,7 @@ const DashboardConfigurePage: React.FC<DashboardConfigurePageProps> = ({
|
||||||
|
|
||||||
const getPanelGroups = () => {
|
const getPanelGroups = () => {
|
||||||
if (configure === false) {
|
if (configure === false) {
|
||||||
const chaosEngineNamesAndNamespacesMap: ChaosEngineNamesAndNamespacesMap[] = [];
|
const chaosResultNamesAndNamespacesMap: ChaosResultNamesAndNamespacesMap[] = [];
|
||||||
workflowSchedules?.getScheduledWorkflows.forEach(
|
workflowSchedules?.getScheduledWorkflows.forEach(
|
||||||
(schedule: ScheduleWorkflow) => {
|
(schedule: ScheduleWorkflow) => {
|
||||||
if (
|
if (
|
||||||
|
|
@ -178,13 +178,13 @@ const DashboardConfigurePage: React.FC<DashboardConfigurePageProps> = ({
|
||||||
engineNamespace = parsedEmbeddedYaml.metadata.namespace;
|
engineNamespace = parsedEmbeddedYaml.metadata.namespace;
|
||||||
}
|
}
|
||||||
let matchIndex: number = -1;
|
let matchIndex: number = -1;
|
||||||
const check: number = chaosEngineNamesAndNamespacesMap.filter(
|
const check: number = chaosResultNamesAndNamespacesMap.filter(
|
||||||
(data, index) => {
|
(data, index) => {
|
||||||
if (
|
if (
|
||||||
data.engineName.includes(
|
data.resultName.includes(
|
||||||
parsedEmbeddedYaml.metadata.name
|
parsedEmbeddedYaml.metadata.name
|
||||||
) &&
|
) &&
|
||||||
data.engineNamespace === engineNamespace
|
data.resultNamespace === engineNamespace
|
||||||
) {
|
) {
|
||||||
matchIndex = index;
|
matchIndex = index;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -193,15 +193,15 @@ const DashboardConfigurePage: React.FC<DashboardConfigurePageProps> = ({
|
||||||
}
|
}
|
||||||
).length;
|
).length;
|
||||||
if (check === 0) {
|
if (check === 0) {
|
||||||
chaosEngineNamesAndNamespacesMap.push({
|
chaosResultNamesAndNamespacesMap.push({
|
||||||
engineName: `${parsedEmbeddedYaml.metadata.name}-${parsedEmbeddedYaml.spec.experiments[0].name}`,
|
resultName: `${parsedEmbeddedYaml.metadata.name}-${parsedEmbeddedYaml.spec.experiments[0].name}`,
|
||||||
engineNamespace,
|
resultNamespace: engineNamespace,
|
||||||
workflowName: workflowYaml.metadata.name,
|
workflowName: workflowYaml.metadata.name,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
chaosEngineNamesAndNamespacesMap[
|
chaosResultNamesAndNamespacesMap[
|
||||||
matchIndex
|
matchIndex
|
||||||
].workflowName = `${chaosEngineNamesAndNamespacesMap[matchIndex].workflowName}, \n${workflowYaml.metadata.name}`;
|
].workflowName = `${chaosResultNamesAndNamespacesMap[matchIndex].workflowName}, \n${workflowYaml.metadata.name}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -217,16 +217,16 @@ const DashboardConfigurePage: React.FC<DashboardConfigurePageProps> = ({
|
||||||
const selectedPanels: Panel[] = [];
|
const selectedPanels: Panel[] = [];
|
||||||
panelGroup.panels.forEach((panel) => {
|
panelGroup.panels.forEach((panel) => {
|
||||||
const selectedPanel: Panel = panel;
|
const selectedPanel: Panel = panel;
|
||||||
chaosEngineNamesAndNamespacesMap.forEach((keyValue) => {
|
chaosResultNamesAndNamespacesMap.forEach((keyValue) => {
|
||||||
selectedPanel.prom_queries.push({
|
selectedPanel.prom_queries.push({
|
||||||
queryid: uuidv4(),
|
queryid: uuidv4(),
|
||||||
prom_query_name: generateChaosQuery(
|
prom_query_name: generateChaosQuery(
|
||||||
DashboardList[DashboardTemplateID ?? 0]
|
DashboardList[DashboardTemplateID ?? 0]
|
||||||
.chaosEventQueryTemplate,
|
.chaosEventQueryTemplate,
|
||||||
keyValue.engineName,
|
keyValue.resultName,
|
||||||
keyValue.engineNamespace
|
keyValue.resultNamespace
|
||||||
),
|
),
|
||||||
legend: `${keyValue.workflowName}- \n${keyValue.engineName}`,
|
legend: `${keyValue.workflowName}- \n${keyValue.resultName}`,
|
||||||
resolution: '1/1',
|
resolution: '1/1',
|
||||||
minstep: '1',
|
minstep: '1',
|
||||||
line: false,
|
line: false,
|
||||||
|
|
@ -376,6 +376,7 @@ const DashboardConfigurePage: React.FC<DashboardConfigurePageProps> = ({
|
||||||
<Modal
|
<Modal
|
||||||
open={open}
|
open={open}
|
||||||
onClose={() => setOpen(false)}
|
onClose={() => setOpen(false)}
|
||||||
|
width="60%"
|
||||||
modalActions={
|
modalActions={
|
||||||
<ButtonOutlined
|
<ButtonOutlined
|
||||||
className={classes.closeButton}
|
className={classes.closeButton}
|
||||||
|
|
@ -385,7 +386,7 @@ const DashboardConfigurePage: React.FC<DashboardConfigurePageProps> = ({
|
||||||
</ButtonOutlined>
|
</ButtonOutlined>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div>
|
<div className={classes.modal}>
|
||||||
<Typography align="center">
|
<Typography align="center">
|
||||||
{success === true ? (
|
{success === true ? (
|
||||||
<img
|
<img
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,10 @@ const useStyles = makeStyles((theme) => ({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-evenly',
|
justifyContent: 'space-evenly',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
modal: {
|
||||||
|
padding: theme.spacing(15, 0),
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ const DataSourceConfigurePage: React.FC<DataSourceConfigurePageProps> = ({
|
||||||
<Modal
|
<Modal
|
||||||
open={open}
|
open={open}
|
||||||
onClose={() => setOpen(false)}
|
onClose={() => setOpen(false)}
|
||||||
width="55%"
|
width="60%"
|
||||||
modalActions={
|
modalActions={
|
||||||
<ButtonOutlined
|
<ButtonOutlined
|
||||||
className={classes.closeButton}
|
className={classes.closeButton}
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
modal: {
|
modal: {
|
||||||
[theme.breakpoints.up('lg')]: {
|
padding: theme.spacing(15, 0),
|
||||||
padding: theme.spacing(20),
|
|
||||||
},
|
|
||||||
padding: theme.spacing(10),
|
|
||||||
},
|
},
|
||||||
|
|
||||||
modalHeading: {
|
modalHeading: {
|
||||||
|
|
|
||||||
|
|
@ -77,16 +77,18 @@ const Settings: React.FC = () => {
|
||||||
>
|
>
|
||||||
<Tab data-cy="my-account" label="My Account" {...tabProps(0)} />
|
<Tab data-cy="my-account" label="My Account" {...tabProps(0)} />
|
||||||
<Tab data-cy="teaming" label="Team" {...tabProps(1)} />
|
<Tab data-cy="teaming" label="Team" {...tabProps(1)} />
|
||||||
{role === 'admin' ? (
|
{role === 'admin' && (
|
||||||
<Tab
|
<Tab
|
||||||
data-cy="user-management"
|
data-cy="user-management"
|
||||||
label="User Management"
|
label="User Management"
|
||||||
{...tabProps(2)}
|
{...tabProps(2)}
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
)}
|
||||||
<Tab data-cy="gitOps" label="GitOps" {...tabProps(3)} />
|
<Tab
|
||||||
|
data-cy="gitOps"
|
||||||
|
label="GitOps"
|
||||||
|
{...tabProps(role === 'admin' ? 3 : 2)}
|
||||||
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Paper>
|
</Paper>
|
||||||
<TabPanel value={settingsTabValue} index={0}>
|
<TabPanel value={settingsTabValue} index={0}>
|
||||||
|
|
@ -97,15 +99,13 @@ const Settings: React.FC = () => {
|
||||||
<TeamingTab />
|
<TeamingTab />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</div>
|
</div>
|
||||||
{role === 'admin' ? (
|
{role === 'admin' && (
|
||||||
<TabPanel value={settingsTabValue} index={2}>
|
<TabPanel value={settingsTabValue} index={2}>
|
||||||
<UserManagement />
|
<UserManagement />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
)}
|
||||||
<div data-cy="GitOpsPanel">
|
<div data-cy="GitOpsPanel">
|
||||||
<TabPanel value={settingsTabValue} index={3}>
|
<TabPanel value={settingsTabValue} index={role === 'admin' ? 3 : 2}>
|
||||||
<GitOpsTab />
|
<GitOpsTab />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { ChaosEngineNamesAndNamespacesMap } from '../models/dashboardsData';
|
import { ChaosResultNamesAndNamespacesMap } from '../models/dashboardsData';
|
||||||
|
|
||||||
const getEngineNameAndNamespace = (chaosQueryString: string) => {
|
const getResultNameAndNamespace = (chaosQueryString: string) => {
|
||||||
const parsedChaosInfoMap: ChaosEngineNamesAndNamespacesMap = {
|
const parsedChaosInfoMap: ChaosResultNamesAndNamespacesMap = {
|
||||||
engineName: chaosQueryString
|
resultName: chaosQueryString
|
||||||
.split(',')[0]
|
.split(',')[0]
|
||||||
.trim()
|
.trim()
|
||||||
.split('=')[1]
|
.split('=')[1]
|
||||||
.slice(1, -1),
|
.slice(1, -1),
|
||||||
engineNamespace: chaosQueryString
|
resultNamespace: chaosQueryString
|
||||||
.split(',')[1]
|
.split(',')[1]
|
||||||
.trim()
|
.trim()
|
||||||
.split('=')[1]
|
.split('=')[1]
|
||||||
|
|
@ -17,4 +17,4 @@ const getEngineNameAndNamespace = (chaosQueryString: string) => {
|
||||||
return parsedChaosInfoMap;
|
return parsedChaosInfoMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getEngineNameAndNamespace;
|
export default getResultNameAndNamespace;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import Divider from '@material-ui/core/Divider';
|
||||||
import { InputField } from 'litmus-ui';
|
import { InputField } from 'litmus-ui';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
import CheckBox from '../../../../components/CheckBox';
|
||||||
import { LIST_DATASOURCE } from '../../../../graphql';
|
import { LIST_DATASOURCE } from '../../../../graphql';
|
||||||
import { DataSourceDetails } from '../../../../models/dataSourceData';
|
import { DataSourceDetails } from '../../../../models/dataSourceData';
|
||||||
import {
|
import {
|
||||||
|
|
@ -23,7 +24,7 @@ import {
|
||||||
validateTextEmpty,
|
validateTextEmpty,
|
||||||
validateTimeInSeconds,
|
validateTimeInSeconds,
|
||||||
} from '../../../../utils/validate';
|
} from '../../../../utils/validate';
|
||||||
import useStyles, { StyledCheckbox } from './styles';
|
import useStyles from './styles';
|
||||||
|
|
||||||
interface ConfigurePrometheusProps {
|
interface ConfigurePrometheusProps {
|
||||||
configure: boolean;
|
configure: boolean;
|
||||||
|
|
@ -256,7 +257,7 @@ const ConfigurePrometheus: React.FC<ConfigurePrometheusProps> = ({
|
||||||
<div className={classes.inputDivCheckBox}>
|
<div className={classes.inputDivCheckBox}>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<StyledCheckbox
|
<CheckBox
|
||||||
color="primary"
|
color="primary"
|
||||||
checked={dataSourceDetails.noAuth}
|
checked={dataSourceDetails.noAuth}
|
||||||
onChange={handleAuthChange}
|
onChange={handleAuthChange}
|
||||||
|
|
@ -268,7 +269,7 @@ const ConfigurePrometheus: React.FC<ConfigurePrometheusProps> = ({
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
className={classes.basicAuth}
|
className={classes.basicAuth}
|
||||||
control={
|
control={
|
||||||
<StyledCheckbox
|
<CheckBox
|
||||||
color="primary"
|
color="primary"
|
||||||
disabled
|
disabled
|
||||||
checked={dataSourceDetails.basicAuth}
|
checked={dataSourceDetails.basicAuth}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Checkbox, makeStyles, withStyles } from '@material-ui/core';
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
|
|
@ -65,11 +65,4 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const StyledCheckbox = withStyles((theme) => ({
|
|
||||||
root: {
|
|
||||||
color: theme.palette.text.hint,
|
|
||||||
},
|
|
||||||
checked: {},
|
|
||||||
}))(Checkbox);
|
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
setConfirm(false);
|
setConfirm(false);
|
||||||
}}
|
}}
|
||||||
|
width="60%"
|
||||||
modalActions={
|
modalActions={
|
||||||
<ButtonOutlined
|
<ButtonOutlined
|
||||||
className={classes.closeButton}
|
className={classes.closeButton}
|
||||||
|
|
@ -148,7 +149,7 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
</ButtonOutlined>
|
</ButtonOutlined>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div>
|
<div className={classes.modal}>
|
||||||
{confirm === true ? (
|
{confirm === true ? (
|
||||||
<Typography align="center">
|
<Typography align="center">
|
||||||
{success === true ? (
|
{success === true ? (
|
||||||
|
|
|
||||||
|
|
@ -220,9 +220,14 @@ const useStyles = makeStyles((theme) => ({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-evenly',
|
justifyContent: 'space-evenly',
|
||||||
},
|
},
|
||||||
|
|
||||||
buttonOutlineWarning: {
|
buttonOutlineWarning: {
|
||||||
borderColor: theme.palette.error.dark,
|
borderColor: theme.palette.error.dark,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
modal: {
|
||||||
|
padding: theme.spacing(15, 0),
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const useOutlinedInputStyles = makeStyles((theme: Theme) => ({
|
export const useOutlinedInputStyles = makeStyles((theme: Theme) => ({
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import {
|
||||||
Template,
|
Template,
|
||||||
WorkflowYaml,
|
WorkflowYaml,
|
||||||
} from '../../../../models/chaosWorkflowYaml';
|
} from '../../../../models/chaosWorkflowYaml';
|
||||||
import { ChaosEngineNamesAndNamespacesMap } from '../../../../models/dashboardsData';
|
import { ChaosResultNamesAndNamespacesMap } from '../../../../models/dashboardsData';
|
||||||
import {
|
import {
|
||||||
DeleteDashboardInput,
|
DeleteDashboardInput,
|
||||||
ListDashboardResponse,
|
ListDashboardResponse,
|
||||||
|
|
@ -127,7 +127,7 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const reSyncChaosQueries = () => {
|
const reSyncChaosQueries = () => {
|
||||||
const chaosEngineNamesAndNamespacesMap: ChaosEngineNamesAndNamespacesMap[] = [];
|
const chaosResultNamesAndNamespacesMap: ChaosResultNamesAndNamespacesMap[] = [];
|
||||||
workflowSchedules?.getScheduledWorkflows.forEach(
|
workflowSchedules?.getScheduledWorkflows.forEach(
|
||||||
(schedule: ScheduleWorkflow) => {
|
(schedule: ScheduleWorkflow) => {
|
||||||
if (schedule.cluster_id === data.cluster_id && !schedule.isRemoved) {
|
if (schedule.cluster_id === data.cluster_id && !schedule.isRemoved) {
|
||||||
|
|
@ -178,13 +178,13 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
engineNamespace = parsedEmbeddedYaml.metadata.namespace;
|
engineNamespace = parsedEmbeddedYaml.metadata.namespace;
|
||||||
}
|
}
|
||||||
let matchIndex: number = -1;
|
let matchIndex: number = -1;
|
||||||
const check: number = chaosEngineNamesAndNamespacesMap.filter(
|
const check: number = chaosResultNamesAndNamespacesMap.filter(
|
||||||
(data, index) => {
|
(data, index) => {
|
||||||
if (
|
if (
|
||||||
data.engineName.includes(
|
data.resultName.includes(
|
||||||
parsedEmbeddedYaml.metadata.name
|
parsedEmbeddedYaml.metadata.name
|
||||||
) &&
|
) &&
|
||||||
data.engineNamespace === engineNamespace
|
data.resultNamespace === engineNamespace
|
||||||
) {
|
) {
|
||||||
matchIndex = index;
|
matchIndex = index;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -193,15 +193,15 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
}
|
}
|
||||||
).length;
|
).length;
|
||||||
if (check === 0) {
|
if (check === 0) {
|
||||||
chaosEngineNamesAndNamespacesMap.push({
|
chaosResultNamesAndNamespacesMap.push({
|
||||||
engineName: `${parsedEmbeddedYaml.metadata.name}-${parsedEmbeddedYaml.spec.experiments[0].name}`,
|
resultName: `${parsedEmbeddedYaml.metadata.name}-${parsedEmbeddedYaml.spec.experiments[0].name}`,
|
||||||
engineNamespace,
|
resultNamespace: engineNamespace,
|
||||||
workflowName: workflowYaml.metadata.name,
|
workflowName: workflowYaml.metadata.name,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
chaosEngineNamesAndNamespacesMap[
|
chaosResultNamesAndNamespacesMap[
|
||||||
matchIndex
|
matchIndex
|
||||||
].workflowName = `${chaosEngineNamesAndNamespacesMap[matchIndex].workflowName}, \n${workflowYaml.metadata.name}`;
|
].workflowName = `${chaosResultNamesAndNamespacesMap[matchIndex].workflowName}, \n${workflowYaml.metadata.name}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -212,7 +212,7 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
const isChaosQueryPresent: number[] = Array(
|
const isChaosQueryPresent: number[] = Array(
|
||||||
chaosEngineNamesAndNamespacesMap.length
|
chaosResultNamesAndNamespacesMap.length
|
||||||
).fill(0);
|
).fill(0);
|
||||||
|
|
||||||
data.panel_groups[0].panels[0].prom_queries.forEach(
|
data.panel_groups[0].panels[0].prom_queries.forEach(
|
||||||
|
|
@ -222,20 +222,20 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
'litmuschaos_awaited_experiments'
|
'litmuschaos_awaited_experiments'
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const chaosDetails: ChaosEngineNamesAndNamespacesMap = getEngineNameAndNamespace(
|
const chaosDetails: ChaosResultNamesAndNamespacesMap = getEngineNameAndNamespace(
|
||||||
existingPromQuery.prom_query_name
|
existingPromQuery.prom_query_name
|
||||||
);
|
);
|
||||||
chaosEngineNamesAndNamespacesMap.forEach(
|
chaosResultNamesAndNamespacesMap.forEach(
|
||||||
(
|
(
|
||||||
chaosDetailsFomSchedule: ChaosEngineNamesAndNamespacesMap,
|
chaosDetailsFomSchedule: ChaosResultNamesAndNamespacesMap,
|
||||||
index: number
|
index: number
|
||||||
) => {
|
) => {
|
||||||
if (
|
if (
|
||||||
chaosDetailsFomSchedule.engineName.includes(
|
chaosDetailsFomSchedule.resultName.includes(
|
||||||
chaosDetails.engineName
|
chaosDetails.resultName
|
||||||
) &&
|
) &&
|
||||||
chaosDetailsFomSchedule.engineNamespace ===
|
chaosDetailsFomSchedule.resultNamespace ===
|
||||||
chaosDetails.engineNamespace
|
chaosDetails.resultNamespace
|
||||||
) {
|
) {
|
||||||
isChaosQueryPresent[index] = 1;
|
isChaosQueryPresent[index] = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -259,17 +259,17 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
if (
|
if (
|
||||||
query.prom_query_name.startsWith('litmuschaos_awaited_experiments')
|
query.prom_query_name.startsWith('litmuschaos_awaited_experiments')
|
||||||
) {
|
) {
|
||||||
const chaosDetails: ChaosEngineNamesAndNamespacesMap = getEngineNameAndNamespace(
|
const chaosDetails: ChaosResultNamesAndNamespacesMap = getEngineNameAndNamespace(
|
||||||
query.prom_query_name
|
query.prom_query_name
|
||||||
);
|
);
|
||||||
chaosEngineNamesAndNamespacesMap.forEach(
|
chaosResultNamesAndNamespacesMap.forEach(
|
||||||
(chaosDetailsFomSchedule: ChaosEngineNamesAndNamespacesMap) => {
|
(chaosDetailsFomSchedule: ChaosResultNamesAndNamespacesMap) => {
|
||||||
if (
|
if (
|
||||||
chaosDetailsFomSchedule.engineName.includes(
|
chaosDetailsFomSchedule.resultName.includes(
|
||||||
chaosDetails.engineName
|
chaosDetails.resultName
|
||||||
) &&
|
) &&
|
||||||
chaosDetailsFomSchedule.engineNamespace ===
|
chaosDetailsFomSchedule.resultNamespace ===
|
||||||
chaosDetails.engineNamespace &&
|
chaosDetails.resultNamespace &&
|
||||||
!query.legend.includes(chaosDetailsFomSchedule.workflowName)
|
!query.legend.includes(chaosDetailsFomSchedule.workflowName)
|
||||||
) {
|
) {
|
||||||
updatedLegend = `${chaosDetailsFomSchedule.workflowName}, \n${query.legend}`;
|
updatedLegend = `${chaosDetailsFomSchedule.workflowName}, \n${query.legend}`;
|
||||||
|
|
@ -288,17 +288,17 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
};
|
};
|
||||||
updatedQueries.push(updatedQuery);
|
updatedQueries.push(updatedQuery);
|
||||||
});
|
});
|
||||||
chaosEngineNamesAndNamespacesMap.forEach(
|
chaosResultNamesAndNamespacesMap.forEach(
|
||||||
(keyValue: ChaosEngineNamesAndNamespacesMap, index: number) => {
|
(keyValue: ChaosResultNamesAndNamespacesMap, index: number) => {
|
||||||
if (isChaosQueryPresent[index] === 0) {
|
if (isChaosQueryPresent[index] === 0) {
|
||||||
updatedQueries.push({
|
updatedQueries.push({
|
||||||
queryid: uuidv4(),
|
queryid: uuidv4(),
|
||||||
prom_query_name: generateChaosQuery(
|
prom_query_name: generateChaosQuery(
|
||||||
DashboardList[dashboardTemplateID].chaosEventQueryTemplate,
|
DashboardList[dashboardTemplateID].chaosEventQueryTemplate,
|
||||||
keyValue.engineName,
|
keyValue.resultName,
|
||||||
keyValue.engineNamespace
|
keyValue.resultNamespace
|
||||||
),
|
),
|
||||||
legend: `${keyValue.workflowName}- \n${keyValue.engineName}`,
|
legend: `${keyValue.workflowName}- \n${keyValue.resultName}`,
|
||||||
resolution: '1/1',
|
resolution: '1/1',
|
||||||
minstep: '1',
|
minstep: '1',
|
||||||
line: false,
|
line: false,
|
||||||
|
|
@ -527,6 +527,7 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
setConfirm(false);
|
setConfirm(false);
|
||||||
setOpenModal(false);
|
setOpenModal(false);
|
||||||
}}
|
}}
|
||||||
|
width="60%"
|
||||||
modalActions={
|
modalActions={
|
||||||
<ButtonOutlined
|
<ButtonOutlined
|
||||||
className={classes.closeButton}
|
className={classes.closeButton}
|
||||||
|
|
@ -539,7 +540,7 @@ const TableData: React.FC<TableDataProps> = ({ data }) => {
|
||||||
</ButtonOutlined>
|
</ButtonOutlined>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div>
|
<div className={classes.modal}>
|
||||||
{confirm === true ? (
|
{confirm === true ? (
|
||||||
<Typography align="center">
|
<Typography align="center">
|
||||||
{success === true ? (
|
{success === true ? (
|
||||||
|
|
|
||||||
|
|
@ -226,9 +226,14 @@ const useStyles = makeStyles((theme) => ({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-evenly',
|
justifyContent: 'space-evenly',
|
||||||
},
|
},
|
||||||
|
|
||||||
buttonOutlineWarning: {
|
buttonOutlineWarning: {
|
||||||
borderColor: theme.palette.error.dark,
|
borderColor: theme.palette.error.dark,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
modal: {
|
||||||
|
padding: theme.spacing(15, 0),
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const useOutlinedInputStyles = makeStyles((theme: Theme) => ({
|
export const useOutlinedInputStyles = makeStyles((theme: Theme) => ({
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
marginLeft: theme.spacing(3),
|
marginLeft: theme.spacing(3),
|
||||||
},
|
},
|
||||||
height: '1.5rem',
|
height: '1.5rem',
|
||||||
width: '17.5rem',
|
width: '15rem',
|
||||||
},
|
},
|
||||||
|
|
||||||
selectText: {
|
selectText: {
|
||||||
|
|
@ -26,7 +26,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
marginLeft: theme.spacing(6),
|
marginLeft: theme.spacing(6),
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
[theme.breakpoints.down('md')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
|
@ -65,7 +65,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
marginLeft: theme.spacing(5),
|
marginLeft: theme.spacing(5),
|
||||||
marginTop: theme.spacing(5),
|
marginTop: theme.spacing(5),
|
||||||
width: '17.5rem',
|
width: '15rem',
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
marginLeft: 0,
|
marginLeft: 0,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import { Checkbox, IconButton, Typography } from '@material-ui/core';
|
import { IconButton, Typography } from '@material-ui/core';
|
||||||
import ExpandMoreTwoToneIcon from '@material-ui/icons/ExpandMoreTwoTone';
|
import ExpandMoreTwoToneIcon from '@material-ui/icons/ExpandMoreTwoTone';
|
||||||
import cronstrue from 'cronstrue';
|
import cronstrue from 'cronstrue';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import CheckBox from '../../../../components/CheckBox';
|
||||||
import { Workflow } from '../../../../models/graphql/workflowListData';
|
import { Workflow } from '../../../../models/graphql/workflowListData';
|
||||||
import { history } from '../../../../redux/configureStore';
|
import { history } from '../../../../redux/configureStore';
|
||||||
import useStyles, { StyledTableCell } from './styles';
|
import useStyles, { StyledTableCell } from './styles';
|
||||||
|
|
@ -35,10 +36,9 @@ const TableData: React.FC<TableDataProps> = ({
|
||||||
<>
|
<>
|
||||||
<StyledTableCell padding="checkbox" className={classes.checkbox}>
|
<StyledTableCell padding="checkbox" className={classes.checkbox}>
|
||||||
{comparisonState === false ? (
|
{comparisonState === false ? (
|
||||||
<Checkbox
|
<CheckBox
|
||||||
checked={itemSelectionStatus}
|
checked={itemSelectionStatus}
|
||||||
inputProps={{ 'aria-labelledby': labelIdentifier }}
|
inputProps={{ 'aria-labelledby': labelIdentifier }}
|
||||||
className={classes.checkBoxStyle}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div />
|
<div />
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import { Checkbox, IconButton, TableHead, TableRow } from '@material-ui/core';
|
import { IconButton, TableHead, TableRow } from '@material-ui/core';
|
||||||
import ExpandLessTwoToneIcon from '@material-ui/icons/ExpandLessTwoTone';
|
import ExpandLessTwoToneIcon from '@material-ui/icons/ExpandLessTwoTone';
|
||||||
import ExpandMoreTwoToneIcon from '@material-ui/icons/ExpandMoreTwoTone';
|
import ExpandMoreTwoToneIcon from '@material-ui/icons/ExpandMoreTwoTone';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import CheckBox from '../../../../components/CheckBox';
|
||||||
import useStyles, { StyledTableCell } from './styles';
|
import useStyles, { StyledTableCell } from './styles';
|
||||||
|
|
||||||
interface SortData {
|
interface SortData {
|
||||||
|
|
@ -48,12 +49,11 @@ const TableHeader: React.FC<TableHeaderProps> = ({
|
||||||
<TableRow className={classes.tableHead}>
|
<TableRow className={classes.tableHead}>
|
||||||
<StyledTableCell padding="checkbox" className={classes.checkbox}>
|
<StyledTableCell padding="checkbox" className={classes.checkbox}>
|
||||||
{comparisonState === false ? (
|
{comparisonState === false ? (
|
||||||
<Checkbox
|
<CheckBox
|
||||||
indeterminate={numSelected > 0 && numSelected < rowCount}
|
indeterminate={numSelected > 0 && numSelected < rowCount}
|
||||||
checked={rowCount > 0 && numSelected === rowCount}
|
checked={rowCount > 0 && numSelected === rowCount}
|
||||||
onChange={onSelectAllClick}
|
onChange={onSelectAllClick}
|
||||||
inputProps={{ 'aria-label': 'select all desserts' }}
|
inputProps={{ 'aria-label': 'select all desserts' }}
|
||||||
className={classes.checkBoxStyle}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div />
|
<div />
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,9 @@ const WorkflowComparisonTable = () => {
|
||||||
run_date: run.run_date,
|
run_date: run.run_date,
|
||||||
tests_passed: run.tests_passed.toString(),
|
tests_passed: run.tests_passed.toString(),
|
||||||
tests_failed: run.tests_failed.toString(),
|
tests_failed: run.tests_failed.toString(),
|
||||||
resilience_score: run.resilience_score.toString(),
|
resilience_score: `${parseFloat(run.resilience_score as string)
|
||||||
|
.toFixed(2)
|
||||||
|
.toString()}%`,
|
||||||
test_details_string: detail_string,
|
test_details_string: detail_string,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -294,10 +294,6 @@ const useStyles = makeStyles((theme) => ({
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
},
|
},
|
||||||
|
|
||||||
checkBoxStyle: {
|
|
||||||
color: theme.palette.border.main,
|
|
||||||
},
|
|
||||||
|
|
||||||
rangeSelectorIcon: {
|
rangeSelectorIcon: {
|
||||||
width: '0.625rem',
|
width: '0.625rem',
|
||||||
height: '0.625rem',
|
height: '0.625rem',
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,26 @@ import { history } from '../../../../redux/configureStore';
|
||||||
const AnalyticsQuickActionCard: React.FC = () => {
|
const AnalyticsQuickActionCard: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const quickActionDataAnalytics = [
|
const quickActionDataAnalytics = [
|
||||||
|
{
|
||||||
|
src: './icons/addDashboard.svg',
|
||||||
|
alt: 'dashboard',
|
||||||
|
onClick: () => history.push('/analytics/dashboard/select'),
|
||||||
|
text: t('quickActionCard.addDashboard'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
src: './icons/addDataSource.svg',
|
src: './icons/addDataSource.svg',
|
||||||
alt: 'source',
|
alt: 'data source',
|
||||||
onClick: () => history.push('/analytics/datasource/select'),
|
onClick: () => history.push('/analytics/datasource/select'),
|
||||||
text: t('quickActionCard.addDataSource'),
|
text: t('quickActionCard.addDataSource'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: './icons/addAgent.svg',
|
src: './icons/calendarWorkflowIcon.svg',
|
||||||
|
alt: 'workflow',
|
||||||
|
onClick: () => history.push('/create-workflow'),
|
||||||
|
text: t('quickActionCard.scheduleWorkflow'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: './icons/target.svg',
|
||||||
alt: 'agent',
|
alt: 'agent',
|
||||||
onClick: () => history.push('/agent-connect'),
|
onClick: () => history.push('/agent-connect'),
|
||||||
text: t('quickActionCard.addAgent'),
|
text: t('quickActionCard.addAgent'),
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import {
|
||||||
Template,
|
Template,
|
||||||
WorkflowYaml,
|
WorkflowYaml,
|
||||||
} from '../../../../models/chaosWorkflowYaml';
|
} from '../../../../models/chaosWorkflowYaml';
|
||||||
import { ChaosEngineNamesAndNamespacesMap } from '../../../../models/dashboardsData';
|
import { ChaosResultNamesAndNamespacesMap } from '../../../../models/dashboardsData';
|
||||||
import {
|
import {
|
||||||
ListDashboardResponse,
|
ListDashboardResponse,
|
||||||
Panel,
|
Panel,
|
||||||
|
|
@ -95,7 +95,7 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
// reSyncChaos
|
// reSyncChaos
|
||||||
|
|
||||||
const reSyncChaosQueries = (data: ListDashboardResponse) => {
|
const reSyncChaosQueries = (data: ListDashboardResponse) => {
|
||||||
const chaosEngineNamesAndNamespacesMap: ChaosEngineNamesAndNamespacesMap[] = [];
|
const chaosResultNamesAndNamespacesMap: ChaosResultNamesAndNamespacesMap[] = [];
|
||||||
schedulesData?.getScheduledWorkflows.forEach(
|
schedulesData?.getScheduledWorkflows.forEach(
|
||||||
(schedule: ScheduleWorkflow) => {
|
(schedule: ScheduleWorkflow) => {
|
||||||
if (schedule.cluster_id === data.cluster_id && !schedule.isRemoved) {
|
if (schedule.cluster_id === data.cluster_id && !schedule.isRemoved) {
|
||||||
|
|
@ -146,13 +146,13 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
engineNamespace = parsedEmbeddedYaml.metadata.namespace;
|
engineNamespace = parsedEmbeddedYaml.metadata.namespace;
|
||||||
}
|
}
|
||||||
let matchIndex: number = -1;
|
let matchIndex: number = -1;
|
||||||
const check: number = chaosEngineNamesAndNamespacesMap.filter(
|
const check: number = chaosResultNamesAndNamespacesMap.filter(
|
||||||
(data, index) => {
|
(data, index) => {
|
||||||
if (
|
if (
|
||||||
data.engineName.includes(
|
data.resultName.includes(
|
||||||
parsedEmbeddedYaml.metadata.name
|
parsedEmbeddedYaml.metadata.name
|
||||||
) &&
|
) &&
|
||||||
data.engineNamespace === engineNamespace
|
data.resultNamespace === engineNamespace
|
||||||
) {
|
) {
|
||||||
matchIndex = index;
|
matchIndex = index;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -161,15 +161,15 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
}
|
}
|
||||||
).length;
|
).length;
|
||||||
if (check === 0) {
|
if (check === 0) {
|
||||||
chaosEngineNamesAndNamespacesMap.push({
|
chaosResultNamesAndNamespacesMap.push({
|
||||||
engineName: `${parsedEmbeddedYaml.metadata.name}-${parsedEmbeddedYaml.spec.experiments[0].name}`,
|
resultName: `${parsedEmbeddedYaml.metadata.name}-${parsedEmbeddedYaml.spec.experiments[0].name}`,
|
||||||
engineNamespace,
|
resultNamespace: engineNamespace,
|
||||||
workflowName: workflowYaml.metadata.name,
|
workflowName: workflowYaml.metadata.name,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
chaosEngineNamesAndNamespacesMap[
|
chaosResultNamesAndNamespacesMap[
|
||||||
matchIndex
|
matchIndex
|
||||||
].workflowName = `${chaosEngineNamesAndNamespacesMap[matchIndex].workflowName}, \n${workflowYaml.metadata.name}`;
|
].workflowName = `${chaosResultNamesAndNamespacesMap[matchIndex].workflowName}, \n${workflowYaml.metadata.name}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -180,7 +180,7 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
const isChaosQueryPresent: number[] = Array(
|
const isChaosQueryPresent: number[] = Array(
|
||||||
chaosEngineNamesAndNamespacesMap.length
|
chaosResultNamesAndNamespacesMap.length
|
||||||
).fill(0);
|
).fill(0);
|
||||||
|
|
||||||
data.panel_groups[0].panels[0].prom_queries.forEach(
|
data.panel_groups[0].panels[0].prom_queries.forEach(
|
||||||
|
|
@ -190,20 +190,20 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
'litmuschaos_awaited_experiments'
|
'litmuschaos_awaited_experiments'
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const chaosDetails: ChaosEngineNamesAndNamespacesMap = getEngineNameAndNamespace(
|
const chaosDetails: ChaosResultNamesAndNamespacesMap = getEngineNameAndNamespace(
|
||||||
existingPromQuery.prom_query_name
|
existingPromQuery.prom_query_name
|
||||||
);
|
);
|
||||||
chaosEngineNamesAndNamespacesMap.forEach(
|
chaosResultNamesAndNamespacesMap.forEach(
|
||||||
(
|
(
|
||||||
chaosDetailsFomSchedule: ChaosEngineNamesAndNamespacesMap,
|
chaosDetailsFomSchedule: ChaosResultNamesAndNamespacesMap,
|
||||||
index: number
|
index: number
|
||||||
) => {
|
) => {
|
||||||
if (
|
if (
|
||||||
chaosDetailsFomSchedule.engineName.includes(
|
chaosDetailsFomSchedule.resultName.includes(
|
||||||
chaosDetails.engineName
|
chaosDetails.resultName
|
||||||
) &&
|
) &&
|
||||||
chaosDetailsFomSchedule.engineNamespace ===
|
chaosDetailsFomSchedule.resultNamespace ===
|
||||||
chaosDetails.engineNamespace
|
chaosDetails.resultNamespace
|
||||||
) {
|
) {
|
||||||
isChaosQueryPresent[index] = 1;
|
isChaosQueryPresent[index] = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -227,17 +227,17 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
if (
|
if (
|
||||||
query.prom_query_name.startsWith('litmuschaos_awaited_experiments')
|
query.prom_query_name.startsWith('litmuschaos_awaited_experiments')
|
||||||
) {
|
) {
|
||||||
const chaosDetails: ChaosEngineNamesAndNamespacesMap = getEngineNameAndNamespace(
|
const chaosDetails: ChaosResultNamesAndNamespacesMap = getEngineNameAndNamespace(
|
||||||
query.prom_query_name
|
query.prom_query_name
|
||||||
);
|
);
|
||||||
chaosEngineNamesAndNamespacesMap.forEach(
|
chaosResultNamesAndNamespacesMap.forEach(
|
||||||
(chaosDetailsFomSchedule: ChaosEngineNamesAndNamespacesMap) => {
|
(chaosDetailsFomSchedule: ChaosResultNamesAndNamespacesMap) => {
|
||||||
if (
|
if (
|
||||||
chaosDetailsFomSchedule.engineName.includes(
|
chaosDetailsFomSchedule.resultName.includes(
|
||||||
chaosDetails.engineName
|
chaosDetails.resultName
|
||||||
) &&
|
) &&
|
||||||
chaosDetailsFomSchedule.engineNamespace ===
|
chaosDetailsFomSchedule.resultNamespace ===
|
||||||
chaosDetails.engineNamespace &&
|
chaosDetails.resultNamespace &&
|
||||||
!query.legend.includes(chaosDetailsFomSchedule.workflowName)
|
!query.legend.includes(chaosDetailsFomSchedule.workflowName)
|
||||||
) {
|
) {
|
||||||
updatedLegend = `${chaosDetailsFomSchedule.workflowName}, \n${query.legend}`;
|
updatedLegend = `${chaosDetailsFomSchedule.workflowName}, \n${query.legend}`;
|
||||||
|
|
@ -256,18 +256,18 @@ const TableDashboardData: React.FC<TableDashboardData> = ({
|
||||||
};
|
};
|
||||||
updatedQueries.push(updatedQuery);
|
updatedQueries.push(updatedQuery);
|
||||||
});
|
});
|
||||||
chaosEngineNamesAndNamespacesMap.forEach(
|
chaosResultNamesAndNamespacesMap.forEach(
|
||||||
(keyValue: ChaosEngineNamesAndNamespacesMap, index: number) => {
|
(keyValue: ChaosResultNamesAndNamespacesMap, index: number) => {
|
||||||
if (isChaosQueryPresent[index] === 0) {
|
if (isChaosQueryPresent[index] === 0) {
|
||||||
updatedQueries.push({
|
updatedQueries.push({
|
||||||
queryid: uuidv4(),
|
queryid: uuidv4(),
|
||||||
prom_query_name: generateChaosQuery(
|
prom_query_name: generateChaosQuery(
|
||||||
DashboardTemplatesList[dashboardTemplateID]
|
DashboardTemplatesList[dashboardTemplateID]
|
||||||
.chaosEventQueryTemplate,
|
.chaosEventQueryTemplate,
|
||||||
keyValue.engineName,
|
keyValue.resultName,
|
||||||
keyValue.engineNamespace
|
keyValue.resultNamespace
|
||||||
),
|
),
|
||||||
legend: `${keyValue.workflowName}- \n${keyValue.engineName}`,
|
legend: `${keyValue.workflowName}- \n${keyValue.resultName}`,
|
||||||
resolution: '1/1',
|
resolution: '1/1',
|
||||||
minstep: '1',
|
minstep: '1',
|
||||||
line: false,
|
line: false,
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ const TableDataSource: React.FC<TableDataSourceProps> = ({
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.seeAllArrowBtn}
|
className={classes.seeAllArrowBtn}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
tabs.changeAnalyticsDashboardTabs(1);
|
tabs.changeAnalyticsDashboardTabs(3);
|
||||||
history.push('/analytics');
|
history.push('/analytics');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,8 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
height: '1.75rem',
|
height: '1.75rem',
|
||||||
},
|
},
|
||||||
seeAllArrowBtn: {
|
seeAllArrowBtn: {
|
||||||
|
backgroundColor: 'transparent !important',
|
||||||
|
cursor: 'pointer',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
'& p': {
|
'& p': {
|
||||||
paddingRight: theme.spacing(2),
|
paddingRight: theme.spacing(2),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
/* eslint-disable no-empty-pattern */
|
/* eslint-disable no-empty-pattern */
|
||||||
/* eslint-disable no-return-assign */
|
/* eslint-disable no-return-assign */
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import { FormControl, InputLabel, MenuItem, Select } from '@material-ui/core';
|
import {
|
||||||
|
FormControl,
|
||||||
|
InputLabel,
|
||||||
|
MenuItem,
|
||||||
|
Select,
|
||||||
|
useTheme,
|
||||||
|
} from '@material-ui/core';
|
||||||
import Plotly from 'plotly.js';
|
import Plotly from 'plotly.js';
|
||||||
import { string } from 'prop-types';
|
import { string } from 'prop-types';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
@ -14,6 +20,7 @@ const Plot = createPlotlyComponent(Plotly);
|
||||||
|
|
||||||
const CommunityAnalyticsPlot: React.FC = () => {
|
const CommunityAnalyticsPlot: React.FC = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
const { palette } = useTheme();
|
||||||
|
|
||||||
const { communityData } = useSelector(
|
const { communityData } = useSelector(
|
||||||
(state: RootState) => state.communityData
|
(state: RootState) => state.communityData
|
||||||
|
|
@ -178,6 +185,16 @@ const CommunityAnalyticsPlot: React.FC = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
processData();
|
processData();
|
||||||
|
try {
|
||||||
|
const nodeStyle = (document.getElementsByClassName(
|
||||||
|
'modebar'
|
||||||
|
)[0] as HTMLElement).style;
|
||||||
|
nodeStyle.left = '29%';
|
||||||
|
nodeStyle.width = 'fit-content';
|
||||||
|
nodeStyle.backgroundColor = palette.background.paper;
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
}, [currentPlotType, currentGranularityType]);
|
}, [currentPlotType, currentGranularityType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -232,91 +249,99 @@ const CommunityAnalyticsPlot: React.FC = () => {
|
||||||
<MenuItem value="Monthly">Monthly</MenuItem>
|
<MenuItem value="Monthly">Monthly</MenuItem>
|
||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
<Plot
|
||||||
<div className={classes.plot}>
|
className={classes.plot}
|
||||||
<Plot
|
data={[
|
||||||
data={[
|
{
|
||||||
{
|
type: 'scatter',
|
||||||
type: 'scatter',
|
x: data.x,
|
||||||
x: data.x,
|
y: data.y,
|
||||||
y: data.y,
|
mode: 'lines',
|
||||||
mode: 'lines',
|
name: 'Operator Installs',
|
||||||
name: 'Operator Installs',
|
line: { color: palette.secondary.main },
|
||||||
line: { color: '#109B67' },
|
},
|
||||||
|
{
|
||||||
|
type: 'scatter',
|
||||||
|
x: data.x,
|
||||||
|
y: data.y2,
|
||||||
|
mode: 'lines',
|
||||||
|
name: 'Experiment Runs',
|
||||||
|
yaxis: 'y2',
|
||||||
|
line: { color: palette.primary.main },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
layout={{
|
||||||
|
autosize: true,
|
||||||
|
height: 800,
|
||||||
|
margin: {
|
||||||
|
l: 60,
|
||||||
|
r: 60,
|
||||||
|
b: 10,
|
||||||
|
t: 5,
|
||||||
|
pad: 10,
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
rangeselector: selectorOptions as any,
|
||||||
|
rangeslider: { visible: true },
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
title: 'Operators',
|
||||||
|
side: 'left',
|
||||||
|
showgrid: false,
|
||||||
|
},
|
||||||
|
yaxis2: {
|
||||||
|
title: 'Experiments',
|
||||||
|
side: 'right',
|
||||||
|
overlaying: 'y',
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
traceorder: 'normal',
|
||||||
|
font: {
|
||||||
|
family: 'ubuntu',
|
||||||
|
size: 12,
|
||||||
|
color: palette.text.primary,
|
||||||
},
|
},
|
||||||
{
|
bgcolor: palette.background.paper,
|
||||||
type: 'scatter',
|
bordercolor: palette.background.paper,
|
||||||
x: data.x,
|
borderwidth: 0,
|
||||||
y: data.y2,
|
},
|
||||||
mode: 'lines',
|
}}
|
||||||
name: 'Experiment Runs',
|
useResizeHandler
|
||||||
yaxis: 'y2',
|
style={{
|
||||||
line: { color: '#858CDD' },
|
margin: 'auto',
|
||||||
},
|
}}
|
||||||
]}
|
config={{
|
||||||
layout={{
|
displaylogo: false,
|
||||||
autosize: true,
|
autosizable: true,
|
||||||
width: 920,
|
responsive: true,
|
||||||
height: 650,
|
frameMargins: 0.2,
|
||||||
margin: {
|
showAxisDragHandles: true,
|
||||||
l: 60,
|
showAxisRangeEntryBoxes: true,
|
||||||
r: 60,
|
showTips: true,
|
||||||
b: 10,
|
displayModeBar: true,
|
||||||
t: 5,
|
toImageButtonOptions: {
|
||||||
pad: 10,
|
format: 'png',
|
||||||
},
|
filename: 'Litmus_Community_Stats',
|
||||||
xaxis: {
|
width: 1920,
|
||||||
rangeselector: selectorOptions as any,
|
height: 1080,
|
||||||
rangeslider: { visible: true },
|
scale: 2,
|
||||||
},
|
},
|
||||||
yaxis: {
|
}}
|
||||||
title: 'Operators',
|
onInitialized={() => {
|
||||||
side: 'left',
|
try {
|
||||||
showgrid: false,
|
const nodeStyle = (document.getElementsByClassName(
|
||||||
},
|
'modebar'
|
||||||
yaxis2: {
|
)[0] as HTMLElement).style;
|
||||||
title: 'Experiments',
|
nodeStyle.left = '29%';
|
||||||
side: 'right',
|
nodeStyle.width = 'fit-content';
|
||||||
overlaying: 'y',
|
nodeStyle.backgroundColor = palette.background.paper;
|
||||||
},
|
} catch (err) {
|
||||||
legend: {
|
console.error(err);
|
||||||
x: 0,
|
}
|
||||||
y: 1,
|
}}
|
||||||
traceorder: 'normal',
|
/>
|
||||||
font: {
|
|
||||||
family: 'ubuntu',
|
|
||||||
size: 12,
|
|
||||||
color: '#000',
|
|
||||||
},
|
|
||||||
bgcolor: '#E2E2E2',
|
|
||||||
bordercolor: '#FFFFFF',
|
|
||||||
borderwidth: 0,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
useResizeHandler
|
|
||||||
style={{
|
|
||||||
width: 'fit-content',
|
|
||||||
margin: 'auto',
|
|
||||||
}}
|
|
||||||
config={{
|
|
||||||
displaylogo: false,
|
|
||||||
autosizable: true,
|
|
||||||
responsive: true,
|
|
||||||
frameMargins: 0.2,
|
|
||||||
showAxisDragHandles: true,
|
|
||||||
showAxisRangeEntryBoxes: true,
|
|
||||||
showTips: true,
|
|
||||||
displayModeBar: true,
|
|
||||||
toImageButtonOptions: {
|
|
||||||
format: 'png',
|
|
||||||
filename: 'Litmus_Community_Stats',
|
|
||||||
width: 1920,
|
|
||||||
height: 1080,
|
|
||||||
scale: 2,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,25 @@ const useStyles = makeStyles((theme) => ({
|
||||||
margin: theme.spacing(0.5),
|
margin: theme.spacing(0.5),
|
||||||
height: '2.5rem',
|
height: '2.5rem',
|
||||||
width: '19.375rem',
|
width: '19.375rem',
|
||||||
|
[theme.breakpoints.down('sm')]: {
|
||||||
|
width: '15rem',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
plotCard: {
|
plotCard: {
|
||||||
paddingTop: theme.spacing(2),
|
paddingTop: theme.spacing(2),
|
||||||
paddingBottom: theme.spacing(2),
|
paddingBottom: theme.spacing(2),
|
||||||
},
|
},
|
||||||
|
|
||||||
root: {
|
root: {
|
||||||
height: '2.5rem',
|
height: '2.5rem',
|
||||||
padding: theme.spacing(0.5),
|
padding: theme.spacing(0.5),
|
||||||
},
|
},
|
||||||
|
|
||||||
plot: {
|
plot: {
|
||||||
|
margin: 'auto',
|
||||||
|
width: '150%',
|
||||||
|
paddingLeft: '4.5%',
|
||||||
marginTop: theme.spacing(2),
|
marginTop: theme.spacing(2),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,7 @@ const GeoMap = () => {
|
||||||
const [showCountry, setShowCountry] = useState<boolean>(true);
|
const [showCountry, setShowCountry] = useState<boolean>(true);
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<div
|
<div className={classes.map}>
|
||||||
className={`${classes.map} ${
|
|
||||||
showCountry ? classes.countryMap : classes.cityMap
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{showCountry ? <CountryMap /> : <CityMap />}
|
{showCountry ? <CountryMap /> : <CityMap />}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
@ -20,8 +16,8 @@ const GeoMap = () => {
|
||||||
<BinarySwitch
|
<BinarySwitch
|
||||||
handleChange={() => setShowCountry(!showCountry)}
|
handleChange={() => setShowCountry(!showCountry)}
|
||||||
checked={showCountry}
|
checked={showCountry}
|
||||||
leftLabel="Country View"
|
leftLabel="City View"
|
||||||
rightLabel="City View"
|
rightLabel="Country View"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,11 @@ const useStyles = makeStyles((theme) => ({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
cityMapComposableMap: {
|
cityMapComposableMap: {
|
||||||
width: '54rem',
|
width: '45vw',
|
||||||
height: '40rem',
|
height: '30rem',
|
||||||
|
[theme.breakpoints.down('sm')]: {
|
||||||
|
height: '25rem',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
countryMapchartStyle: {
|
countryMapchartStyle: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -38,25 +41,23 @@ const useStyles = makeStyles((theme) => ({
|
||||||
paddingTop: theme.spacing(2),
|
paddingTop: theme.spacing(2),
|
||||||
},
|
},
|
||||||
countryMapchartContentStyle: {
|
countryMapchartContentStyle: {
|
||||||
width: '54rem',
|
width: '45vw',
|
||||||
height: '40rem',
|
height: '30rem',
|
||||||
|
[theme.breakpoints.down('sm')]: {
|
||||||
|
height: '25rem',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
|
backgroundColor: theme.palette.cards.background,
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
cityMap: {
|
|
||||||
backgroundColor: theme.palette.cards.background,
|
|
||||||
},
|
|
||||||
countryMap: {
|
|
||||||
backgroundColor: theme.palette.cards.background,
|
|
||||||
},
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Divider, IconButton, Typography } from '@material-ui/core';
|
import { Divider, IconButton, Typography } from '@material-ui/core';
|
||||||
import EditIcon from '@material-ui/icons/Edit';
|
import EditIcon from '@material-ui/icons/Edit';
|
||||||
import cronstrue from 'cronstrue';
|
import cronstrue from 'cronstrue';
|
||||||
import { EditableText, Modal, ButtonOutlined } from 'litmus-ui';
|
import { ButtonOutlined, EditableText, Modal } from 'litmus-ui';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|
@ -281,7 +281,9 @@ const VerifyCommit: React.FC<VerifyCommitProps> = ({
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
width="60%"
|
width="60%"
|
||||||
modalActions={
|
modalActions={
|
||||||
<ButtonOutlined onClick={handleClose}>✕</ButtonOutlined>
|
<ButtonOutlined onClick={handleClose} className={classes.closeBtn}>
|
||||||
|
✕
|
||||||
|
</ButtonOutlined>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<YamlEditor
|
<YamlEditor
|
||||||
|
|
|
||||||
|
|
@ -149,5 +149,10 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
buttomPad: {
|
buttomPad: {
|
||||||
paddingBottom: theme.spacing(3.75),
|
paddingBottom: theme.spacing(3.75),
|
||||||
},
|
},
|
||||||
|
closeBtn: {
|
||||||
|
color: theme.palette.secondary.contrastText,
|
||||||
|
marginTop: theme.spacing(-6),
|
||||||
|
marginRight: theme.spacing(-2.5),
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue