Skip to content
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

Conversation

pavankumar0408
Copy link
Contributor

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Ran Test A
  • Ran Test B

Test Configuration:

  • Software versions:
  • Hardware versions:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@rajnishdargan rajnishdargan changed the base branch from release-7.0.0_for_compass to release-7.0.0 December 19, 2023 05:08
@rajnishdargan rajnishdargan changed the base branch from release-7.0.0 to release-7.0.0_for_compass December 19, 2023 05:12
@@ -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;
Copy link
Contributor

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.

Copy link
Contributor Author

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){
Copy link
Contributor

@rajnishdargan rajnishdargan Dec 27, 2023

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

Copy link
Contributor Author

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",
Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

@rajnishdargan rajnishdargan Dec 27, 2023

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 ?

Copy link
Contributor Author

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()) {
Copy link
Contributor

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

Copy link
Contributor Author

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){
Copy link
Contributor

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

Copy link
Contributor Author

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 rajnishdargan changed the base branch from release-7.0.0_for_compass to release-7.1.0-dev December 28, 2023 09:03
@rajnishdargan rajnishdargan changed the base branch from release-7.1.0-dev to release-7.0.0 December 28, 2023 09:04
@rajnishdargan rajnishdargan changed the base branch from release-7.0.0 to release-7.0.0_for_compass January 3, 2024 09:07
@rajnishdargan rajnishdargan changed the base branch from release-7.0.0_for_compass to release-7.0.0 January 3, 2024 11:36
@rajnishdargan rajnishdargan changed the base branch from release-7.0.0 to release-7.0.0_for_compass January 3, 2024 11:37
@pavankumar0408
Copy link
Contributor Author

@rajnishdargan, sonar issue fixed

@rajnishdargan rajnishdargan changed the base branch from release-7.0.0_for_compass to release-7.1.0-dev January 22, 2024 09:21
@rajnishdargan rajnishdargan changed the base branch from release-7.1.0-dev to release-7.0.0_for_compass January 22, 2024 09:22
Copy link

sonarcloud bot commented Jan 22, 2024

@pavankumar0408
Copy link
Contributor Author

Another PR has been raised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants