From 3be8e65d85ad1617230289c4df0e2f7f7ad86473 Mon Sep 17 00:00:00 2001 From: Rajnish Dargan Date: Fri, 20 Dec 2024 10:24:57 +0530 Subject: [PATCH 1/2] Issue #PS-2876 feat: Integration of Learning Framework for content creation --- src/components/GenericEditor.tsx | 4 +- src/pages/api/mocked-response.ts | 262 +++++++++++++++++++------------ src/utils/app.config.ts | 5 + 3 files changed, 165 insertions(+), 106 deletions(-) diff --git a/src/components/GenericEditor.tsx b/src/components/GenericEditor.tsx index e0585c4..943471d 100644 --- a/src/components/GenericEditor.tsx +++ b/src/components/GenericEditor.tsx @@ -6,7 +6,7 @@ import 'izimodal/css/iziModal.css'; import 'izimodal/js/iziModal.js'; import editorConfig from './editor.config.json'; import { getLocalStoredUserId, getLocalStoredUserName } from "@/services/LocalStorageService"; -import { CHANNEL_ID, FRAMEWORK_ID, TENANT_ID } from "@/utils/app.config"; +import { CHANNEL_ID, CONTENT_FRAMEWORK_ID, TENANT_ID } from "@/utils/app.config"; const GenericEditor: React.FC = () => { const router = useRouter(); @@ -136,7 +136,7 @@ const GenericEditor: React.FC = () => { window['context'].contextRollUp.l1 = CHANNEL_ID; window['context'].tags = [CHANNEL_ID]; window['context'].channel = CHANNEL_ID; - window['context'].framework = FRAMEWORK_ID; + window['context'].framework = CONTENT_FRAMEWORK_ID; if (isLargeFileUpload || (_.get(data, 'contentDisposition') === 'online-only')) { window.context['uploadInfo'] = { isLargeFileUpload: true diff --git a/src/pages/api/mocked-response.ts b/src/pages/api/mocked-response.ts index 66d7ea3..d65c6b6 100644 --- a/src/pages/api/mocked-response.ts +++ b/src/pages/api/mocked-response.ts @@ -71,29 +71,33 @@ export const genericEditorSaveFormResponse = { "visible": true }, { - "code": "audience", + "code": "primaryUser", "dataType": "list", - "description": "Audience", + "description": "Primary User", "editable": true, "index": 5, "inputType": "multiselect", - "label": "Audience", - "name": "Audience", + "label": "Primary User", + "name": "Primary User", "range": [ { - "key": "Student", - "name": "Student" + "key": "Parents", + "name": "Parents" }, { - "key": "Teacher", - "name": "Teacher" + "key": "Educators", + "name": "Educators" }, { - "key": "Administrator", - "name": "Administrator" + "key": "Children", + "name": "Children" + }, + { + "key": "Volunteer", + "name": "Volunteer" } ], - "placeholder": "Select Audience", + "placeholder": "Select Primary User", "renderingHints": {}, "required": false, "visible": true @@ -183,140 +187,190 @@ export const genericEditorReviewFormResponse = { "visible": true }, { - "code": "state", + "code": "learningCategory", "visible": true, "depends": [ - "board", - "medium", - "gradeLevel", - "courseType", - "subject", - "topic" + "learningCategorySubset" ], "editable": true, "dataType": "text", "renderingHints": {}, - "description": "State", + "description": "Learning Category", "index": 5, - "label": "State", + "label": "Learning Category", "required": true, - "name": "State", + "name": "Learning Category", "inputType": "select", - "placeholder": "State" + "placeholder": "Select Learning Category" }, { - "code": "board", + "code": "learningCategorySubset", "visible": true, "depends": [ - "medium", - "gradeLevel", - "courseType", - "subject" ], "editable": true, "dataType": "text", "renderingHints": {}, - "description": "Board", + "description": "Learning Category Subset", "index": 6, - "label": "Board/Syllabus", + "label": "Learning Category Subset", "required": true, - "name": "Board/Syllabus", + "name": "Learning Category Subset", "inputType": "select", - "placeholder": "Select Board/Syllabus" + "placeholder": "Learning Category Subset" }, { - "code": "medium", - "visible": true, - "depends": [ - "gradeLevel", - "courseType", - "subject" - ], - "editable": true, + "code": "targetAgeGroup", "dataType": "list", - "renderingHints": {}, - "description": "", + "description": "Target Age group / Grade level (Who is the content targeted for?)", + "editable": true, "index": 7, - "label": "Medium", - "required": true, - "name": "medium", "inputType": "multiselect", - "placeholder": "Select Medium" - }, - { - "code": "gradeLevel", - "visible": true, - "depends": [ - "courseType", - "subject" + "label": "Target Age group", + "name": "Target Age group", + "range": [ + { + "key": "0-3 Years", + "name": "0-3 Years" + }, + { + "key": "3-6 Years", + "name": "3-6 Years" + }, + { + "key": "6-8 Years", + "name": "6-8 Years" + }, + { + "key": "8-11 Years", + "name": "8-11 Years" + }, + { + "key": "11-14 Years", + "name": "11-14 Years" + }, + { + "key": "14-18 Years", + "name": "14-18 Years" + }, + { + "key": "18 and above", + "name": "18 and above" + } ], - "editable": true, - "dataType": "list", + "placeholder": "Target Age group", "renderingHints": {}, - "description": "Class", - "index": 8, - "label": "Class", - "required": true, - "name": "Class", - "inputType": "multiselect", - "placeholder": "Select Class" + "required": false, + "visible": true }, { - "code": "courseType", - "visible": true, - "depends": [ - "subject" - ], - "editable": true, + "code": "primaryUser", "dataType": "list", - "renderingHints": {}, - "description": "", - "index": 9, - "label": "Course Type", - "required": true, - "name": "Course Type", - "inputType": "multiselect", - "placeholder": "Course Type" - }, - { - "code": "subject", - "visible": true, - "depends": [], + "description": "Primary User", "editable": true, - "dataType": "list", - "renderingHints": {}, - "description": "", - "index": 10, - "label": "Subject", - "required": true, - "name": "Subject", + "index": 8, "inputType": "multiselect", - "placeholder": "Select Subject" + "label": "Primary User", + "name": "Primary User", + "range": [ + { + "key": "Parents", + "name": "Parents" + }, + { + "key": "Educators", + "name": "Educators" + }, + { + "key": "Children", + "name": "Children" + }, + { + "key": "Volunteer", + "name": "Volunteer" + } + ], + "placeholder": "Select Primary User", + "renderingHints": {}, + "required": false, + "visible": true }, { - "code": "audience", - "dataType": "list", - "description": "Audience", + "code": "mediumOfLearning", + "dataType": "text", + "description": "Medium of Learning", "editable": true, - "index": 11, - "inputType": "multiselect", - "label": "Audience", - "name": "Audience", + "index": 8, + "inputType": "select", + "label": "Medium of Learning", + "name": "Medium of Learning", "range": [ { - "key": "Student", - "name": "Student" + "key": "Hindi", + "name": "Hindi" + }, + { + "key": "English", + "name": "English" + }, + { + "key": "Urdu", + "name": "Urdu" }, { - "key": "Teacher", - "name": "Teacher" + "key": "Sanskrit", + "name": "Sanskrit" }, { - "key": "Administrator", - "name": "Administrator" + "key": "Punjabi", + "name": "Punjabi" + }, + { + "key": "Gujarati", + "name": "Gujarati" + }, + { + "key": "Marathi", + "name": "Marathi" + }, + { + "key": "Tamil", + "name": "Tamil" + }, + { + "key": "Telugu", + "name": "Telugu" + }, + { + "key": "Kannada", + "name": "Kannada" + }, + { + "key": "Malayalam", + "name": "Malayalam" + }, + { + "key": "Odia", + "name": "Odia" + }, + { + "key": "Assamese", + "name": "Assamese" + }, + { + "key": "Bengali", + "name": "Bengali" + }, + { + "key": "Manipuri", + "name": "Manipuri" + }, + { + "key": "Kashmiri", + "name": "Kashmiri" } ], - "placeholder": "Select Audience", + "placeholder": "Medium of Learning", "renderingHints": {}, "required": false, "visible": true @@ -326,7 +380,7 @@ export const genericEditorReviewFormResponse = { "dataType": "text", "description": "Indicate if this should be visible on open school", "editable": true, - "index": 12, + "index": 9, "inputType": "select", "label": "Show on open school?", "name": "Open School Visibility", @@ -350,7 +404,7 @@ export const genericEditorReviewFormResponse = { "dataType": "text", "description": "Program", "editable": true, - "index": 13, + "index": 10, "inputType": "select", "label": "Program", "name": "Program", diff --git a/src/utils/app.config.ts b/src/utils/app.config.ts index 8876abf..407b422 100644 --- a/src/utils/app.config.ts +++ b/src/utils/app.config.ts @@ -36,6 +36,11 @@ if (!FRAMEWORK_ID) { console.warn('NEXT_PUBLIC_FRAMEWORK_ID is not set in the environment variables.'); } +export const CONTENT_FRAMEWORK_ID = process.env.NEXT_PUBLIC_CONTENT_FRAMEWORK_ID || ""; +if (!CONTENT_FRAMEWORK_ID) { + console.warn('NEXT_PUBLIC_CONTENT_FRAMEWORK_ID is not set in the environment variables.'); +} + export const CLOUD_STORAGE_URL = process.env.NEXT_PUBLIC_CLOUD_STORAGE_URL || ""; if (!CLOUD_STORAGE_URL) { console.warn('NEXT_PUBLIC_CLOUD_STORAGE_URL is not set in the environment variables.'); From 0fabf6452c4a2104a41ee5042e30cb15c3384023 Mon Sep 17 00:00:00 2001 From: Rajnish Dargan Date: Fri, 20 Dec 2024 10:30:02 +0530 Subject: [PATCH 2/2] Issue #PS-2876 feat: Integration of Learning Framework for content creation --- .env | 1 + 1 file changed, 1 insertion(+) diff --git a/.env b/.env index 3a4c03e..981c209 100644 --- a/.env +++ b/.env @@ -4,6 +4,7 @@ NEXT_PUBLIC_TENANT_ID="" # Tenant Id of User NEXT_PUBLIC_CLOUD_STORAGE_URL="" # Use environment variable for S3 Cloud Storage URL - should have / at the end. NEXT_PUBLIC_CHANNEL_ID="" # Channel Id of knowlg-inQuiry setup NEXT_PUBLIC_FRAMEWORK_ID="" # Framework Id of knowlg-inQuiry setup +NEXT_PUBLIC_CONTENT_FRAMEWORK_ID="" # Learning Framework Id for Content Creation NEXT_PUBLIC_TELEMETRY_URL="" #telemetry service path AWS_ACCESS_KEY_ID="" # For AWS S3 large file chunks upload AWS_ACCESS_SECRET_KEY="" # For AWS S3 large file chunks upload