fix(app/account): create access token button (#7014)

* fix(api): remove unused leftover imports

* fix(app/account): create access token button

* fix(app/formcontrol): error message overlapping input on smaller screens
pull/7089/head^2
LP B 2022-06-16 21:25:37 +02:00 committed by GitHub
parent 97a880e6c1
commit 8ed41de815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 16 deletions

View File

@ -29,6 +29,7 @@ export function FormControl({
required, required,
}: PropsWithChildren<Props>) { }: PropsWithChildren<Props>) {
return ( return (
<>
<div className={clsx('form-group', styles.container)}> <div className={clsx('form-group', styles.container)}>
<label <label
htmlFor={inputId} htmlFor={inputId}
@ -42,13 +43,15 @@ export function FormControl({
</label> </label>
<div className={sizeClassChildren(size)}>{children}</div> <div className={sizeClassChildren(size)}>{children}</div>
</div>
{errors && ( {errors && (
<div className="form-group">
<div className="col-md-12"> <div className="col-md-12">
<FormError>{errors}</FormError> <FormError>{errors}</FormError>
</div> </div>
)}
</div> </div>
)}
</>
); );
} }

View File

@ -61,7 +61,7 @@ export function CreateAccessToken({
return ( return (
<Widget> <Widget>
<WidgetBody> <WidgetBody>
<div> <div className="form-horizontal">
<FormControl <FormControl
inputId="input" inputId="input"
label={t('Description')} label={t('Description')}

View File

@ -48,7 +48,7 @@ angular.module('portainer.app').controller('AccountController', [
}; };
this.uiCanExit = (newTransition) => { this.uiCanExit = (newTransition) => {
if ($scope.userRole === 1 && newTransition.to().name === 'portainer.settings.authentication') { if ($scope.userRole === 1 && newTransition && newTransition.to().name === 'portainer.settings.authentication') {
return true; return true;
} }
if (newTransition.to().name === 'portainer.logout') { if (newTransition.to().name === 'portainer.logout') {