Skip to content

Conversation

microbit-henry
Copy link
Contributor

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

@microbit-henry
Copy link
Contributor Author

The warning message currently looks like this for .mpy files. Any changes to the wording are very welcome.
Screenshot 2019-09-25 11 04 56

@microbit-carlos microbit-carlos changed the title Load/Save Modal: Added custom warning when .mpy files are loaded Load/Save Modal: Add warning when unknown file extension or .mpy files are loaded Sep 25, 2019
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
Copy link
Collaborator

@microbit-carlos microbit-carlos left a 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
Copy link
Collaborator

@microbit-carlos microbit-carlos left a comment

Choose a reason for hiding this comment

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

Good work Henry!

@microbit-carlos microbit-carlos merged commit 3fadf94 into bbcmicrobit:v2-beta Oct 2, 2019
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.

2 participants