Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Loading indicator on object and variogram result #422

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

const StyledOutletWrapper = styled.section`
const StyledOutletWrapper = styled.div`
height: calc(100% - 128px);
overflow: auto;
`;
Expand Down
4 changes: 2 additions & 2 deletions src/features/HandleModel/SidePane/SidePane.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import styled from 'styled-components';
import { spacings } from '../../../tokens/spacings';
import { theme } from '../../../tokens/theme';

export const SidebarWrapper = styled.div`
heigth: 100%;
export const SidebarWrapper = styled.aside`
height: 100%;
max-width: 256px;
`;

Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddModel/AddModel.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const PageLayout = styled.div`
height: 100%;
`;

export const Content = styled.div`
export const Content = styled.main`
display: flex;
flex-direction: column;
align-items: flex-start;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Browse/Browse.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';
import { spacings } from '../../tokens/spacings';

export const BrowseWrapper = styled.div`
export const BrowseWrapper = styled.main`
column-gap: ${spacings.X_LARGE};
padding: ${spacings.XXX_LARGE} ${spacings.X_LARGE};

Expand Down
7 changes: 5 additions & 2 deletions src/pages/ModelPages/Model/Model.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ export const Wrapper = styled.div`
display: grid;
grid-template-areas: 'sidebar content';
grid-template-columns: 16rem 1fr;
height: 100%;
`;

export const ContentWrapper = styled.div`
export const ContentWrapper = styled.main`
grid-area: content;
display: flex;
flex-flow: column nowrap;
`;

export const SidebarWrapper = styled.div`
export const SidebarWrapper = styled.aside`
grid-area: sidebar;
`;
2 changes: 1 addition & 1 deletion src/pages/ModelPages/Model/Model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const Model = () => {
size={24}
value={100}
variant="indeterminate"
/>{' '}
/>
<Typography variant="body_short">Loading, please wait…</Typography>
</div>
</Styled.EmptyPage>
Expand Down
17 changes: 16 additions & 1 deletion src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { NoResults } from '../../../../features/Results/NoResults/NoResults';
import { useFetchObjectResults } from '../../../../hooks/useFetchChannelResults';
import { usePepmContextStore } from '../../../../hooks/GlobalState';
import { useEffect } from 'react';
import { CircularProgress, Typography } from '@equinor/eds-core-react';
import * as Styled from '../../Model/Model.styled';

export const ObjectResult = () => {
const { computeCases, objectResults, setObjectEstimationResults } =
Expand All @@ -13,7 +15,20 @@ export const ObjectResult = () => {
if (data) setObjectEstimationResults(data.data);
}, [data, setObjectEstimationResults]);

if (isLoading) return <>Loading ...</>;
if (isLoading)
return (
<Styled.EmptyPage>
<div className="loading">
<CircularProgress
color="primary"
size={24}
value={100}
variant="indeterminate"
/>
<Typography variant="body_short">Loading, please wait…</Typography>
</div>
</Styled.EmptyPage>
);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { CaseResultView } from '../../../../features/Results/CaseResult/CaseResu
import { NoResults } from '../../../../features/Results/NoResults/NoResults';
import { usePepmContextStore } from '../../../../hooks/GlobalState';
import { useFetchVariogramResults } from '../../../../hooks/useFetchVariogramResults';
import { CircularProgress, Typography } from '@equinor/eds-core-react';
import * as Styled from '../../Model/Model.styled';

export const VariogramResults = () => {
const { data, isLoading } = useFetchVariogramResults();
Expand All @@ -13,7 +15,20 @@ export const VariogramResults = () => {
if (data) setVariogramResults(data.data);
}, [data, setVariogramResults]);

if (isLoading) return <>Loading ...</>;
if (isLoading)
return (
<Styled.EmptyPage>
<div className="loading">
<CircularProgress
color="primary"
size={24}
value={100}
variant="indeterminate"
/>
<Typography variant="body_short">Loading, please wait…</Typography>
</div>
</Styled.EmptyPage>
);

return (
<>
Expand Down
Loading