Skip to content

Commit

Permalink
Viewer element template rename and Cypress test fix for delete modal
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao committed Aug 1, 2023
1 parent dbdf4cf commit 4c53462
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/layout_clock.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ describe('Layout Designer', function() {
// Delete
cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_clock-analogue"]').parents('.designer-region').rightclick();
cy.get('[data-title="Delete"]').click();
cy.get('.btn-bb-confirm').click();
cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_clock-analogue"]').should('not.exist');
});
});
1 change: 0 additions & 1 deletion cypress/e2e/layout_dataset.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ describe('Layout Designer', function() {

cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_dataset"]').parents('.designer-region').rightclick();
cy.get('[data-title="Delete"]').click();
cy.get('.btn-bb-confirm').click();
cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_dataset"]').should('not.exist');
});
});
1 change: 0 additions & 1 deletion cypress/e2e/layout_mastodon.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('Layout Designer', function() {

cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_mastodon"]').parents('.designer-region').rightclick();
cy.get('[data-title="Delete"]').click();
cy.get('.btn-bb-confirm').click();
cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_mastodon"]').should('not.exist');
});
});
1 change: 0 additions & 1 deletion cypress/e2e/layout_rss_ticker.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ describe('Layout Designer', function() {

cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_rss-ticker"]').parents('.designer-region').rightclick();
cy.get('[data-title="Delete"]').click();
cy.get('.btn-bb-confirm').click();
cy.get('#layout-viewer .designer-region .widget-preview[data-type="widget_rss-ticker"]').should('not.exist');
});
});
16 changes: 8 additions & 8 deletions ui/src/layout-editor/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const viewerLayoutPreview = require('../templates/viewer-layout-preview.hbs');
const viewerActionEditRegionTemplate =
require('../templates/viewer-action-edit-region.hbs');
const loadingTemplate = require('../templates/loading.hbs');
const viewerObjectTemplate = require('../templates/viewer-object.hbs');
const viewerObjectGroupTemplate =
require('../templates/viewer-object-group.hbs');
const viewerObjectContentTemplate =
require('../templates/viewer-object-content.hbs');
const viewerElementTemplate = require('../templates/viewer-element.hbs');
const viewerElementGroupTemplate =
require('../templates/viewer-element-group.hbs');
const viewerElementContentTemplate =
require('../templates/viewer-element-content.hbs');
const drawThrottle = 60;

/**
Expand Down Expand Up @@ -1216,7 +1216,7 @@ Viewer.prototype.renderElement = function(
}

// Render element container
const $newElement = $(viewerObjectTemplate({
const $newElement = $(viewerElementTemplate({
element: element,
dimensions: elementRenderDimensions,
}));
Expand All @@ -1229,7 +1229,7 @@ Viewer.prototype.renderElement = function(
$canvasRegionContainer.find(`#${element.groupId}`).length == 0
) {
$canvasRegionContainer.append(
viewerObjectGroupTemplate({
viewerElementGroupTemplate({
element: element,
trans: viewerTrans,
}),
Expand Down Expand Up @@ -1441,7 +1441,7 @@ Viewer.prototype.renderElementContent = function(
}

// Render element with template
$elementContainer.html($(viewerObjectContentTemplate({
$elementContainer.html($(viewerElementContentTemplate({
element: element,
template: template,
scale: self.containerObjectDimensions.scale,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ui/src/templates/viewer-widget.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="{{id}}" data-type="widget" data-widget-region="{{regionId}}" data-widget-id="{{widgetId}}" class="designer-widget viewer-object-select {{containerStyle}} {{type}} droppable {{#if selected}}selected{{/if}} {{#if drawerWidget}}drawerWidget{{/if}}">
<div class="widget-preview {{#if editable}}parent-editable{{/if}}"
data-parent="region" data-parent-id="{{parentId}}" data-type="{{elementType}}">
data-parent="region" data-parent-id="{{parentId}}" data-type="{{objectType}}">
{{{res.html}}}
</div>
</div>

0 comments on commit 4c53462

Please sign in to comment.