diff --git a/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.styles.ts b/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.styles.ts index e5519179be45c..5a58800272732 100644 --- a/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.styles.ts +++ b/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.styles.ts @@ -27,7 +27,7 @@ export const getStyles = ({ v1: { spacing, colors } }: GrafanaTheme2) => ({ notesTitle: css` font-weight: 500; font-size: 16px; - margin-top: 27px + margin-top: 27px; `, updateButtons: css` margin-top: 35px; diff --git a/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.test.tsx b/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.test.tsx new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.tsx b/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.tsx index 857769ba319df..84dd606035961 100644 --- a/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.tsx +++ b/public/app/percona/shared/components/PerconaBootstrapper/PerconaUpdateVersion/PerconaUpdateVersion.tsx @@ -25,12 +25,11 @@ const PerconaUpdateVersion: FC = () => { useEffect(() => { const showModal = async () => { - console.log('checkUpdatesChangelogs'); await dispatch(checkUpdatesChangeLogs()); setShowUpdate(true); }; - const differenceInDays = async () => { + const differenceInDays = () => { if (lastChecked) { const lastCheckDate = new Date(lastChecked); const currentDate = new Date(); @@ -45,19 +44,18 @@ const PerconaUpdateVersion: FC = () => { if (!snoozeCurrentVersion) { dispatch(getSnoozeCurrentVersion()); } - differenceInDays().then((days) => { - if ( - (installed?.version !== latest?.version /*days > 6 &&*/ && - snoozeCurrentVersion?.snoozedPmmVersion !== latest?.version) || - !lastChecked - ) { - showModal(); - } - }); + const days = differenceInDays(); + if ( + (installed?.version !== latest?.version && + days > 6 && + snoozeCurrentVersion?.snoozedPmmVersion !== latest?.version) || + !lastChecked + ) { + showModal(); + } } }, [dispatch, updateAvailable, installed, latest, snoozeCurrentVersion, lastChecked]); - // Snooze API const snoozeUpdate = async () => { if (latest && latest.version) { const payload = { @@ -108,7 +106,7 @@ const PerconaUpdateVersion: FC = () => { {changeLogs?.updates.map((update: UpdatesChangelogs) => (