-
Notifications
You must be signed in to change notification settings - Fork 3
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
M2-7011: feat conditional logic extend item type #883
M2-7011: feat conditional logic extend item type #883
Conversation
…swerValidator, adding fieldValue to time range and improving payloads
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.
Some minor nit changes, but good overall 🤓. Will do a local test run of all logical conditions. Ok to pre-approve
// @ts-expect-error | ||
delete updatedCondition.itemName; | ||
switch (condition.type) { |
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.
Some cases are missing from this one, that aren't straightforward
payload: {
value: number;
};
General conditions
case 'BETWEEN':
case 'OUTSIDE_OF':
Row option conditions
case 'EQUAL_TO_ROW_OPTION':
case 'NOT_EQUAL_TO_ROW_OPTION':
Slider row conditions
case 'GREATER_THAN_SLIDER_ROWS':
case 'LESS_THAN_SLIDER_ROWS':
case 'EQUAL_TO_SLIDER_ROWS':
case 'NOT_EQUAL_TO_SLIDER_ROWS':
case 'BETWEEN_SLIDER_ROWS':
case 'OUTSIDE_OF_SLIDER_ROWS':
Should those be added?
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.
not really, thats not necessary, but it would be good, actually no one of the items added are necessary as long as I have "updatedCondition.payload = condition.payload;", but I really think this mapper that I created helps to understand how the payload is working, and being applied, so I will add a "case" for those that is missing.
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 only ones I dont recommend to be mapped, right now is BETWEEN, OUSIDE_OF, GREATER_THAN ..., because its being used for multiples parts and it must to be generic (due a lot of payload), or we could map but keep it generic with same payload of "default"
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 I added a case for those ones that are specific, like GREATER_THAN_SLIDER_ROWS ...
Co-authored-by: André Vital <[email protected]>
… fixing order of condition, improving isValidTimeFormat validation, and creating a parse Time string
…ons, and fixing unit tests
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.
Looks good!
Note: Would seriously prefer if the ===
changes are added 🤓
const inputMinutes = timeToMinutes(input); | ||
const conditionMinutes = timeToMinutes(time); | ||
|
||
const result = inputMinutes == conditionMinutes; |
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.
👀
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.
Looks good!
📝 Description
🔗 Jira Ticket M2-7011
This PR is focused to extend and create item types and conditional logic.
here is described the rules it must to follow:
https://mindlogger.atlassian.net/wiki/spaces/MINDLOGGER1/pages/596410369/Item+Flow+-+Extend+the+list+of+supported+Item+Types
📸 Screenshots
Screen.Recording.2024-10-28.at.2.02.27.PM.mov
Screen.Recording.2024-10-27.at.9.29.36.PM.mov
🪤 Peer Testing
1 - Launch admin app, and create a new applet or open an existed one.
2 - go to the items and create the items you would like to test, example, Date, Message, Text ...
3 - click on "item flow" tab and create your conditional logic, example:
4 - launch the app and choose the applet you created.
5 - check if the logic is working, I left a video sample to demonstrate one of the logics.
✏️ Notes
For it works on development it depends of the backend, the backend branch I am testing is: ffeature/M2-8209_adding_FieldName_to_time_payload
Somehow when you create a condition on admin side, the date looks little different, so its super important makes a validation based on what was inserted on API