From cce8eb22eccc6a088b0fd297b91946ad845a6667 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 15 Apr 2018 10:51:37 +0200 Subject: [PATCH] Simplified page. --- .../apps/pages/apps-page.component.html | 4 +- .../apps/pages/apps-page.component.ts | 37 ++++++------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/Squidex/app/features/apps/pages/apps-page.component.html b/src/Squidex/app/features/apps/pages/apps-page.component.html index f3204ade1..b27a6d1d3 100644 --- a/src/Squidex/app/features/apps/pages/apps-page.component.html +++ b/src/Squidex/app/features/apps/pages/apps-page.component.html @@ -13,7 +13,7 @@

You are not collaborating to any app yet

-
+

{{app.name}}

@@ -75,7 +75,7 @@
- diff --git a/src/Squidex/app/features/apps/pages/apps-page.component.ts b/src/Squidex/app/features/apps/pages/apps-page.component.ts index 77a773b03..fc78b8020 100644 --- a/src/Squidex/app/features/apps/pages/apps-page.component.ts +++ b/src/Squidex/app/features/apps/pages/apps-page.component.ts @@ -5,14 +5,11 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { Subscription } from 'rxjs'; +import { Component, OnInit } from '@angular/core'; import { - AppDto, AppsState, AuthService, - ImmutableArray, ModalView, OnboardingService } from '@app/shared'; @@ -22,13 +19,9 @@ import { styleUrls: ['./apps-page.component.scss'], templateUrl: './apps-page.component.html' }) -export class AppsPageComponent implements OnDestroy, OnInit { - private appsSubscription: Subscription; - +export class AppsPageComponent implements OnInit { public addAppDialog = new ModalView(); - - public apps: ImmutableArray = ImmutableArray.empty(); - public appTemplate = ''; + public addAppTemplate = ''; public onboardingModal = new ModalView(); @@ -39,26 +32,18 @@ export class AppsPageComponent implements OnDestroy, OnInit { ) { } - public ngOnDestroy() { - this.appsSubscription.unsubscribe(); - } - public ngOnInit() { - this.appsSubscription = - this.appsState.apps - .subscribe(apps => { - if (apps.length === 0 && this.onboardingService.shouldShow('dialog')) { - this.onboardingService.disable('dialog'); - this.onboardingModal.show(); - } - - this.apps = apps; - }); + this.appsState.apps.take(1) + .subscribe(apps => { + if (this.onboardingService.shouldShow('dialog') && apps.length === 0) { + this.onboardingService.disable('dialog'); + this.onboardingModal.show(); + } + }); } public createNewApp(template: string) { - this.appTemplate = template; - + this.addAppTemplate = template; this.addAppDialog.show(); } } \ No newline at end of file