You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Kenton Taylor <kt...@slashdotmedia.com> on 2018/03/14 18:29:31 UTC

[allura:tickets] #8196 Save content before form submission



---

** [tickets:#8196] Save content before form submission**

**Status:** open
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Wed Mar 14, 2018 06:28 PM UTC
**Owner:** Kenton Taylor





---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Kenton Taylor <kt...@slashdotmedia.com>.
New rev pushed with a number of adjustments:

* Changed this to `WSGIHTTPException` for readability
* SimpleMDE autosave does not appear to work; even if it did, it's "forget before successful post" doesn't really meet our needs.
* sisyphus references are cruft from earlier experiments; removed

* SF reference removed
* RE: Memorable.initialize; good catch! it can, and has been changed. Didn't notice how those two had merged after a few refactors
* RE: length check; antispam input names make those names unusable as identifiers; however, refactored this to use a configurable regex.
* RE: slice vs loop; good suggestion, changed.
* the None just happens to be the class that element gets rendered with, and gets used as part of the key since it can be uniquely identified.  Might be worth exploring why that is in a separate ticket, but doesn't affect this work.
* Forget action is now decoupled from the individual inputs managers

* Cancel links now "forget" the relevant input fields on the form
* Logout now writes the memorable cookie to forget all (which self-destructs), but also means that memorable.js is registered at the template level, rather than at the EW level.


---

** [tickets:#8196] Save content before form submission**

**Status:** open
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Wed Mar 21, 2018 04:07 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Kenton Taylor <kt...@slashdotmedia.com>.
- **status**: open --> review



---

** [tickets:#8196] Save content before form submission**

**Status:** review
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Fri Mar 23, 2018 07:12 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Dave Brondsema <da...@brondsema.net>.
- **status**: review --> closed



---

** [tickets:#8196] Save content before form submission**

**Status:** closed
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Wed Mar 28, 2018 07:35 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Kenton Taylor <kt...@slashdotmedia.com>.
- **status**: in-progress --> review
- **Comment**:

New rev pushed:

- Added
- Removed
- Nested Reply
 - Leaving, as discussed
 - Fixed
 - Fixed



---

** [tickets:#8196] Save content before form submission**

**Status:** review
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Tue Mar 27, 2018 03:50 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Kenton Taylor <kt...@slashdotmedia.com>.
- Description has changed:

Diff:

~~~~

--- old
+++ new
@@ -0,0 +1,3 @@
+It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.
+
+Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.

~~~~

- **status**: in-progress --> review
- **Comment**:

First rev available at kt/8196.

* Applied only to Markdown inputs for now (and one vanilla text input as POC). 
* User-entered content should be persisted unless/until the form post results in something we interpret as a successful processing (currently an "ok" flash message, or a 302). 




---

** [tickets:#8196] Save content before form submission**

**Status:** review
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Wed Mar 14, 2018 06:44 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Dave Brondsema <da...@brondsema.net>.
- **status**: review --> open
- **Reviewer**: Dave Brondsema
- **Comment**:

Nice overall structure, and commenting/documentation.  This is going to be great.

* `memorable_forget`'s `_inner` should only catch HTTP exceptions I think.  Safer and more clear about what its doing.
* Does the SimpleMDE config `autosave:true` do anything?
* there are some `sisyphus` references I don't think we need
* blog post successful submit doesn't set memorable_forget cookie.  Same for a nested reply.

### `memorable.js`
* shouldn't use a `SF` namespace
* `Memorable.initialize` looks to do similar work as `Memorable.add`, could it call `add`?
* `name.length != 28` - what is that about?
* the loop`i = 3; i < list.length`... also could do .slice() and .join() instead of a loop
* commenting on a blog post generates storage key `/p/test/blog/_discuss/thread/ce912605/post__None`  is that None ok?  same for creating a new discussion topic.
* memorable_forget cookie only triggers clearing if memorable.js runs on the page?  Not too big a deal since the cookie will stick around until you visit a page with it, but maybe better to have clearing behavior run separate from the saving behavior

### User Experience
* if I intentionally navigate away, it may be surprising to see saved text from long ago when I come back.  (even more so if I click "cancel" on a form)
* maybe could refine our logic to only save for a duration of time?  not sure.  At a minimum we could have 'cancel' links clear the storage
* probably a separate ticket, but if i get logged out and then try to do a POST I get sent to /auth/ without any return_to.  Probably should have a return_to of the referrer (e.g. wiki edit, ticket edit page)
* should an intentional logout clear all the local storage?  I think so, for privacy.






---

** [tickets:#8196] Save content before form submission**

**Status:** open
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Wed Mar 14, 2018 06:45 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Kenton Taylor <kt...@slashdotmedia.com>.
- **status**: open --> in-progress



---

** [tickets:#8196] Save content before form submission**

**Status:** in-progress
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Wed Mar 14, 2018 06:28 PM UTC
**Owner:** Kenton Taylor





---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #8196 Save content before form submission

Posted by Dave Brondsema <da...@brondsema.net>.
- **status**: review --> in-progress
- **Comment**:

* invalidInputName could still use a comment explaining that it is to recognize antispam random names
* might as well remove the `autosave: true` from simplemde config if its not doing anything
* on a nested reply:
    * to use a saved value, you have to click the "reply" button again.  So its not obvious immediately that your content has been saved (under that particular post), but not sure if we want to automatically expand it
    * When you do start to restore a reply, you have to click into the editor for the text to show up.  Bug report https://github.com/sparksuite/simplemde-markdown-editor/issues/344 has a workaround, also mixed info there about whether an upgrade would fix it.
    * the saved value doesn't get cleared after a successful submit



---

** [tickets:#8196] Save content before form submission**

**Status:** in-progress
**Milestone:** unreleased
**Created:** Wed Mar 14, 2018 06:28 PM UTC by Kenton Taylor
**Last Updated:** Fri Mar 23, 2018 07:12 PM UTC
**Owner:** Kenton Taylor


It would be helpful to save form content before submitting, in case the Antispam spinner/honeypot rejects it, or you get logged out. And obvious restore the content when viewing the form again.

Use localStorage? Clear it after a successful submit? And/or after an hour? Also need to deal with spinner field names properly.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.