-
Notifications
You must be signed in to change notification settings - Fork 127
Load/Save Modal: Add warning when unknown file extension or .mpy files are loaded #245
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
Merged
microbit-carlos
merged 16 commits into
bbcmicrobit:v2-beta
from
microbit-henry:mpy-warning
Oct 2, 2019
Merged
Load/Save Modal: Add warning when unknown file extension or .mpy files are loaded #245
microbit-carlos
merged 16 commits into
bbcmicrobit:v2-beta
from
microbit-henry:mpy-warning
Oct 2, 2019
Conversation
This file contains hidden or 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
2d1e3b6
to
b3cb3c7
Compare
When a file is loaded, the Load/Save modal is closed. Now if the file doesnt have either .hex or .py as an extension another modal is opened to tell the user the file they have loaded has an invalid extension.
Moved if statement into function instead of only calling function in specific circumstances
Added function showWarning that checks the extension if it isnt hex or py, and if it is mpy shows a warning message telling the user that these files are not supported but should be soon.
Added a test case that tests that files of all incompatible types are handled correctly, showing the right warning message if they are .mpy files or otherwise
Made the text in the warning modal part of the translations, changed wording, and edited modal-msg to dislpay the warning instead of creating a new modal
287a7c2
to
6c53ba6
Compare
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.
Great, almost ready for merge!
Moved link formatting outside of if statement so that the links in modals are automatically cleared when a modal is closed
Changed from 'check' to 'fileType' to more convey what the variable represents
microbit-carlos
approved these changes
Oct 2, 2019
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.
Good work Henry!
This was referenced Oct 2, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added a function that displays a custom warning message if a user tries to load a file with the .mpy extension. I have branched from PR #244 as both displayed a modal on loading an incompatible file type, just with different contents.
Closes microbit-foundation/platform-software-issue-tracker#436