From c8998e4e36b401fbfb17d40c762b2bdd24539c7f Mon Sep 17 00:00:00 2001 From: Arif-tekdi-technologies Date: Wed, 11 Dec 2024 18:48:49 +0530 Subject: [PATCH 1/4] Issue #2784 feat: Course editor add from library filters --- src/services/ContentService.ts | 114 +++++++++++++++++---------------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/src/services/ContentService.ts b/src/services/ContentService.ts index 7717888..530f4a3 100644 --- a/src/services/ContentService.ts +++ b/src/services/ContentService.ts @@ -1,7 +1,15 @@ -import { getLocalStoredUserId , getLocalStoredUserRole} from "./LocalStorageService"; +import { + getLocalStoredUserId, + getLocalStoredUserRole, +} from "./LocalStorageService"; import { delApi, get, post } from "./RestClient"; import axios from "axios"; -import { MIME_TYPE, CHANNEL_ID, TENANT_ID, FRAMEWORK_ID } from "@/utils/app.config"; +import { + MIME_TYPE, + CHANNEL_ID, + TENANT_ID, + FRAMEWORK_ID, +} from "@/utils/app.config"; import { v4 as uuidv4 } from "uuid"; import { PrimaryCategoryValue, Role } from "@/utils/app.constant"; @@ -44,13 +52,13 @@ const defaultReqBody = { const upForReviewReqBody = { request: { filters: { - // createdBy: { userId}, + // createdBy: { userId}, }, sort_by: { lastUpdatedOn: "desc", }, }, -} +}; const getReqBodyWithStatus = ( status: string[], query: string, @@ -68,12 +76,30 @@ const getReqBodyWithStatus = ( } primaryCategory = primaryCategory.length === 0 ? PrimaryCategory : primaryCategory; - if(contentType==="discover-contents") -{ - const userRole = getLocalStoredUserRole(); + if (contentType === "discover-contents") { + const userRole = getLocalStoredUserRole(); + + if (state) { + return { + ...upForReviewReqBody, + request: { + ...upForReviewReqBody.request, + filters: { + ...upForReviewReqBody.request.filters, + status, + primaryCategory, + createdBy: { "!=": getLocalStoredUserId() }, + state: state, + }, + + query, + limit, + offset, + sort_by, + }, + }; + } - if(state) - { return { ...upForReviewReqBody, request: { @@ -82,56 +108,32 @@ const getReqBodyWithStatus = ( ...upForReviewReqBody.request.filters, status, primaryCategory, - createdBy:{"!=": getLocalStoredUserId()}, - state:state - + createdBy: { "!=": getLocalStoredUserId() }, }, - + query, limit, offset, sort_by, }, }; - } - - return { - ...upForReviewReqBody, - request: { - ...upForReviewReqBody.request, - filters: { - ...upForReviewReqBody.request.filters, - status, - primaryCategory, - createdBy:{"!=":getLocalStoredUserId()} - - }, - - query, - limit, - offset, - sort_by, - }, - }; -} -else if(contentType==="upReview") -{ - return { - ...upForReviewReqBody, - request: { - ...upForReviewReqBody.request, - filters: { - ...upForReviewReqBody.request.filters, - status, - primaryCategory, + } else if (contentType === "upReview") { + return { + ...upForReviewReqBody, + request: { + ...upForReviewReqBody.request, + filters: { + ...upForReviewReqBody.request.filters, + status, + primaryCategory, + }, + query, + limit, + offset, + sort_by, }, - query, - limit, - offset, - sort_by, - }, - }; -} + }; + } return { ...defaultReqBody, @@ -189,6 +191,7 @@ export const createQuestionSet = async () => { primaryCategory: "Practice Question Set", code: uuidv4(), createdBy: userId, + framework: FRAMEWORK_ID, }, }, }; @@ -197,7 +200,7 @@ export const createQuestionSet = async () => { const response = await axios.post(apiURL, reqBody, { headers: { "Content-Type": "application/json", - "tenantId": TENANT_ID, + tenantId: TENANT_ID, }, }); return response?.data; @@ -241,6 +244,7 @@ export const createCourse = async (userId: any) => { resourceType: "Course", primaryCategory: "Course", contentType: "Course", + framework: FRAMEWORK_ID, }, }, }; @@ -304,12 +308,12 @@ export const getContentHierarchy = async ({ const apiUrl: string = `/action/content/v3/hierarchy/${doId}`; try { - console.log('Request data', apiUrl); + console.log("Request data", apiUrl); const response = await get(apiUrl); // console.log('response', response); return response; } catch (error) { - console.error('Error in getContentHierarchy Service', error); + console.error("Error in getContentHierarchy Service", error); throw error; } }; @@ -320,7 +324,7 @@ export const getFrameworkDetails = async (): Promise => { const response = await axios.get(apiUrl); return response?.data; } catch (error) { - console.error('Error in getting Framework Details', error); + console.error("Error in getting Framework Details", error); return error; } }; From 7d01af35d71cce929a06c4f4886b2c9be75822b8 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Thu, 12 Dec 2024 14:38:26 +0530 Subject: [PATCH 2/4] Issue feat:Add author in rowdata for upfor review page --- src/pages/workspace/content/up-review/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/content/up-review/index.tsx b/src/pages/workspace/content/up-review/index.tsx index 6642ce3..229e692 100644 --- a/src/pages/workspace/content/up-review/index.tsx +++ b/src/pages/workspace/content/up-review/index.tsx @@ -74,7 +74,10 @@ const UpForReviewPage = () => { mimeType: item.mimeType, mode: item.mode, createdBy: item.createdBy, - creator: item.creator + creator: item.creator, + author: item.author + + })); From 0cf4c2ff9fdbf88a470d8bb5c3999b52f6f18e41 Mon Sep 17 00:00:00 2001 From: Arif-tekdi-technologies Date: Thu, 12 Dec 2024 16:07:58 +0530 Subject: [PATCH 3/4] Issue #2322 feat: Workspace improvements and Fixes --- src/components/CollectionEditor.tsx | 1 + src/components/QuestionSetEditor.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/CollectionEditor.tsx b/src/components/CollectionEditor.tsx index 961b08f..00fb512 100644 --- a/src/components/CollectionEditor.tsx +++ b/src/components/CollectionEditor.tsx @@ -247,6 +247,7 @@ const CollectionEditor: React.FC = () => { event.detail?.action === "publishContent" || event.detail?.action === "rejectContent" ) { + localStorage.removeItem("contentMode"); window.history.back(); window.addEventListener( "popstate", diff --git a/src/components/QuestionSetEditor.tsx b/src/components/QuestionSetEditor.tsx index e9a8a63..f05a9b9 100644 --- a/src/components/QuestionSetEditor.tsx +++ b/src/components/QuestionSetEditor.tsx @@ -197,6 +197,7 @@ const QuestionSetEditor: React.FC = () => { event.detail?.action === "publishContent" || event.detail?.action === "rejectContent" ) { + localStorage.removeItem("contentMode"); window.history.back(); window.addEventListener( "popstate", From 1a793bba982798bd53126570ae19f88fecaad3a9 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Thu, 12 Dec 2024 17:55:12 +0530 Subject: [PATCH 4/4] Issue #PS-2753 feat : Implemention of telemetry for V1 player --- src/components/V1-Player/V1Player.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/V1-Player/V1Player.tsx b/src/components/V1-Player/V1Player.tsx index a8107cb..a27da05 100644 --- a/src/components/V1-Player/V1Player.tsx +++ b/src/components/V1-Player/V1Player.tsx @@ -1,3 +1,4 @@ +import { getTelemetryEvents } from "@/utils/Helper"; import React, { useRef, useEffect } from "react"; interface PlayerProps { @@ -17,7 +18,10 @@ const V1Player = ({ playerConfig }: PlayerProps) => { const handleLoad = () => { setTimeout(() => { - if (preview.contentWindow && preview.contentWindow.initializePreview) { + if ( + preview.contentWindow && + preview.contentWindow.initializePreview + ) { preview.contentWindow.initializePreview(playerConfig); } preview.contentWindow.addEventListener("message", (event: any) => { @@ -26,12 +30,13 @@ const V1Player = ({ playerConfig }: PlayerProps) => { preview.addEventListener("renderer:telemetry:event", (event: any) => { console.log("V1 player telemetry event ===>", event); - if (event.detail.telemetryData.eid === 'START') { + if (event.detail.telemetryData.eid === "START") { console.log("V1 player telemetry START event ===>", event); } - if (event.detail.telemetryData.eid === 'END') { + if (event.detail.telemetryData.eid === "END") { console.log("V1 player telemetry END event ===>", event); } + getTelemetryEvents(event.detail.telemetryData, "v1"); }); }, 100); };