Skip to content

Add a link to the service-alti api to download a CSV of the profile data#230

Merged
pakb merged 5 commits intodevelopfrom
feat-2432-add-export-to-csv-to-profile-popup
Jul 6, 2022
Merged

Add a link to the service-alti api to download a CSV of the profile data#230
pakb merged 5 commits intodevelopfrom
feat-2432-add-export-to-csv-to-profile-popup

Conversation

@jedef
Copy link
Contributor

@jedef jedef commented Jun 23, 2022

A Link is shown to the user to download the CSV of the profile data

Test link

@jedef jedef requested a review from pakb June 23, 2022 09:09
@davidoesch
Copy link
Contributor

davidoesch commented Jun 23, 2022

hi some improvements

  • switch the order of delete and download icon
  • filename: rename file to, if possible to map.geo.admin.ch_CSV_20220623120352.csv structure as in the export KML
  • the csv is missing a header info , renmae the 4 cols to Distance [m],Altitude[m],X,Y

@pakb
Copy link
Contributor

pakb commented Jun 23, 2022

  • the csv is missing a header info , renmae the 4 cols to Distance [m],Altitude[m],X,Y

We still need to switch on to service-alti on Frankfurt and see if this would fix this issue (Brice has done some bugfix on the latest version only deployed in Frankfurt). Otherwise, that means we will have to fix that in service-alti directly

@jedef jedef force-pushed the feat-2432-add-export-to-csv-to-profile-popup branch from 9f39355 to 99e80b9 Compare June 23, 2022 14:08
@jedef jedef force-pushed the feat-2432-add-export-to-csv-to-profile-popup branch 2 times, most recently from 4b892b8 to c29a2e1 Compare June 29, 2022 14:41
@jedef jedef requested a review from pakb June 29, 2022 15:59
Comment on lines +254 to +270
triggerDownload(blob, fileName) {
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = fileName

link.click()
URL.revokeObjectURL(link.href)
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a little comment that we must use this <a> approach so that we can define the downloaded file name?
otherwise the next one to come here will want to switch to a window.open(...) 😉

context('check how app behave with backend output', () => {
const goToDrawingWithMockProfile = (mockValue) => {
cy.mockupBackendResponse('rest/services/profile.json', mockValue, 'profile')
cy.mockupBackendResponse('rest/services/profile.json?*', mockValue, 'profile')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not cy.mockupBackendResponse('rest/services/profile.json**', mockValue, 'profile')?
now if the app calls the backend without any URL argument (without the ?... part of the URL) it might not be caught anymore, no?

@pakb
Copy link
Contributor

pakb commented Jun 30, 2022

Please add some Cypress test that covers this new button and the output it gives 😉 (or at least that the right backend was called)

@jedef jedef force-pushed the feat-2432-add-export-to-csv-to-profile-popup branch 2 times, most recently from 2704803 to bb11368 Compare July 6, 2022 09:24
@jedef jedef requested a review from pakb July 6, 2022 09:45
jedef added 5 commits July 6, 2022 16:12
Also hid file extension outside of file api and simplified the
triggerdownload function.
- profile.api uses now JSON format to pass the geoJSON, and not the
  urlencoded format. Fixed the e2e tests accordingly
- search.api now does not use anymore a version number in the URL, as
  this is not supported anymore by sys-api3
@pakb pakb force-pushed the feat-2432-add-export-to-csv-to-profile-popup branch from bb11368 to 9907a26 Compare July 6, 2022 14:13
@pakb pakb merged commit 8acf1b1 into develop Jul 6, 2022
@pakb pakb deleted the feat-2432-add-export-to-csv-to-profile-popup branch July 6, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants