-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add filter to dashboard list and map panel
- Loading branch information
1 parent
9bb3705
commit de1e1ba
Showing
13 changed files
with
614 additions
and
67 deletions.
There are no files selected for viewing
137 changes: 90 additions & 47 deletions
137
backend/src/main/resources/db/testdata/V666.18__insert_dummy_dashboards.sql
Large diffs are not rendered by default.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
frontend/cypress/e2e/side_window/dashboard_list/filters.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { customDayjs } from '@mtes-mct/monitor-ui' | ||
|
||
import { getUtcDateInMultipleFormats } from '../../utils/getUtcDateInMultipleFormats' | ||
import { visitSideWindow } from '../../utils/visitSideWindow' | ||
|
||
context('Side Window > Dashboard List > Filter Bar', () => { | ||
beforeEach(() => { | ||
cy.viewport(1280, 1024) | ||
visitSideWindow() | ||
cy.clickButton('Tableaux de bord') | ||
}) | ||
|
||
it('Should filter dashboard for today', () => { | ||
cy.fill('Date de mise à jour', 'Aujourd’hui') | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
|
||
it('Should filter dashboard for the last week', () => { | ||
cy.fill('Date de mise à jour', 'Une semaine') | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
|
||
it('Should filter dashboard for the last month', () => { | ||
cy.fill('Date de mise à jour', 'Un mois') | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
}) | ||
|
||
it('Should filter dashboard for the current year', () => { | ||
cy.fill('Date de mise à jour', 'Année en cours') | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
|
||
it('Should filter dashboards by specific period', () => { | ||
cy.fill('Date de mise à jour', 'Période spécifique') | ||
|
||
const expectedStartDate = getUtcDateInMultipleFormats('2024-01-01T00:00:00.000Z') | ||
const expectedEndDate = getUtcDateInMultipleFormats(customDayjs().toISOString()) | ||
|
||
cy.fill('Période spécifique de la date de mise à jour', [ | ||
expectedStartDate.asDatePickerDate, | ||
expectedEndDate.asDatePickerDate | ||
]) | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
|
||
it('Should filter dashboard by sea front', () => { | ||
cy.wait(200) | ||
cy.fill('Façade', ['NAMO']) | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
cy.get('.Table-SimpleTable tr').each((row, index) => { | ||
if (index === 0) { | ||
return | ||
} | ||
|
||
cy.wrap(row).should('contain', 'NAMO') | ||
}) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
|
||
it('Should filter dashboard by regulatory themes', () => { | ||
cy.wait(200) | ||
cy.fill('Thématique réglementaire', ['RNN']) | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
cy.get('.Table-SimpleTable tr').each((row, index) => { | ||
if (index === 0) { | ||
return | ||
} | ||
|
||
cy.wrap(row).should('contain', 'RNN Iroise') | ||
}) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
|
||
it('Should filter dashboards by units', () => { | ||
cy.fill('Unité', ['DML']) | ||
|
||
cy.get('.Table-SimpleTable tr').should('have.length.to.be.greaterThan', 0) | ||
cy.get('.Table-SimpleTable tr').each((row, index) => { | ||
if (index === 0) { | ||
return | ||
} | ||
|
||
cy.wrap(row).should('contain', 'DML 2A (DDTM)') | ||
}) | ||
|
||
cy.clickButton('Réinitialiser les filtres') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.