Skip to content

Commit f96a085

Browse files
authored
Merge pull request #2487 from intersective/hotfix/disable-duedates-production
[CORE-7959] disable duedate for production
2 parents 16e232f + d7a22cb commit f96a085

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

projects/v3/src/app/pages/tabs/tabs.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ion-badge color="danger" *ngIf="badges.chat > 0">{{ badges.chat }}</ion-badge>
2323
</ion-tab-button>
2424

25-
<ion-tab-button class="tab-item" tab="due-dates"
25+
<ion-tab-button *ngIf="forDeveloperMode('dueStatus')" class="tab-item" tab="due-dates"
2626
[ngClass]="{'selected': selectedTab === 'dueStatus'}">
2727
<ion-icon name="alarm"></ion-icon>
2828
</ion-tab-button>

projects/v3/src/app/pages/tabs/tabs.page.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, HostListener, OnDestroy, OnInit, ViewChild } from '@angular/core';
1+
import { Component, HostListener, isDevMode, OnDestroy, OnInit, ViewChild } from '@angular/core';
22
import { IonTabs } from '@ionic/angular';
33
import { ActivatedRoute } from '@angular/router';
44
import { Review, ReviewService } from '@v3/services/review.service';
@@ -42,6 +42,18 @@ export class TabsPage implements OnInit, OnDestroy {
4242
) {
4343
}
4444

45+
/**
46+
* Check if a feature is enabled in developer mode only
47+
* @param featureName The name of the feature to check
48+
* @returns True if the feature is enabled in developer mode, false otherwise
49+
*/
50+
forDeveloperMode(featureName: 'dueStatus'): boolean {
51+
if (isDevMode() && featureName === 'dueStatus') {
52+
return true;
53+
}
54+
return false;
55+
}
56+
4557
ngOnInit() {
4658
this.utils.screenStatus$.subscribe((res) => {
4759
this.hasLeftSidebar = res.leftSidebarExpanded;

projects/v3/src/app/pages/v3/v3.page.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { takeUntil, mergeMap } from 'rxjs/operators';
2-
import { Component, HostListener, OnDestroy, OnInit } from '@angular/core';
2+
import { Component, HostListener, isDevMode, OnDestroy, OnInit } from '@angular/core';
33
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
44
import { MenuController, ModalController } from '@ionic/angular';
55
import { Review, ReviewService } from '@v3/app/services/review.service';
@@ -160,15 +160,18 @@ export class V3Page implements OnInit, OnDestroy {
160160
code: 'Messages',
161161
badges: 0,
162162
},
163-
{
164-
title: $localize`Due Status`,
165-
url: '/v3/due-dates',
166-
icon: 'alarm',
167-
code: 'DueDates',
168-
badges: 0,
169-
},
170163
];
171164

165+
if (isDevMode()) {
166+
this.appPages.push({
167+
title: $localize`Due Status`,
168+
url: '/v3/due-dates',
169+
icon: 'alarm',
170+
code: 'DueDates',
171+
badges: 0,
172+
});
173+
}
174+
172175
this.institutionName = this.storageService.getUser().institutionName || 'Practera';
173176
}
174177

0 commit comments

Comments
 (0)