Skip to content

Support downloading excel and csv responses with content disposition attachment header #2274

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

Open
wants to merge 210 commits into
base: master
Choose a base branch
from

Conversation

LauraXiulan
Copy link

@LauraXiulan LauraXiulan commented Aug 16, 2023

When retrieving an CSV or EXCEL file as response in the Developer Portal, the response is shown inline, which makes it unreadable. This PR adds logic to download these kinds of responses instead.

Suggestions, remarks and edits are welcome. I tested the code locally for our own APIM by temporary switching to Self-Hosted.
I have only added CSV and EXCEL in this PR, but I can imagine a usecase for PDF's as well.

malincrist and others added 30 commits February 22, 2022 12:44
Azure#1584)

* Create mainCI.yml

Work in progress, don't merge

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* added script for build website

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Fixed color contrast accessibility issues

* Fixed ari-roles issues

* added static storage wip

* Added missing static data

* Update mainCI.yml

* added static data for requests made at publishing time

* updated PublisherStaticDataProvider

* updated PublisherStaticDataProvider

* updated PublisherStaticDataProvider

* get data from default.json too

* added build-static-data script

* refactoring

* removed logs

* removed some headers from static data

* removed headers

* added smaller GraphQL api

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* Update mainCI.yml

* test accessibility on profile

* Update mainCI.yml

* Update mainCI.yml

* removed headers

* test with pre-populated e-mail and password

* compacted json files

* removed test e-mail and password

* code review changes

* test for signed in version

* added default.json and defaultMockData.json only for staticData

* fixed webpack configs

* fixed accessibility issues

* fixed accessibility issues

* added staticDataEnviroment constant

* Update mainCI.yml

* removed logs

* renamed defaultMockData.json
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…enerate.js (Azure#1675)

> @azaslonov Thank you for accepting the PR. Not sure why the build failed. It appears not related to my changes. Any insights?

This is accessibility check, doesn't seem to be related to your PR.
@malincrist, do you mind taking a look?
* Added support for union types in the graphql console

* Removing hardcoding and using constant values from the graphql library
Implementation inspired by Azure#1621

Co-authored-by: Jonas Anker Rasmussen <[email protected]>
* Add "API: Products (dropdown)" widget

Closes Azure#1177

* Update src/components/apis/api-products/ko/runtime/api-products-dropdown.ts

Avoid assigning undefined to undefined

Co-authored-by: Rafał Mielowski <[email protected]>

* Remove unnecessary function called in the next line by other function

Co-authored-by: Rafał Mielowski <[email protected]>
* Supporting graphql subscriptions

* Adding improvements and style variables to the gql console.
malincrist and others added 20 commits May 31, 2023 16:14
…zure#2190)

* Made page content section stretch by default for all viewport sizes

* stretch by default for home layout as well
* Replace deprecated methods from cred generation

Co-authored-by: Farhad Alizada <[email protected]>
* added pagination for user subscriptions

* lint fix
* Fixed scroll to operation in operation details

* use id instead of class; fixed for graphql
* Removed duplicated styles
* Add dropdown for the case when there are multiple examples
---------

Co-authored-by: Farhad Alizada <[email protected]>
…est run (Azure#2209)

* Remove no needed async and wait for the server listen event before test run
* Listen to console errors in tests
* Use node 18
* Add incognito option for browser
* Clear user directory before test start
---------
Co-authored-by: Farhad Alizada <[email protected]>
Co-authored-by: Alexander Zaslonov <[email protected]>
Co-authored-by: Farhad Alizada <[email protected]>
* Add Playwright tests with image comparison for profile page
---------

Co-authored-by: Farhad Alizada <[email protected]>
@LauraXiulan
Copy link
Author

@microsoft-github-policy-service agree

@LauraXiulan
Copy link
Author

#1984

@LauraXiulan
Copy link
Author

@ygrik @malincrist @azaslonov

@verschaevesiebe
Copy link

Nice addition, we sometimes have the intent to download other content types. Eg. a very large JSON file for example.
Would you be able to include a similar feature for attachment disposition types where filenames are json or by means any text formal is applicable ?

E.g xml, text, json, jsonc, etc ...

header('Content-Disposition: attachment; filename=data.json');
header('Content-Type: application/json');

Would be amazing thanks !

@azaslonov azaslonov force-pushed the master branch 4 times, most recently from 79dae19 to a74f7db Compare March 21, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.