mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:41:56 +00:00
Move deploy blur logic to parent component
This commit is contained in:
parent
8f4a6fd83e
commit
97ed48b408
@ -1,7 +1,9 @@
|
|||||||
<div class="tfw-grid-main-components">
|
<div class="tfw-grid-main-components">
|
||||||
<div class="tfw-header"><app-header></app-header></div>
|
<div class="tfw-header"><app-header></app-header></div>
|
||||||
<div class="tfw-messages"><app-messages></app-messages></div>
|
<div class="tfw-messages"><app-messages></app-messages></div>
|
||||||
<div class="tfw-web tao-grid-top-left"><app-login></app-login></div>
|
<div class="tfw-web tao-grid-top-left" [ngClass]="{ 'deploy-blur': deploying }">
|
||||||
|
<app-login></app-login>
|
||||||
|
</div>
|
||||||
<div class="tfw-webide"><app-webide></app-webide></div>
|
<div class="tfw-webide"><app-webide></app-webide></div>
|
||||||
<div class="tfw-terminal"><app-terminal></app-terminal></div>
|
<div class="tfw-terminal"><app-terminal></app-terminal></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -107,3 +107,8 @@ $layout: (
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.deploy-blur {
|
||||||
|
filter: blur(3px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,28 @@
|
|||||||
import { Component } from '@angular/core';
|
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||||
|
import {DeploymentNotificationService} from '../services/deployment-notification.service';
|
||||||
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dashboard',
|
selector: 'app-dashboard',
|
||||||
templateUrl: './dashboard.component.html',
|
templateUrl: './dashboard.component.html',
|
||||||
styleUrls: ['./dashboard.component.scss']
|
styleUrls: ['./dashboard.component.scss']
|
||||||
})
|
})
|
||||||
export class DashboardComponent {
|
export class DashboardComponent implements OnInit, OnDestroy {
|
||||||
constructor() {}
|
|
||||||
|
deploying = false;
|
||||||
|
deploymentNotificationSubscription: Subscription;
|
||||||
|
|
||||||
|
constructor(private deploymentNotificationService: DeploymentNotificationService) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe(
|
||||||
|
(deploying) => this.deploying = deploying
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
if (this.deploymentNotificationSubscription) {
|
||||||
|
this.deploymentNotificationSubscription.unsubscribe();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div [ngClass]="{ 'deploy-blur': deploying }">
|
<div>
|
||||||
<h1>Login page</h1>
|
<h1>Login page</h1>
|
||||||
<form #loginForm="ngForm" (submit)="onSubmit()" [hidden]="submitted">
|
<form #loginForm="ngForm" (submit)="onSubmit()" [hidden]="submitted">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -31,6 +31,4 @@
|
|||||||
You <em><span *ngIf="!is_admin">don't </span>have</em> admin privileges.
|
You <em><span *ngIf="!is_admin">don't </span>have</em> admin privileges.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
.deploy-blur {
|
|
||||||
filter: blur(3px);
|
|
||||||
}
|
|
@ -10,17 +10,14 @@ import {Subscription} from 'rxjs/Subscription';
|
|||||||
templateUrl: './login.component.html',
|
templateUrl: './login.component.html',
|
||||||
styleUrls: ['./login.component.scss']
|
styleUrls: ['./login.component.scss']
|
||||||
})
|
})
|
||||||
export class LoginComponent implements OnInit, OnDestroy {
|
export class LoginComponent {
|
||||||
model = new Login('', '');
|
model = new Login('', '');
|
||||||
submitted = false;
|
submitted = false;
|
||||||
is_admin: boolean;
|
is_admin: boolean;
|
||||||
logged_in_email: string;
|
logged_in_email: string;
|
||||||
deploying = false;
|
|
||||||
deploymentNotificationSubscription: Subscription;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient
|
||||||
private deploymentNotificationService: DeploymentNotificationService
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
@ -36,16 +33,4 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|||||||
postLogin(login: Login): Observable<any> {
|
postLogin(login: Login): Observable<any> {
|
||||||
return this.http.post<Login>('/login', login);
|
return this.http.post<Login>('/login', login);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe(
|
|
||||||
(deploying) => this.deploying = deploying
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
|
||||||
if (this.deploymentNotificationSubscription) {
|
|
||||||
this.deploymentNotificationSubscription.unsubscribe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user