Add basic dates tab (#62)
This is not the final visuals for the dates tab, but an in-progress page to base further work on. AA-116
This commit is contained in:
@@ -3,6 +3,9 @@ import { getConfig, camelCaseObject } from '@edx/frontend-platform';
|
||||
import { getAuthenticatedHttpClient, getAuthenticatedUser } from '@edx/frontend-platform/auth';
|
||||
import { logError } from '@edx/frontend-platform/logging';
|
||||
|
||||
// FIXME: remove this WIP hack once we're done developing the tab
|
||||
import datesTabData from './dates';
|
||||
|
||||
function overrideTabUrls(id, tabs) {
|
||||
// "LMS tab slug" to "MFE URL slug" for overridden tabs
|
||||
const tabOverrides = {};
|
||||
@@ -49,6 +52,16 @@ export async function getCourseMetadata(courseId) {
|
||||
return normalizeMetadata(data);
|
||||
}
|
||||
|
||||
export async function getTabData(courseId, tab, version) {
|
||||
if (tab === 'dates') {
|
||||
return camelCaseObject(datesTabData());
|
||||
}
|
||||
|
||||
const url = `${getConfig().LMS_BASE_URL}/course/${courseId}/api/course_home/${version}/${tab}`;
|
||||
const { data } = await getAuthenticatedHttpClient().get(url);
|
||||
return camelCaseObject(data);
|
||||
}
|
||||
|
||||
function normalizeBlocks(courseId, blocks) {
|
||||
const models = {
|
||||
courses: {},
|
||||
|
||||
Reference in New Issue
Block a user