Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
#847 Test of loader in documentView
Browse files Browse the repository at this point in the history
  • Loading branch information
damianprzygodzki committed Jun 9, 2017
1 parent e2d9fb6 commit 83cf3a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/app/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {
import {
selectTableItems,
getItemsByProperty,
mapIncluded
mapIncluded,
indicatorState
} from '../../actions/WindowActions';

import {
Expand Down Expand Up @@ -354,6 +355,7 @@ class DocumentList extends Component {
const {windowType, updateUri, setNotFound} = this.props;

setNotFound && setNotFound(false);
this.props.dispatch(indicatorState('pending'));

if(updateUri){
id && updateUri('viewId', id);
Expand All @@ -364,6 +366,8 @@ class DocumentList extends Component {
return browseViewRequest(
id, page, this.pageLength, sortingQuery, windowType
).then(response => {
this.props.dispatch(indicatorState('saved'));

this.mounted && this.setState(Object.assign({}, {
data: response.data,
filters: response.data.filters
Expand Down
13 changes: 11 additions & 2 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import NotificationHandler
from '../components/notifications/NotificationHandler';

import {
noConnection
} from '../actions/WindowActions'
noConnection,
indicatorState
} from '../actions/WindowActions';

import {
addNotification,
Expand Down Expand Up @@ -45,7 +46,15 @@ export default class App extends Component {
languageSuccess(cachedLang);
}

// axios.interceptors.request.use(config => {
// store.dispatch(indicatorState('pending'));
// return config;
// }, error => {
// return Promise.reject(error);
// });

axios.interceptors.response.use(function (response) {
// store.dispatch(indicatorState('saved'));
return response;
}, function (error) {
if(!error.response){
Expand Down

0 comments on commit 83cf3a2

Please sign in to comment.