Skip to content

Commit 81a81b7

Browse files
authored
fix: Loading indicator on object and variogram result (#422)
* 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)
1 parent a4c552e commit 81a81b7

File tree

8 files changed

+43
-10
lines changed

8 files changed

+43
-10
lines changed

src/App.styled.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components';
22

3-
const StyledOutletWrapper = styled.section`
3+
const StyledOutletWrapper = styled.div`
44
height: calc(100% - 128px);
55
overflow: auto;
66
`;

src/features/HandleModel/SidePane/SidePane.styled.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import styled from 'styled-components';
33
import { spacings } from '../../../tokens/spacings';
44
import { theme } from '../../../tokens/theme';
55

6-
export const SidebarWrapper = styled.div`
7-
heigth: 100%;
6+
export const SidebarWrapper = styled.aside`
7+
height: 100%;
88
max-width: 256px;
99
`;
1010

src/pages/AddModel/AddModel.styled.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const PageLayout = styled.div`
88
height: 100%;
99
`;
1010

11-
export const Content = styled.div`
11+
export const Content = styled.main`
1212
display: flex;
1313
flex-direction: column;
1414
align-items: flex-start;

src/pages/Browse/Browse.styled.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styled from 'styled-components';
22
import { spacings } from '../../tokens/spacings';
33

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

src/pages/ModelPages/Model/Model.styled.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ export const Wrapper = styled.div`
2020
display: grid;
2121
grid-template-areas: 'sidebar content';
2222
grid-template-columns: 16rem 1fr;
23+
height: 100%;
2324
`;
2425

25-
export const ContentWrapper = styled.div`
26+
export const ContentWrapper = styled.main`
2627
grid-area: content;
28+
display: flex;
29+
flex-flow: column nowrap;
2730
`;
2831

29-
export const SidebarWrapper = styled.div`
32+
export const SidebarWrapper = styled.aside`
3033
grid-area: sidebar;
3134
`;

src/pages/ModelPages/Model/Model.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const Model = () => {
132132
size={24}
133133
value={100}
134134
variant="indeterminate"
135-
/>{' '}
135+
/>
136136
<Typography variant="body_short">Loading, please wait…</Typography>
137137
</div>
138138
</Styled.EmptyPage>

src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { NoResults } from '../../../../features/Results/NoResults/NoResults';
33
import { useFetchObjectResults } from '../../../../hooks/useFetchChannelResults';
44
import { usePepmContextStore } from '../../../../hooks/GlobalState';
55
import { useEffect } from 'react';
6+
import { CircularProgress, Typography } from '@equinor/eds-core-react';
7+
import * as Styled from '../../Model/Model.styled';
68

79
export const ObjectResult = () => {
810
const { computeCases, objectResults, setObjectEstimationResults } =
@@ -13,7 +15,20 @@ export const ObjectResult = () => {
1315
if (data) setObjectEstimationResults(data.data);
1416
}, [data, setObjectEstimationResults]);
1517

16-
if (isLoading) return <>Loading ...</>;
18+
if (isLoading)
19+
return (
20+
<Styled.EmptyPage>
21+
<div className="loading">
22+
<CircularProgress
23+
color="primary"
24+
size={24}
25+
value={100}
26+
variant="indeterminate"
27+
/>
28+
<Typography variant="body_short">Loading, please wait…</Typography>
29+
</div>
30+
</Styled.EmptyPage>
31+
);
1732

1833
return (
1934
<>

src/pages/ModelPages/Results/VariogramResults/VariogramResults.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { CaseResultView } from '../../../../features/Results/CaseResult/CaseResu
33
import { NoResults } from '../../../../features/Results/NoResults/NoResults';
44
import { usePepmContextStore } from '../../../../hooks/GlobalState';
55
import { useFetchVariogramResults } from '../../../../hooks/useFetchVariogramResults';
6+
import { CircularProgress, Typography } from '@equinor/eds-core-react';
7+
import * as Styled from '../../Model/Model.styled';
68

79
export const VariogramResults = () => {
810
const { data, isLoading } = useFetchVariogramResults();
@@ -13,7 +15,20 @@ export const VariogramResults = () => {
1315
if (data) setVariogramResults(data.data);
1416
}, [data, setVariogramResults]);
1517

16-
if (isLoading) return <>Loading ...</>;
18+
if (isLoading)
19+
return (
20+
<Styled.EmptyPage>
21+
<div className="loading">
22+
<CircularProgress
23+
color="primary"
24+
size={24}
25+
value={100}
26+
variant="indeterminate"
27+
/>
28+
<Typography variant="body_short">Loading, please wait…</Typography>
29+
</div>
30+
</Styled.EmptyPage>
31+
);
1732

1833
return (
1934
<>

0 commit comments

Comments
 (0)