Conversation
| return false; | ||
| } | ||
| //inputValue is false on "cancel" and has a string value of the input if confirmed. | ||
| if (!(typeof inputValue === 'boolean' && inputValue === false)) { |
There was a problem hiding this comment.
@ruKurz I could have also validated that there is a String provided for the same result.
However, as an empty String ("") is evaluated as false in JS, I opted for the inverse.-
wdyt?
There was a problem hiding this comment.
As non JS expert I would say:
if (isNotEmptyOrWhitespaceOnly(inputValue)) {
// save & close
} else {
// cancel
}
There was a problem hiding this comment.
I think there should be three cases handled when closing a conversation:
- Close and store
- Close and do not store
- Do not close / cancel the dialog
As far as I understand the code, now it is possible to
- close and store
- cancel the dialog
@mrsimpson WDYT?
There was a problem hiding this comment.
@ruKurz what's the business value of "Close and do not store"
Would this be an explicit decision by the user?
There was a problem hiding this comment.
Yes, I think the "explicit decision" is a benefit. But if you aim to grab as much data with Smarti as possible the "close and do not store option" would cause the lose of conversational data.
So the trade-off is "user control" vs. "data octopus".
There was a problem hiding this comment.
@ruKurz I extracted the check into a separate method. Any objections merging it?
There was a problem hiding this comment.
@ruKurz whether we provide a "close but don't store" is another decision, imho.
ruKurz
left a comment
There was a problem hiding this comment.
I assume all the other lines are just modified for formatting.
5883245 to
0dd1228
Compare
|
Since this issue addresses a bug fix, a new Issue has been opened to discuss wether "Close and do not store" is a required feature or not and if this is part of RC or Smarti. |
fixes #3