Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/143522
Change subject: Only allow one form of summarize or close to be open at a time
......................................................................
Only allow one form of summarize or close to be open at a time
Change-Id: Ie17f03ffcd5ff37a86ef60a3afeb915cd383c565
---
M handlebars/compiled/flow_block_topiclist.handlebars.php
M handlebars/flow_topic_titlebar_content.handlebars
M modules/new/components/flow-board.js
M tests/browser/features/close_reopen_topics.feature
M tests/browser/features/step_definitions/close_reopen_topics_steps.rb
M tests/browser/features/step_definitions/flow_steps.rb
M tests/browser/features/support/pages/flow_page.rb
7 files changed, 18 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/22/143522/1
diff --git a/handlebars/compiled/flow_block_topiclist.handlebars.php
b/handlebars/compiled/flow_block_topiclist.handlebars.php
index 48cad2f..99c7a71 100644
--- a/handlebars/compiled/flow_block_topiclist.handlebars.php
+++ b/handlebars/compiled/flow_block_topiclist.handlebars.php
@@ -128,9 +128,6 @@
'.LCRun3::ch($cx, 'escapeContent', Array(((is_array($in) &&
isset($in['summaryFormat'])) ? $in['summaryFormat'] : null),((is_array($in) &&
isset($in['summary'])) ? $in['summary'] : null)), 'encq').'
' : '').'
</div>
-<div class="flow-topic-edit-summary">
-
-</div>
'.((!LCRun3::ifvar($cx, ((is_array($in) && isset($in['isPreview'])) ?
$in['isPreview'] : null))) ? '
diff --git a/handlebars/flow_topic_titlebar_content.handlebars
b/handlebars/flow_topic_titlebar_content.handlebars
index c5c2350..e0ae2df 100644
--- a/handlebars/flow_topic_titlebar_content.handlebars
+++ b/handlebars/flow_topic_titlebar_content.handlebars
@@ -21,6 +21,3 @@
{{escapeContent summaryFormat summary}}
{{/if}}
</div>
-<div class="flow-topic-edit-summary">
- {{!-- placeholder where js will insert summary --}}
-</div>
diff --git a/modules/new/components/flow-board.js
b/modules/new/components/flow-board.js
index 036b792..9884fd5 100644
--- a/modules/new/components/flow-board.js
+++ b/modules/new/components/flow-board.js
@@ -418,7 +418,7 @@
$( this ).closest( '.flow-menu' ).removeClass( 'focus'
);
if ( info.status === 'done' ) {
- $target = info.$target.find(
'.flow-topic-edit-summary' );
+ $target = info.$target.find(
'.flow-topic-summary' );
// FIXME: API should take care of this for me.
result = data.flow[ 'view-post' ].result.topic;
diff --git a/tests/browser/features/close_reopen_topics.feature
b/tests/browser/features/close_reopen_topics.feature
index d1aeee4..942dc83 100644
--- a/tests/browser/features/close_reopen_topics.feature
+++ b/tests/browser/features/close_reopen_topics.feature
@@ -9,6 +9,15 @@
And I have created a Flow topic
When I click the Topic Actions link
And I click the Close topic button
+ And I click the Topic Actions link
+ And I click the Summarize link
+ And I do not see the close/reopen form
+
+ Scenario: Closing a topic and then changing your mind
+ Given I am on Flow page
+ And I have created a Flow topic
+ When I click the Topic Actions link
+ And I click the Close topic button
And I cancel the close/reopen topic form
And the page renders in 1 seconds
Then the top post is an open discussion
diff --git
a/tests/browser/features/step_definitions/close_reopen_topics_steps.rb
b/tests/browser/features/step_definitions/close_reopen_topics_steps.rb
index af73fa8..36e72f5 100644
--- a/tests/browser/features/step_definitions/close_reopen_topics_steps.rb
+++ b/tests/browser/features/step_definitions/close_reopen_topics_steps.rb
@@ -14,6 +14,10 @@
on(FlowPage).topic_reopen_button_element.when_present.click
end
+When(/^I click the Summarize link$/) do
+ on(FlowPage).topic_summarize_button_element.when_present.click
+end
+
When(/^I type "(.*?)" as the reason$/) do |reason|
on(FlowPage).topic_close_form_reason_element.when_present.clear()
# Focus textarea so that any menus that have been clicked lose their focus.
In Chrome these might disrupt the test as
diff --git a/tests/browser/features/step_definitions/flow_steps.rb
b/tests/browser/features/step_definitions/flow_steps.rb
index 2d0f47c..5611d61 100644
--- a/tests/browser/features/step_definitions/flow_steps.rb
+++ b/tests/browser/features/step_definitions/flow_steps.rb
@@ -47,7 +47,7 @@
end
When(/^I click the Topic Actions link$/) do
- on(FlowPage).topic_actions_link_element.when_present.click
+ on(FlowPage).topic_actions_link_element.click
end
When(/^I create a (.+) in Flow new topic$/) do |flow_title|
diff --git a/tests/browser/features/support/pages/flow_page.rb
b/tests/browser/features/support/pages/flow_page.rb
index 64020ad..7779afd 100644
--- a/tests/browser/features/support/pages/flow_page.rb
+++ b/tests/browser/features/support/pages/flow_page.rb
@@ -107,6 +107,9 @@
a(:topic_reopen_button) do |page|
page.topic_actions_menu_element.link_element(title: "Reopen topic")
end
+ a(:topic_summarize_button) do |page|
+ page.topic_actions_menu_element.link_element(title: "Summarize")
+ end
## Close topic workflow
form(:topic_close_form, css: ".flow-edit-form")
--
To view, visit https://gerrit.wikimedia.org/r/143522
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie17f03ffcd5ff37a86ef60a3afeb915cd383c565
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits