-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1049 from openedx/sundas/INF-1360
fix: fixed environment variable issue for email cadence
- Loading branch information
Showing
7 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import showEmailChannel from './utils'; | ||
|
||
export const NOTIFICATION_CHANNELS = showEmailChannel(); | ||
|
||
export const EMAIL_CADENCE = { | ||
const EMAIL_CADENCE = { | ||
DAILY: 'Daily', | ||
WEEKLY: 'Weekly', | ||
IMMEDIATELY: 'Immediately', | ||
NEVER: 'Never', | ||
}; | ||
|
||
export default EMAIL_CADENCE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import { getConfig } from '@edx/frontend-platform'; | ||
|
||
const showEmailChannel = () => ({ WEB: 'web', ...(getConfig().SHOW_EMAIL_CHANNEL === 'true' && { EMAIL: 'email' }) }); | ||
export const notificationChannels = () => ({ WEB: 'web', ...(getConfig().SHOW_EMAIL_CHANNEL === 'true' && { EMAIL: 'email' }) }); | ||
|
||
export default showEmailChannel; | ||
export const shouldHideAppPreferences = (preferences, appId) => { | ||
const appPreferences = preferences.filter(pref => pref.appId === appId); | ||
|
||
if (appPreferences.length !== 1) { | ||
return false; | ||
} | ||
|
||
const firstPreference = appPreferences[0]; | ||
|
||
return firstPreference?.id === 'core' && (!firstPreference.coreNotificationTypes?.length); | ||
}; |