-
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
Conversation
…d-inQuiry/editor into pr-to-inquiry-v2
@@ -214,7 +214,7 @@ export class MetaFormComponent implements OnChanges, OnDestroy { | |||
field.default = _.get(metaDataFields, 'recordedBy') !== 'Self' ? 'Yes' : 'No' ; | |||
} | |||
if (field.code === 'mode') { | |||
field.default = _.get(metaDataFields, 'eval.mode') | |||
field.default = _.get(metaDataFields, 'evalMode') == this.configService.editorConfig.evalMode || _.get(metaDataFields, 'mode') === true ? true : false; |
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.
@pavankumar0408 Instead of field.code === 'mode'
can we use different name for this field say serverMode
.
Editor config have a mode property and it's creating confusion at a first look what this mode is. Please provide a meaningful name to this field.
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.
done changed to serverMode
@@ -1007,7 +1007,9 @@ export class QuestionComponent implements OnInit, AfterViewInit, OnDestroy { | |||
this.editorService.data = {}; | |||
this.editorService.selectedSection = selectedUnitId; | |||
let metaData = this.getQuestionMetadata(); | |||
metaData.eval = activeNode?.data.metadata?.eval || data?.data?.eval; | |||
if(activeNode?.data.metadata?.evalMode || data?.data?.evalMode || data?.data?.metadata?.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.
I think this can be refactored:
Can you try below code for it -
const evalMode = activeNode?.data?.metadata?.evalMode || data?.data?.evalMode || data?.data?.metadata?.evalMode;
if (evalMode) {
metaData.evalMode = evalMode;
}
And can you tell me why we are checking evalMode
in all these place
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.
done
"serverSearch": "{\"mode\":\"server\"}", | ||
"clientSearch": "{\"mode\":\"client\"}", | ||
"evalMode": "server", | ||
"client": "client", |
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.
Are these these properties getting used any where?
"client": "client",
"serverMode": "yes",
"notServerMode": "no",
If not used please remove it.
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.
done
@@ -6,6 +6,7 @@ export const treeNode = { | |||
"keywords": [ | |||
"test" | |||
], | |||
"mode": true, |
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.
Note: mode
should be renamed to meaningful name.
Are we storing both mode
and evalMode
in question/questionset metadata for enabling server side evaluation ?
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.
done. We are storing evalMode for server side evaluation
@@ -552,7 +552,9 @@ export class EditorComponent implements OnInit, OnDestroy, AfterViewInit { | |||
searchFormConfig: this.questionlibraryInput.searchFormConfig, | |||
metadataFormConfig: this.questionlibraryInput.metadataFormConfig | |||
}; | |||
this.questionlibraryInput.collection.eval = this.treeService.getEval(); | |||
if(this.treeService.getEval()) { |
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
in editorConfig
take it from editorConfig
?
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
@@ -253,35 +253,40 @@ export class TreeService { | |||
} | |||
|
|||
updateEvaluable(nodeId){ |
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.
The method call of updateEvaluable
in this service can you call it based on some condition check
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.
Inside the method we have condition based update for evalMode. If I keep outside this will requires more changes and testing now.
@rajnishdargan
@rajnishdargan, sonar issue fixed |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Another PR has been raised |
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
Please choose appropriate options.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: