-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pr to inquiry v2 #121
Pr to inquiry v2 #121
Changes from all commits
d225e0f
ab8a301
1f6fa6f
cdbc3e0
189ca99
bb5883e
aa70284
eb7163a
f280365
7224de1
739acab
6969508
8cac0b9
704e81c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,35 +253,41 @@ export class TreeService { | |
} | ||
|
||
updateEvaluable(nodeId){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method call of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inside the method we have condition based update for evalMode. If I keep outside this will requires more changes and testing now. |
||
this.treeCache.nodesModified[nodeId].metadata.eval = this.treeCache.nodesModified[nodeId].metadata.primaryCategory === this.configService.editorConfig.evaluableQuestionSet ? | ||
this.configService.editorConfig.server:this.configService.editorConfig.client; | ||
if(this.treeCache.nodesModified[nodeId].metadata.primaryCategory === this.configService.editorConfig.evaluableQuestionSet) { | ||
this.treeCache.nodesModified[nodeId].metadata.evalMode = this.configService.editorConfig.evalMode | ||
} | ||
if(!this.treeCache.nodesModified[nodeId].root){ | ||
this.treeCache.nodesModified[nodeId].metadata.eval = this.getFirstChild().data.primaryCategory === this.configService.editorConfig.evaluableQuestionSet? | ||
this.configService.editorConfig.server:this.configService.editorConfig.client; | ||
if(this.getFirstChild().data.primaryCategory === this.configService.editorConfig.evaluableQuestionSet) { | ||
this.treeCache.nodesModified[nodeId].metadata.evalMode = this.configService.editorConfig.evalMode; | ||
} | ||
this.overrideEvaluable(nodeId); | ||
} else { | ||
if(this.getFirstChild().data?.metadata.mode) { | ||
this.treeCache.nodesModified[nodeId].metadata.eval = this.getFirstChild().data.metadata.mode === this.configService.editorConfig.editorModeCheck ? | ||
this.configService.editorConfig.server:this.configService.editorConfig.client; | ||
const firstChild = this.getFirstChild().data?.metadata; | ||
if(firstChild?.serverMode) { | ||
this.treeCache.nodesModified[nodeId].metadata.evalMode = this.configService.editorConfig.evalMode; | ||
this.updateFirstChild(this.treeCache.nodesModified[nodeId].metadata.evalMode) | ||
} else if(!firstChild?.serverMode) { | ||
delete this.treeCache.nodesModified[nodeId].metadata.evalMode; | ||
delete $(this.treeNativeElement).fancytree('getRootNode').getFirstChild()?.data?.evalMode | ||
} | ||
this.updateFirstChild(this.treeCache.nodesModified[nodeId].metadata.eval) | ||
} | ||
} | ||
|
||
updateFirstChild(evalMode:any) { | ||
$(this.treeNativeElement).fancytree('getRootNode').getFirstChild().data.eval = evalMode; | ||
$(this.treeNativeElement).fancytree('getRootNode').getFirstChild().data.evalMode = evalMode; | ||
} | ||
|
||
getEval() { | ||
return this.getFirstChild().data?.eval?.mode === this.configService.editorConfig.server.mode || | ||
this.getFirstChild().data.metadata?.eval?.mode === this.configService.editorConfig.server.mode ? this.configService.editorConfig.serverSearch : this.configService.editorConfig.clientSearch | ||
if(this.getFirstChild().data?.serverMode || this.getFirstChild().data?.metadata?.serverMode) { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
overrideEvaluable(nodeId){ | ||
const firstNode = this.getFirstChild() | ||
if(this.getFirstChild().data.metadata.mode) { | ||
this.treeCache.nodesModified[nodeId].metadata.eval = firstNode.data.metadata.mode === this.configService.editorConfig.editorModeCheck ? | ||
this.configService.editorConfig.server:this.configService.editorConfig.client; | ||
if(this.getFirstChild().data?.metadata?.serverMode && firstNode.data?.metadata?.serverMode) { | ||
this.treeCache.nodesModified[nodeId].metadata.evalMode = this.configService.editorConfig.evalMode | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of taking this value from tree object can you set the
evalMode
ineditorConfig
take it fromeditorConfig
?I have doubt here calling treeService will give error for Question Editor flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is only for sending evalMode property to the resource library for composite search. Here, we are not making use of this inside editor just we are passing the configuration to library this will not break anything in editor flow.
@rajnishdargan