Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

no success message on ineffectual resize

ulferts0c53a5befc38
diff --git a/frontend/src/app/modules/grids/areas/grid-widget-area.ts b/frontend/src/app/modules/grids/areas/grid-widget-area.ts
index e391ec42685..ba7ca6ee6ed 100644
--- a/frontend/src/app/modules/grids/areas/grid-widget-area.ts
+++ b/frontend/src/app/modules/grids/areas/grid-widget-area.ts
@@ -63,6 +63,13 @@ export class GridWidgetArea extends GridArea {
this.rowOverlaps(otherArea);
}
+ public get unchangedSize() {
+ return this.startColumn === this.widget.startColumn &&
+ this.endColumn === this.widget.endColumn &&
+ this.startRow === this.widget.startRow &&
+ this.endRow === this.widget.endRow;
+ }
+
public writeAreaChangeToWidget() {
this.widget.startRow = this.startRow;
this.widget.endRow = this.endRow;
diff --git a/frontend/src/app/modules/grids/grid/resize.service.ts b/frontend/src/app/modules/grids/grid/resize.service.ts
index 4ef5c60e3b3..ff87a5ac5ec 100644
--- a/frontend/src/app/modules/grids/grid/resize.service.ts
+++ b/frontend/src/app/modules/grids/grid/resize.service.ts
@@ -20,11 +20,16 @@ export class GridResizeService {
return;
}
+ this.resizedArea = null;
+
+ // user aborted dragging
+ if (area.unchangedSize) {
+ return;
+ }
+
this.layout.writeAreaChangesToWidgets();
this.layout.cleanupUnusedAreas();
- this.resizedArea = null;
-
this.layout.rebuildAndPersist();
}
diff --git a/modules/overviews/spec/features/managing_overview_page_spec.rb b/modules/overviews/spec/features/managing_overview_page_spec.rb
index e9d474b7d6d..22851aaa668 100644
--- a/modules/overviews/spec/features/managing_overview_page_spec.rb
+++ b/modules/overviews/spec/features/managing_overview_page_spec.rb
@@ -98,16 +98,28 @@ describe 'Overview page managing', type: :feature, js: true, with_mail: false do
# within top-left area, add an additional widget
overview_page.add_widget(1, 1, :row, 'Work packages table')
+ # Actually there are two success messages displayed currently. One for the grid getting updated and one
+ # for the query assigned to the new widget being created. A user will not notice it but the automated
+ # browser can get confused. Therefore we wait.
+ sleep(1)
+
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(6)')
table_area.expect_to_span(1, 1, 2, 2)
+ # A useless resizing shows no message and does not alter the size
+ table_area.resize_to(1, 1)
+
+ overview_page.expect_no_notification message: I18n.t('js.notice_successful_update')
+
+ table_area.expect_to_span(1, 1, 2, 2)
+
table_area.resize_to(1, 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 table area now spanning a larger area
table_area.expect_to_span(1, 1, 2, 3)
within table_area.area do