mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
fix: cleanup application view (#553)
This commit is contained in:
parent
264d9e997a
commit
c63e301c3c
@ -278,44 +278,16 @@ exports[`renders correctly with permissions 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="MuiListItemAvatar-root"
|
className="MuiListItemAvatar-root"
|
||||||
>
|
>
|
||||||
<span
|
<svg
|
||||||
className="MuiSwitch-root"
|
aria-hidden={true}
|
||||||
|
className="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<span
|
<path
|
||||||
aria-disabled={true}
|
d="M14.4 6l-.24-1.2c-.09-.46-.5-.8-.98-.8H6c-.55 0-1 .45-1 1v15c0 .55.45 1 1 1s1-.45 1-1v-6h5.6l.24 1.2c.09.47.5.8.98.8H19c.55 0 1-.45 1-1V7c0-.55-.45-1-1-1h-4.6z"
|
||||||
className="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-15 MuiSwitch-switchBase MuiSwitch-colorSecondary PrivateSwitchBase-disabled-17 Mui-disabled Mui-disabled Mui-disabled"
|
|
||||||
onBlur={[Function]}
|
|
||||||
onDragLeave={[Function]}
|
|
||||||
onFocus={[Function]}
|
|
||||||
onKeyDown={[Function]}
|
|
||||||
onKeyUp={[Function]}
|
|
||||||
onMouseDown={[Function]}
|
|
||||||
onMouseLeave={[Function]}
|
|
||||||
onMouseUp={[Function]}
|
|
||||||
onTouchEnd={[Function]}
|
|
||||||
onTouchMove={[Function]}
|
|
||||||
onTouchStart={[Function]}
|
|
||||||
tabIndex={-1}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className="MuiIconButton-label"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
className="PrivateSwitchBase-input-18 MuiSwitch-input"
|
|
||||||
disabled={true}
|
|
||||||
onChange={[Function]}
|
|
||||||
type="checkbox"
|
|
||||||
value={true}
|
|
||||||
/>
|
/>
|
||||||
<span
|
</svg>
|
||||||
className="MuiSwitch-thumb"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
className="MuiSwitch-track"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="MuiListItemText-root MuiListItemText-multiline"
|
className="MuiListItemText-root MuiListItemText-multiline"
|
||||||
@ -348,6 +320,11 @@ exports[`renders correctly with permissions 1`] = `
|
|||||||
aria-hidden={true}
|
aria-hidden={true}
|
||||||
className="MuiSvgIcon-root"
|
className="MuiSvgIcon-root"
|
||||||
focusable="false"
|
focusable="false"
|
||||||
|
style={
|
||||||
|
Object {
|
||||||
|
"color": "red",
|
||||||
|
}
|
||||||
|
}
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
@ -362,7 +339,7 @@ exports[`renders correctly with permissions 1`] = `
|
|||||||
className="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
className="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="/projects/default/create-toggle?name=ToggleB"
|
href="/projects/default/create-toggle2?name=ToggleB"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
>
|
>
|
||||||
ToggleB
|
ToggleB
|
||||||
@ -443,6 +420,11 @@ exports[`renders correctly with permissions 1`] = `
|
|||||||
aria-hidden={true}
|
aria-hidden={true}
|
||||||
className="MuiSvgIcon-root"
|
className="MuiSvgIcon-root"
|
||||||
focusable="false"
|
focusable="false"
|
||||||
|
style={
|
||||||
|
Object {
|
||||||
|
"color": "red",
|
||||||
|
}
|
||||||
|
}
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
|
@ -7,10 +7,9 @@ import {
|
|||||||
ListItem,
|
ListItem,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
ListItemAvatar,
|
ListItemAvatar,
|
||||||
Switch,
|
|
||||||
Typography,
|
Typography,
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
import { Report, Extension, Timeline } from '@material-ui/icons';
|
import { Report, Extension, Timeline, FlagRounded } from '@material-ui/icons';
|
||||||
|
|
||||||
import { shorten } from '../common';
|
import { shorten } from '../common';
|
||||||
import {
|
import {
|
||||||
@ -33,7 +32,7 @@ function ApplicationView({
|
|||||||
show={
|
show={
|
||||||
<ListItem key={`not_found_${name}`}>
|
<ListItem key={`not_found_${name}`}>
|
||||||
<ListItemAvatar>
|
<ListItemAvatar>
|
||||||
<Report />
|
<Report style={{color: 'red'}} />
|
||||||
</ListItemAvatar>
|
</ListItemAvatar>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={<Link to={`${createUrl}`}>{name}</Link>}
|
primary={<Link to={`${createUrl}`}>{name}</Link>}
|
||||||
@ -59,19 +58,13 @@ function ApplicationView({
|
|||||||
const foundListItem = ({
|
const foundListItem = ({
|
||||||
viewUrl,
|
viewUrl,
|
||||||
name,
|
name,
|
||||||
showSwitch,
|
|
||||||
enabled,
|
|
||||||
description,
|
description,
|
||||||
|
Icon,
|
||||||
i,
|
i,
|
||||||
}) => (
|
}) => (
|
||||||
<ListItem key={`found_${name}-${i}`}>
|
<ListItem key={`found_${name}-${i}`}>
|
||||||
<ListItemAvatar>
|
<ListItemAvatar>
|
||||||
<ConditionallyRender
|
<Icon />
|
||||||
key={`conditional_avatar_${name}`}
|
|
||||||
condition={showSwitch}
|
|
||||||
show={<Switch disabled value={!!enabled} />}
|
|
||||||
elseShow={<Extension />}
|
|
||||||
/>
|
|
||||||
</ListItemAvatar>
|
</ListItemAvatar>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={
|
primary={
|
||||||
@ -91,14 +84,14 @@ function ApplicationView({
|
|||||||
<List>
|
<List>
|
||||||
{seenToggles.map(
|
{seenToggles.map(
|
||||||
(
|
(
|
||||||
{ name, description, enabled, notFound, project },
|
{ name, description, notFound, project },
|
||||||
i
|
i
|
||||||
) => (
|
) => (
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
key={`toggle_conditional_${name}`}
|
key={`toggle_conditional_${name}`}
|
||||||
condition={notFound}
|
condition={notFound}
|
||||||
show={notFoundListItem({
|
show={notFoundListItem({
|
||||||
createUrl: `/projects/default/create-toggle?name=${name}`,
|
createUrl: `/projects/default/create-toggle2?name=${name}`,
|
||||||
name,
|
name,
|
||||||
permission: CREATE_FEATURE,
|
permission: CREATE_FEATURE,
|
||||||
i,
|
i,
|
||||||
@ -106,9 +99,8 @@ function ApplicationView({
|
|||||||
elseShow={foundListItem({
|
elseShow={foundListItem({
|
||||||
viewUrl: getTogglePath(project, name),
|
viewUrl: getTogglePath(project, name),
|
||||||
name,
|
name,
|
||||||
showSwitch: true,
|
|
||||||
enabled,
|
|
||||||
description,
|
description,
|
||||||
|
Icon: FlagRounded,
|
||||||
i,
|
i,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
@ -135,7 +127,7 @@ function ApplicationView({
|
|||||||
elseShow={foundListItem({
|
elseShow={foundListItem({
|
||||||
viewUrl: '/strategies/view',
|
viewUrl: '/strategies/view',
|
||||||
name,
|
name,
|
||||||
showSwitch: false,
|
Icon: Extension,
|
||||||
enabled: undefined,
|
enabled: undefined,
|
||||||
description,
|
description,
|
||||||
i,
|
i,
|
||||||
|
Loading…
Reference in New Issue
Block a user