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

Commit

Permalink
feat: allow adding conditions to actions (#1332)
Browse files Browse the repository at this point in the history
* feat: allow adding conditions to actions

* chore: display value conditions

* chore: pdate internationalization language

* chore: fix condition creator modal and display existing conditions

* chore: start work on tests

* test: more work on tests

* test: fix tests

* chore: update source hashText since it was moved

* chore: allow multivalue entity selection

* chore: more renaming to imply conditions

* fix: multivalue entity conditions

* test: add multivalue tests

* fix: available condition matching and sorting

* chore: move conditions utilities to dedicated file

* chore: add comment for findNumberFromMemory

* chore: simplify elementsFromConditions

* chore: fix render condition logic more

* chore: move logic about action conditions to utility module

* test: add tests for dialog validity

* chore: add protection around setting selected entity to undefined

* fix: white font on add condition button

* chore: make picker robust to no entities

* fix: allow negative conditions

* chore: add info to errors and move utilities

* chore: spacing

* chore: remove "Entities or" from labels

* chore: more work on removing Entity Or from names fix setState bug

* chore: update models
  • Loading branch information
mattmazzola authored Oct 17, 2019
1 parent f5ae132 commit 0c96eea
Show file tree
Hide file tree
Showing 15 changed files with 4,610 additions and 192 deletions.
3,051 changes: 3,051 additions & 0 deletions cypress/fixtures/actionConditions.cl

Large diffs are not rendered by default.

710 changes: 710 additions & 0 deletions cypress/integration/regressionTs/actionConditions.spec.ts

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions cypress/support/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const selectors = {
buttonCreateEntity: '[data-testid="action-button-create-entity"]',
buttonCancel: '[data-testid="action-creator-cancel-button"]',
buttonDelete: '[data-testid="action-creator-delete-button"]',
buttonAddCondition: '[data-testid="action-creator-modal-button-add-condition"]',
inputResponse: '[data-testid="action-text-response"] [contenteditable="true"]',
inputRequiredConditions: '[data-testid="action-required-entities"] input',
inputDisqualifiedConditions: '[data-testid="action-disqualifying-entities"] input',
Expand All @@ -89,6 +90,18 @@ const selectors = {
buttonConfirm: '[data-testid="action-delete-confirm"]',
buttonCancel: '[data-testid="confirm-cancel-modal-cancel"]',
},
addConditionModal: {
modal: '[data-testid="condition-creator-modal-title"]',
buttonCreate: '[data-testid="condition-creator-button-create"]',
buttonCancel: '[data-testid="condition-creator-button-cancel"]',
buttonUseCondition: '[data-testid="condition-creator-modal-button-use-condition"]',
dropdownEntity: '[data-testid="condition-creator-modal-dropdown-entity"]',
dropdownOperator: '[data-testid="condition-creator-modal-dropdown-operator"]',
dropdownEnumValue: '[data-testid="condition-creator-modal-dropdown-enumvalue"]',
inputNumberValue: '[data-testid="condition-creator-modal-dropdown-numbervalue"] input',
existingCondition: '[data-testid="condition-creator-modal-existing-condition"]',
existingConditionMatch: '[data-testid="condition-creator-modal-existing-condition-match"]',
},
confirmCancelModal: {
buttonCancel: '[data-testid="confirm-cancel-modal-cancel"]',
buttonConfirm: '[data-testid="confirm-cancel-modal-accept"]',
Expand All @@ -104,14 +117,18 @@ const selectors = {
inputWebChat: 'input[placeholder="Type your message..."]',
buttonScoreActions: '[data-testid="score-actions-button"]',
buttonAbandon: '[data-testid="edit-dialog-modal-abandon-delete-button"]',
// TODO: Shouldn't have different test ids for enabled / disabled
buttonSelectAction: '[data-testid="action-scorer-button-clickable"]',
buttonSelectActionDisabled: '[data-testid="action-scorer-button-no-click"]',
buttonSave: '[data-testid="edit-teach-dialog-close-save-button"]',
actionScorerSetEntityActions: '[data-testid="action-scorer-action-set-entity"]',
actionScorerTextActions: '[data-testid="action-scorer-text-response"]',
actionScorer: {
enumActions: '[data-testid="action-scorer-action-set-entity"]',
rowField: '[data-automationid="DetailsRowFields"]',
buttonCreate: '[data-testid="action-scorer-add-action-button"]',
buttonSelected: '[data-testid="action-scorer-button-selected"]',
condition: '[data-testid="action-scorer-entities"]',
},
},
mergeModal: {
Expand Down Expand Up @@ -189,6 +206,7 @@ const selectors = {
messageFromMeException: '.wc-border-error-from-me',
messageColorException: '.wc-message-color-exception',
messageDownArrow: '.wc-message-downarrow',
activities: '[data-testid="web-chat-utterances"]',
buttonAddAction: '[data-testid="chat-edit-add-bot-response-button"]',
buttonAddInput: '[data-testid="chat-edit-add-user-input-button"]',
buttonBranch: '[data-testid="edit-dialog-modal-branch-button"]',
Expand Down
65 changes: 18 additions & 47 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.213.0",
"@conversationlearner/models": "0.214.0",
"@conversationlearner/webchat": "0.157.0",
"@cypress/webpack-preprocessor": "4.0.3",
"adaptivecards": "1.2.0",
Expand Down
Loading

0 comments on commit 0c96eea

Please sign in to comment.