Skip to content

Commit 8ff8e45

Browse files
committed
general BUG fix
1 parent e946ccb commit 8ff8e45

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

app-manage/routes.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const getRoutes = (history, store) => {
2323
return (
2424
<Router history={history}>
2525
<Route path="/" component={App}>
26-
<IndexRoute component={Editor} />
26+
<IndexRoute component={Editor} onEnter={requireAuth} />
2727
<Route path="login" component={Login} />
2828
<Route path="signup" component={SignupForm} />
2929
<Route path="user">

app-manage/sagas/user.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function* runLogin({ username, password }) {
77
const { response, error } = yield call(api.login, username, password);
88
if (response) {
99
yield put(userActions.login.success({ username }, response));
10-
history.push('/library');
10+
history.push('/square');
1111
} else {
1212
yield put(userActions.login.failure({ username }, error));
1313
}
@@ -28,7 +28,7 @@ export function* runChangePassword({ oldPassword, newPassword }) {
2828
const { response, error } = yield call(api.changepassword, oldPassword, newPassword, token);
2929
if (response) {
3030
yield put(userActions.changePassword.success({ message: '修改密码成功' }, response));
31-
history.push('/library');
31+
history.push('/square');
3232
} else {
3333
yield put(userActions.changePassword.failure({ }, error));
3434
}

app/components/ConditionModule.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default class ConditionModule extends Component {
8181
ifModuleBlockClick() {
8282
const { dispatch } = this.props;
8383
dispatch(addIf({ parentId: this.props.id, playload: 'procedure' }));
84-
this.setState({ conditionModalOpen: false });
84+
this.setState({ modalOpen: false });
8585
}
8686

8787
createModule(programModule) {

app/components/UnaryOperatorModule.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ const opTypes = [
3333
text: '-',
3434
value: 'unary_minus',
3535
},
36+
{
37+
text: '=',
38+
value: 'unary_assign',
39+
},
3640
];
3741

3842
export default class UnaryOperatorModule extends Component {

app/reducers/program.js

+3
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ const program = (state = initialState, action) => {
155155
return {
156156
...state,
157157
isLoading: false,
158+
id: action.response.problemId, // TODO: have not tested...
159+
state: action.response.state,
160+
rate: action.response.passRate,
158161
};
159162
case problemActions.UPDATE_PROBLEM.FAILURE:
160163
return {

styles/program-card.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.program-card {
44
width: 300px;
5-
height: 150px;
5+
height: 140px;
66
padding: 16px;
77
margin-right: 16px;
88
margin-bottom: 16px;
@@ -11,6 +11,7 @@
1111
border: 1px solid #e9e9e9;
1212
cursor: pointer;
1313
transition: 0.5s;
14+
vertical-align: top;
1415

1516
&__title {
1617
font-size: 32px;
@@ -20,6 +21,7 @@
2021
&__description {
2122
font-size: 16px;
2223
color: $primary-font-color;
24+
height: 36px;
2325
}
2426

2527
&:hover {

0 commit comments

Comments
 (0)