-
Notifications
You must be signed in to change notification settings - Fork 119
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
Make possible to upgrade packages within IDE #1467
Conversation
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.
Suggest fixing the terminology in user messages and JS symbol names. When we download and install, it is an upgrade. When we check, we are checking for updates. That is, upgrade is an action: desctructive and not undoable; update is informational it is a noun.
|
||
renderCores() { | ||
if (!this.state.cores) { | ||
return <span>Checking for updates. Please wait...</span>; |
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.
Just: “Checking for updates...”
|
||
return ( | ||
<div> | ||
<p>There are some packages you can update:</p> |
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.
Just “Packages to upgrade”
@@ -0,0 +1,3 @@ | |||
export const SHOW_UPDATE_ARDUPACKAGES_POPUP = 'SHOW_UPDATE_ARDUPACKAGES_POPUP'; | |||
export const HIDE_UPDATE_ARDUPACKAGES_POPUP = 'HIDE_UPDATE_ARDUPACKAGES_POPUP'; | |||
export const RUN_UPDATE_PROCESS = 'RUN_UPDATE_PROCESS'; |
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.
Eh... Flux misuse. Actions are facts, not intents. That is:
ARDUPACKAGES_UPDATE_REQUESTED
— it is our decision should any dialog be shown or two, or the upgrade should start right awayPOPUP_DISCARDED
— it does not matter which popup, its identifier might be included in the payload in a unified way. The fact is just about clicking the cross icon, “Cancel” button, or ESC keyARDUPACKAGES_UPGRADE_PROCEED
— the reaction is the same, but semantics is better
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.
After googling again for Redux action name conventions, I think the best one to stick to is <NOUN>_<VERB_INFINITIVE>
. That is:
ARDUPACKAGES_UPDATE_REQUEST
POPUP_DISCARD
orPOPUP_CLOSE
ARDUPACKAGES_UPGRADE_PROCEED
See
@@ -106,6 +106,9 @@ const rawItems = { | |||
uploadToArduino: { | |||
label: 'Upload to Arduino...', | |||
}, | |||
updatePackages: { | |||
label: 'Update Packages...', |
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.
Upgrade Arduino Packages & Toolchains...
f3ac38a
to
8f199ab
Compare
@nkrkv fixed but just rename |
* | ||
* :: (Object -> _) -> ArduinoCli -> Promise String Error | ||
*/ | ||
const updateArduinoPackages = (onProgress, cli) => cli.core.upgrade(onProgress); |
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.
upgrade
subscribeIpc(() => checkUpdates(cli), CHECK_ARDUINO_DEPENDENCY_UPDATES); | ||
}; | ||
|
||
export const subscribeUpdateArduinoPackages = cli => { |
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.
upgrade?
client.deleteProcess(processId, client.INSTALL_ARDUINO_DEPENDENCIES) | ||
); | ||
export const showUpdatePackagesPopup = () => ({ | ||
type: AT.ARDUPACKAGES_UPDATE_REQUESTED, |
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.
Name after action type:
updateArdupackages
or updatePackages
type: AT.ARDUPACKAGES_UPDATE_REQUESTED, | ||
}); | ||
export const hideUpdatePackagesPopup = () => ({ | ||
type: AT.UPDATE_ARDUPACKAGES_POPUP_CLOSED, |
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.
closePackageUpdatePopup
8f199ab
to
5fb951f
Compare
@@ -41,3 +41,37 @@ export const deleteProcess = (id, type) => ({ | |||
payload: { id }, | |||
meta: { status: STATUS.DELETED }, | |||
}); | |||
|
|||
export const createProcess = type => dispatch => { |
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.
👍🏻
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.
LGTM
It closes #1453.