intregrate newly created help into help mode

pull/7646/head
ulferts 5 years ago
parent 86fac33f26
commit 8fe262652e
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 2
      frontend/src/app/modules/grids/grid/add-widget.service.ts
  2. 4
      frontend/src/app/modules/grids/grid/area.service.ts
  3. 5
      frontend/src/app/modules/my-page/my-page.component.html
  4. 4
      modules/grids/spec/support/pages/grid.rb

@ -30,7 +30,7 @@ export class GridAddWidgetService {
public isAddable(area:GridArea) { public isAddable(area:GridArea) {
return !this.drag.currentlyDragging && return !this.drag.currentlyDragging &&
!this.resize.currentlyResizing && !this.resize.currentlyResizing &&
(this.layout.mousedOverArea === area || this.layout.isSingleCell || this.layout.isNewlyCreated || this.layout.inHelpMode) && (this.layout.mousedOverArea === area || this.layout.isSingleCell || this.layout.inHelpMode) &&
this.isAllowed; this.isAllowed;
} }

@ -33,6 +33,8 @@ export class GridAreaService {
this.numRows = this.resource.rowCount; this.numRows = this.resource.rowCount;
this.numColumns = this.resource.columnCount; this.numColumns = this.resource.columnCount;
this.helpMode = this.isNewlyCreated;
this.buildAreas(true); this.buildAreas(true);
} }
@ -113,7 +115,7 @@ export class GridAreaService {
return this.numRows === 1 && this.numColumns === 1 && this.widgetResources.length === 0; return this.numRows === 1 && this.numColumns === 1 && this.widgetResources.length === 0;
} }
public get isNewlyCreated() { private get isNewlyCreated() {
return moment(moment.utc()).diff(moment(this.resource.createdAt), 'seconds') < 20; return moment(moment.utc()).diff(moment(this.resource.createdAt), 'seconds') < 20;
} }

@ -1,5 +0,0 @@
<h2 [textContent]="text.title"></h2>
<ng-container *ngIf="(grid$ | async) as grid">
<grid [grid]="grid"></grid>
</ng-container>

@ -33,7 +33,7 @@ module Pages
def add_widget(row_number, column_number, location, name) def add_widget(row_number, column_number, location, name)
within_add_widget_modal(row_number, column_number, location) do within_add_widget_modal(row_number, column_number, location) do
expect(page) expect(page)
.to have_content(I18n.t('js.grid.add_modal.choose_widget')) .to have_content(I18n.t('js.grid.add_widget'))
page.find('.grid--addable-widget', text: Regexp.new("^#{name}$")).click page.find('.grid--addable-widget', text: Regexp.new("^#{name}$")).click
end end
@ -83,7 +83,7 @@ module Pages
def expect_specific_widget_unaddable(row_number, column_number, location, name) def expect_specific_widget_unaddable(row_number, column_number, location, name)
within_add_widget_modal(row_number, column_number, location) do within_add_widget_modal(row_number, column_number, location) do
expect(page) expect(page)
.to have_content(I18n.t('js.grid.add_modal.choose_widget')) .to have_content(I18n.t('js.grid.add_widget'))
expect(page) expect(page)
.not_to have_selector('.grid--addable-widget', text: Regexp.new("^#{name}$")) .not_to have_selector('.grid--addable-widget', text: Regexp.new("^#{name}$"))

Loading…
Cancel
Save