Add appropriate message if empty bundle #119
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.
Looks good but there might be an issue. See the comments.
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.
So I am not sure how to test the changes in this PR. Can you explain the steps to manually test this?
|
||
if (!localStorage.getItem("packageConfigJSON")["bundle"] === undefined ) { | ||
if (localStorage.getItem("packageConfigJSON")["bundle"]["title"] === undefined ) { | ||
this.setState({title: "No title Specified"}) |
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.
What do you expect the user to do under this condition?
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.
The user cannot do anything. He cannot manually change the title unless he goes back and creates a new configuration
To test manually you need to have npm and mavnen installed
To start backend
|
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 think there needs to be some extra logging or at least messaging for the else case.
I think you can add a whole separate ticket for testing.
else { | ||
this.setState({description: JSON.parse(localStorage.getItem("packageConfigJSON"))["bundle"]["description"]}) | ||
} | ||
} |
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.
Should you also notes if there are issues if "bundle" isn't in the packageConfigJSON?
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.
Should I add another condition to check if the bundle is present ?
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.
Only if there's not a check earlier for if JSON.parse(localStorage.getItem("packageConfigJSON"))["bundle"]
is missing. If it's missing, then you can't do generation, but you should put something out to the console so you can trace where a problem happened.
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.
These are just for the description for the cards so we do not really care if it present or not. If the generation errors out the backend comes back with the 404.
I am having difficulties running this PR. I get these errors in the frontend:
|
@kwhetstone @martinda Should we add more checks to this PR or is it good to go as is ? |
Hi @sladyn98 . I still get the errors I mentioned above. Those need to be addressed. This PR is behind master, so I suggest you start by rebasing it on master. Then write down the steps to test all aspects of this fix, then write a unit test. |
Steps to test this PR: |
For the testing of react we would need to choose a tool and then setup the architecture for it |
Tested this with three different cases |
I get the infinite spinning wheel :-( How I run it:
In another terminal:
The errors:
|
@martinda you can only run this pr using docker since multiple environments is not yet supported.we need to merge that first to get this working using npm and spring Boot |
Ok, so with docker "it runs" but I am still clueless with regards to testing this. What sequence of buttons should I click in the app? Should I expect error messages in the browser? |
@martinda instructions are the same as the previous comment made a few days back. Should I add something more in the instructions? |
This PR fixes the app crashing if the bundle in the local cache is empty and instead adds an appropriate message.