Merge pull request #3209 from alfonso-salces/MOBILE-4010

MOBILE-4010 about: show feedback item if there is a selected site
main
Noel De Martin 2022-03-29 16:17:45 +02:00 committed by GitHub
commit c139683631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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-label>{{ 'core.settings.accessstatement' | translate }}</ion-label>
</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">
<ion-icon name="fas-bullhorn" slot="start" aria-hidden="true"></ion-icon>
<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 { CoreSites } from '@services/sites';
import { CoreNavigator } from '@services/navigator';
import { CoreSite } from '@classes/site';
/**
* App settings about menu page.
@ -33,16 +34,17 @@ export class CoreSettingsAboutPage {
privacyPolicy: string;
feedbackFormUrl = CoreConstants.CONFIG.feedbackFormUrl ?? 'https://feedback.moodle.org/mobileapp';
a11yStatement = CoreConstants.CONFIG.a11yStatement ?? 'https://apps.moodle.com/admin/tool/policy/view.php?versionid=5';
currentSite?: CoreSite;
constructor() {
const currentSite = CoreSites.getCurrentSite();
this.currentSite = CoreSites.getCurrentSite();
this.appName = CoreConstants.CONFIG.appname;
this.versionName = CoreConstants.CONFIG.versionname;
// Calculate the privacy policy to use.
this.privacyPolicy = (currentSite && (currentSite.getStoredConfig('tool_mobile_apppolicy') ||
currentSite.getStoredConfig('sitepolicy'))) || CoreConstants.CONFIG.privacypolicy;
this.privacyPolicy = (this.currentSite && (this.currentSite.getStoredConfig('tool_mobile_apppolicy') ||
this.currentSite.getStoredConfig('sitepolicy'))) || CoreConstants.CONFIG.privacypolicy;
}
/**