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

Fix- Flowchart does not load for static data inputs #843

Merged
merged 21 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a2ed98e
v4.4.0
studioswong Apr 1, 2022
d78fcd7
update lightsail image version
studioswong Apr 1, 2022
655da53
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong Apr 1, 2022
0c059f9
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong Apr 11, 2022
fd1510c
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong Apr 12, 2022
aa05699
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong Apr 17, 2022
d4d624a
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong May 3, 2022
513b7c6
add an additional dispatch action to ensure initial nodes gets rendered
studioswong May 3, 2022
5512181
added further comments to supplement the updateGraph sequence
studioswong May 3, 2022
a7ee933
update store.js and mocking of states
studioswong May 4, 2022
abf0894
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong May 4, 2022
dbfc0f5
Merge branch 'main' into fix/fix-viz-npm-loading-issue
studioswong May 4, 2022
d5adfb2
update release notes
studioswong May 5, 2022
3bd9cde
add in datatype prop for configureStore
studioswong May 5, 2022
34f600b
added param description
studioswong May 5, 2022
51d4bbe
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong May 5, 2022
2846eff
Merge branch 'main' into fix/fix-viz-npm-loading-issue
studioswong May 5, 2022
83122da
update release note
studioswong May 5, 2022
57682c2
update release note wording
studioswong May 5, 2022
4f80050
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into main
studioswong May 5, 2022
a154b38
Merge branch 'main' into fix/fix-viz-npm-loading-issue
studioswong May 5, 2022
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
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Please follow the established format:
- Update feature flag description to remind the user of the need for page refresh to apply settings. (#821)
- Fix experiment tracking not showing run details bug on Windows. (#809)
- Improve performance when many datasets are missing. (#832)
- Fix flowchart not showing on initial load for static data inputs. (#843)

# Release 4.4.0

Expand Down
2 changes: 1 addition & 1 deletion src/components/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class App extends React.Component {
constructor(props) {
super(props);
const initialState = getInitialState(props);
this.store = configureStore(initialState);
this.store = configureStore(initialState, this.props.data);
}

componentDidMount() {
Expand Down
12 changes: 10 additions & 2 deletions src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { saveState, pruneFalseyKeys } from './helpers';
* update state.graph via a web worker when it changes.
* @param {object} store Redux store
*/
const updateGraphOnChange = (store) => {
export const updateGraphOnChange = (store) => {
const watchGraph = watch(() => getGraphInput(store.getState()));
store.subscribe(
watchGraph((graphInput) => {
Expand Down Expand Up @@ -60,16 +60,24 @@ const saveStateToLocalStorage = (state) => {
/**
* Configure initial state and create the Redux store
* @param {Object} initialState Initial Redux state (from initial-state.js)
* @param {Object} dataType type of pipeline data - "static" or "json" (if data is loaded from API)
* @return {Object} Redux store
*/
export default function configureStore(initialState) {
export default function configureStore(initialState, dataType) {
studioswong marked this conversation as resolved.
Show resolved Hide resolved
const composeEnhancers =
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
reducer,
initialState,
composeEnhancers(applyMiddleware(thunk))
);

// dispatch the calculateGraph action to ensure the graph nodes still gets rendered
// on initial load if data is loaded via data prop instead of fetching from Rest API
if (dataType !== 'json') {
studioswong marked this conversation as resolved.
Show resolved Hide resolved
store.dispatch(calculateGraph(getGraphInput(store.getState())));
}

updateGraphOnChange(store);
store.subscribe(() => {
saveStateToLocalStorage(store.getState());
Expand Down
4 changes: 3 additions & 1 deletion src/utils/state.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export const setup = {
prepareState({ data: spaceflights, ...props })
);
return mount(
<Provider store={configureStore(initialState)}>{children}</Provider>
<Provider store={configureStore(initialState, 'json')}>
{children}
</Provider>
);
},
/**
Expand Down