Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
fix: fix typo and update cl models package version (#1410)
Browse files Browse the repository at this point in the history
* fix: update typo in the condition enum and update cl models package version
  • Loading branch information
msft-paulkim authored Dec 12, 2019
1 parent 8c7c4e7 commit d893d89
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cypress/fixtures/actionConditions.cl
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,7 @@
{
"entityId": "ba50584b-244c-4c73-83fe-b0bf04498714",
"value": 3,
"condition": "LESS_THEN_OR_EQUAL"
"condition": "LESS_THAN_OR_EQUAL"
}
],
"negativeConditions": [],
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"private": true,
"dependencies": {
"@conversationlearner/models": "0.218.0",
"@conversationlearner/models": "0.219.0",
"@conversationlearner/webchat": "0.157.0",
"@cypress/webpack-preprocessor": "4.0.3",
"@types/klaw-sync": "^6.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/Utils/actionCondition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const conditionDisplay: Record<CLM.ConditionType, string> = {
[CLM.ConditionType.GREATER_THAN]: '>',
[CLM.ConditionType.GREATER_THAN_OR_EQUAL]: '>=',
[CLM.ConditionType.LESS_THAN]: '<',
[CLM.ConditionType.LESS_THEN_OR_EQUAL]: '<=',
[CLM.ConditionType.LESS_THAN_OR_EQUAL]: '<=',
}

export const getEnumConditionName = (entity: CLM.EntityBase, enumValue: CLM.EnumValue): string => {
Expand Down Expand Up @@ -102,7 +102,7 @@ export const isValueConditionTrue = (condition: CLM.Condition, numberValue: numb
|| (condition.condition === CLM.ConditionType.GREATER_THAN && numberValue > condition.value)
|| (condition.condition === CLM.ConditionType.GREATER_THAN_OR_EQUAL && numberValue >= condition.value)
|| (condition.condition === CLM.ConditionType.LESS_THAN && numberValue < condition.value)
|| (condition.condition === CLM.ConditionType.LESS_THEN_OR_EQUAL && numberValue <= condition.value)
|| (condition.condition === CLM.ConditionType.LESS_THAN_OR_EQUAL && numberValue <= condition.value)
}

return isTrue
Expand Down Expand Up @@ -150,7 +150,7 @@ export const getUpdatedActionsUsingCondition = (actions: CLM.ActionBase[], exist
draftAction.requiredConditions.splice(requiredConditionIndex, 1, newCondition)
isActionUsingCondition = true
}

const negativeConditionIndex = draftAction.negativeConditions.findIndex(c => isConditionEqual(c, existingCondition))
if (negativeConditionIndex >= 0) {
draftAction.negativeConditions.splice(negativeConditionIndex, 1, newCondition)
Expand Down

0 comments on commit d893d89

Please sign in to comment.