Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 16 additions & 3 deletions frontend/src/app/components/login/login.component.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:host app-alert:not(:empty) {
--alert-margin: 24px;
--alert-margin: 24px;

position: absolute;
top: var(--mat-toolbar-standard-height);
width: calc(100% - 48px);
top: var(--mat-toolbar-standard-height);
width: calc(100% - 48px);
}

.wrapper {
Expand Down Expand Up @@ -360,3 +360,16 @@
transform: translateX(100%);
}
}

.demo-loader {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 24px;
}

.demo-loader__text {
color: var(--mat-sidenav-content-text-color);
margin: 0;
}
9 changes: 9 additions & 0 deletions frontend/src/app/components/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<app-alert></app-alert>

@if (isDemoMode) {
<div class="wrapper background-decoration">
<div class="login-page demo-loader">
<mat-spinner diameter="48"></mat-spinner>
<p class="mat-body-1 demo-loader__text">Loading demo account...</p>
Comment on lines +3 to +7

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New demo-mode branch introduces UI/behavior (show spinner + hide login form when mode=demo) but there is no corresponding unit test. Please extend login.component.spec.ts to cover mode=demo (e.g., set query params to demo, assert spinner/loader text is rendered and the login form is not, and optionally assert Google One Tap init is skipped).

Copilot uses AI. Check for mistakes.
</div>
</div>
} @else {
<div class="wrapper background-decoration">
<div class="login-page">
<form
Expand Down Expand Up @@ -133,4 +141,5 @@ <h2 class="mat-headline-4 qr-verification__title">Enter 2nd factor code</h2>
</form>
</div>
</div>
}

9 changes: 7 additions & 2 deletions frontend/src/app/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { MatDialog } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSelectModule } from '@angular/material/select';
import { Router, RouterModule } from '@angular/router';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { Angulartics2, Angulartics2OnModule } from 'angulartics2';
import { accounts } from 'google-one-tap';
import { EmailValidationDirective } from 'src/app/directives/emailValidator.directive';
Expand Down Expand Up @@ -35,6 +36,7 @@ declare var google: any;
MatSelectModule,
MatIconModule,
MatButtonModule,
MatProgressSpinnerModule,
EmailValidationDirective,
AlertComponent,
Angulartics2OnModule,
Expand All @@ -55,6 +57,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
public submitting: boolean;
public isPasswordFieldShown: boolean = false;
public is2FAShown: boolean = false;
public isDemoMode: boolean = false;
public errors = {
'No_user_registered_with_this_GitHub_account.': 'No user registered with this GitHub account.',
'GitHub_login_failed._Please_contact_our_support_team.': 'GitHub login failed. Please contact our support team.',
Expand All @@ -63,6 +66,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
constructor(
private _auth: AuthService,
public router: Router,
private _route: ActivatedRoute,
private angulartics2: Angulartics2,
private ngZone: NgZone,
private _notifications: NotificationsService,
Expand All @@ -71,6 +75,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
) {}

ngOnInit(): void {
this.isDemoMode = this._route.snapshot.queryParams['mode'] === 'demo';
this.isCustomDomain = this._company.isCustomDomain() && this.isSaas;

const error = new URLSearchParams(location.search).get('error');
Expand All @@ -85,7 +90,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
}

ngAfterViewInit() {
if (this.isSaas) {
if (this.isSaas && !this.isDemoMode) {
const gAccounts: accounts = google.accounts;
gAccounts.id.initialize({
client_id: '681163285738-e4l0lrv5vv7m616ucrfhnhso9r396lum.apps.googleusercontent.com',
Expand Down
Loading