save notifications on grid

pull/7661/head
ulferts 5 years ago
parent 63e1d81789
commit b9708ab741
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 7
      frontend/src/app/modules/grids/grid/area.service.ts
  2. 12
      modules/dashboards/spec/features/custom_text_spec.rb
  3. 5
      modules/my_page/spec/features/my/my_page_spec.rb
  4. 4
      modules/my_page/spec/features/my/work_package_table_spec.rb
  5. 4
      modules/overviews/spec/features/managing_overview_page_spec.rb

@ -8,6 +8,8 @@ import {GridWidgetResource} from "core-app/modules/hal/resources/grid-widget-res
import {SchemaResource} from "core-app/modules/hal/resources/schema-resource"; import {SchemaResource} from "core-app/modules/hal/resources/schema-resource";
import {WidgetChangeset} from "core-app/modules/grids/widgets/widget-changeset"; import {WidgetChangeset} from "core-app/modules/grids/widgets/widget-changeset";
import * as moment from 'moment'; import * as moment from 'moment';
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
@Injectable() @Injectable()
export class GridAreaService { export class GridAreaService {
@ -24,7 +26,9 @@ export class GridAreaService {
public mousedOverArea:GridArea|null; public mousedOverArea:GridArea|null;
public helpMode = false; public helpMode = false;
constructor (private gridDm:GridDmService) { } constructor (private gridDm:GridDmService,
private notification:NotificationsService,
private i18n:I18nService) { }
public set gridResource(value:GridResource) { public set gridResource(value:GridResource) {
this.resource = value; this.resource = value;
@ -133,6 +137,7 @@ export class GridAreaService {
.update(resource, schema) .update(resource, schema)
.then(updatedGrid => { .then(updatedGrid => {
this.assignAreasWidget(updatedGrid); this.assignAreasWidget(updatedGrid);
this.notification.addSuccess(this.i18n.t('js.notice_successful_update'));
}); });
} }

@ -76,7 +76,11 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
field.set_value('My own little text') field.set_value('My own little text')
field.save! field.save!
end
dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
within custom_text_widget.area do
expect(page) expect(page)
.to have_selector('.wp-edit-field--display-field', text: 'My own little text') .to have_selector('.wp-edit-field--display-field', text: 'My own little text')
@ -87,7 +91,11 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
expect(page) expect(page)
.to have_selector('.wp-edit-field--display-field', text: 'My own little text') .to have_selector('.wp-edit-field--display-field', text: 'My own little text')
end
dashboard_page.expect_no_notification message: I18n.t('js.notice_successful_update')
within custom_text_widget.area do
# adding an image # adding an image
find('.inplace-editing--container').click find('.inplace-editing--container').click
@ -103,7 +111,11 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
expect(page).to have_no_selector('notifications-upload-progress') expect(page).to have_no_selector('notifications-upload-progress')
field.save! field.save!
end
dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
within custom_text_widget.area do
expect(page) expect(page)
.to have_selector('#content img', count: 1) .to have_selector('#content img', count: 1)

@ -159,7 +159,7 @@ describe 'My page', type: :feature, js: true do
# that widgets that have been there are moved down # that widgets that have been there are moved down
created_area.drag_to(1, 3) created_area.drag_to(1, 3)
sleep(1) my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
reload_grid! reload_grid!
@ -174,7 +174,8 @@ describe 'My page', type: :feature, js: true do
# as no more widgets start in the second column, that column is removed # as no more widgets start in the second column, that column is removed
news_area.drag_to(1, 3) news_area.drag_to(1, 3)
sleep(1) my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
reload_grid! reload_grid!
# Reloading keeps the user's values # Reloading keeps the user's values

@ -107,6 +107,8 @@ describe 'Arbitrary WorkPackage query table widget on my page', type: :feature,
columns.assume_opened columns.assume_opened
columns.remove 'Subject' columns.remove 'Subject'
my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
expect(filter_area.area) expect(filter_area.area)
.to have_selector('.id', text: type_work_package.id) .to have_selector('.id', text: type_work_package.id)
@ -125,6 +127,8 @@ describe 'Arbitrary WorkPackage query table widget on my page', type: :feature,
input.native.send_keys(:return) input.native.send_keys(:return)
end end
my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
sleep(1) sleep(1)
# The whole of the configuration survives a reload # The whole of the configuration survives a reload

@ -95,11 +95,15 @@ describe 'Overview page managing', type: :feature, js: true, with_mail: false do
# within top-right area, add an additional widget # within top-right area, add an additional widget
overview_page.add_widget(1, 1, :row, 'Work packages table') overview_page.add_widget(1, 1, :row, 'Work packages table')
overview_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
table_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(5)') table_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(5)')
table_area.expect_to_span(1, 1, 2, 2) table_area.expect_to_span(1, 1, 2, 2)
table_area.resize_to(2, 2) table_area.resize_to(2, 2)
overview_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
# Resizing leads to the calendar area now spanning a larger area # Resizing leads to the calendar area now spanning a larger area
table_area.expect_to_span(1, 1, 2, 3) table_area.expect_to_span(1, 1, 2, 3)

Loading…
Cancel
Save