Browse Source
Merge pull request #170 from maooson/fixbug-apps-menu
fix bug.
pull/177/head
Sebastian Stehle
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
5 deletions
-
src/Squidex/app/shell/pages/internal/apps-menu.component.html
-
src/Squidex/app/shell/pages/internal/apps-menu.component.ts
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<ul class="nav navbar-nav" *ngIf="apps"> |
|
|
|
<li class="nav-item dropdown"> |
|
|
|
<span class="nav-link dropdown-toggle" id="app-name" (click)="modalMenu.toggle()">{{ctx.app ? ctx.app.name : 'Apps Overview'}}</span> |
|
|
|
<span class="nav-link dropdown-toggle" id="app-name" (click)="modalMenu.toggle()">{{selectedApp ? selectedApp.name : 'Apps Overview'}}</span> |
|
|
|
|
|
|
|
<div class="dropdown-menu" *sqxModalView="modalMenu" closeAlways="true" @fade> |
|
|
|
<a class="dropdown-item all-apps" routerLink="/app"> |
|
|
|
@ -22,12 +22,12 @@ |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
|
|
|
|
<li class="nav-item" *ngIf="ctx.app && ctx.app.planUpgrade && ctx.app.planName && ctx.app.permission === 'Owner'"> |
|
|
|
<li class="nav-item" *ngIf="selectedApp && selectedApp.planUpgrade && selectedApp.planName && selectedApp.permission === 'Owner'"> |
|
|
|
<div class="btn-group app-upgrade"> |
|
|
|
<button type="button" class="btn btn-primary"> |
|
|
|
You are on the <strong>{{ctx.app.planName}}</strong> plan. |
|
|
|
You are on the <strong>{{selectedApp.planName}}</strong> plan. |
|
|
|
</button> |
|
|
|
<button type="button" class="btn btn-warning" [routerLink]="['/app', ctx.app.name, 'settings', 'plans']"> |
|
|
|
<button type="button" class="btn btn-warning" [routerLink]="['/app', selectedApp.name, 'settings', 'plans']"> |
|
|
|
Upgrade! |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -29,19 +29,22 @@ import { |
|
|
|
}) |
|
|
|
export class AppsMenuComponent implements OnDestroy, OnInit { |
|
|
|
private appsSubscription: Subscription; |
|
|
|
private appSubscription: Subscription; |
|
|
|
|
|
|
|
public modalMenu = new ModalView(false, true); |
|
|
|
public modalDialog = new ModalView(); |
|
|
|
|
|
|
|
public apps: AppDto[] = []; |
|
|
|
public selectedApp: AppDto; |
|
|
|
|
|
|
|
constructor(public readonly ctx: AppContext, |
|
|
|
constructor( |
|
|
|
private readonly appsStore: AppsStoreService |
|
|
|
) { |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
this.appsSubscription.unsubscribe(); |
|
|
|
this.appSubscription.unsubscribe(); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
|
@ -49,6 +52,11 @@ export class AppsMenuComponent implements OnDestroy, OnInit { |
|
|
|
this.appsStore.apps.subscribe(apps => { |
|
|
|
this.apps = apps; |
|
|
|
}); |
|
|
|
|
|
|
|
this.appSubscription = |
|
|
|
this.appsStore.selectedApp.subscribe(app => { |
|
|
|
this.selectedApp = app; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public createApp() { |
|
|
|
|