diff --git a/forge/db/models/Application.js b/forge/db/models/Application.js index c98ce51373..156a6a98e3 100644 --- a/forge/db/models/Application.js +++ b/forge/db/models/Application.js @@ -106,7 +106,7 @@ module.exports = { if (includeApplicationDevices) { const include = { model: M.Device, - attributes: ['hashid', 'id', 'name', 'links', 'state', 'mode', 'updatedAt', 'lastSeenAt', 'editorConnected', 'editorToken', 'ownerType', 'ProjectId', 'ApplicationId'] + attributes: ['hashid', 'id', 'name', 'type', 'links', 'state', 'mode', 'updatedAt', 'lastSeenAt', 'editorConnected', 'editorToken', 'ownerType', 'ProjectId', 'ApplicationId'] } if (associationsLimit) { diff --git a/frontend/src/pages/team/Applications/index.vue b/frontend/src/pages/team/Applications/index.vue index 1bb6383cf6..a1efe29e07 100644 --- a/frontend/src/pages/team/Applications/index.vue +++ b/frontend/src/pages/team/Applications/index.vue @@ -158,7 +158,8 @@ export default { const filteredDevices = app.devices.filter(device => { return [ device.name.toLowerCase().includes(this.filterTerm.toLowerCase()), - device.id.toLowerCase().includes(this.filterTerm.toLowerCase()) + device.id.toLowerCase().includes(this.filterTerm.toLowerCase()), + device.type.toLowerCase().includes(this.filterTerm.toLowerCase()) ].includes(true) }) @@ -179,7 +180,8 @@ export default { const filteredDevices = app.devices.filter(device => { return [ device.name.toLowerCase().includes(this.filterTerm.toLowerCase()), - device.id.toLowerCase().includes(this.filterTerm.toLowerCase()) + device.id.toLowerCase().includes(this.filterTerm.toLowerCase()), + device.type.toLowerCase().includes(this.filterTerm.toLowerCase()) ].includes(true) }) diff --git a/test/e2e/frontend/cypress/tests/applications/overview.spec.js b/test/e2e/frontend/cypress/tests/applications/overview.spec.js index 74ff7eeb1d..818bdb5695 100644 --- a/test/e2e/frontend/cypress/tests/applications/overview.spec.js +++ b/test/e2e/frontend/cypress/tests/applications/overview.spec.js @@ -616,7 +616,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '2', @@ -625,7 +626,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '3', @@ -634,7 +636,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '4', @@ -643,7 +646,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' } ] } @@ -664,7 +668,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' } ] } @@ -733,7 +738,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '123', @@ -742,7 +748,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' } ] } @@ -788,7 +795,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '13234', @@ -797,7 +805,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' } ] } @@ -844,7 +853,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '13234', @@ -853,7 +863,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: 'edge-entity' } ] } @@ -928,6 +939,21 @@ describe('FlowForge - Applications', () => { cy.get('[data-el="application-instance-item"]').should('have.length', 1) cy.get('[data-el="application-instance-item"]').contains('interesting instance name') }) + + cy.get('[data-form="search"] input').clear() + cy.get('[data-form="search"]').type('edge-entity') + + // app present due to name match but with filtered instances and devices + cy.get('[data-el="application-item"]').contains('interesting app name') + .parent() + .parent() + .parent() + .within(() => { + // one device present that matches query + cy.get('[data-el="device-tile"]').should('exist') + cy.get('[data-el="device-tile"]').should('have.length', 1) + cy.get('[data-el="device-tile"]').contains('another device name') + }) }) it('carries the search queries onwards to the application devices page when clicking show more', () => { @@ -939,7 +965,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '2', @@ -948,7 +975,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '3', @@ -957,7 +985,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '4', @@ -966,7 +995,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' }, { id: '5', @@ -975,7 +1005,8 @@ describe('FlowForge - Applications', () => { lastSeenMs: null, status: 'offline', mode: 'autonomous', - isDeploying: false + isDeploying: false, + type: '' } ] const instances = []