Skip to content

Commit

Permalink
Web Actions Tab: Remove Tooltip from MetadataCollapse (#833)
Browse files Browse the repository at this point in the history
* Confusing interaction with a redundant tooltip on a Metadata item which when clicked reveals a Collapse component
  • Loading branch information
adrw committed Mar 8, 2019
1 parent a7b87f9 commit e414106
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions misk/web/tabs/web-actions/src/containers/WebActionsContainer.tsx
Expand Up @@ -120,15 +120,27 @@ const Metadata = (
props: {
content: string | JSX.Element
label: string
tooltip: string | JSX.Element
tooltip?: string | JSX.Element
} & any
) => (
<MenuItem
label={props.label}
text={<Tooltip content={props.tooltip}>{props.content}</Tooltip>}
{...props}
/>
)
) => {
if (props.tooltip) {
return (
<MenuItem
label={props.label}
text={<Tooltip content={props.tooltip}>{props.content}</Tooltip>}
{...props}
/>
)
} else {
return (
<MenuItem
label={props.label}
text={<Tooltip>{props.content}</Tooltip>}
{...props}
/>
)
}
}

/**
* Metadata that slides out content below when clicked
Expand All @@ -146,7 +158,7 @@ const MetadataCollapse = (
content: string | JSX.Element
label: string
tag: string
tooltip: string | JSX.Element
tooltip?: string | JSX.Element
} & IState &
IDispatchProps
) => (
Expand All @@ -168,16 +180,6 @@ const MetadataCollapse = (
props.tag,
props.simpleForm
)}
tooltip={
<span>
{simpleSelect(props.simpleForm, props.tag, "data") ? (
<Icon icon={IconNames.CARET_DOWN} />
) : (
<Icon icon={IconNames.CARET_RIGHT} />
)}{" "}
{props.content}
</span>
}
/>
<Collapse isOpen={simpleSelect(props.simpleForm, props.tag, "data")}>
{props.children}
Expand Down Expand Up @@ -353,7 +355,6 @@ const WebAction = (
tag={`${tag}::${
props.action.pathPattern
}::ApplicationInterceptors`}
tooltip={"Application Interceptors"}
{...props}
>
{props.action.applicationInterceptors.map(i => (
Expand All @@ -364,7 +365,6 @@ const WebAction = (
content={"Network Interceptors"}
label={`(${props.action.networkInterceptors.length})`}
tag={`${tag}::${props.action.pathPattern}::NetworkInterceptors`}
tooltip={"Network Interceptors"}
{...props}
>
{props.action.networkInterceptors.map(i => (
Expand All @@ -375,7 +375,6 @@ const WebAction = (
content={"Send a Request"}
label={""}
tag={`${tag}::${props.action.pathPattern}::Request`}
tooltip={"Send a Request"}
{...props}
>
<span />
Expand Down

0 comments on commit e414106

Please sign in to comment.