From e403e3f55d2df3864f5033d57e0975d8429a9a68 Mon Sep 17 00:00:00 2001 From: maxym Date: Wed, 6 Sep 2023 12:31:06 +0100 Subject: [PATCH] feature: add checklist modal --- .../NetworkStatus/NetworkStatus.tsx | 2 +- app/redux/ui/reducer.ts | 4 + app/screens/modal/ErrorCheckListModal.tsx | 116 ++++++++++++++++++ desktop/main/reactions/syncToRenderer.ts | 5 +- shared/constants.ts | 7 +- shared/types/node.ts | 2 +- 6 files changed, 130 insertions(+), 6 deletions(-) create mode 100644 app/screens/modal/ErrorCheckListModal.tsx diff --git a/app/components/NetworkStatus/NetworkStatus.tsx b/app/components/NetworkStatus/NetworkStatus.tsx index b1ed535d3..d2d407a55 100644 --- a/app/components/NetworkStatus/NetworkStatus.tsx +++ b/app/components/NetworkStatus/NetworkStatus.tsx @@ -112,7 +112,7 @@ const NetworkStatus = ({ isRestarting ? 'Restarting node...' : isShowMissingLibsMessage - ? 'Please install libs and restart node' + ? 'Please install required libraries and restart node' : 'Please restart node' } diff --git a/app/redux/ui/reducer.ts b/app/redux/ui/reducer.ts index cea1236b6..7b85428f5 100644 --- a/app/redux/ui/reducer.ts +++ b/app/redux/ui/reducer.ts @@ -1,5 +1,6 @@ import { UiState, CustomAction } from '../../types'; import { isDarkBackground } from '../../theme'; +import { IPC_BATCH_SYNC, reduceChunkUpdate } from '../ipcBatchSync'; import { SET_OS_THEME, // THEME_SWITCHER, @@ -18,6 +19,7 @@ const initialState: UiState = { skinId: null, error: null, warnings: [], + osPlatform: '', }; const reducer = (state: UiState = initialState, action: CustomAction) => { @@ -52,6 +54,8 @@ const reducer = (state: UiState = initialState, action: CustomAction) => { }; case SHOW_CLOSING_APP_MODAL: return { ...state, isClosingApp: true }; + case IPC_BATCH_SYNC: + return reduceChunkUpdate('ui', action.payload, state); default: return state; } diff --git a/app/screens/modal/ErrorCheckListModal.tsx b/app/screens/modal/ErrorCheckListModal.tsx new file mode 100644 index 000000000..0968fef39 --- /dev/null +++ b/app/screens/modal/ErrorCheckListModal.tsx @@ -0,0 +1,116 @@ +import React from 'react'; +import styled from 'styled-components'; +import { useSelector } from 'react-redux'; +import { ExternalLinks } from '../../../shared/constants'; +import { eventsService } from '../../infra/eventsService'; +import Modal from '../../components/common/Modal'; +import { Button, Link } from '../../basicComponents'; +import { + isWindows as isWindowsSelector, + isLinux as isLinuxSelector, + isMacOS as isMacOSSelector, +} from '../../redux/ui/selectors'; + +const ListContainer = styled.ol` + padding: 20px; + list-style: decimal; + + li { + padding: 5px 0; + line-height: 21px; + } +`; + +const ModalFooterContainer = styled.div` + display: flex; + justify-content: flex-end; + margin: 10px; +`; + +const ErrorCheckListModal = ({ onClose }: { onClose: () => void }) => { + const isWindows = useSelector(isWindowsSelector); + const isLinux = useSelector(isLinuxSelector); + const isMacOS = useSelector(isMacOSSelector); + const openDiscord = () => window.open(ExternalLinks.Discord); + const openSmappIssuePage = () => + window.open(ExternalLinks.GithubSMAppIssuePage); + + const navigateToOpenWindowsCLInstallationGuide = () => + window.open(ExternalLinks.OpenCLWindowsInstallGuide); + const navigateToOpenUbuntuCLInstallationGuide = () => + window.open(ExternalLinks.OpenCLUbuntuInstallGuide); + const navigateToRedistInstallationGuide = () => + window.open(ExternalLinks.RedistWindowsInstallOfficialSite); + const openLogFile = () => { + eventsService.showFileInFolder({ isLogFile: true }); + }; + return ( + + + {!isMacOS && ( +
  • + Please ensure that you have installed:{' '} + {isLinux && ( + + )} + {isWindows && ( + <> + {' '} + and{' '} + + + )} +
  • + )} +
  • + Check your firewall settings and ensure that your ports are open. +
  • +
  • Update your GPU drivers.
  • +
  • + Please check for ERROR and FATAL messages and investigate them on your + end{' '} + +
  • +
    +

    + If none of these solutions have worked, please do not hesitate to report + the error or seek help on{' '} + +

    +

    + Alternatively, you can submit your logs on GitHub if you have an account + there{' '} + +

    + +