mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
Fix: icon rendering issue in ApplicationList and add help to app update (#5730)
- Fixed app icon rendering - Added tooltip with link to MUI
This commit is contained in:
parent
9683dda8ec
commit
eeb2b2115e
@ -94,6 +94,7 @@ export const ApplicationEdit = () => {
|
|||||||
} else if (!application) {
|
} else if (!application) {
|
||||||
return <p>Application ({appName}) not found</p>;
|
return <p>Application ({appName}) not found</p>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageContent>
|
<PageContent>
|
||||||
|
@ -60,7 +60,7 @@ export const ApplicationList = () => {
|
|||||||
<IconCell
|
<IconCell
|
||||||
icon={
|
icon={
|
||||||
<Avatar>
|
<Avatar>
|
||||||
<Icon>{icon}</Icon>
|
<Icon>{icon || 'apps'}</Icon>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ChangeEvent, useState } from 'react';
|
import { ChangeEvent, useMemo, useState } from 'react';
|
||||||
import { Grid, TextField } from '@mui/material';
|
import { Grid, TextField, styled } from '@mui/material';
|
||||||
import { useThemeStyles } from 'themes/themeStyles';
|
import { useThemeStyles } from 'themes/themeStyles';
|
||||||
import icons from 'component/application/iconNames';
|
import icons from 'component/application/iconNames';
|
||||||
import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect';
|
import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect';
|
||||||
@ -8,11 +8,18 @@ import useToast from 'hooks/useToast';
|
|||||||
import { IApplication } from 'interfaces/application';
|
import { IApplication } from 'interfaces/application';
|
||||||
import useApplication from 'hooks/api/getters/useApplication/useApplication';
|
import useApplication from 'hooks/api/getters/useApplication/useApplication';
|
||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
|
import { HelpIcon } from 'component/common/HelpIcon/HelpIcon';
|
||||||
|
|
||||||
interface IApplicationUpdateProps {
|
interface IApplicationUpdateProps {
|
||||||
application: IApplication;
|
application: IApplication;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const StyledSelectContainer = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
}));
|
||||||
|
|
||||||
export const ApplicationUpdate = ({ application }: IApplicationUpdateProps) => {
|
export const ApplicationUpdate = ({ application }: IApplicationUpdateProps) => {
|
||||||
const { storeApplicationMetaData } = useApplicationsApi();
|
const { storeApplicationMetaData } = useApplicationsApi();
|
||||||
const { appName, icon, url, description } = application;
|
const { appName, icon, url, description } = application;
|
||||||
@ -41,18 +48,38 @@ export const ApplicationUpdate = ({ application }: IApplicationUpdateProps) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const options = useMemo(() => icons.map((v) => ({ key: v, label: v })), []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid container style={{ marginTop: '1rem' }}>
|
<Grid container style={{ marginTop: '1rem' }}>
|
||||||
<Grid item sm={12} xs={12} className={themeStyles.contentSpacingY}>
|
<Grid item sm={12} xs={12} className={themeStyles.contentSpacingY}>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<GeneralSelect
|
<StyledSelectContainer>
|
||||||
name='iconSelect'
|
<GeneralSelect
|
||||||
id='selectIcon'
|
name='iconSelect'
|
||||||
label='Icon'
|
id='selectIcon'
|
||||||
options={icons.map((v) => ({ key: v, label: v }))}
|
label='Icon'
|
||||||
value={icon || 'apps'}
|
options={options}
|
||||||
onChange={(key) => onChange('icon', key)}
|
value={icon || 'apps'}
|
||||||
/>
|
onChange={(key) => onChange('icon', key)}
|
||||||
|
/>
|
||||||
|
<HelpIcon
|
||||||
|
htmlTooltip
|
||||||
|
tooltip={
|
||||||
|
<>
|
||||||
|
<p>Unleash is using Material Icons</p>
|
||||||
|
<br />
|
||||||
|
<a
|
||||||
|
href='https://mui.com/material-ui/material-icons/'
|
||||||
|
target='_blank'
|
||||||
|
rel='noreferrer'
|
||||||
|
>
|
||||||
|
Preview icons on MUI.com
|
||||||
|
</a>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</StyledSelectContainer>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<TextField
|
<TextField
|
||||||
|
Loading…
Reference in New Issue
Block a user