MOBILE-3320 more: Add loading when logging out
parent
49f6cc56e5
commit
94205791b5
|
@ -8,90 +8,92 @@
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-list>
|
<core-loading [hideUntil]="!loggedOut">
|
||||||
<ion-item button *ngIf="siteInfo" class="ion-text-wrap" core-user-link [userId]="siteInfo.userid">
|
<ion-list>
|
||||||
<core-user-avatar [user]="siteInfo" slot="start"></core-user-avatar>
|
<ion-item button *ngIf="siteInfo" class="ion-text-wrap" core-user-link [userId]="siteInfo.userid">
|
||||||
<ion-label>
|
<core-user-avatar [user]="siteInfo" slot="start"></core-user-avatar>
|
||||||
<h2>{{siteInfo.fullname}}</h2>
|
|
||||||
<p>
|
|
||||||
<core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0" [wsNotFiltered]="true">
|
|
||||||
</core-format-text>
|
|
||||||
</p>
|
|
||||||
<p>{{ siteUrl }}</p>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
<core-spacer></core-spacer>
|
|
||||||
<ion-item class="ion-text-center" *ngIf="(!handlers || !handlers.length) && !handlersLoaded">
|
|
||||||
<ion-label><ion-spinner></ion-spinner></ion-label>
|
|
||||||
</ion-item>
|
|
||||||
<ion-item button *ngFor="let handler of handlers" [ngClass]="['core-moremenu-handler', handler.class || '']"
|
|
||||||
(click)="openHandler(handler)" [attr.aria-label]="handler.title | translate" detail="true">
|
|
||||||
<ion-icon [name]="handler.icon" slot="start" aria-hidden="true"></ion-icon>
|
|
||||||
<ion-label>
|
|
||||||
<p class="item-heading">{{ handler.title | translate}}</p>
|
|
||||||
</ion-label>
|
|
||||||
<ion-badge slot="end" *ngIf="handler.showBadge" [hidden]="handler.loading || !handler.badge" aria-hidden="true">
|
|
||||||
{{handler.badge}}
|
|
||||||
</ion-badge>
|
|
||||||
<span *ngIf="handler.showBadge && handler.badge && handler.badgeA11yText" class="sr-only">
|
|
||||||
{{ handler.badgeA11yText | translate: {$a : handler.badge } }}
|
|
||||||
</span>
|
|
||||||
<ion-spinner slot="end" *ngIf="handler.showBadge && handler.loading"></ion-spinner>
|
|
||||||
</ion-item>
|
|
||||||
<ng-container *ngFor="let item of customItems">
|
|
||||||
<ion-item button *ngIf="item.type != 'embedded'" [href]="item.url" [attr.aria-label]="item.label" core-link
|
|
||||||
[capture]="item.type == 'app'" [inApp]="item.type == 'inappbrowser'" class="core-moremenu-customitem" detail="true">
|
|
||||||
<ion-icon [name]="item.icon" slot="start" aria-hidden="true"></ion-icon>
|
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{item.label}}</p>
|
<h2>{{siteInfo.fullname}}</h2>
|
||||||
|
<p>
|
||||||
|
<core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0" [wsNotFiltered]="true">
|
||||||
|
</core-format-text>
|
||||||
|
</p>
|
||||||
|
<p>{{ siteUrl }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item button *ngIf="item.type == 'embedded'" (click)="openItem(item)" [attr.aria-label]="item.label"
|
<core-spacer></core-spacer>
|
||||||
class="core-moremenu-customitem" detail="true">
|
<ion-item class="ion-text-center" *ngIf="(!handlers || !handlers.length) && !handlersLoaded">
|
||||||
<ion-icon [name]="item.icon" slot="start" aria-hidden="true"></ion-icon>
|
<ion-label><ion-spinner></ion-spinner></ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item button *ngFor="let handler of handlers" [ngClass]="['core-moremenu-handler', handler.class || '']"
|
||||||
|
(click)="openHandler(handler)" [attr.aria-label]="handler.title | translate" detail="true">
|
||||||
|
<ion-icon [name]="handler.icon" slot="start" aria-hidden="true"></ion-icon>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{item.label}}</p>
|
<p class="item-heading">{{ handler.title | translate}}</p>
|
||||||
|
</ion-label>
|
||||||
|
<ion-badge slot="end" *ngIf="handler.showBadge" [hidden]="handler.loading || !handler.badge" aria-hidden="true">
|
||||||
|
{{handler.badge}}
|
||||||
|
</ion-badge>
|
||||||
|
<span *ngIf="handler.showBadge && handler.badge && handler.badgeA11yText" class="sr-only">
|
||||||
|
{{ handler.badgeA11yText | translate: {$a : handler.badge } }}
|
||||||
|
</span>
|
||||||
|
<ion-spinner slot="end" *ngIf="handler.showBadge && handler.loading"></ion-spinner>
|
||||||
|
</ion-item>
|
||||||
|
<ng-container *ngFor="let item of customItems">
|
||||||
|
<ion-item button *ngIf="item.type != 'embedded'" [href]="item.url" [attr.aria-label]="item.label" core-link
|
||||||
|
[capture]="item.type == 'app'" [inApp]="item.type == 'inappbrowser'" class="core-moremenu-customitem" detail="true">
|
||||||
|
<ion-icon [name]="item.icon" slot="start" aria-hidden="true"></ion-icon>
|
||||||
|
<ion-label>
|
||||||
|
<p class="item-heading">{{item.label}}</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item button *ngIf="item.type == 'embedded'" (click)="openItem(item)" [attr.aria-label]="item.label"
|
||||||
|
class="core-moremenu-customitem" detail="true">
|
||||||
|
<ion-icon [name]="item.icon" slot="start" aria-hidden="true"></ion-icon>
|
||||||
|
<ion-label>
|
||||||
|
<p class="item-heading">{{item.label}}</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ng-container>
|
||||||
|
<ion-item button *ngIf="showScanQR" (click)="scanQR()" detail="true">
|
||||||
|
<ion-icon name="fas-qrcode" slot="start" aria-hidden="true"></ion-icon>
|
||||||
|
<ion-label>
|
||||||
|
<p class="item-heading">{{ 'core.scanqr' | translate }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ng-container>
|
<ion-item button *ngIf="showWeb && siteInfo" [href]="siteInfo.siteurl" core-link autoLogin="yes"
|
||||||
<ion-item button *ngIf="showScanQR" (click)="scanQR()" detail="true">
|
[attr.aria-label]="'core.mainmenu.website' | translate" detail="true">
|
||||||
<ion-icon name="fas-qrcode" slot="start" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-globe" slot="start" aria-hidden="true"></ion-icon>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ 'core.scanqr' | translate }}</p>
|
<p class="item-heading">{{ 'core.mainmenu.website' | translate }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item button *ngIf="showWeb && siteInfo" [href]="siteInfo.siteurl" core-link autoLogin="yes"
|
<ion-item button *ngIf="showHelp" [href]="docsUrl" core-link autoLogin="no"
|
||||||
[attr.aria-label]="'core.mainmenu.website' | translate" detail="true">
|
[attr.aria-label]="'core.mainmenu.help' | translate" detail="true">
|
||||||
<ion-icon name="fas-globe" slot="start" aria-hidden="true"></ion-icon>
|
<ion-icon name="far-life-ring" slot="start" aria-hidden="true"></ion-icon>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ 'core.mainmenu.website' | translate }}</p>
|
<p class="item-heading">{{ 'core.mainmenu.help' | translate }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item button *ngIf="showHelp" [href]="docsUrl" core-link autoLogin="no"
|
<ion-item button (click)="openPreferences()" [attr.aria-label]="'core.settings.preferences' | translate" detail="true">
|
||||||
[attr.aria-label]="'core.mainmenu.help' | translate" detail="true">
|
<ion-icon name="fas-wrench" slot="start" aria-hidden="true"></ion-icon>
|
||||||
<ion-icon name="far-life-ring" slot="start" aria-hidden="true"></ion-icon>
|
<ion-label>
|
||||||
<ion-label>
|
<p class="item-heading">{{ 'core.settings.preferences' | translate }}</p>
|
||||||
<p class="item-heading">{{ 'core.mainmenu.help' | translate }}</p>
|
</ion-label>
|
||||||
</ion-label>
|
</ion-item>
|
||||||
</ion-item>
|
<ion-item button (click)="logout()" [attr.aria-label]="logoutLabel | translate" detail="true">
|
||||||
<ion-item button (click)="openPreferences()" [attr.aria-label]="'core.settings.preferences' | translate" detail="true">
|
<ion-icon name="fas-sign-out-alt" slot="start" aria-hidden="true"></ion-icon>
|
||||||
<ion-icon name="fas-wrench" slot="start" aria-hidden="true"></ion-icon>
|
<ion-label>
|
||||||
<ion-label>
|
<p class="item-heading">{{ logoutLabel | translate }}</p>
|
||||||
<p class="item-heading">{{ 'core.settings.preferences' | translate }}</p>
|
</ion-label>
|
||||||
</ion-label>
|
</ion-item>
|
||||||
</ion-item>
|
<core-spacer></core-spacer>
|
||||||
<ion-item button (click)="logout()" [attr.aria-label]="logoutLabel | translate" detail="true">
|
<ion-item button (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate" detail="true">
|
||||||
<ion-icon name="fas-sign-out-alt" slot="start" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-cogs" slot="start" aria-hidden="true"></ion-icon>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ logoutLabel | translate }}</p>
|
<p class="item-heading">{{ 'core.settings.appsettings' | translate }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<core-spacer></core-spacer>
|
</ion-list>
|
||||||
<ion-item button (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate" detail="true">
|
</core-loading>
|
||||||
<ion-icon name="fas-cogs" slot="start" aria-hidden="true"></ion-icon>
|
|
||||||
<ion-label>
|
|
||||||
<p class="item-heading">{{ 'core.settings.appsettings' | translate }}</p>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
</ion-list>
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
@ -50,6 +50,7 @@ export class CoreMainMenuMorePage implements OnInit, OnDestroy {
|
||||||
docsUrl?: string;
|
docsUrl?: string;
|
||||||
customItems?: CoreMainMenuCustomItem[];
|
customItems?: CoreMainMenuCustomItem[];
|
||||||
siteUrl?: string;
|
siteUrl?: string;
|
||||||
|
loggedOut = false;
|
||||||
|
|
||||||
protected subscription!: Subscription;
|
protected subscription!: Subscription;
|
||||||
protected langObserver: CoreEventObserver;
|
protected langObserver: CoreEventObserver;
|
||||||
|
@ -203,6 +204,7 @@ export class CoreMainMenuMorePage implements OnInit, OnDestroy {
|
||||||
* Logout the user.
|
* Logout the user.
|
||||||
*/
|
*/
|
||||||
logout(): void {
|
logout(): void {
|
||||||
|
this.loggedOut = true;
|
||||||
CoreSites.logout();
|
CoreSites.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue