Framework Details.

Background:

Presently BMGS is hardcoded for Framework request. If we want to change this label as category1, category2, category3 and category4 then we have to change the framework request.

Jira ticket:https://project-sunbird.atlassian.net/browse/ED-1959

Problem Statement :

1.What is the new API request for getFrameworkDetails? (We invoke the getFrameworkDetails api with default framework(BMGS) to get the framework categories as BMGS but to get categorie for multiple framework what API should call?

1.How to handle different categories for multiple frameworks(framework1-board, medium, grade, subject. framework2-department, block)?

2. Suppose default framework is framework1. so, it’s showing board, medium and grade label in onboarding page. now we select framework2. Then BMG label will change to department, block or what happen??

3. If user change framework on profile edit page then BMGS label should change?

Key Design Problem:

  1. Create a form

  2. Store multiple frameworks keys as category1, category2

  3. Check the label is updating or not for selected framework

Design :

Framework-Details Api’s

Update framework api request as category[i] and we have to change the framework details response categories code also in sunbird SDK.

export enum FrameworkCategoryCode { BOARD = 'board', MEDIUM = 'medium', GRADE_LEVEL = 'gradeLevel', SUBJECT = 'subject', TOPIC = 'topic', PURPOSE = 'purpose' }

Now change the framework request BMGS to category[i]

export enum FrameworkCategoryCode1 { CATEGORY1 = 'category1', CATEGORY2 = 'category2', CATEGORY3 = 'category3', CATEGORY4 = 'category4', TOPIC = 'topic', PURPOSE = 'purpose' }

apiRequest.parameters for new request:

{categories: "category1,category2,category3,category4"}

Categories Response for category1:

Remove BMGS hardcoded and use category1 for board, category2 for medium, category3 for gradeLevel and category4 for subject in mobile.

  1. Onboarding : a) Remove BMGS hardcoded and use category1 for board, category2 for medium and category3 for grade in HTML and TS file.

b. we have to use proper methods and variables name for board, medium and grade(onMediumChange, mediumControl, mediumList ) 

c. Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2 and category3

Change FrameworkCategoryCode.BOARD to FrameworkCategoryCode.CATEGORY1

Change FrameworkCategoryCode.MEDIUM to FrameworkCategoryCode.CATEGORY2

Change FrameworkCategoryCode.GRADE_LEVEL to FrameworkCategoryCode.CATEGORY3

2. Guest Profile :

a) Remove BMGS hardcoded and use category1 for board, category2 for medium and category3 for grade in HTML and TS file.

b). Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4

3. Guest Edit Profile / Edit logged In profile:

  1. a) Remove BMGS hardcoded and use category1 for board, category2 for medium and category3 for grade in HTML and TS file.

b. we have to use proper methods and variables name for board, medium and grade(onMediumChange, mediumControl, mediumList ) 

c. Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4

Update boardCategoryTermsRequet as category1TermsRequest, category2TermsRequest for medium . category3TermsRequest for grade

4. Logged In Profile : a) Remove BMGS hardcoded and use category1 for board, category2 for medium, category3 for grade and category4 for subject TS file.

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4

5.Help Section (faq-report-issue.page.ts) :

a) Remove BMGS hardcoded and use category1 for board, category2 for medium, category3 for grade and category4 for subject in HTML and TS file

b. Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4

6. relevent-content.page.ts:

a) Remove BMGS hardcoded and use category1 for board, category2 for medium, category3 for grade and category4 for subject TS file

b. Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4

7.search :

a) Remove BMGS hardcoded and use category1 for board, category2 for medium, category3 for grade and category4 for subject TS file

b. Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4.

8. Update User Profile (update-profile.service.ts):

a) Remove BMGS hardcoded and use category1 for board, category2 for medium, category3 for grade and category4 for subject TS file

b. Update framework API’s request with category[i].

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4.

DEFAULT_FRAMEWORK_CATEGORIES should be category1, category2, category3 and category4.