-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Remove success banner on container state change #14659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,10 +2,11 @@ | |
| * Subviews (usually small side panels) for XBlockContainerPage. | ||
| */ | ||
| define(['jquery', 'underscore', 'gettext', 'js/views/baseview', 'common/js/components/utils/view_utils', | ||
| 'js/views/utils/xblock_utils'], | ||
| function($, _, gettext, BaseView, ViewUtils, XBlockViewUtils) { | ||
| var VisibilityState = XBlockViewUtils.VisibilityState, | ||
| disabledCss = 'is-disabled'; | ||
| 'js/views/utils/xblock_utils', 'js/views/utils/move_xblock_utils'], | ||
| function($, _, gettext, BaseView, ViewUtils, XBlockViewUtils, MoveXBlockUtils) { | ||
| 'use strict'; | ||
|
||
|
|
||
| var disabledCss = 'is-disabled'; | ||
|
|
||
| /** | ||
| * A view that refreshes the view when certain values in the XBlockInfo have changed | ||
|
|
@@ -132,6 +133,8 @@ define(['jquery', 'underscore', 'gettext', 'js/views/baseview', 'common/js/compo | |
| return xblockInfo.save({publish: 'make_public'}, {patch: true}); | ||
| }).always(function() { | ||
| xblockInfo.set('publish', null); | ||
| // Hide any move notification if present. | ||
| MoveXBlockUtils.hideMovedNotification(); | ||
| }).done(function() { | ||
| xblockInfo.fetch(); | ||
| }); | ||
|
|
@@ -151,6 +154,8 @@ define(['jquery', 'underscore', 'gettext', 'js/views/baseview', 'common/js/compo | |
| return xblockInfo.save({publish: 'discard_changes'}, {patch: true}); | ||
| }).always(function() { | ||
| xblockInfo.set('publish', null); | ||
| // Hide any move notification if present. | ||
| MoveXBlockUtils.hideMovedNotification(); | ||
|
||
| }).done(function() { | ||
| renderPage(); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| from common.test.acceptance.tests.helpers import create_user_partition_json | ||
|
|
||
| import datetime | ||
| from bok_choy.promise import Promise, EmptyPromise | ||
| import ddt | ||
| from base_studio_test import ContainerBase | ||
| from xmodule.partitions.partitions import Group | ||
|
|
||
|
|
@@ -1131,6 +1131,7 @@ def test_common_problem_types_tab(self): | |
|
|
||
|
|
||
| @attr(shard=1) | ||
| @ddt.ddt | ||
| class MoveComponentTest(ContainerBase): | ||
| """ | ||
| Tests of moving an XBlock to another XBlock. | ||
|
|
@@ -1220,6 +1221,30 @@ def verify_move_opertions(self, unit_page, source_component, operation, componen | |
| component_display_names_after_operation | ||
| ) | ||
|
|
||
| def verify_state_change(self, unit_page, operation): | ||
| """ | ||
| Verify that after state change, confirmation message is hidden. | ||
|
|
||
| Arguments: | ||
| unit_page (Object) Unit container page. | ||
|
||
| operation (String) Publish or discard changes operation. | ||
| """ | ||
| # Verify unit in draft state now | ||
| self.container.verify_publish_title(self.DRAFT_STATUS) | ||
|
|
||
| # Now click publish/discard button | ||
| if operation == 'publish': | ||
| unit_page.publish_action.click() | ||
| else: | ||
| unit_page.discard_changes() | ||
|
|
||
| # Now verify success message is hidden | ||
| self.container.verify_publish_title(self.PUBLISHED_LIVE_STATUS) | ||
| self.container.verify_confirmation_message( | ||
| message=self.message_move.format(display_name=self.source_component_display_name), | ||
| verify_hidden=True | ||
| ) | ||
|
|
||
| def test_move_component_successfully(self): | ||
| """ | ||
| Test if we can move a component successfully. | ||
|
|
@@ -1268,6 +1293,40 @@ def test_undo_move_component_successfully(self): | |
| component_display_names_after_operation=['HTML 11', 'HTML 12'] | ||
| ) | ||
|
|
||
| @ddt.data('publish', 'discard') | ||
| def test_publish_discard_changes_afer_move(self, operation): | ||
| """ | ||
| Test if success banner is hidden when we discard changes or publish the unit after a move operation. | ||
|
|
||
| Given I am a staff user | ||
| And I go to unit page in first section | ||
| And I open the move modal | ||
| And I navigate to unit in second section | ||
| And I see move button is enabled | ||
| When I click on the move button | ||
| Then I see move operation success message | ||
| And When I click on publish or discard changes button | ||
| Then I see move operation success message is hidden. | ||
| """ | ||
| unit_page = self.go_to_unit_page(unit_name='Test Unit 1') | ||
| components = unit_page.displayed_children | ||
| self.assertEqual(len(components), 2) | ||
|
|
||
| components[0].open_move_modal() | ||
| self.move_modal_view.navigate_to_category(self.source_xblock_category, self.navigation_options) | ||
| self.assertEqual(self.move_modal_view.is_move_button_enabled, True) | ||
|
|
||
| # Verify unit is in published state before move operation | ||
| self.container.verify_publish_title(self.PUBLISHED_LIVE_STATUS) | ||
|
|
||
| self.move_modal_view.click_move_button() | ||
| self.container.verify_confirmation_message( | ||
| self.message_move.format(display_name=self.source_component_display_name) | ||
| ) | ||
| self.assertEqual(len(unit_page.displayed_children), 1) | ||
|
|
||
| self.verify_state_change(unit_page, operation) | ||
|
|
||
| def test_content_experiment(self): | ||
| """ | ||
| Test if we can move a component of content experiment successfully. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mushtaqak My only concern is that some of the above messages are not user friendly. We can release the changes now but we should create a new ticket to improve the log messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created the JIRA ticket : https://openedx.atlassian.net/browse/TNL-6678