Skip to content

Commit ec1fa66

Browse files
authored
Merge pull request #1937 from HSLdevcom/1935_routePath_sync_fix
Updated sync button, refresh page after syncing
2 parents d92879c + b0fcdaf commit ec1fa66

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

src/components/navigationBar/SyncView.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ const SyncView = inject('alertStore')(
3535
if (!response.isDbSyncing) {
3636
clearInterval(newIntervalIdRef.current);
3737
setIsSyncRunning(false);
38+
// Refresh the page once sync is complete
39+
location.reload();
3840
}
3941
}, 2000);
4042
}
@@ -65,22 +67,26 @@ const SyncView = inject('alertStore')(
6567
return (
6668
<>
6769
<div
70+
onClick={() => setIsSyncViewVisible(true)}
6871
className={s.openSyncViewButton}
6972
title={`Avaa uusi ikkuna uusimpien tietojen hakuun Joresta`}
7073
>
71-
<IoIosArrowDown className={s.icon} onClick={() => setIsSyncViewVisible(true)} />
74+
Päivitä
75+
<IoIosArrowDown className={s.icon} />
7276
</div>
7377
<div>
7478
{isSyncViewVisible && (
7579
<ModalContainer>
7680
<div className={s.syncViewContainer}>
77-
<div>Hae uusimmat (alle 24h sisään päivitetyt) tiedot Joresta</div>
81+
<div>
82+
Hae alle 24h sisään päivitetyt tiedot Joresta. Sivu ladataan
83+
automaattisesti uudestaan haun jälkeen.
84+
</div>
7885
{isSyncRunning ? (
7986
<>
8087
<div className={s.loaderContainer}>
8188
<div className={s.loadingText}>
82-
Tietojen haku käynnissä. Voit halutessasi sulkea
83-
tämän ikkunan, haku jatkuu taustalla.
89+
Tietoja päivitetään...
8490
</div>
8591
<Loader hasNoMargin={true} />
8692
</div>
@@ -134,6 +140,7 @@ const SyncView = inject('alertStore')(
134140
<div className={s.syncButtonContainer}>
135141
<Button
136142
isWide={true}
143+
disabled={isSyncRunning}
137144
onClick={() => setIsSyncViewVisible(false)}
138145
>
139146
Sulje

src/components/navigationBar/syncView.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
margin: 15px 70px;
99
padding: 10px;
1010
width: 350px;
11-
height: 270px; // We want a static height so that it doesn't change when content changes
11+
height: 290px; // We want a static height so that it doesn't change when content changes
1212
color: $fontColorDefault;
1313

1414
.loaderContainer  {
@@ -42,12 +42,19 @@
4242

4343
.openSyncViewButton {
4444
display: flex;
45-
margin: 6px;
4645
cursor: pointer;
4746
padding: 3px;
47+
text-align: center;
48+
line-height: 20px;
49+
justify-content: center;
50+
align-items: center;
51+
font-size: 0.8rem;
52+
padding: 5px;
53+
margin-left: 5px;
54+
letter-spacing: -0.6px;
4855

4956
.icon {
50-
font-size: 24px;
57+
font-size: 20px;
5158
}
5259
}
5360
.openSyncViewButton:hover {

0 commit comments

Comments
 (0)