-
Notifications
You must be signed in to change notification settings - Fork 40
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
1863 upgrade button #1951
1863 upgrade button #1951
Conversation
api/src/app_latest_version.ts
Outdated
switch (bodyResult.apiVersion) { | ||
case "1.0": { | ||
axios | ||
.get("https://hub.docker.com/v2/repositories/trubudget%2Fapi/tags?page_size=10") |
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.
I would take this out at least to Constants file
Generated by E2E-Test |
const [latestVersion, setLatestVersion] = useState(null); | ||
|
||
useEffect(() => { | ||
axios |
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.
I would take backend calls to api file
}, []); | ||
|
||
const upgradeApp = useCallback(() => { | ||
axios |
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.
same here, should be in api file with other backend calls
@@ -136,6 +172,13 @@ const StatusTable = (props) => { | |||
return ( | |||
<div data-test="status-dashboard" className="table-container"> | |||
<div className="custom-width"> | |||
<p> | |||
New version of TruBudget is available. Backup your data and click{" "} | |||
<Button onClick={upgradeApp} variant="contained"> |
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 button should be probably visible only to root user
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.
missing error handling on api calls. Non root users are getting error overlay on opening this page, as well as on Upgrade button click
const [latestVersion, setLatestVersion] = useState(null); | ||
|
||
useEffect(() => { | ||
axios |
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.
also, question here would be, if this request should be even called for non root users? If yes, should non root users alway get error in response?
Checklist
Description
How to test
upgrade_version.txt
with content "v2.14.0" (if the file was deleted in the meantime)Alternatively if app is started with
start-upgradable-trubudget.sh
script it has the ability to restart itself when stopped. The check is based on presence of running api container. If you stop it, the app should restart.You can stop this process by
stop-upgradable-trubudget.sh
script.Closes #1863