mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Merge pull request #642 from Unleash/fix/create-screens-clean-up
fix: add autofocus to all new create-screens
This commit is contained in:
		
						commit
						7773d107bc
					
				@ -80,6 +80,7 @@ const ApiTokenForm: React.FC<IApiTokenFormProps> = ({
 | 
				
			|||||||
                    error={errors.username !== undefined}
 | 
					                    error={errors.username !== undefined}
 | 
				
			||||||
                    errorText={errors.username}
 | 
					                    errorText={errors.username}
 | 
				
			||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
                <p className={styles.inputDescription}>
 | 
					                <p className={styles.inputDescription}>
 | 
				
			||||||
                    What is your token type?
 | 
					                    What is your token type?
 | 
				
			||||||
 | 
				
			|||||||
@ -142,6 +142,7 @@ const ProjectRoleForm: React.FC<IProjectRoleForm> = ({
 | 
				
			|||||||
                    errorText={errors.name}
 | 
					                    errorText={errors.name}
 | 
				
			||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
                    onBlur={validateNameUniqueness}
 | 
					                    onBlur={validateNameUniqueness}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <p className={styles.inputDescription}>
 | 
					                <p className={styles.inputDescription}>
 | 
				
			||||||
 | 
				
			|||||||
@ -74,6 +74,7 @@ const UserForm: React.FC<IUserForm> = ({
 | 
				
			|||||||
                    error={Boolean(errors.name)}
 | 
					                    error={Boolean(errors.name)}
 | 
				
			||||||
                    errorText={errors.name}
 | 
					                    errorText={errors.name}
 | 
				
			||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
                <Input
 | 
					                <Input
 | 
				
			||||||
                    className={styles.input}
 | 
					                    className={styles.input}
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@ import useUsers from '../../../../hooks/api/getters/useUsers/useUsers';
 | 
				
			|||||||
const useProjectRoleForm = (
 | 
					const useProjectRoleForm = (
 | 
				
			||||||
    initialName = '',
 | 
					    initialName = '',
 | 
				
			||||||
    initialEmail = '',
 | 
					    initialEmail = '',
 | 
				
			||||||
    initialSendEmail = false,
 | 
					    initialSendEmail = true,
 | 
				
			||||||
    initialRootRole = 1
 | 
					    initialRootRole = 1
 | 
				
			||||||
) => {
 | 
					) => {
 | 
				
			||||||
    const [name, setName] = useState(initialName);
 | 
					    const [name, setName] = useState(initialName);
 | 
				
			||||||
 | 
				
			|||||||
@ -109,6 +109,7 @@ const ContextForm: React.FC<IContextForm> = ({
 | 
				
			|||||||
                    errorText={errors.name}
 | 
					                    errorText={errors.name}
 | 
				
			||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
                    onBlur={validateNameUniqueness}
 | 
					                    onBlur={validateNameUniqueness}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
                <p className={styles.inputDescription}>
 | 
					                <p className={styles.inputDescription}>
 | 
				
			||||||
                    What is this context for?
 | 
					                    What is this context for?
 | 
				
			||||||
@ -160,7 +161,7 @@ const ContextForm: React.FC<IContextForm> = ({
 | 
				
			|||||||
                        Add
 | 
					                        Add
 | 
				
			||||||
                    </Button>
 | 
					                    </Button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <p className={styles.inputHeader}>Custom stickiness (beta)</p>
 | 
					                <p className={styles.inputHeader}>Custom stickiness</p>
 | 
				
			||||||
                <p>
 | 
					                <p>
 | 
				
			||||||
                    By enabling stickiness on this context field you can use it
 | 
					                    By enabling stickiness on this context field you can use it
 | 
				
			||||||
                    together with the flexible-rollout strategy. This will
 | 
					                    together with the flexible-rollout strategy. This will
 | 
				
			||||||
 | 
				
			|||||||
@ -51,6 +51,7 @@ const EnvironmentForm: React.FC<IEnvironmentForm> = ({
 | 
				
			|||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
                    onBlur={validateEnvironmentName}
 | 
					                    onBlur={validateEnvironmentName}
 | 
				
			||||||
                    disabled={mode === 'Edit'}
 | 
					                    disabled={mode === 'Edit'}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <p className={styles.inputDescription}>
 | 
					                <p className={styles.inputDescription}>
 | 
				
			||||||
 | 
				
			|||||||
@ -62,6 +62,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
 | 
				
			|||||||
                    What would you like to call your toggle?
 | 
					                    What would you like to call your toggle?
 | 
				
			||||||
                </p>
 | 
					                </p>
 | 
				
			||||||
                <Input
 | 
					                <Input
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                    disabled={mode === 'Edit'}
 | 
					                    disabled={mode === 'Edit'}
 | 
				
			||||||
                    className={styles.input}
 | 
					                    className={styles.input}
 | 
				
			||||||
                    label="Name"
 | 
					                    label="Name"
 | 
				
			||||||
 | 
				
			|||||||
@ -54,6 +54,7 @@ const ProjectForm: React.FC<IProjectForm> = ({
 | 
				
			|||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
                    onBlur={validateIdUniqueness}
 | 
					                    onBlur={validateIdUniqueness}
 | 
				
			||||||
                    disabled={mode === 'Edit'}
 | 
					                    disabled={mode === 'Edit'}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <p className={styles.inputDescription}>
 | 
					                <p className={styles.inputDescription}>
 | 
				
			||||||
 | 
				
			|||||||
@ -52,6 +52,7 @@ const TagTypeForm: React.FC<ITagTypeForm> = ({
 | 
				
			|||||||
                    onFocus={() => clearErrors()}
 | 
					                    onFocus={() => clearErrors()}
 | 
				
			||||||
                    disabled={mode === EDIT}
 | 
					                    disabled={mode === EDIT}
 | 
				
			||||||
                    onBlur={validateNameUniqueness}
 | 
					                    onBlur={validateNameUniqueness}
 | 
				
			||||||
 | 
					                    autoFocus
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <p className={styles.inputDescription}>What is this tag for?</p>
 | 
					                <p className={styles.inputDescription}>What is this tag for?</p>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user