feat: Create three day streak celebration (#354)

Show learners a celebratory modal if they visit the learning mfe for 3 days in a row. Call edx-platform API to determine if they should see the celebration.
AA-304
This commit is contained in:
Matthew Piatetsky
2021-02-22 14:34:28 -05:00
committed by GitHub
parent 26a7b3b0de
commit 2525805aac
29 changed files with 2290 additions and 2902 deletions

View File

@@ -1,6 +1,7 @@
import { getConfig, camelCaseObject } from '@edx/frontend-platform';
import { getAuthenticatedHttpClient, getAuthenticatedUser } from '@edx/frontend-platform/auth';
import { logInfo } from '@edx/frontend-platform/logging';
import { appendBrowserTimezoneToUrl } from '../../utils';
export function normalizeBlocks(courseId, blocks) {
const models = {
@@ -153,7 +154,8 @@ function normalizeMetadata(metadata) {
}
export async function getCourseMetadata(courseId) {
const url = `${getConfig().LMS_BASE_URL}/api/courseware/course/${courseId}`;
let url = `${getConfig().LMS_BASE_URL}/api/courseware/course/${courseId}`;
url = appendBrowserTimezoneToUrl(url);
const { data } = await getAuthenticatedHttpClient().get(url);
return normalizeMetadata(data);
}