mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[ACS-7519] - Login page (#9565)
This commit is contained in:
parent
4b454b6b83
commit
585cd08e90
@ -43,18 +43,20 @@
|
|||||||
<div *ngIf="!ssoLogin">
|
<div *ngIf="!ssoLogin">
|
||||||
|
|
||||||
<!--USERNAME FIELD-->
|
<!--USERNAME FIELD-->
|
||||||
<div class="adf-login__field"
|
<div class="adf-login__field adf-login-container"
|
||||||
[ngClass]="{'adf-is-invalid': isErrorStyle(form.controls.username)}">
|
[ngClass]="{'adf-is-invalid': isErrorStyle(form.controls.username)}">
|
||||||
<mat-form-field class="adf-full-width adf-login-form-field"
|
<mat-form-field class="adf-full-width adf-login-form-field"
|
||||||
floatPlaceholder="never"
|
floatPlaceholder="never"
|
||||||
color="primary">
|
color="primary">
|
||||||
|
<mat-label class="adf-login-form-input-label">
|
||||||
|
{{'LOGIN.LABEL.USERNAME' | translate }}
|
||||||
|
</mat-label>
|
||||||
<input matInput
|
<input matInput
|
||||||
type="text"
|
type="text"
|
||||||
class="adf-full-width"
|
class="adf-login-input"
|
||||||
formControlName="username"
|
formControlName="username"
|
||||||
id="username"
|
id="username"
|
||||||
data-automation-id="username"
|
data-automation-id="username"
|
||||||
placeholder="{{'LOGIN.LABEL.USERNAME' | translate }}"
|
|
||||||
autocapitalize="none"
|
autocapitalize="none"
|
||||||
(blur)="trimUsername($event)">
|
(blur)="trimUsername($event)">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@ -74,10 +76,13 @@
|
|||||||
<mat-form-field class="adf-full-width adf-login-form-field"
|
<mat-form-field class="adf-full-width adf-login-form-field"
|
||||||
floatPlaceholder="never"
|
floatPlaceholder="never"
|
||||||
color="primary">
|
color="primary">
|
||||||
|
<mat-label class="adf-login-form-input-label">
|
||||||
|
{{'LOGIN.LABEL.PASSWORD' | translate }}
|
||||||
|
</mat-label>
|
||||||
<input matInput
|
<input matInput
|
||||||
placeholder="{{'LOGIN.LABEL.PASSWORD' | translate }}"
|
|
||||||
[type]="isPasswordShow ? 'text' : 'password'"
|
[type]="isPasswordShow ? 'text' : 'password'"
|
||||||
formControlName="password"
|
formControlName="password"
|
||||||
|
class="adf-login-input"
|
||||||
id="password"
|
id="password"
|
||||||
data-automation-id="password">
|
data-automation-id="password">
|
||||||
<button matSuffix
|
<button matSuffix
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@import '../../../styles/mixins';
|
@import '../../../styles/mixins';
|
||||||
|
@import 'styles/mat-selectors';
|
||||||
|
|
||||||
.adf-login {
|
.adf-login {
|
||||||
@include flex-column;
|
@include flex-column;
|
||||||
@ -88,6 +89,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.adf-login-card-header-text {
|
.adf-login-card-header-text {
|
||||||
|
padding-bottom: 42px;
|
||||||
|
padding-top: 0;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +101,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.adf-alfresco-logo {
|
.adf-alfresco-logo {
|
||||||
padding: 24px 16px;
|
padding: 24px 16px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adf-alfresco-logo img {
|
.adf-alfresco-logo img {
|
||||||
@ -114,6 +117,7 @@
|
|||||||
|
|
||||||
.adf-login-button-label {
|
.adf-login-button-label {
|
||||||
color: var(--theme-accent-color-default-contrast);
|
color: var(--theme-accent-color-default-contrast);
|
||||||
|
font-weight: bolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adf-login-button.adf-isChecking {
|
.adf-login-button.adf-isChecking {
|
||||||
@ -145,12 +149,6 @@
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adf-login-controls {
|
|
||||||
padding: 0 0 26px;
|
|
||||||
overflow: visible;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.adf-login-action {
|
.adf-login-action {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -179,21 +177,59 @@
|
|||||||
opacity: 0.54;
|
opacity: 0.54;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adf-login-form-field .adf-login-password-icon.adf-login-form-password-icon {
|
.adf-login-input:is(input) {
|
||||||
color: var(--adf-theme-foreground-text-color);
|
font-size: var(--theme-subheading-2-font-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
.adf-login__field {
|
.adf-login-form-field .adf-login-password-icon.adf-login-form-password-icon {
|
||||||
margin: 1em 0 0;
|
color: var(--adf-theme-foreground-text-color);
|
||||||
display: block;
|
|
||||||
padding-bottom: 18px;
|
|
||||||
font-size: var(--theme-subheading-2-font-size);
|
font-size: var(--theme-subheading-2-font-size);
|
||||||
|
top: 9px;
|
||||||
|
position: relative;
|
||||||
|
left: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
& input:-webkit-autofill {
|
.adf-login-controls:has(div) {
|
||||||
/* stylelint-disable */
|
padding: 0 0 26px;
|
||||||
-webkit-box-shadow: 0 0 0 1000px var(--adf-theme-background-dialog-color) inset;
|
overflow: visible;
|
||||||
-webkit-text-fill-color: var(--adf-theme-foreground-text-color);
|
width: 100%;
|
||||||
/* stylelint-enable */
|
margin-bottom: 16px;
|
||||||
|
|
||||||
|
.adf-login-container {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adf-login__field {
|
||||||
|
display: block;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
font-size: var(--theme-subheading-2-font-size);
|
||||||
|
|
||||||
|
#{$mat-form-field-infix} {
|
||||||
|
min-height: 0;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
padding-top: 20px;
|
||||||
|
|
||||||
|
.adf-login-form-input-label {
|
||||||
|
font-size: var(--theme-subheading-2-font-size);
|
||||||
|
}
|
||||||
|
|
||||||
|
#{$mat-floating-label-float-above} {
|
||||||
|
padding-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#{$mat-floating-label--required} {
|
||||||
|
&::after {
|
||||||
|
font-size: var(--theme-subheading-2-font-size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& input:-webkit-autofill {
|
||||||
|
/* stylelint-disable */
|
||||||
|
-webkit-box-shadow: 0 0 0 1000px var(--adf-theme-background-dialog-color) inset;
|
||||||
|
-webkit-text-fill-color: var(--adf-theme-foreground-text-color);
|
||||||
|
/* stylelint-enable */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,13 +305,13 @@ describe('LoginComponent', () => {
|
|||||||
|
|
||||||
it('should render Login form with all the keys to be translated', () => {
|
it('should render Login form with all the keys to be translated', () => {
|
||||||
expect(element.querySelector('[data-automation-id="username"]')).toBeDefined();
|
expect(element.querySelector('[data-automation-id="username"]')).toBeDefined();
|
||||||
expect(element.querySelector('[data-automation-id="username"]').getAttribute('placeholder')).toEqual('LOGIN.LABEL.USERNAME');
|
expect(element.querySelectorAll('.adf-login-form-input-label')[0].innerText).toEqual('LOGIN.LABEL.USERNAME');
|
||||||
|
|
||||||
expect(element.querySelector('#adf-login-remember')).toBeDefined();
|
expect(element.querySelector('#adf-login-remember')).toBeDefined();
|
||||||
expect(element.querySelector('#adf-login-remember').innerText).toContain('LOGIN.LABEL.REMEMBER');
|
expect(element.querySelector('#adf-login-remember').innerText).toContain('LOGIN.LABEL.REMEMBER');
|
||||||
|
|
||||||
expect(element.querySelector('[data-automation-id="password"]')).toBeDefined();
|
expect(element.querySelector('[data-automation-id="password"]')).toBeDefined();
|
||||||
expect(element.querySelector('[data-automation-id="password"]').getAttribute('placeholder')).toEqual('LOGIN.LABEL.PASSWORD');
|
expect(element.querySelectorAll('.adf-login-form-input-label')[1].innerText).toContain('LOGIN.LABEL.PASSWORD');
|
||||||
|
|
||||||
expect(element.querySelector('#adf-login-action-left')).toBeDefined();
|
expect(element.querySelector('#adf-login-action-left')).toBeDefined();
|
||||||
expect(element.querySelector('#adf-login-action-left').innerText).toEqual('LOGIN.ACTION.HELP');
|
expect(element.querySelector('#adf-login-action-left').innerText).toEqual('LOGIN.ACTION.HELP');
|
||||||
|
@ -100,4 +100,7 @@ $mat-select-arrow-wrapper: '.mat-mdc-select-arrow-wrapper';
|
|||||||
$mat-dialog-title: '.mdc-dialog__title';
|
$mat-dialog-title: '.mdc-dialog__title';
|
||||||
$mat-expansion-panel-body: '.mat-expansion-panel-body';
|
$mat-expansion-panel-body: '.mat-expansion-panel-body';
|
||||||
$mat-dialog-surface: '.mat-mdc-dialog-surface';
|
$mat-dialog-surface: '.mat-mdc-dialog-surface';
|
||||||
$mdc-dialog: '.mdc-dialog'
|
$mdc-dialog: '.mdc-dialog';
|
||||||
|
$mat-text-filed-input: '.mdc-text-field__input';
|
||||||
|
$mat-floating-label-float-above: '.mdc-floating-label--float-above';
|
||||||
|
$mat-floating-label--required: '.mdc-floating-label--required';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user