Skip to content

Commit

Permalink
fix: Loading indicator on object and variogram result (#422)
Browse files Browse the repository at this point in the history
* fix: Add animated progress indicator to object- and variogram result pages

* fix: Housekeeping (adjust HTML landmarks, correct a typo, set model page to full height)
  • Loading branch information
o-jorgensen authored Jan 2, 2025
1 parent a4c552e commit 81a81b7
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 10 deletions.
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} ${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

0 comments on commit 81a81b7

Please sign in to comment.