-
Notifications
You must be signed in to change notification settings - Fork 416
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
fixing .geojson file not supported with mac os #10082
fixing .geojson file not supported with mac os #10082
Conversation
FixBug .geojson file not supported in macos. - In macOS .geojson file will be identified as type of "application/geo+json". So in checkFileType and readFile functions, they will not go into MIME_LOOKUPS list to find the corresponding type. - Check first in MIME_LOOKUPS list and then the file.type will solve this problem. On behalf of DB Systel GmbH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution.
This quick fix could be ok, but the most correct solution could also be to support the mime-type in the code.
I'd also add a unit test to preserve this functionality across maintainance.
Thank you for your suggestions. While attempting to add unit tests, I discovered that unit tests for reading geojson files already existed. This led me to wonder why those tests were passing despite the issues at hand. Upon further investigation into the existing tests in
However, I encountered two main issues.
Given these observations, I opted to directly assign the
I've now also added code to support geojson. However, I noticed that the I would greatly appreciate any further advice you could provide. Thank you. |
FixBug .geojson file not supported in macos. - added codes to support geojson in processFiles.jsx - fixed bug in testData.js in order to give a type by initialing a new File instance On behalf of DB Systel GmbH
@tdipisa @offtherailz Since this scenario can be tested effectively only on mac. Can I test and proceed with the backport? |
You can test with MAC but let's also wait for functional tests as usual made by @ElenaGallo. No? Did I miss something? |
@tdipisa @ElenaGallo Works fine in DEV and tested on a Mac with geosjon file |
* geosolutions-it#10081 FixBug .geojson file not supported in macos. - In macOS .geojson file will be identified as type of "application/geo+json". So in checkFileType and readFile functions, they will not go into MIME_LOOKUPS list to find the corresponding type. - Check first in MIME_LOOKUPS list and then the file.type will solve this problem. On behalf of DB Systel GmbH * geosolutions-it#10082 FixBug .geojson file not supported in macos. - added codes to support geojson in processFiles.jsx - fixed bug in testData.js in order to give a type by initialing a new File instance On behalf of DB Systel GmbH (cherry picked from commit afafc5c)
testpassed, @dsuren1 please backport to 2024.02.xx. Thanks |
* #10081 FixBug .geojson file not supported in macos. - In macOS .geojson file will be identified as type of "application/geo+json". So in checkFileType and readFile functions, they will not go into MIME_LOOKUPS list to find the corresponding type. - Check first in MIME_LOOKUPS list and then the file.type will solve this problem. On behalf of DB Systel GmbH * #10082 FixBug .geojson file not supported in macos. - added codes to support geojson in processFiles.jsx - fixed bug in testData.js in order to give a type by initialing a new File instance On behalf of DB Systel GmbH (cherry picked from commit afafc5c) Co-authored-by: congchen1101 <161452326+congchen1101@users.noreply.github.com>
* geosolutions-it#10081 FixBug .geojson file not supported in macos. - In macOS .geojson file will be identified as type of "application/geo+json". So in checkFileType and readFile functions, they will not go into MIME_LOOKUPS list to find the corresponding type. - Check first in MIME_LOOKUPS list and then the file.type will solve this problem. On behalf of DB Systel GmbH * geosolutions-it#10082 FixBug .geojson file not supported in macos. - added codes to support geojson in processFiles.jsx - fixed bug in testData.js in order to give a type by initialing a new File instance On behalf of DB Systel GmbH
FixBug .geojson file not supported in macos.
Description
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
#10081
What is the new behavior?
now import geojson is also supported with macOS
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information
“On behalf of DB Systel GmbH”