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

Feat/normalizing state #882

Merged
merged 39 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f0d7a46
feat: add normalize and denormalize function to deal with redux state
Guilherme-NL Oct 17, 2023
6df8135
test: update tests to deal with the normalized state
Guilherme-NL Oct 17, 2023
2591286
fix: remove commited line from columns_spec
Guilherme-NL Oct 18, 2023
7834fe7
refactor: simplify mergeWithFetchedStories
Guilherme-NL Oct 18, 2023
ff49808
feat: addition of multiple new stories
Guilherme-NL Oct 20, 2023
cc7cd7d
fix: story delete
Guilherme-NL Oct 20, 2023
d83342a
test: update tests, id as a symbol
Guilherme-NL Oct 20, 2023
e034442
remove console.log
Guilherme-NL Oct 20, 2023
12ab998
feat: create functions to normalize and denormalize pastIterations
Guilherme-NL Oct 20, 2023
e59db1f
feat: update pastIterations reducers to normalize the data
Guilherme-NL Oct 20, 2023
042534c
refactor: normalizeStories variable names
Guilherme-NL Oct 20, 2023
6529e01
refactor: denomalize pasIterations to render
Guilherme-NL Oct 20, 2023
23851fd
test: uptade test
Guilherme-NL Oct 20, 2023
a1bf32f
test: add normalize and denormalize tests
Guilherme-NL Oct 23, 2023
a5b4255
refactor: remove unwanted mutability, repited id insertion in createN…
Guilherme-NL Oct 24, 2023
9785b5e
feat: add function to generate a temporary id
Guilherme-NL Oct 24, 2023
54e3d99
refactor: recive past stories
Guilherme-NL Oct 25, 2023
86a5b7d
refactor mergeWithFetchedStories function, to deal with allIds array
Guilherme-NL Oct 25, 2023
8b4d850
update tests
Guilherme-NL Oct 25, 2023
cf256e7
refactor: normalize and denormalize past iterations, add byId and allIds
Guilherme-NL Oct 25, 2023
6d4d960
update tests
Guilherme-NL Oct 25, 2023
8f6e1a6
test: add delete test, when a story is no longer fetched
Guilherme-NL Oct 25, 2023
7d849f3
feat: add stories selectors
Guilherme-NL Oct 30, 2023
fb150fc
feat: import selectors
Guilherme-NL Oct 30, 2023
5dac247
test: update story spec tests
Guilherme-NL Oct 30, 2023
84c222d
feat: add pastIteration selectors
Guilherme-NL Oct 30, 2023
04199c2
refactor: import getIterations
Guilherme-NL Oct 30, 2023
5e86a06
refactor: pastIterations reducers to use normalized state
Guilherme-NL Oct 31, 2023
c69f0fa
test: update tests using normalized state
Guilherme-NL Oct 31, 2023
237399f
refactor: remove mutability from mergeWithFetchedStories
Guilherme-NL Oct 31, 2023
71544a6
remove comment
Guilherme-NL Oct 31, 2023
28d4aec
refactor: move mergeWithFetchedStories to /reducers/stories.js
Guilherme-NL Oct 31, 2023
01a6864
test: update tests
Guilherme-NL Oct 31, 2023
68dc3d6
refactor: avoid mutability
Guilherme-NL Nov 1, 2023
cf02560
refactor: mergedStories generation, and fix delete test
Guilherme-NL Nov 1, 2023
07a73b6
refactor: move pastIterations normalize and denormalize functions fro…
Guilherme-NL Nov 3, 2023
6ce9990
feat: add projectBoard, stories and project slectors
Guilherme-NL Nov 3, 2023
8515d58
refactor: move stories normalize and denormalize functions from model…
Guilherme-NL Nov 3, 2023
cf14e7d
refactor: remove denormalizedIterations function
Guilherme-NL Nov 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions app/assets/javascripts/actions/projectBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ export const fetchProjectBoard =
(projectId) =>
async (dispatch, getState, { ProjectBoard, UrlService }) => {
dispatch(requestProjectBoard());
const currentState = getState();

const fetchedIterations = currentState.pastIterations.filter(
(iteration) => iteration.fetched === true
);

const storyIds = fetchedIterations.flatMap(
(iterations) => iterations.storyIds
);

try {
const { project, users, stories, pastIterations } =
Expand All @@ -97,7 +88,7 @@ export const fetchProjectBoard =
dispatch(receiveProject(project));
dispatch(receivePastIterations(pastIterations));
dispatch(receiveUsers(users));
dispatch(receiveStories({ stories, storyIds }));
dispatch(receiveStories(stories));
dispatch(receiveProjectBoard(projectId));
expandStoryIfNeeded(dispatch, UrlService.getHash);
} catch (error) {
Expand Down
Loading
Loading