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,26 +29,29 @@ export function FormControl({
required, required,
}: PropsWithChildren<Props>) { }: PropsWithChildren<Props>) {
return ( return (
<div className={clsx('form-group', styles.container)}> <>
<label <div className={clsx('form-group', styles.container)}>
htmlFor={inputId} <label
className={clsx(sizeClassLabel(size), 'control-label', 'text-left')} htmlFor={inputId}
> className={clsx(sizeClassLabel(size), 'control-label', 'text-left')}
{label} >
{label}
{required && <span className="text-danger">*</span>} {required && <span className="text-danger">*</span>}
{tooltip && <Tooltip message={tooltip} />} {tooltip && <Tooltip message={tooltip} />}
</label> </label>
<div className={sizeClassChildren(size)}>{children}</div>
<div className={sizeClassChildren(size)}>{children}</div>
</div>
{errors && ( {errors && (
<div className="col-md-12"> <div className="form-group">
<FormError>{errors}</FormError> <div className="col-md-12">
<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') {