Skip to content

Commit fcd385b

Browse files
Fix rendering of steps
1 parent 5b2e59e commit fcd385b

9 files changed

Lines changed: 86 additions & 33 deletions

File tree

example-project/src/auth/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010

1111
function authenticate(provider) {
1212
return dispatch => {
13-
//c1c:#signin#2;firebase auth;on success set
13+
//c1c:#signin#1;firebase auth;on success set
1414
firebaseAuth.signInWithPopup(provider)
1515
.then(result => dispatch(signInSuccess(result)))
1616
.catch(error => dispatch(signInError(error)));

example-project/src/auth/reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function authReducer(state = new AuthState(), {payload, type}) {
1313
case INIT_AUTH:
1414
case SIGN_IN_SUCCESS:
1515
return state.merge({
16-
authenticated: !!payload,
16+
authenticated: !!payload, //c1c:#signin#2;authenticated toggle
1717
id: payload ? payload.uid : null
1818
});
1919

example-project/src/views/components/task-item/task-item.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export class TaskItem extends Component {
8282
);
8383
}
8484

85-
//c2c:#layout#4;item;
8685
render() {
8786
const { editing } = this.state;
8887
const { task } = this.props;

example-project/src/views/pages/sign-in/sign-in-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SignInPage.propTypes = {
3333
//-------------------------------------
3434

3535
const mapDispatchToProps = {
36-
signInWithGithub: authActions.signInWithGithub, //c1c:#signin#1;dispatch action
36+
signInWithGithub: authActions.signInWithGithub, //c1c:#signin#0;dispatch action
3737
signInWithGoogle: authActions.signInWithGoogle,
3838
signInWithTwitter: authActions.signInWithTwitter
3939
};

src/public/dist/bundle.js

Lines changed: 44 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/dist/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/js/components/controls/ViewSwitches/store/reducer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ const DefaultState = {
7676
checkedState: {
7777
[CONTROLS_KEYS.SOURCE]: true,
7878
[CONTROLS_KEYS.DEPENDENCIES_SHOW_DIRECT_ONLY]: true,
79-
[CONTROLS_KEYS.CODE_CRUMBS_LINE_NUMBERS]: true
79+
[CONTROLS_KEYS.CODE_CRUMBS_LINE_NUMBERS]: true,
80+
[CONTROLS_KEYS.CODE_CRUMBS_KEEP_ONLY_SELECTED_FLOW]: true
81+
},
82+
disabledState: {
83+
[CONTROLS_KEYS.CODE_CRUMBS_KEEP_ONLY_SELECTED_FLOW]: true
8084
},
81-
disabledState: {},
8285
valuesState: {
8386
zoom: 1,
8487
selectedTabInSideBar: 'Code'

src/public/js/components/treeDiagram/component/Edge/CodeCrumbEdge.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,19 @@ export const CodeCrumbedFlowEdge = props => {
9595
];
9696
}
9797
} else {
98-
polylinePoints = [
99-
[sourcePt.x, sourcePt.y],
100-
[sourcePt.x, sourcePt.y - padding],
101-
[targetPt.x, sourcePt.y - padding],
102-
[targetPt.x, targetPt.y]
103-
];
98+
if (Math.abs(sourcePt.x - targetPt.x) < 5 ) {
99+
polylinePoints = [
100+
[sourcePt.x, sourcePt.y],
101+
[targetPt.x, targetPt.y]
102+
];
103+
} else {
104+
polylinePoints = [
105+
[sourcePt.x, sourcePt.y],
106+
[sourcePt.x, sourcePt.y - padding],
107+
[targetPt.x, sourcePt.y - padding],
108+
[targetPt.x, targetPt.y]
109+
];
110+
}
104111
}
105112

106113
const endPointConfig = {

src/public/js/utils/treeLayout.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ export const getTreeLayout = (
1818

1919
// TODO: hide .. for folders where it doesn't change anything
2020
data.childrenCollapsed = filteredChildren.length !== data.children.length;
21+
// TODO: refactor sorting of flow steps
22+
if (data.childrenCollapsed && activeCodeCrumbs) {
23+
if (
24+
filteredChildren.length > 1 &&
25+
filteredChildren.filter(
26+
i =>
27+
i.type === FILE_NODE_TYPE &&
28+
i.hasCodecrumbs &&
29+
(i.children || []).find(({ params }) => activeCodeCrumbs[params.original])
30+
).length === filteredChildren.length
31+
) {
32+
filteredChildren.sort(
33+
(a, b) =>
34+
b.children.find(({ params }) => activeCodeCrumbs[params.original]).params
35+
.flowStep -
36+
a.children.find(({ params }) => activeCodeCrumbs[params.original]).params.flowStep
37+
);
38+
}
39+
}
40+
2141
return filteredChildren;
2242
}
2343

0 commit comments

Comments
 (0)