Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datahub: Add pagination for table component #1120

Merged
merged 37 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
53fe72a
feat(table): implement data.source and pass reader to table
tkohr Feb 17, 2025
03397cd
feat(table): add mat paginator
tkohr Feb 17, 2025
9acf9b6
feat(table): display 10 items per page
tkohr Feb 18, 2025
ee90676
feat(table): impove css positioning
tkohr Feb 19, 2025
2443309
fix(storybook): pass data via a mock reader to table
tkohr Feb 19, 2025
823b00e
feat(geo-table-view): change input to reader (WIP)
tkohr Feb 19, 2025
1a3565e
feat(table): translate paginator labels
tkohr Feb 19, 2025
09b2ad9
feat(table): recover displaying count info
tkohr Feb 20, 2025
89c662d
doc(i18n): add a comment on extraction issue
tkohr Feb 20, 2025
7d7d143
test(table): rework tests
tkohr Feb 20, 2025
1ba1be5
feat(geo-table-view): fix mapping and use GeojsonReader in story
tkohr Feb 20, 2025
626ee8b
fix(table): update data when input changes
tkohr Feb 20, 2025
4ef4450
feat(table): keep a table-scroll.component without pagination for now…
tkohr Feb 20, 2025
7eee9c2
test(table-view): return observable with delay to test loading
tkohr Feb 21, 2025
ae33f40
test(table): add e2e tests
tkohr Feb 21, 2025
1e0a8e6
feat(dataviz): add wfs and geojson stories for table
jahow Feb 21, 2025
c62f650
feat(ui): fix pagination in data table, improve storybook entry
jahow Feb 21, 2025
b60099b
chore(ui): rename table to data-table
jahow Feb 21, 2025
ca14cc6
chore(dataviz): remove table-scroll component, use data-table in geo-…
jahow Feb 21, 2025
6a5c9e2
chore(ui): enable wfs data-table storybook entry
jahow Feb 22, 2025
27ade4d
feat(ui): add loading mask on data-table
jahow Feb 22, 2025
576ea1a
feat(ui): disable clear sort on data-table
jahow Feb 22, 2025
bd7b787
feat(ui): wait for properties to be read in data-table
jahow Feb 22, 2025
b243497
feat(ui): do not load geom from WFS in data-table
jahow Feb 22, 2025
e191688
fix(data-table): fix sort
tkohr Feb 24, 2025
d7e693a
test(data-table): fix unit tests
tkohr Feb 24, 2025
9338653
test(table-view): add test for undefined
tkohr Feb 24, 2025
d2a2be0
feat(ui): add tests on data-table
jahow Feb 24, 2025
48fe336
feat(data-fetcher): do not load all data to read WFS properties
jahow Feb 24, 2025
f1db58d
fix(wfs): fix type
tkohr Feb 24, 2025
f9fade5
test(data-table): test pagination
tkohr Feb 24, 2025
596f118
test(data-table): adapt fixtures for e2e tests
tkohr Feb 24, 2025
90ab2bb
feat(data-table): add error handling
tkohr Feb 24, 2025
1f6a35b
feat(record-data-preview): display table-view
tkohr Feb 24, 2025
44e76a2
feat(data-table): error should not be string
tkohr Feb 25, 2025
c3d7b4d
feat(util): return body alongside HTTP error in data-fetcher
jahow Feb 25, 2025
72239c9
chore(dh): reduce data preview height to avoid blank space
jahow Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 69 additions & 17 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,31 @@ beforeEach(() => {
)
cy.intercept(
'GET',
'/geoserver/insee/ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=true&LAYERS=rectangles_200m_menage_erbm*',
'/geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=application%2Fjson&PROPERTYNAME=oid%2Cidk%2Cmen%2Cmen_occ5%2Cpt_men_occ5&COUNT=10&SRSNAME=EPSG%3A4326',
{
fixture: 'insee-rectangles_200m_menage_erbm.png',
fixture: 'insee-wfs-table-data.json',
}
)
//Note: The real WFS of this example responds with an error to this request due to a missing primary key in the table
cy.intercept(
'GET',
'/geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=application%2Fjson*',
'geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=application%2Fjson&PROPERTYNAME=oid%2Cidk%2Cmen%2Cmen_occ5%2Cpt_men_occ5&COUNT=10&SRSNAME=EPSG%3A4326&STARTINDEX=10',
{
fixture: 'insee-rectangles_200m_menage_erbm.json',
fixture: 'insee-wfs-table-data-page2.json',
}
)
cy.intercept(
'GET',
'geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=application%2Fjson&PROPERTYNAME=oid%2Cidk%2Cmen%2Cmen_occ5%2Cpt_men_occ5&COUNT=10&SRSNAME=EPSG%3A4326&SORTBY=idk+D',
{
fixture: 'insee-wfs-table-data-sort-idk.json',
}
)
cy.intercept(
'GET',
'/geoserver/insee/ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=true&LAYERS=rectangles_200m_menage_erbm*',
{
fixture: 'insee-rectangles_200m_menage_erbm.png',
}
)
cy.intercept(
Expand Down Expand Up @@ -389,19 +404,19 @@ describe('dataset pages', () => {

cy.get('@previewSection').find('gn-ui-map-legend').should('be.visible')
})
it('should display the table', () => {
it('should display the table with 10 rows', () => {
cy.get('@previewSection')
.find('.mat-mdc-tab-labels')
.children('div')
.eq(1)
.click()
cy.get('@previewSection').find('gn-ui-table').should('be.visible')
cy.get('@previewSection').find('gn-ui-data-table').should('be.visible')
cy.get('@previewSection')
.find('gn-ui-table')
.find('gn-ui-data-table')
.find('table')
.find('tbody')
.children('tr')
.should('have.length.gt', 0)
.should('have.length', 10)
cy.screenshot({ capture: 'fullPage' })
})
it('should display the chart & dropdowns', () => {
Expand Down Expand Up @@ -441,16 +456,53 @@ describe('dataset pages', () => {
})
cy.get('@previewSection').find('gn-ui-feature-detail')
})
it('TABLE : should scroll', () => {
cy.get('@previewSection')
.find('.mat-mdc-tab-labels')
.children('div')
.eq(1)
.click()
cy.get('@previewSection').find('gn-ui-table').find('table').as('table')
cy.get('@table').scrollTo('bottom', { ensureScrollable: false })
describe('TABLE', () => {
beforeEach(() => {
cy.get('@previewSection')
.find('.mat-mdc-tab-labels')
.children('div')
.eq(1)
.click()
cy.get('@previewSection')
.find('gn-ui-data-table')
.find('table')
.as('table')
})

cy.get('@table').find('tr:last-child').should('be.visible')
it('TABLE sort: should sort the table on column click', () => {
cy.get('@table').find('th').eq(1).click()
cy.get('@table')
.find('td')
.eq(1)
.invoke('text')
.then((firstValue) => {
cy.get('@table').find('th').eq(1).click()
cy.get('@table')
.find('td')
.eq(1)
.invoke('text')
.should('not.eq', firstValue)
})
})
it('TABLE pagination: should display 10 rows with different data when clicking next page', () => {
cy.get('@previewSection').find('mat-paginator').as('pagination')
cy.get('@table')
.find('td')
.eq(1)
.invoke('text')
.then((firstValue) => {
cy.get('@pagination').find('button').eq(2).click()
cy.get('@table')
.find('td')
.eq(1)
.invoke('text')
.should('not.eq', firstValue)
cy.get('@table')
.find('tbody')
.children('tr')
.should('have.length', 10)
})
})
})
it('CHART : should change the chart on options change', () => {
cy.get('@previewSection')
Expand Down
Loading
Loading