From 75d6f86465508f5584fc41b7690f9f2cc48eb412 Mon Sep 17 00:00:00 2001 From: Giovanni Di Milia Date: Tue, 28 Jun 2016 16:41:51 -0400 Subject: [PATCH 1/3] Removed upgrade logic from the frontend --- static/js/util/courseList.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/static/js/util/courseList.js b/static/js/util/courseList.js index 51207a9553..5dde3b6def 100644 --- a/static/js/util/courseList.js +++ b/static/js/util/courseList.js @@ -70,23 +70,11 @@ export function makeCourseStatusDisplay(course: Course, now: moment = moment()): ; } case STATUS_ENROLLED_NOT_VERIFIED: { - if (!firstRun.verification_date) { - // Invalid case, API should always send a valid verification date - return ""; - } - let courseUpgradeUrl = `${SETTINGS.edx_base_url}/course_modes/choose/${firstRun.course_id}/`; - - let verificationDate = moment(firstRun.verification_date); - if (verificationDate.isAfter(now, 'day')) { - return ; - } else { - // User cannot verify anymore - return ""; - } + return ; } case STATUS_OFFERED_NOT_ENROLLED: { if (!firstRun.enrollment_start_date && firstRun.fuzzy_enrollment_start_date !== undefined ) { From c7d1c3a345b463c0d1547fb5fcdd141e463b26de Mon Sep 17 00:00:00 2001 From: Giovanni Di Milia Date: Tue, 28 Jun 2016 16:57:07 -0400 Subject: [PATCH 2/3] Tests fixed --- static/js/util/courseList_test.js | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/static/js/util/courseList_test.js b/static/js/util/courseList_test.js index 0e853fe8ba..9e755fd8bf 100644 --- a/static/js/util/courseList_test.js +++ b/static/js/util/courseList_test.js @@ -99,19 +99,11 @@ describe('courseList functions', () => { }, moment(today)), "33%"); }); - it("is an enrolled course with no verification date", () => { - assert.equal(renderCourseStatusDisplay({ - status: STATUS_ENROLLED_NOT_VERIFIED, - runs: [] - }, moment(today)), ""); - }); - - it("is an enrolled course with a verification date of tomorrow", () => { + it("is an enrolled course but not verified", () => { assert.equal( renderCourseStatusDisplay({ status: STATUS_ENROLLED_NOT_VERIFIED, runs: [{ - verification_date: tomorrow, title: "Run title" }], }, moment(today)), @@ -119,24 +111,6 @@ describe('courseList functions', () => { ); }); - it("is an enrolled course with a verification date of today", () => { - assert.equal(renderCourseStatusDisplay({ - status: STATUS_ENROLLED_NOT_VERIFIED, - runs: [{ - verification_date: today - }] - }, moment(today)), ""); - }); - - it("is an enrolled course with a verification date of yesterday", () => { - assert.equal(renderCourseStatusDisplay({ - status: STATUS_ENROLLED_NOT_VERIFIED, - runs: [{ - verification_date: yesterday - }] - }, moment(today)), ""); - }); - it("is an offered course with no enrollment start date", () => { assert.equal(renderCourseStatusDisplay({ status: STATUS_OFFERED_NOT_ENROLLED, @@ -224,7 +198,7 @@ describe('courseList functions', () => { describe("makeRunStatusDisplay", () => { it('shows Course passed when a course is passed', () => { - assert.equal("Passed", makeRunStatusDisplay({ + assert.equal("Passed", makeRunStatusDisplay({ status: STATUS_PASSED, runs: [] })); From 85589d76bc54cf1fd0ccd5bcd14a9a7809e8dd12 Mon Sep 17 00:00:00 2001 From: Giovanni Di Milia Date: Fri, 1 Jul 2016 07:59:41 -0400 Subject: [PATCH 3/3] Removed some (now) useless cases in constants --- static/js/constants.js | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/static/js/constants.js b/static/js/constants.js index 0741dde010..dcc7216f39 100644 --- a/static/js/constants.js +++ b/static/js/constants.js @@ -214,7 +214,6 @@ export const DASHBOARD_RESPONSE = [ "id": 7, "status": STATUS_ENROLLED_NOT_VERIFIED, "title": "Not verified run", - "verification_date": "2200-01-01T03:00:00Z", "course_id": "not-verified", "position": 0 } @@ -257,36 +256,6 @@ export const DASHBOARD_RESPONSE = [ } ] }, - { - "id": 13, - "status": STATUS_ENROLLED_NOT_VERIFIED, - "title": "Enrolled, no verification date - no status text", - "position_in_program": 7, - "runs": [ - { - "title": "Enrolled no verification date", - "status": STATUS_ENROLLED_NOT_VERIFIED, - "position": 0, - "course_id": "course_id", - "id": 11 - } - ] - }, - { - "id": 14, - "position_in_program": 8, - "title": "enrolled not verified, verification date passed - no status text", - "status": STATUS_ENROLLED_NOT_VERIFIED, - "runs": [ - { - "position": 0, - "id": 12, - "status": STATUS_ENROLLED_NOT_VERIFIED, - "title": "enrolled not verified, verification date passed", - "verification_date": "2000-01-01" - } - ] - }, { "id": 15, "position_in_program": 9,