-
-
Notifications
You must be signed in to change notification settings - Fork 18
separate landing page for demo #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| .wrapper { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| min-height: 100vh; | ||
| } | ||
|
|
||
| .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; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <div class="wrapper background-decoration"> | ||
| <div class="demo-loader"> | ||
| <mat-spinner diameter="48"></mat-spinner> | ||
| <p class="mat-body-1 demo-loader__text">Loading demo account...</p> | ||
| </div> | ||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { Component, OnInit } from '@angular/core'; | ||
| import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; | ||
| import { Angulartics2 } from 'angulartics2'; | ||
| import posthog from 'posthog-js'; | ||
| import { AuthService } from 'src/app/services/auth.service'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-demo-login', | ||
| templateUrl: './demo-login.component.html', | ||
| styleUrls: ['./demo-login.component.css'], | ||
| imports: [MatProgressSpinnerModule], | ||
| }) | ||
| export class DemoLoginComponent implements OnInit { | ||
| constructor( | ||
| private _auth: AuthService, | ||
| private angulartics2: Angulartics2, | ||
| ) {} | ||
|
|
||
| ngOnInit(): void { | ||
| this._auth.loginToDemoAccount().subscribe(() => { | ||
| this.angulartics2.eventTrack.next({ | ||
|
Comment on lines
+19
to
+21
|
||
| action: 'Demo account is logged in', | ||
| }); | ||
| posthog.capture('Demo account is logged in'); | ||
| }); | ||
|
Comment on lines
+19
to
+25
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
/demoroute is not protected byconfigurationGuardlike/login. In self-hosted mode this means an unconfigured instance can still hit the demo endpoint and surface confusing errors instead of redirecting to/setup. Consider addingcanActivate: [configurationGuard](or a dedicated guard that disables demo outside SaaS/self-hosted-configured environments).