Skip to content

Commit

Permalink
Merge pull request #35 from delta-reporter/local-sttoragee-for-delta-…
Browse files Browse the repository at this point in the history
…view

Fixing small issue that broke delta view
  • Loading branch information
opishcheiko authored Aug 16, 2020
2 parents b1dac6f + 3c2c10f commit 4e50801
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
31 changes: 16 additions & 15 deletions components/templates/DeltaViewForLaunches.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import { Button, makeStyles } from "@material-ui/core"
import { Button } from "@material-ui/core"
import { showStatusIcon } from "."
import ReactEcharts from "echarts-for-react"
import Router from "next/router"


const useStyles = makeStyles(() => ({
rootLight: {
},
rootDark:{
backgroundColor: "#2a2a2a",
color: "#8c8d8d",
border: "1px grey solid",
},
}))


let pyramidData = []
let roseData = []

function setButtonsBackgroundColor(darkMode) {
if(darkMode) //light mode - highlighted
return "#2a2a2a"
else return "#e0e0e0"
}

function setButtonsTextColor(darkMode) {
if(darkMode) //light mode - highlighted
return "#8c8d8d"
else return "black"
}

export function testRunButtonsDefaultView(testRunStats: any, darkMode: boolean) {
const classes = useStyles(testRunStats)

return testRunStats.map(testRun => (
<Button
Expand All @@ -33,8 +32,10 @@ export function testRunButtonsDefaultView(testRunStats: any, darkMode: boolean)
paddingBottom: "0px",
paddingTop: "0px",
marginLeft: "5px",
backgroundColor: setButtonsBackgroundColor(darkMode),
border: "1px grey solid",
color: setButtonsTextColor(darkMode)
}}
className={darkMode ? classes.rootDark : classes.rootLight}
>
{testRun.test_type}{" "}
{testRun.tests_total === testRun.tests_passed + testRun.tests_skipped ? (
Expand Down
2 changes: 1 addition & 1 deletion components/templates/ListOfSuites.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const ListOfSuites = function(props: Props) {
}
let statsArray = setStats()

const [expandedSuite, setExpandedSuite] = React.useState<string | false>(
const [expandedSuite, setExpandedSuite] = useState<string | false>(
false
)
const expandCollapseSuite = (suitePanel: string) => (
Expand Down
8 changes: 4 additions & 4 deletions components/templates/Test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React, { useState } from "react"
import { makeStyles } from "@material-ui/core/styles"
import { Paper, Typography, Button } from "@material-ui/core"
import {
Expand Down Expand Up @@ -64,8 +64,8 @@ export const TestExpanded = function(props: TestProps) {
const { children, darkMode } = props
const classes = useStyles(props)

const [openResolutionDialog, setOpenResolutionDialog] = React.useState(false)
const [resolutionResponse, setResolutionResponse] = React.useState(
const [openResolutionDialog, setOpenResolutionDialog] = useState(false)
const [resolutionResponse, setResolutionResponse] = useState(
testResolutions[0]
)
const handleResolutionDialogOpen = () => {
Expand Down Expand Up @@ -101,7 +101,7 @@ export const TestExpanded = function(props: TestProps) {
className={darkMode ? classes.textColorDarkMode : classes.textColorLightMode}
>
{showStatusText(children.status, darkMode)}
{children.name}
<span style={{paddingLeft:"8px"}}> {children.name}</span>
</Typography>
<Tabs style={{ marginTop: "20px" }} className={darkMode ? classes.textColorDarkMode : classes.textColorLightMode}>
<TabList>
Expand Down
6 changes: 3 additions & 3 deletions components/templates/TestExpandablePanels.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React, { useState } from "react"
import ExpandMoreIcon from "@material-ui/icons/ExpandMore"
import MuiAccordion from "@material-ui/core/Accordion"
import MuiAccordionSummary from "@material-ui/core/AccordionSummary"
Expand Down Expand Up @@ -62,7 +62,7 @@ interface TestProps {
export const TestErrorMessageAccordion = function(props: TestProps) {
const { children } = props

const [expandedErrorPanel, setExpandedErrorPanel] = React.useState<
const [expandedErrorPanel, setExpandedErrorPanel] = useState<
string | false
>(false)
const expandCollapsePanel = (errorPanel: string) => (
Expand Down Expand Up @@ -116,7 +116,7 @@ export const TestErrorMessageAccordion = function(props: TestProps) {
export const TestMediaAccordion = function(props: TestProps) {
const { children } = props

const [mediaExpandedPanel, setMediaExpandedPanel] = React.useState<
const [mediaExpandedPanel, setMediaExpandedPanel] = useState<
string | false
>(false)
const expandCollapsePanel = (mediaPanel: string) => (
Expand Down
6 changes: 3 additions & 3 deletions components/templates/showAndChangeLaunchStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from "react"
import React, { useState } from "react"
import { Tooltip, IconButton, Snackbar } from "@material-ui/core"
import { showStatusIcon } from "."
import StopIcon from "@material-ui/icons/Stop"
import CloseIcon from "@material-ui/icons/Close"

export function showStatusAndEnableToStopRunningLaunch(status, launchId) {
const [openPopUp, setOpenPopUp] = React.useState(false)
const [openPopUp, setOpenPopUp] = useState(false)

const handleStopButtonClick = async (launchId: string | number) => {
// PUT request using fetch with async/await
Expand Down Expand Up @@ -34,7 +34,7 @@ export function showStatusAndEnableToStopRunningLaunch(status, launchId) {
setOpenPopUp(false)
}

const [isHovered, setIsHovered] = React.useState(false)
const [isHovered, setIsHovered] = useState(false)

const hoverOn = () => {
setIsHovered(true)
Expand Down
2 changes: 1 addition & 1 deletion pages/launches/[launchesByProjectId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function Launches(props: Props) {
}

// delta view switch
const [switchViews, setSwitchViews] = React.useState({
const [switchViews, setSwitchViews] = useState({
deltaView: getInitialDeltaViewState(),
})

Expand Down

0 comments on commit 4e50801

Please sign in to comment.