Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2f3d1b9

Browse files
committed
toaster apply on update
1 parent 96e83d8 commit 2f3d1b9

File tree

8 files changed

+9226
-5220
lines changed

8 files changed

+9226
-5220
lines changed

‎package-lock.json

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

‎package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
"react-dom": "^16.4.0",
2828
"react-loadable": "^5.4.0",
2929
"react-redux": "^5.0.7",
30+
"react-redux-toastr": "^7.3.0",
3031
"react-router-config": "^1.0.0-beta.4",
3132
"react-router-dom": "^4.3.1",
3233
"react-router-redux": "^4.0.8",
3334
"react-scripts": "1.1.4",
3435
"react-select": "^1.2.1",
3536
"react-table": "^6.8.6",
36-
"react-test-renderer": "^16.4.0",
37+
"react-test-renderer": "^16.4.0",
3738
"reactstrap": "^6.1.0",
3839
"redux": "^4.0.0",
3940
"redux-devtools-extension": "^2.13.2",

‎src/containers/App/Backend/Access/Roles/reducer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export default (state = initialState, action) => {
5050
...state,
5151
inProgress: false,
5252
errors: action.error ? action.payload.error : null,
53-
redirectTo: action.error ? null : '/access/role',
5453
};
5554
case ROLE_FORM_PAGE_LOADED:
5655
return {

‎src/containers/App/Backend/Access/Users/reducer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export default (state = initialState, action) => {
4242
...state,
4343
inProgress: false,
4444
errors: action.error ? action.payload.error : null,
45-
redirectTo: action.error ? null : '/access/user',
4645
};
4746
case USER_FORM_PAGE_LOADED:
4847
return {

‎src/containers/App/Backend/Layouts/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import reducer from '../backendCommonReducer';
2222
import authAgent from '../Auth/agent';
2323
import { APP_LOAD } from 'constants/actionTypes';
2424

25+
import { toastr } from 'react-redux-toastr';
26+
2527
// sidebar nav config
2628
import { navigation } from '../Routes';
2729

@@ -38,6 +40,7 @@ import AdminFooter from './Footer';
3840
import AdminHeader from './Header';
3941

4042
import { BACKEND_REDIRECT } from '../constant';
43+
import ReduxToastr from 'react-redux-toastr';
4144

4245
class AdminLayout extends Component {
4346
// constructor(props) {
@@ -51,6 +54,7 @@ class AdminLayout extends Component {
5154

5255
componentWillReceiveProps(nextProps) {
5356
if (nextProps.redirectTo) {
57+
toastr.success('Success', 'The user updated Success.');
5458
this.props.history.push(nextProps.redirectTo);
5559
this.props.onRedirect();
5660
}
@@ -59,6 +63,16 @@ class AdminLayout extends Component {
5963
render() {
6064
return (
6165
<div className="app">
66+
<ReduxToastr
67+
timeOut={4000}
68+
newestOnTop={false}
69+
preventDuplicates
70+
position="top-right"
71+
transitionIn="fadeIn"
72+
transitionOut="fadeOut"
73+
progressBar
74+
/>
75+
6276
<AppHeader fixed>
6377
<AdminHeader
6478
appName={this.props.appName}

‎src/reducers/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { combineReducers } from 'redux';
22
import { reducer as formReducer } from 'redux-form';
33

4+
import { reducer as toastrReducer } from 'react-redux-toastr';
5+
46
import common from './common';
57

68
export default function createReducer(injectedReducers) {
79
return combineReducers({
810
form: formReducer,
911
common,
12+
toastr: toastrReducer,
1013
...injectedReducers,
1114
});
1215
}

‎src/scss/_custom.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import 'react-redux-toastr/src/styles/index';
12
// Here you can add other styles
23
.centered-checkbox {
34
display: flex;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /