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

Tech/move filestates to redux #853

Merged
merged 56 commits into from Mar 11, 2020
Merged

Tech/move filestates to redux #853

merged 56 commits into from Mar 11, 2020

Conversation

NearW
Copy link
Contributor

@NearW NearW commented Jan 31, 2020

Move the filestates to the redux store

Description

This PR should prevent the fileStates from being mutated unpredictably by moving it to the redux store and only mutating it with redux actions. This should make the dataflow easier and also make future performance issues (cloning a lot) easier to solve.

  • Created a new folder model
  • Added class Files that handles all reducer functions and provides the functionality of the previous fileStateHelper class
  • Refactored some functions that passed a parameter through and through instead of just reading it from the store, where the parameter was needed

Notes to reviewer

  • When everything is reviewed and approved, we should move the codeCharta.model.ts into the model folder
  • Since this was a major refactoring, please take your time to give it a long manual test

Definition of Done

A task/pull request will not be considered to be complete until all these items can be checked off.

  • All requirements mentioned in the issue are implemented
  • Does match the Code of Conduct and the Contribution file
  • Task has its own GitHub issue (something it is solving)
    • Issue number is included in the commit messages for traceability
  • Update the README.md with any changes/additions made
  • Update the CHANGELOG.md with any changes/additions made
  • Enough test coverage to ensure that uncovered changes do not break functionality
  • All tests pass
  • Descriptive pull request text, answering:
    • What problem/issue are you fixing?
    • What does this PR implement and how?
  • Assign your PR to someone for a code review
    • This person will be contacted first if a bug is introduced into master
  • Manual testing did not fail

…ilestates-to-redux

# Conflicts:
#	visualization/app/codeCharta/state/injector.service.ts
#	visualization/app/codeCharta/state/state.module.ts
#	visualization/app/codeCharta/ui/codeMap/codeMap.arrow.service.spec.ts
#	visualization/app/codeCharta/ui/codeMap/codeMap.arrow.service.ts
#	visualization/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts
#	visualization/app/codeCharta/ui/fileChooser/fileChooser.component.ts
@NearW NearW added the tech For technical stories without user impact (=refactoring stories). label Jan 31, 2020
@alschmut
Copy link
Contributor

alschmut commented Jan 31, 2020

@NearW are you sure to add the files (old: fileStates) to the fileSettings? Because in fact, a CCFile can contain fileSettings, which makes it recursive then. I would rather put them side by side with the fileSettings/dynamicSettings etc. on the top level.

@NearW
Copy link
Contributor Author

NearW commented Feb 6, 2020

@NearW are you sure to add the files (old: fileStates) to the fileSettings? Because in fact, a CCFile can contain fileSettings, which makes it recursive then. I would rather put them side by side with the fileSettings/dynamicSettings etc. on the top level.

I know. See the first todo checkbox. :D

…ilestates-to-redux

# Conflicts:
#	visualization/plopfile.js
…ilestates-to-redux

# Conflicts:
#	visualization/app/codeCharta/codeCharta.service.ts
#	visualization/app/codeCharta/state/metric.service.spec.ts
#	visualization/app/codeCharta/state/store.service.spec.ts
#	visualization/app/codeCharta/state/store.service.ts
#	visualization/app/codeCharta/state/store/appSettings/mapColors/mapColors.reducer.ts
#	visualization/app/codeCharta/state/store/dynamicSettings/colorRange/colorRange.reducer.ts
#	visualization/app/codeCharta/state/store/fileSettings/attributeTypes/attributeTypes.reducer.ts
#	visualization/app/codeCharta/state/store/fileSettings/attributeTypes/attributeTypes.service.ts
#	visualization/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.ts
#	visualization/app/codeCharta/state/store/fileSettings/edges/edges.service.ts
#	visualization/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.ts
#	visualization/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.service.ts
#	visualization/app/codeCharta/ui/codeMap/codeMap.preRender.service.spec.ts
#	visualization/app/codeCharta/ui/codeMap/codeMap.preRender.service.ts
#	visualization/app/codeCharta/ui/codeMap/codeMap.render.service.spec.ts
#	visualization/app/codeCharta/util/fileDownloader.ts
#	visualization/app/codeCharta/util/settingsMerger.spec.ts
#	visualization/app/codeCharta/util/settingsMerger.ts
@NearW NearW changed the title WIP: Tech/move filestates to redux Tech/move filestates to redux Feb 14, 2020
@alschmut
Copy link
Contributor

alschmut commented Feb 27, 2020

So I just run the visualisation for this branch, and found these two bugs:

undefined mode (fixed with commit)

  • Select Multiple mode
  • Open the mapSelection
  • Unselect all maps or click button None
    => now no mode is selected, the loadingMapGif is showing and
    => the mapSelection disappears, when clicking outside of the mapSelection menu
    Comment: While I kinda like that it's not setting the only available unary metric for all three metrics as it did before, we should find a solution here that behaves like before or better.

preselected multiple mode (not reproducable)

  • Select Multiple mode
  • Import two or more files
    => now sometimes the multiple mode is still selected, although it should by default select single mode after importing new files
  • EDIT: I can somehow not reproduce this bug anymore..

@alschmut alschmut self-assigned this Mar 1, 2020
@alschmut alschmut self-requested a review March 7, 2020 13:39
Copy link
Contributor

@alschmut alschmut left a comment

Choose a reason for hiding this comment

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

After implementing the requested changes and fixing the selection of zero files in Multiple mode, I am fine with merging this PR 🎉

@JaiJoPa
Copy link
Contributor

JaiJoPa commented Mar 11, 2020

After implementing the requested changes and fixing the selection of zero files in Multiple mode, I am fine with merging this PR 🎉

I like the fix! Thanks @alschmut

@JaiJoPa JaiJoPa merged commit f1be26d into master Mar 11, 2020
@JaiJoPa JaiJoPa deleted the tech/move-filestates-to-redux branch March 11, 2020 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech For technical stories without user impact (=refactoring stories).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants