-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS and other bug fixes for 2.0 beta 1 #2535
Changes from all commits
fdd200a
07eefa8
67ea470
d8c9b14
996da2f
2a2f1d7
80ad3f4
91a3a32
4c3da95
f19fa39
f9557d6
900b4f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import React, { useEffect, useState } from 'react'; | ||
import { Typography, Button, Box } from '@material-ui/core'; | ||
import { Box, Button, Typography, useTheme } from '@material-ui/core'; | ||
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 FindInPageTwoToneIcon from '@material-ui/icons/FindInPageTwoTone'; | ||
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 SelectAllTwoToneIcon from '@material-ui/icons/SelectAllTwoTone'; | ||
import UndoTwoToneIcon from '@material-ui/icons/UndoTwoTone'; | ||
import UnfoldLessTwoToneIcon from '@material-ui/icons/UnfoldLessTwoTone'; | ||
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 '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-code_lens'; | ||
import 'ace-builds/src-min-noconflict/ext-elastic_tabstops_lite'; | ||
|
@@ -30,18 +26,22 @@ import 'ace-builds/src-min-noconflict/ext-modelist'; | |
import 'ace-builds/src-min-noconflict/ext-options'; | ||
import 'ace-builds/src-min-noconflict/ext-prompt'; | ||
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-split'; | ||
import 'ace-builds/src-min-noconflict/ext-static_highlight'; | ||
import 'ace-builds/src-min-noconflict/ext-statusbar'; | ||
import 'ace-builds/src-min-noconflict/ext-textarea'; | ||
import 'ace-builds/src-min-noconflict/ext-themelist'; | ||
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 { AceValidations, parseYamlValidations } from './Validations'; | ||
import useStyles from './styles'; | ||
import useActions from '../../redux/actions'; | ||
import * as WorkflowActions from '../../redux/actions/workflow'; | ||
import useStyles from './styles'; | ||
import { AceValidations, parseYamlValidations } from './Validations'; | ||
|
||
interface YamlEditorProps { | ||
id: string; | ||
|
@@ -61,6 +61,7 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
readOnly, | ||
}) => { | ||
const classes = useStyles(); | ||
const { palette } = useTheme(); | ||
|
||
const workflow = useActions(WorkflowActions); | ||
|
||
|
@@ -105,7 +106,7 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
'ace_gutter-cell' | ||
)[stateObject.annotations[0].row - 1] as any).style; | ||
nodeStyleError.background = 'red'; | ||
nodeStyleError.color = '#FFFFFF'; | ||
nodeStyleError.color = palette.secondary.contrastText; | ||
} else { | ||
setIsValid(true); | ||
setErrors({ | ||
|
@@ -118,8 +119,10 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
'ace_gutter-cell' | ||
); | ||
for (let i = 0; i < nodeStyleErrorList.length; i += 1) { | ||
(nodeStyleErrorList[i] as any).style.backgroundColor = '#1C1C1C'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kindly import colors from theme file if possible instead of hardcoded colors There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes will be with v2 redesigning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are making any change in the Hex then it can be from litmus theme itself now also as hard coded colors do not look good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two different colours in the editor right now, latest code is available on v2 branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change makes the colour uniform as was in the design before some breaking changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use useTheme() to take the colors rom theme file |
||
(nodeStyleErrorList[i] as any).style.color = 'rgba(255, 255, 255, 0.4)'; | ||
(nodeStyleErrorList[i] as any).style.backgroundColor = | ||
palette.common.black; | ||
(nodeStyleErrorList[i] as any).style.color = | ||
palette.secondary.contrastText; | ||
} | ||
} | ||
setModifiedYaml(value); | ||
|
@@ -496,14 +499,14 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
editor.setAnimatedScroll(true); | ||
editor.setShowInvisibles(false); | ||
editor.setFontSize('0.98rem'); | ||
editor.container.style.background = '#1C1C1C'; | ||
editor.container.style.background = palette.common.black; | ||
editor.container.style.lineHeight = '160%'; | ||
const nodeStyle = (document.getElementsByClassName( | ||
'ace_gutter' | ||
)[0] as any).style; | ||
nodeStyle.color = 'rgba(255, 255, 255, 0.4)'; | ||
nodeStyle.color = palette.secondary.contrastText; | ||
nodeStyle.borderRight = 0; | ||
nodeStyle.background = '#1C1C1C'; | ||
nodeStyle.background = palette.common.black; | ||
}} | ||
onCursorChange={(selection) => { | ||
(YamlAce.current!.editor as any).setOptions({ | ||
|
@@ -516,9 +519,9 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
); | ||
for (let i = 0; i < nodeStyleActiveList.length; i += 1) { | ||
(nodeStyleActiveList[i] as any).style.backgroundColor = | ||
'#1C1C1C'; | ||
palette.common.black; | ||
(nodeStyleActiveList[i] as any).style.color = | ||
'rgba(255, 255, 255, 0.4)'; | ||
palette.secondary.contrastText; | ||
} | ||
|
||
if ( | ||
|
@@ -529,8 +532,8 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
const nodeStyleActive = (document.getElementsByClassName( | ||
'ace_gutter-cell' | ||
)[selection.cursor.row] as any).style; | ||
nodeStyleActive.backgroundColor = '#5B44BA'; | ||
nodeStyleActive.color = '#FFFFFF'; | ||
nodeStyleActive.backgroundColor = palette.primary.main; | ||
nodeStyleActive.color = palette.secondary.contrastText; | ||
} | ||
}} | ||
annotations={editorState.annotations} | ||
|
@@ -553,10 +556,8 @@ const YamlEditor: React.FC<YamlEditorProps> = ({ | |
<img | ||
src="/icons/fullscreen.svg" | ||
alt="Full Screen" | ||
color="#FFFFFF" | ||
width="25px" | ||
height="25px" | ||
margin-right="25px" | ||
color={palette.secondary.contrastText} | ||
className={classes.fullScreenIcon} | ||
/> | ||
} | ||
/> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace
px
with some other relative unit at this place and other places alsoThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes @whitetiger1399 , I have just fixed the colours as these components are being removed as part of the v2 redesign so increasing the number of changes with this, won't be of much use here. We may refactor the code while redesigning which is already in progress on a separate branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For border px is fine...you can change but it's fine...too small a thing... you won't notice it being responsive.