Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/app/login/login-form/login-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,18 @@
formControlName="password"
[placeholder]="'labels.placeholders.Enter your password' | translate"
(keyup.enter)="onEnter($event)"
(keydown)="checkCapsLock($event)"
(keyup)="checkCapsLock($event)"
/>
<mifosx-m3-icon matIconPrefix name="lock"></mifosx-m3-icon>
@if (isCapsLockOn) {
<mifosx-m3-icon
matSuffix
name="keyboard_capslock"
[matTooltip]="'labels.commons.Caps Lock is on' | translate"
class="caps-lock-warning"
></mifosx-m3-icon>
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
@if (loginForm.controls.password.value && !loading) {
<button
type="button"
Expand Down
8 changes: 7 additions & 1 deletion src/app/login/login-form/login-form.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* Copyright since 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
Expand Down Expand Up @@ -184,6 +184,12 @@
}
}

.caps-lock-warning {
color: var(--md-sys-color-error, #ba1a1a);
margin-right: 8px;
cursor: help;
}

// ===== Loading Progress =====
.login-progress {
height: 3px;
Expand Down
10 changes: 10 additions & 0 deletions src/app/login/login-form/login-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export class LoginFormComponent implements OnInit {
oauthEnabled = environment.OIDC.oidcServerEnabled || environment.oauth.enabled;
/** Whether remember me functionality is enabled */
enableRememberMe = environment.enableRememberMe === true;
/** True if Caps Lock is on. */
isCapsLockOn = false;

/**
* Creates login form.
Expand Down Expand Up @@ -159,4 +161,12 @@ export class LoginFormComponent implements OnInit {
onEnter(event: any): void {
this.login();
}

/**
* Checks the state of the Caps Lock key.
* @param {KeyboardEvent} event - Keyboard event.
*/
checkCapsLock(event: KeyboardEvent) {
this.isCapsLockOn = event.getModifierState('CapsLock');
}
}
1 change: 1 addition & 0 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@
"Is": "is",
"is required": "is required",
"pass is required": "is required (min length {{min}})",
"Caps Lock is on": "Caps Lock is on",
"least one uppercase": "least one uppercase",
"lowercase and special character": "lowercase and special character",
"must be": "must be",
Expand Down