FEATURE: Shared Drafts

This feature can be enabled by choosing a destination for the
`shared drafts category` site setting.

* Staff members can create shared drafts, choosing a destination
category for the topic when it is published.

* Shared Drafts can be viewed in their category, or above the
topic list for the destination category where it will end up.

* When the shared draft is ready, it can be published to the
appropriate category by clicking a button on the topic view.

* When published, Drafts change their timestamps to the current
time, and any edits to the original post are removed.
This commit is contained in:
Robin Ward
2018-03-13 15:59:12 -04:00
parent dcbd9635f4
commit b9abd7dc9e
59 changed files with 851 additions and 260 deletions

View File

@ -91,6 +91,22 @@ QUnit.test('replying to post - reply_as_new_topic', assert => {
});
});
QUnit.test('shared draft', assert => {
let composerActions = selectKit('.composer-actions');
visit("/");
click('#create-topic');
andThen(() => {
composerActions.expand().selectRowByValue('shared_draft');
});
andThen(() => {
assert.equal(
find('#reply-control .btn-primary.create .d-button-label').text(),
I18n.t('composer.create_shared_draft')
);
assert.ok(find('#reply-control.composing-shared-draft').length === 1);
});
});
QUnit.test('interactions', assert => {
const composerActions = selectKit('.composer-actions');
@ -137,7 +153,7 @@ QUnit.test('interactions', assert => {
assert.equal(composerActions.rowByIndex(0).value(), 'reply_to_post');
assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message');
assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic');
assert.equal(composerActions.rowByIndex(3).value(), undefined);
assert.equal(composerActions.rowByIndex(3).value(), 'shared_draft');
});
composerActions.selectRowByValue('reply_as_private_message').expand();