MOBILE-4010 about: show feedback item if there is a selected site

main
Alfonso 2022-03-29 13:44:28 +02:00
parent 1703c05740
commit 5313754a25
2 changed files with 6 additions and 4 deletions

View File

@ -27,7 +27,7 @@
<ion-icon name="fas-universal-access" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-universal-access" slot="start" aria-hidden="true"></ion-icon>
<ion-label>{{ 'core.settings.accessstatement' | translate }}</ion-label> <ion-label>{{ 'core.settings.accessstatement' | translate }}</ion-label>
</ion-item> </ion-item>
<ion-item *ngIf="feedbackFormUrl" class="ion-text-wrap" button core-link [href]="feedbackFormUrl" detail="true" <ion-item *ngIf="currentSite && feedbackFormUrl" class="ion-text-wrap" button core-link [href]="feedbackFormUrl" detail="true"
detailIcon="open-outline"> detailIcon="open-outline">
<ion-icon name="fas-bullhorn" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-bullhorn" slot="start" aria-hidden="true"></ion-icon>
<ion-label>{{ 'core.settings.helpusimprove' | translate }}</ion-label> <ion-label>{{ 'core.settings.helpusimprove' | translate }}</ion-label>

View File

@ -17,6 +17,7 @@ import { Component } from '@angular/core';
import { CoreConstants } from '@/core/constants'; import { CoreConstants } from '@/core/constants';
import { CoreSites } from '@services/sites'; import { CoreSites } from '@services/sites';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreSite } from '@classes/site';
/** /**
* App settings about menu page. * App settings about menu page.
@ -33,16 +34,17 @@ export class CoreSettingsAboutPage {
privacyPolicy: string; privacyPolicy: string;
feedbackFormUrl = CoreConstants.CONFIG.feedbackFormUrl ?? 'https://feedback.moodle.org/mobileapp'; feedbackFormUrl = CoreConstants.CONFIG.feedbackFormUrl ?? 'https://feedback.moodle.org/mobileapp';
a11yStatement = CoreConstants.CONFIG.a11yStatement ?? 'https://apps.moodle.com/admin/tool/policy/view.php?versionid=5'; a11yStatement = CoreConstants.CONFIG.a11yStatement ?? 'https://apps.moodle.com/admin/tool/policy/view.php?versionid=5';
currentSite?: CoreSite;
constructor() { constructor() {
const currentSite = CoreSites.getCurrentSite(); this.currentSite = CoreSites.getCurrentSite();
this.appName = CoreConstants.CONFIG.appname; this.appName = CoreConstants.CONFIG.appname;
this.versionName = CoreConstants.CONFIG.versionname; this.versionName = CoreConstants.CONFIG.versionname;
// Calculate the privacy policy to use. // Calculate the privacy policy to use.
this.privacyPolicy = (currentSite && (currentSite.getStoredConfig('tool_mobile_apppolicy') || this.privacyPolicy = (this.currentSite && (this.currentSite.getStoredConfig('tool_mobile_apppolicy') ||
currentSite.getStoredConfig('sitepolicy'))) || CoreConstants.CONFIG.privacypolicy; this.currentSite.getStoredConfig('sitepolicy'))) || CoreConstants.CONFIG.privacypolicy;
} }
/** /**