Skip to content

Commit

Permalink
fix: no pending data message
Browse files Browse the repository at this point in the history
  • Loading branch information
SPageot committed Dec 30, 2021
1 parent 0bac62b commit 7803a2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
14 changes: 1 addition & 13 deletions src/components/blocks/StagingDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux';
import styled, { withTheme } from 'styled-components';
import { TableCellHeaderText, TableCellText } from '../typography';
import { convertPascalCaseToSentenceCase } from '../../utils/stringUtils';
import { MinusIcon, H3 } from '..';
import { MinusIcon } from '..';
import { TableDrawer } from './';
import { useWindowSize } from '../hooks/useWindowSize';

Expand Down Expand Up @@ -76,13 +76,6 @@ const StagingDataTableContainer = styled('div')`
height: 100%;
`;

const NoDataMessageContainer = styled('div')`
display: flex;
height: 100%;
justify-content: center;
align-items: center;
`;

const ChangeGroupHeader = ({ headings, appStore }) => {
return (
<THead selectedTheme={appStore.theme}>
Expand Down Expand Up @@ -202,11 +195,6 @@ const StagingDataTable = withTheme(({ headings, data, deleteStagingData }) => {
return (
<StagingDataTableContainer ref={ref}>
<div style={{ height: `${height}px`, overflow: 'auto' }}>
{data.length === 0 && (
<NoDataMessageContainer>
<H3>No staged data at this time</H3>
</NoDataMessageContainer>
)}
{data &&
headings &&
data.map((changeGroup, index) => (
Expand Down
18 changes: 18 additions & 0 deletions src/pages/Projects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
SelectSizeEnum,
SelectTypeEnum,
CreateProjectForm,
H3
} from '../../components';

import {
Expand Down Expand Up @@ -48,6 +49,13 @@ const StyledSubHeaderContainer = styled('div')`
padding-right: 27.23px;
`;

const NoDataMessageContainer = styled('div')`
display: flex;
height: 100%;
justify-content: center;
align-items: center;
`;

const Projects = withRouter(() => {
const dispatch = useDispatch();
const [create, setCreate] = useState(false);
Expand Down Expand Up @@ -155,6 +163,11 @@ const Projects = withRouter(() => {
)}
</TabPanel>
<TabPanel value={tabValue} index={1} style={{ height: '100%' }}>
{climateWarehouseStore.stagingData && climateWarehouseStore.stagingData.projects.staging.length === 0 && (
<NoDataMessageContainer>
<H3>No staged data at this time</H3>
</NoDataMessageContainer>
)}
{climateWarehouseStore.stagingData && (
<StagingDataTable
headings={headings}
Expand All @@ -164,6 +177,11 @@ const Projects = withRouter(() => {
)}
</TabPanel>
<TabPanel value={tabValue} index={2} style={{ height: '100%' }}>
{climateWarehouseStore.stagingData && climateWarehouseStore.stagingData.projects.pending.length === 0 && (
<NoDataMessageContainer>
<H3>No pending data at this time</H3>
</NoDataMessageContainer>
)}
{climateWarehouseStore.stagingData && (
<StagingDataTable
headings={headings}
Expand Down

0 comments on commit 7803a2f

Please sign in to comment.