boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

Add "reason for edit" optional input. #654

Open dcavins opened 5 years ago

dcavins commented 5 years ago

Achim on this support thread has some interesting ideas about enriching edits to a doc. https://wordpress.org/support/topic/revision-summary-2/#post-11462991

• Allow user to enter a reason for the edit, like bbPress or Wikipedia allow • Allow user to choose whether the notice of the edit would be emailed out or posted to the activity stream, like in the case of fixing a typo or something. • Potentially link from the activity stream entry directly to the file diff view.

These are interesting, but would have to be enabled by the site admin and I think would be off by default (because most of the complaints I hear are that the edit form is too complicated already).

boonebgorges commented 5 years ago

Thanks for bringing this ticket over. I have written a version of the second item for a client. Added a checkbox to the edit panel, and then:

/**
 *
 * Stop an activity item from being posted for a saved BuddyPress Doc when the 'minor edit' box
 * is checked.
 */
function cac_minor_doc_edit() {
    global $bp_docs;

    if ( isset( $_POST['doc-minor-edit'] ) ) {
        remove_action( 'bp_docs_doc_saved', 'bp_docs_post_activity' );
    }
}
add_action( 'bp_docs_doc_saved', 'cac_minor_doc_edit', 5 );

I like all three of these ideas, but I agree that they should be toggleable (at least in code) and maybe should be turned off by default (less sure about that)

dcavins commented 5 years ago

I also like all three of these ideas, too, and they seem like they offer a good ratio of broad usefulness/effort. I think it would be worth the effort (meaning I'd be happy to do the small work) to make them optional & toggleable from the docs settings pane. If we can decide on the language that would be good, like these overly wordy options:

• Add a "minor edit" checkbox on the edit form that, when selected, prevents an activity item from being created for the edit.

• Add a text input on the edit form allowing the user to note the reason for this edit.

• Links in "edited doc" activity items should link to the doc's "read" view. • Links in "edited doc" activity items should link to the doc's "revisions" view, if the user has access.

Are there any obvious functional issues that these changes would cause?

boonebgorges commented 5 years ago

I don't see any obvious functional problems with this. Thanks!