Skip to content
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

PLANNER-1339: Add Redux as state container #23

Merged
merged 14 commits into from
Nov 5, 2018

Conversation

danielefiungo
Copy link
Contributor

No description provided.

@yurloc
Copy link
Member

yurloc commented Oct 26, 2018

The rest of the build errors (apart the one I commented on inline) can be fixed by running npm install and npm run lint:fix.

@yurloc
Copy link
Member

yurloc commented Oct 26, 2018

Every source file (.js, .css, .java, etc.) must have a license header (I think most of configuration files don't have to, so for example .editorconfig doesn't need it).

Action item for me: set up an automated check for license headers that will fail CI build if it's missing.

optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/ducks/tsp/actions.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Show resolved Hide resolved
optaweb-tsp-ui/src/App.js Outdated Show resolved Hide resolved
@danielefiungo danielefiungo changed the title WIP: Add Redux as state container Add Redux as state container Nov 2, 2018
let webSocket;
let stompClient;

function mapEventToActions(dispatch) {
Copy link
Member

Choose a reason for hiding this comment

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

@danielefiungo Is there a good reason to name the function like this? I'm a bit confused. I would expect it to be called perhaps subscribe() or subscribeToRouteTopic() or similar.

Copy link
Member

@yurloc yurloc left a comment

Choose a reason for hiding this comment

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

@danielefiungo the code looks very nice. However, the refactoring introduces two regressions:

  • Automatic re-connection doesn't work.
  • UI doesn't work correctly when there is 1 or 2 locations.
    • If I click an empty map, it remains empty although the home location is added on backend. It's just not displayed until I add the second locations.
    • When there are 2 locations (home + 1 visit) and I remove the visit location, it is not removed from the map.

Under normal circumstances, we would need to fix those bugs before the PR can be merged. At this stage, I'm willing to merge if it help your workflow (let's talk about this on IRC).

From test coverage perspective, it would be really nice if you could write a test that fails due to the UI bug before the fix is made. Since we currently don't have a test that would detect the bug, there's obviously missing test coverage (can we detect it?). If we fix the bug without adding test first, the coverage won't improve and the same bug can be introduced again.

@yurloc
Copy link
Member

yurloc commented Nov 2, 2018

Reconnection now works, thanks!

Copy link
Member

@yurloc yurloc left a comment

Choose a reason for hiding this comment

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

Bugs fixed.

@yurloc yurloc merged commit 0d754ea into kiegroup:master Nov 5, 2018
@yurloc yurloc changed the title Add Redux as state container PLANNER-1339: Add Redux as state container Nov 5, 2018
@danielefiungo danielefiungo deleted the add_redux branch November 5, 2018 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants