diff --git a/ui/src/components/EntryDetailed.tsx b/ui/src/components/EntryDetailed.tsx index 3f573a4bc..d86b3215d 100644 --- a/ui/src/components/EntryDetailed.tsx +++ b/ui/src/components/EntryDetailed.tsx @@ -38,28 +38,36 @@ const EntryTitle: React.FC = ({protocol, data, bodySize, elapsedTime, updat const classes = useStyles(); const response = data.response; + const bodySizeChild =
+ {formatSize(bodySize)} +
; + + const elapsedTimeChild =
+ {Math.round(elapsedTime)}ms +
; + return
{response && } + > + {bodySizeChild} + } {response && = ${elapsedTime}`} updateQuery={updateQuery} - textStyle={{opacity: 0.5}} - wrapperStyle={{marginRight: 18}} - applyTextEllipsis={false} displayIconOnMouseOver={true} - />} + > + {elapsedTimeChild} + }
; }; diff --git a/ui/src/components/EntryDetailed/EntrySections.tsx b/ui/src/components/EntryDetailed/EntrySections.tsx index db4f6360a..ba2982c94 100644 --- a/ui/src/components/EntryDetailed/EntrySections.tsx +++ b/ui/src/components/EntryDetailed/EntrySections.tsx @@ -29,14 +29,12 @@ const EntryViewLine: React.FC = ({label, value, updateQuery, return (label && value && + > +
{label}
+
= ({title, color, isExpanded}) => { return
- +
{isExpanded ? '-' : '+'} - +
{title}
} diff --git a/ui/src/components/EntryListItem/EntryListItem.module.sass b/ui/src/components/EntryListItem/EntryListItem.module.sass index 5cf3ed227..e4d6a0121 100644 --- a/ui/src/components/EntryListItem/EntryListItem.module.sass +++ b/ui/src/components/EntryListItem/EntryListItem.module.sass @@ -70,7 +70,6 @@ flex-direction: column overflow: hidden padding-right: 10px - padding-left: 10px flex-grow: 1 .separatorRight diff --git a/ui/src/components/UI/Queryable.tsx b/ui/src/components/UI/Queryable.tsx index 5bf12b329..237408dcd 100644 --- a/ui/src/components/UI/Queryable.tsx +++ b/ui/src/components/UI/Queryable.tsx @@ -4,24 +4,18 @@ import AddCircleIcon from '@material-ui/icons/AddCircle'; import './style/Queryable.sass'; interface Props { - text: string | number, query: string, updateQuery: any, - title?: string, - textStyle?: object, - wrapperStyle?: object, + style?: object, className?: string, - isPossibleToCopy?: boolean, - applyTextEllipsis?: boolean, useTooltip?: boolean, displayIconOnMouseOver?: boolean, - onClick?: React.EventHandler>; + flipped?: boolean, } -const Queryable: React.FC = ({text, query, updateQuery, title, textStyle, wrapperStyle, className, isPossibleToCopy = true, applyTextEllipsis = true, useTooltip= false, displayIconOnMouseOver = false}) => { +const Queryable: React.FC = ({query, updateQuery, style, className, useTooltip= false, displayIconOnMouseOver = false, flipped = false, children}) => { const [showAddedNotification, setAdded] = useState(false); const [showTooltip, setShowTooltip] = useState(false); - text = String(text); const onCopy = () => { setAdded(true) @@ -39,28 +33,27 @@ const Queryable: React.FC = ({text, query, updateQuery, title, textStyle, // eslint-disable-next-line }, [showAddedNotification]); - const textElement = {text}; - - const copyButton = text ? + const addButton = query ? - {showAddedNotification && Added} + {showAddedNotification && Added} : null; return (
setShowTooltip(true)} onMouseLeave={ e => setShowTooltip(false)} > - {textElement} - {copyButton} - {useTooltip && showTooltip && {text}} + {flipped && addButton} + {children} + {!flipped && addButton} + {useTooltip && showTooltip && }
); }; diff --git a/ui/src/components/UI/StatusCode.tsx b/ui/src/components/UI/StatusCode.tsx index b743aec02..a4d15b468 100644 --- a/ui/src/components/UI/StatusCode.tsx +++ b/ui/src/components/UI/StatusCode.tsx @@ -1,5 +1,6 @@ import React from "react"; import styles from './style/StatusCode.module.sass'; +import Queryable from "./Queryable"; export enum StatusCodeClassification { SUCCESS = "success", @@ -16,15 +17,21 @@ const StatusCode: React.FC = ({statusCode, updateQuery}) => { const classification = getClassification(statusCode) - return { - updateQuery(`response.status == ${statusCode}`) - }} + className={`${styles[classification]} ${styles.base}`} > {statusCode} + + return + {child} + }; export function getClassification(statusCode: number): string { diff --git a/ui/src/components/UI/Summary.tsx b/ui/src/components/UI/Summary.tsx index e7c14a9d4..e56421738 100644 --- a/ui/src/components/UI/Summary.tsx +++ b/ui/src/components/UI/Summary.tsx @@ -10,25 +10,35 @@ interface SummaryProps { } export const Summary: React.FC = ({method, summary, updateQuery}) => { + + const methodChild = + {method} + + + const summaryChild =
+ {summary} +
+ + return
{method && } + > + {methodChild} + } {summary && } + > + {summaryChild} + }
}; diff --git a/ui/src/components/UI/style/Queryable.sass b/ui/src/components/UI/style/Queryable.sass index ef10eb787..603adc56b 100644 --- a/ui/src/components/UI/style/Queryable.sass +++ b/ui/src/components/UI/style/Queryable.sass @@ -25,15 +25,7 @@ border-radius: 4px color: #1E884B - &.Queryable-ContainerEllipsis - .Queryable-Text - text-align: left - text-overflow: ellipsis - overflow: hidden - white-space: nowrap - width: calc(100% - 30px) - - .Queryable-CopyNotifier + .Queryable-AddNotifier background-color: #1E884B font-weight: normal padding: 2px 5px diff --git a/ui/src/components/UI/style/misc.module.sass b/ui/src/components/UI/style/misc.module.sass index 5324000ef..ad5f9ac0d 100644 --- a/ui/src/components/UI/style/misc.module.sass +++ b/ui/src/components/UI/style/misc.module.sass @@ -11,6 +11,7 @@ &.method margin-right: 10px + height: 14px &.filterPlate border-color: #bcc6dd20