mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-01 01:18:10 +02:00
fix: add checks to remove warnings on project settings (#5766)
This PR removes warning on the project settings by always making sure we have the project before rendering the settings and do a conditional check on the featureLimit number field.
This commit is contained in:
parent
769146fbd3
commit
46ecce49a8
@ -12,6 +12,7 @@
|
||||
"start": "vite",
|
||||
"start:prod": "vite build && vite preview",
|
||||
"start:sandbox": "UNLEASH_API=https://sandbox.getunleash.io/ospro yarn run start",
|
||||
"start:sandbox:enterprise": "UNLEASH_API=https://sandbox.getunleash.io/ VITE_TEST_REDIRECT=true UNLEASH_BASE_PATH=/enterprise/ yarn run start",
|
||||
"start:demo2": "UNLEASH_API=https://sandbox.getunleash.io/ UNLEASH_BASE_PATH=/demo2/ yarn run start",
|
||||
"start:enterprise": "UNLEASH_API=https://unleash.herokuapp.com VITE_TEST_REDIRECT=true yarn run start",
|
||||
"start:demo": "UNLEASH_BASE_PATH=/demo/ UNLEASH_API=https://app.unleash-hosted.com/ yarn run start",
|
||||
|
@ -111,7 +111,7 @@ const StyledButtons = styled('div')(({ theme }) => ({
|
||||
padding: theme.spacing(3),
|
||||
paddingRight: theme.spacing(6),
|
||||
paddingLeft: theme.spacing(6),
|
||||
backgroundColor: theme.palette.common.white,
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
justifyContent: 'end',
|
||||
borderTop: `1px solid ${theme.palette.divider}`,
|
||||
}));
|
||||
|
@ -200,7 +200,12 @@ const ProjectForm: React.FC<IProjectForm> = ({
|
||||
label={'Limit'}
|
||||
name='value'
|
||||
type={'number'}
|
||||
value={featureLimit!}
|
||||
value={
|
||||
featureLimit === 'null' ||
|
||||
featureLimit === undefined
|
||||
? ''
|
||||
: featureLimit
|
||||
}
|
||||
onChange={(e) =>
|
||||
setFeatureLimit!(e.target.value)
|
||||
}
|
||||
|
@ -22,6 +22,10 @@ const EditProject = () => {
|
||||
const id = useRequiredPathParam('projectId');
|
||||
const { project } = useProject(id);
|
||||
|
||||
if (!project.name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const accessDeniedAlert = !hasAccess(UPDATE_PROJECT, id) && (
|
||||
<Alert severity='error' sx={{ mb: 4 }}>
|
||||
You do not have the required permissions to edit this project.
|
||||
|
@ -14,6 +14,12 @@ const fallbackProject: IProject = {
|
||||
favorite: false,
|
||||
mode: 'open',
|
||||
defaultStickiness: 'default',
|
||||
featureLimit: 0,
|
||||
featureNaming: {
|
||||
description: 'asd',
|
||||
example: 'A',
|
||||
pattern: '[A-z]',
|
||||
},
|
||||
stats: {
|
||||
archivedCurrentWindow: 0,
|
||||
archivedPastWindow: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user