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

fix(core): WF| 'Save' button gets disabled when “Is past today“ is selected in 'Date/Time' column under 'Add Check Value' event #70

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

Deepika516
Copy link
Collaborator

WF| 'Save' button gets disabled when “Is past today“ is selected in 'Date/Time' column under 'Add Check Value' event

GH-68

Description

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.

Fixes #68

Type of change

Please delete options that are not relevant.

  • 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)
  • Intermediate change (work in progress)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

Copy link

==== Karma Test Coverage ====
Statements: 25.93% ( 125/482 )
Branches : 10.52% ( 24 /228 )
Functions : 12% ( 15 /125 )
Lines : 25.95% ( 122 /470 )

if (typeof node.node.state.get('value') !== 'undefined') {
valueExists = true;
} else if (
node.node.state.get('condition') === ConditionTypes.PastToday

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a suggestion for a small improvement that is not mandatory to follow. It involves removing one minor stuff.

let valueExists = false;

if (typeof node.node.state.get('value') !== 'undefined' || node.node.state.get('condition') === ConditionTypes.PastToday) {
  valueExists = true;
} else {
  valueExists = !!node.node.state.get('value');
}

the conditions are combined into a single 'if' statement, which checks if either the 'value' is defined or the condition is 'PastToday'.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Deepika516 please change this as well

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be disregarded as there may be more conditions in the future and need to add more "if" conditions.

Copy link

==== Karma Test Coverage ====
Statements: 25.87% ( 125/483 )
Branches : 10.52% ( 24 /228 )
Functions : 12% ( 15 /125 )
Lines : 25.9% ( 122 /471 )

Copy link

==== Karma Test Coverage ====
Statements: 25.87% ( 125/483 )
Branches : 10.52% ( 24 /228 )
Functions : 12% ( 15 /125 )
Lines : 25.9% ( 122 /471 )

@yeshamavani yeshamavani merged commit a91ebd7 into master Feb 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants