Commit d6759b25 authored by Valeriy Panov's avatar Valeriy Panov Committed by Matija Obreza
Browse files

`<Loading...` component

parent 5b7b7b86
Pipeline #4121 passed with stages
in 2 minutes and 56 seconds
import * as React from 'react';
import { CircularProgress } from 'material-ui/Progress';
export default ({message}) => (
<div style={ { textAlign: 'center' } }>
<CircularProgress size={ 50 }/>
{ message && <div>{ message }</div> }
</div>
);
......@@ -11,6 +11,7 @@ import { IDescriptorListFilter } from 'model/filter.model';
import { withStyles } from 'material-ui/styles';
import Grid from 'material-ui/Grid';
import Loading from 'ui/common/Loading';
import PaginationComponent from 'ui/common/pagination';
import DescriptorListCard from 'ui/catalog/descriptorlist/Card';
import DescriptorListFilters from './c/Filters';
......@@ -94,7 +95,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
if (! paged || ! paged.content) {
console.log('paged===null?', paged);
return null;
return <Loading message="Fetching data..." />;
}
return (
......
......@@ -12,6 +12,7 @@ import PartnerFilters from './c/Filters';
import Summary from './c/Summary';
import PartnerCard from './c/PartnerCard';
import Loading from 'ui/common/Loading';
import PaginationComponent from 'ui/common/pagination';
import Grid from 'material-ui/Grid';
......@@ -101,7 +102,7 @@ class PartnerListPage extends React.Component<IBrowsePageProps, any> {
if (! paged || ! paged.content) {
console.log('paged===null?', paged);
return null;
return <Loading message="Fetching data..." />;
}
return (
......
......@@ -2,18 +2,20 @@ import * as React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { withStyles } from 'material-ui/styles';
import Grid from 'material-ui/Grid';
import Button from 'material-ui/Button';
import { listVocabularies, createVocabulary } from 'actions/vocabulary';
import { Vocabulary, IVocabularyFilter } from 'model/vocabulary.model';
import { Page, Pagination } from 'model/common.model';
import Authorize from 'ui/common/authorized/Authorize';
import Loading from 'ui/common/Loading';
import PaginationComponent from 'ui/common/pagination';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import VocabularyCard from './c/VocabularyCard';
import Grid from 'material-ui/Grid';
import Button from 'material-ui/Button';
const styles = (theme) => ({
root: {
backgroundColor: '#E8E5E0',
......@@ -71,7 +73,11 @@ class BrowsePage extends React.Component<IBrowsePageProps & any, any> {
public render() {
const {classes, paged, createVocabulary} = this.props;
return paged && paged.content && (
if (!(paged && paged.content)) {
return <Loading message="Fetching data..." />;
}
return (
<div className={ classes.root }>
<Authorize role="ROLE_ADMINISTRATOR">
<ContentHeaderWithButton title="What do you want to do?" buttons={ <Button raised onClick={ createVocabulary }>Create vocabulary</Button> } />
......@@ -84,7 +90,7 @@ class BrowsePage extends React.Component<IBrowsePageProps & any, any> {
sortOptions={ sortOptions }
/>
</Grid>
{ paged && paged.content.map((vocabulary: Vocabulary, index) => (
{ paged.content.map((vocabulary: Vocabulary, index) => (
<Grid key={ index } item xs={ 12 }>
<VocabularyCard className={ classes.card } vocabulary={ vocabulary } />
</Grid>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment