-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from rajnishdargan/release-1.1.0
Issue #PS-3678 feat: Passing userSpecificBoard values to Editors
- Loading branch information
Showing
2 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,10 @@ const CollectionEditor: React.FC = () => { | |
}, | ||
config: { | ||
mode: mode || "edit", // edit / review / read / sourcingReview | ||
userSpecificFrameworkField: { | ||
code: "board", | ||
value: localStorage.getItem('userSpecificBoard') ? localStorage.getItem('userSpecificBoard') : [] | ||
}, | ||
maxDepth: 4, | ||
objectType: "Collection", | ||
primaryCategory: "Course", // Professional Development Course, Curriculum Course | ||
|
@@ -150,6 +154,8 @@ const CollectionEditor: React.FC = () => { | |
}, | ||
}; | ||
|
||
console.log('editorConfig ====>', editorConfig) | ||
|
||
const editorRef = useRef<HTMLDivElement | null>(null); | ||
const isAppendedRef = useRef(false); | ||
const [assetsLoaded, setAssetsLoaded] = useState(false); | ||
|
@@ -162,7 +168,7 @@ const CollectionEditor: React.FC = () => { | |
|
||
script.id = "collection-editor-js"; | ||
script.src = | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].1/sunbird-collection-editor.js"; | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].2/sunbird-collection-editor.js"; | ||
script.async = true; | ||
script.onload = () => setAssetsLoaded(true); | ||
document.body.appendChild(script); | ||
|
@@ -177,7 +183,7 @@ const CollectionEditor: React.FC = () => { | |
link.id = "collection-editor-css"; | ||
link.rel = "stylesheet"; | ||
link.href = | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].1/styles.css"; | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].2/styles.css"; | ||
document.head.appendChild(link); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,10 @@ const QuestionSetEditor: React.FC = () => { | |
}, | ||
config: { | ||
mode: mode || "edit", | ||
userSpecificFrameworkField: { | ||
code: "board", | ||
value: localStorage.getItem('userSpecificBoard') ? localStorage.getItem('userSpecificBoard') : [] | ||
}, | ||
enableQuestionCreation: true, | ||
enableAddFromLibrary: true, | ||
editableFields: { | ||
|
@@ -137,6 +141,8 @@ const QuestionSetEditor: React.FC = () => { | |
}, | ||
}; | ||
|
||
console.log('questionSetEditorConfig ====>', questionSetEditorConfig) | ||
|
||
const editorRef = useRef<HTMLDivElement | null>(null); | ||
const isAppendedRef = useRef(false); | ||
const [assetsLoaded, setAssetsLoaded] = useState(false); | ||
|
@@ -148,15 +154,15 @@ const QuestionSetEditor: React.FC = () => { | |
link.id = "sunbird-editor-css"; | ||
link.rel = "stylesheet"; | ||
link.href = | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].1/styles.css"; | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].2/styles.css"; | ||
document.head.appendChild(link); | ||
} | ||
|
||
if (!document.getElementById("sunbird-editor-js")) { | ||
const script = document.createElement("script"); | ||
script.id = "sunbird-editor-js"; | ||
script.src = | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].1/sunbird-questionset-editor.js"; | ||
"https://cdn.jsdelivr.net/npm/@tekdi/[email protected].2/sunbird-questionset-editor.js"; | ||
script.async = true; | ||
script.onload = () => setAssetsLoaded(true); | ||
document.body.appendChild(script); | ||
|