Skip to content

Check confirmation value on chat close#4

Merged
ruKurz merged 1 commit intomasterfrom
hotfix/#3-cancel-close
Sep 14, 2017
Merged

Check confirmation value on chat close#4
ruKurz merged 1 commit intomasterfrom
hotfix/#3-cancel-close

Conversation

@mrsimpson
Copy link
Copy Markdown
Member

fixes #3

return false;
}
//inputValue is false on "cancel" and has a string value of the input if confirmed.
if (!(typeof inputValue === 'boolean' && inputValue === false)) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@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?

Copy link
Copy Markdown

@ruKurz ruKurz Sep 11, 2017

Choose a reason for hiding this comment

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

As non JS expert I would say:

if (isNotEmptyOrWhitespaceOnly(inputValue)) {
  // save & close
} else {
  // cancel
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think there should be three cases handled when closing a conversation:

  1. Close and store
  2. Close and do not store
  3. Do not close / cancel the dialog

As far as I understand the code, now it is possible to

  1. close and store
  2. cancel the dialog

@mrsimpson WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ruKurz what's the business value of "Close and do not store"
Would this be an explicit decision by the user?

Copy link
Copy Markdown

@ruKurz ruKurz Sep 12, 2017

Choose a reason for hiding this comment

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

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".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ruKurz I extracted the check into a separate method. Any objections merging it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ruKurz whether we provide a "close but don't store" is another decision, imho.

@mrsimpson mrsimpson requested a review from ruKurz September 11, 2017 11:30
@mrsimpson mrsimpson self-assigned this Sep 11, 2017
Copy link
Copy Markdown

@ruKurz ruKurz left a comment

Choose a reason for hiding this comment

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

I assume all the other lines are just modified for formatting.

@mrsimpson mrsimpson force-pushed the hotfix/#3-cancel-close branch from 5883245 to 0dd1228 Compare September 13, 2017 05:22
@ruKurz ruKurz merged commit ffdfee9 into master Sep 14, 2017
@ruKurz
Copy link
Copy Markdown

ruKurz commented Sep 14, 2017

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.

#6

@ruKurz ruKurz deleted the hotfix/#3-cancel-close branch September 14, 2017 11:42
mrsimpson pushed a commit that referenced this pull request Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants