diff --git a/features/stepDefinitions/electron.ts b/features/stepDefinitions/electron.ts
index 4bdaaee2..a65f2980 100644
--- a/features/stepDefinitions/electron.ts
+++ b/features/stepDefinitions/electron.ts
@@ -1,30 +1,30 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */
-import { setWorldConstructor, Given, Then } from '@cucumber/cucumber';
+import { Given, setWorldConstructor, Then } from '@cucumber/cucumber';
import { delay } from 'bluebird';
import { expect } from 'chai';
import { TidGiWorld } from '../supports/world';
setWorldConstructor(TidGiWorld);
-Given('the app is launched', async function (this: TidGiWorld) {
+Given('the app is launched', async function(this: TidGiWorld) {
await delay(100);
await this.start();
const windowCount = await this.app?.client?.getWindowCount();
expect(windowCount).equal(1);
});
-Then('the element {string} is on the page', async function (this: TidGiWorld, elementSelector: string) {
+Then('the element {string} is on the page', async function(this: TidGiWorld, elementSelector: string) {
const result = await this.getElement(elementSelector);
expect(result).to.not.be.undefined;
this.updateContext({ previousElement: result });
});
-Then('click on this element', async function (this: TidGiWorld) {
+Then('click on this element', async function(this: TidGiWorld) {
expect(this.context?.previousElement).to.not.be.undefined;
if (this.context?.previousElement !== undefined) {
await this.context.previousElement.click();
}
});
-Then('click on {string} element', async function (this: TidGiWorld, elementSelector: string) {
+Then('click on {string} element', async function(this: TidGiWorld, elementSelector: string) {
const result = await this.getElement(elementSelector);
expect(result).to.not.be.undefined;
if (result !== undefined) {
@@ -32,7 +32,7 @@ Then('click on {string} element', async function (this: TidGiWorld, elementSelec
await result.click();
}
});
-Then('{string} window show up', async function (this: TidGiWorld, windowName: string) {
+Then('{string} window show up', async function(this: TidGiWorld, windowName: string) {
// await delay(1000);
const windowCount = await this.app?.client?.getWindowCount();
expect(windowCount).equal(2);
diff --git a/features/supports/after.ts b/features/supports/after.ts
index 9259406d..b4c944b2 100644
--- a/features/supports/after.ts
+++ b/features/supports/after.ts
@@ -1,17 +1,17 @@
import { After, Before } from '@cucumber/cucumber';
import fs from 'fs-extra';
-import { DEFAULT_WIKI_FOLDER } from '../../src/constants/paths';
import { SETTINGS_FOLDER } from '../../src/constants/appPaths';
+import { DEFAULT_WIKI_FOLDER } from '../../src/constants/paths';
import { TidGiWorld } from './world';
-Before(async function () {
+Before(async function() {
// clear setting folder
await fs.remove(SETTINGS_FOLDER);
await fs.remove(DEFAULT_WIKI_FOLDER);
});
-After(async function (this: TidGiWorld, testCase) {
+After(async function(this: TidGiWorld, testCase) {
// print logs if test failed
// if (this.app !== undefined && testCase.result?.status === Status.FAILED) {
// console.log('main:\n---\n');
diff --git a/forge.config.js b/forge.config.js
index ea4ed519..2290ac77 100644
--- a/forge.config.js
+++ b/forge.config.js
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
const packageJson = require('./package.json');
-const beforeAsar = require('./scripts/beforeAsar')
+const beforeAsar = require('./scripts/beforeAsar');
const { version, description } = packageJson;
@@ -91,7 +91,7 @@ const config = {
An unhandled rejection has occurred inside Forge:
[object Object]
*/
- {
+ {
name: '@reforged/maker-appimage',
platforms: ['linux'],
config: {
diff --git a/scripts/beforeAsar.js b/scripts/beforeAsar.js
index 08ee5266..f192f0ff 100644
--- a/scripts/beforeAsar.js
+++ b/scripts/beforeAsar.js
@@ -15,7 +15,6 @@ const fs = require('fs-extra');
const util = require('util');
/**
- *
* @param {*} buildPath /var/folders/qj/7j0zx32d0l75zmnrl1w3m3b80000gn/T/electron-packager/darwin-x64/TidGi-darwin-x64/Electron.app/Contents/Resources/app
* @param {*} electronVersion 12.0.6
* @param {*} platform darwin
diff --git a/src/components/FindInPage.tsx b/src/components/FindInPage.tsx
index 97c3eec1..b58fb999 100644
--- a/src/components/FindInPage.tsx
+++ b/src/components/FindInPage.tsx
@@ -1,9 +1,9 @@
-import React, { useState, useCallback, useEffect, useRef } from 'react';
-import { useTranslation } from 'react-i18next';
-import styled from 'styled-components';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import Typography from '@material-ui/core/Typography';
+import React, { useCallback, useEffect, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import styled from 'styled-components';
const Root = styled.div`
display: flex;
@@ -66,11 +66,11 @@ export default function FindInPage(): JSX.Element | null {
return (
-
+
{activeMatch}
- /
+ /
{matches}
- {t('Menu.FindMatches')}
+ {t('Menu.FindMatches')}
@@ -79,7 +79,7 @@ export default function FindInPage(): JSX.Element | null {
inputRef={inputReference}
placeholder={t('Menu.Find')}
value={text}
- margin="dense"
+ margin='dense'
onChange={(event: React.ChangeEvent) => {
const value = event.target.value;
if (typeof value !== 'string') return;
@@ -119,41 +119,45 @@ export default function FindInPage(): JSX.Element | null {
/>
diff --git a/src/components/PopUpMenuItem.tsx b/src/components/PopUpMenuItem.tsx
index d2feab11..4ebb64ea 100644
--- a/src/components/PopUpMenuItem.tsx
+++ b/src/components/PopUpMenuItem.tsx
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
-import React from 'react';
import Menu from '@material-ui/core/Menu';
+import React from 'react';
interface Props {
buttonElement: React.ReactElement;
diff --git a/src/components/RestartSnackbar.tsx b/src/components/RestartSnackbar.tsx
index 67a47011..3cf960d2 100644
--- a/src/components/RestartSnackbar.tsx
+++ b/src/components/RestartSnackbar.tsx
@@ -1,9 +1,9 @@
-import React, { useCallback, useState } from 'react';
-import styled, { keyframes } from 'styled-components';
-import { Snackbar, Button, IconButton, Tooltip } from '@material-ui/core';
+import { Button, IconButton, Snackbar, Tooltip } from '@material-ui/core';
import { Close as CloseIcon } from '@material-ui/icons';
-import { useTranslation } from 'react-i18next';
import useDebouncedCallback from 'beautiful-react-hooks/useDebouncedCallback';
+import React, { useCallback, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import styled, { keyframes } from 'styled-components';
const progressAnimation = keyframes`
from {
@@ -65,7 +65,7 @@ export function useRestartSnackbar(waitBeforeCountDown = 1000, waitBeforeRestart
return [
requestRestartCountDown,
-
+
+ color='secondary'
+ size='small'
+ onClick={handleCloseAndRestart}
+ >
{t('Dialog.RestartNow')}
{t('Dialog.Later')}}>
-
-
+
+
>
diff --git a/src/components/RootStyle.tsx b/src/components/RootStyle.tsx
index 7b38c71a..392fcca1 100644
--- a/src/components/RootStyle.tsx
+++ b/src/components/RootStyle.tsx
@@ -4,20 +4,20 @@ export const RootStyle = styled.div`
.Mui-selected,
.Mui-checked {
${({ theme }) =>
- theme.palette.mode === 'dark'
- ? css`
+ theme.palette.mode === 'dark'
+ ? css`
color: ${theme.palette.primary.light} !important;
`
- : ''};
+ : ''};
}
.Mui-disabled {
${({ theme }) =>
- theme.palette.mode === 'dark'
- ? css`
+ theme.palette.mode === 'dark'
+ ? css`
color: ${theme.palette.primary.dark} !important;
-webkit-text-fill-color: ${theme.palette.primary.light};
`
- : ''};
+ : ''};
}
label,
diff --git a/src/components/StorageService/SearchGithubRepo.tsx b/src/components/StorageService/SearchGithubRepo.tsx
index 09f36c68..9b2d7aba 100644
--- a/src/components/StorageService/SearchGithubRepo.tsx
+++ b/src/components/StorageService/SearchGithubRepo.tsx
@@ -1,14 +1,14 @@
/* eslint-disable @typescript-eslint/no-misused-promises */
-import Promise from 'bluebird';
-import React, { useState, useEffect, useMemo, useCallback } from 'react';
-import styled from 'styled-components';
-import { useQuery, useMutation, GraphQLClient, ClientContext } from 'graphql-hooks';
-import { trim } from 'lodash';
-import { useTranslation } from 'react-i18next';
import useDebouncedCallback from 'beautiful-react-hooks/useDebouncedCallback';
+import Promise from 'bluebird';
+import { ClientContext, GraphQLClient, useMutation, useQuery } from 'graphql-hooks';
+import { trim } from 'lodash';
+import React, { useCallback, useEffect, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import styled from 'styled-components';
-import { TextField, LinearProgress, List, ListItem, ListItemIcon, ListItemText, Button } from '@material-ui/core';
-import { Folder as FolderIcon, Cached as CachedIcon, CreateNewFolder as CreateNewFolderIcon } from '@material-ui/icons';
+import { Button, LinearProgress, List, ListItem, ListItemIcon, ListItemText, TextField } from '@material-ui/core';
+import { Cached as CachedIcon, CreateNewFolder as CreateNewFolderIcon, Folder as FolderIcon } from '@material-ui/icons';
import { GITHUB_GRAPHQL_API } from '@/constants/auth';
import { useUserInfoObservable } from '@services/auth/hooks';
@@ -80,7 +80,7 @@ export default function SearchGithubRepo(props: Props): JSX.Element {
[],
);
useEffect(() => {
- graphqlClient.setHeader('Authorization', accessToken !== undefined ? `Bearer ${accessToken}` : '');
+ graphqlClient.setHeader('Authorization', accessToken === undefined ? '' : `Bearer ${accessToken}`);
}, [accessToken, graphqlClient]);
if (githubUsername === '' || githubUsername === undefined || accessToken === '' || accessToken === undefined) {
@@ -132,7 +132,9 @@ function SearchGithubRepoResultList({
const timeoutHandle = setTimeout(async () => {
await refetchDebounced();
}, 100);
- return () => clearTimeout(timeoutHandle);
+ return () => {
+ clearTimeout(timeoutHandle);
+ };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [githubUsername, accessToken]);
// try refetch on error
@@ -143,7 +145,9 @@ function SearchGithubRepoResultList({
await refetchDebounced();
retryIntervalSetter(retryInterval * 10);
}, retryInterval);
- return () => clearTimeout(timeoutHandle);
+ return () => {
+ clearTimeout(timeoutHandle);
+ };
}
return () => {};
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -189,11 +193,18 @@ function SearchGithubRepoResultList({
value={githubRepoSearchString}
helperText={helperText}
/>
- {(loading || isCreatingRepo) && }
+ {(loading || isCreatingRepo) && }
-
+
{repoList.map(({ name, url }) => (
- onSelectRepo(url, name)} selected={trim(githubWikiUrl) === trim(url)}>
+ {
+ onSelectRepo(url, name);
+ }}
+ selected={trim(githubWikiUrl) === trim(url)}
+ >
@@ -220,20 +231,19 @@ function SearchGithubRepoResultList({
isCreatingRepoSetter(false);
githubWikiUrlSetter(wikiUrlToCreate);
}}
- selected={isCreateNewRepo}>
+ selected={isCreateNewRepo}
+ >
)}
{repoList.length === 0 && (
- } onClick={async () => await refetchDebounced()}>
+ } onClick={async () => await refetchDebounced()}>
{t('AddWorkspace.Reload')}
)}
diff --git a/src/components/TokenForm/GitTokenForm.tsx b/src/components/TokenForm/GitTokenForm.tsx
index 2f4a5d05..3de5c3e8 100644
--- a/src/components/TokenForm/GitTokenForm.tsx
+++ b/src/components/TokenForm/GitTokenForm.tsx
@@ -1,12 +1,12 @@
-import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
+import styled from 'styled-components';
-import { TextField, Button } from '@material-ui/core';
+import { Button, TextField } from '@material-ui/core';
-import { SupportedStorageServices } from '@services/types';
import { useUserInfoObservable } from '@services/auth/hooks';
-import { useAuth } from './gitTokenHooks';
import { getServiceBranchTypes, getServiceEmailTypes, getServiceTokenTypes, getServiceUserNameTypes } from '@services/auth/interface';
+import { SupportedStorageServices } from '@services/types';
+import { useAuth } from './gitTokenHooks';
const AuthingLoginButton = styled(Button)`
width: 100%;
diff --git a/src/components/TokenForm/gitTokenHooks.ts b/src/components/TokenForm/gitTokenHooks.ts
index ee2201d5..096760f2 100644
--- a/src/components/TokenForm/gitTokenHooks.ts
+++ b/src/components/TokenForm/gitTokenHooks.ts
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
-import { useCallback, useMemo } from 'react';
-import { AuthenticationClient } from 'authing-js-sdk';
+import { APP_DOMAIN, APP_ID } from '@/constants/auth';
import { SupportedStorageServices } from '@services/types';
-import { APP_ID, APP_DOMAIN } from '@/constants/auth';
+import { AuthenticationClient } from 'authing-js-sdk';
+import { useCallback, useMemo } from 'react';
export function useAuth(storageService: SupportedStorageServices): [() => Promise, () => Promise] {
const authing = useMemo(
@@ -42,7 +42,9 @@ export function useAuth(storageService: SupportedStorageServices): [() => Promis
}
}
},
- onError: (code, message) => onFailure(new Error(message + String(code))),
+ onError: (code, message) => {
+ onFailure(new Error(message + String(code)));
+ },
});
} catch (error) {
onFailure(error as Error);
diff --git a/src/components/TokenForm/index.tsx b/src/components/TokenForm/index.tsx
index fa8ffe61..a83e574e 100644
--- a/src/components/TokenForm/index.tsx
+++ b/src/components/TokenForm/index.tsx
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
-import React, { useEffect, useState } from 'react';
-import styled, { DefaultTheme, keyframes } from 'styled-components';
-import { Tab as TabRaw, ListItemText as ListItemTextRaw } from '@material-ui/core';
-import { TabPanel as TabPanelRaw, TabContext, TabList as TabListRaw } from '@material-ui/lab';
+import { ListItemText as ListItemTextRaw, Tab as TabRaw } from '@material-ui/core';
+import { TabContext, TabList as TabListRaw, TabPanel as TabPanelRaw } from '@material-ui/lab';
import { SupportedStorageServices } from '@services/types';
+import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import styled, { DefaultTheme, keyframes } from 'styled-components';
import { GitTokenForm } from './GitTokenForm';
@@ -45,7 +45,8 @@ const TabsContainer = styled.div`
min-width: 160px;
}
`;
-const backgroundColorShift = ({ theme }: { theme: DefaultTheme }) => keyframes`
+const backgroundColorShift = ({ theme }: { theme: DefaultTheme }) =>
+ keyframes`
from {background-color: ${theme.palette.background.default};}
to {background-color: ${theme.palette.background.default};}
`;
@@ -85,14 +86,17 @@ export function TokenForm({ storageProvider, storageProviderSetter }: Props): JS
currentTabSetter(newValue as SupportedStorageServices)}
- orientation="vertical"
- variant="scrollable"
+ onChange={(_event, newValue) => {
+ currentTabSetter(newValue as SupportedStorageServices);
+ }}
+ orientation='vertical'
+ variant='scrollable'
value={currentTab}
- aria-label="Vertical tabs example">
-
-
-
+ aria-label='Vertical tabs example'
+ >
+
+
+
diff --git a/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelector.tsx b/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelector.tsx
index ea65be88..3bc4cb04 100644
--- a/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelector.tsx
+++ b/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelector.tsx
@@ -1,10 +1,10 @@
-import { useCallback, MouseEvent, useState } from 'react';
-import { useTranslation } from 'react-i18next';
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
-import { WorkspaceSelector } from './WorkspaceSelector';
-import { IWorkspace } from '@services/workspaces/interface';
import { getWorkspaceMenuTemplate, openWorkspaceTagTiddler } from '@services/workspaces/getWorkspaceMenuTemplate';
+import { IWorkspace } from '@services/workspaces/interface';
+import { MouseEvent, useCallback, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { WorkspaceSelector } from './WorkspaceSelector';
import defaultIcon from '@/images/default-icon.png';
diff --git a/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelectorList.tsx b/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelectorList.tsx
index 589d187e..37be8006 100644
--- a/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelectorList.tsx
+++ b/src/components/WorkspaceIconAndSelector/SortableWorkspaceSelectorList.tsx
@@ -1,6 +1,6 @@
-import { DndContext, useSensor, useSensors, PointerSensor } from '@dnd-kit/core';
-import { SortableContext, arrayMove, verticalListSortingStrategy } from '@dnd-kit/sortable';
+import { DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
+import { arrayMove, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
import { IWorkspace, IWorkspaceWithMetadata } from '@services/workspaces/interface';
import { SortableWorkspaceSelector } from './SortableWorkspaceSelector';
@@ -38,7 +38,8 @@ export function SortableWorkspaceSelectorList({ workspacesList, sidebarShortcutH
});
await window.service.workspace.setWorkspaces(newWorkspaces);
- }}>
+ }}
+ >
{workspacesList
.sort((a, b) => a.order - b.order)
diff --git a/src/components/WorkspaceIconAndSelector/WorkspaceSelector.tsx b/src/components/WorkspaceIconAndSelector/WorkspaceSelector.tsx
index 281c2961..fad39400 100644
--- a/src/components/WorkspaceIconAndSelector/WorkspaceSelector.tsx
+++ b/src/components/WorkspaceIconAndSelector/WorkspaceSelector.tsx
@@ -1,11 +1,11 @@
-import Promise from 'bluebird';
-import React, { useState, useEffect } from 'react';
-import { useTranslation } from 'react-i18next';
import BadgeRaw from '@material-ui/core/Badge';
+import Promise from 'bluebird';
+import React, { useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import styled, { css, keyframes } from 'styled-components';
-import defaultIcon from '../../images/default-icon.png';
import { getAssetsFileUrl } from '@/helpers/url';
+import defaultIcon from '../../images/default-icon.png';
Promise.config({ cancellation: true });
@@ -28,21 +28,21 @@ const Root = styled.div<{ active?: boolean; hibernated?: boolean; workspaceClick
border: 0;
border-color: transparent;
${({ hibernated }) =>
- hibernated === true &&
- css`
+ hibernated === true &&
+ css`
opacity: 0.4;
`}
${({ active }) =>
- active === true &&
- css`
+ active === true &&
+ css`
opacity: 1;
`}
box-sizing: border-box;
border-left: ${({ workspaceCount }) => (workspaceCount > 1 ? '3px' : '0')} solid
${({ active, theme }) => (active === true ? theme.palette.text.primary : 'transparent')};
${({ workspaceClickedLoading }) =>
- workspaceClickedLoading === true &&
- css`
+ workspaceClickedLoading === true &&
+ css`
&:hover {
cursor: wait;
}
@@ -69,15 +69,15 @@ const Avatar = styled.div`
text-transform: uppercase;
overflow: hidden;
${({ large }) =>
- large === true &&
- css`
+ large === true &&
+ css`
height: 44px;
width: 44px;
line-height: 44px;
`}
${({ transparent }) =>
- transparent === true &&
- css`
+ transparent === true &&
+ css`
background: transparent;
border: none;
border-radius: 0;
@@ -91,9 +91,9 @@ const Avatar = styled.div`
color: ${({ theme }) => theme.palette.common.black};
}
${({ addAvatar }: IAvatarProps) =>
- addAvatar
- ? ''
- : css`
+ addAvatar
+ ? ''
+ : css`
background-color: transparent;
`}
`;
@@ -102,8 +102,8 @@ const AvatarPicture = styled.img<{ large?: boolean }>`
height: calc(36px - 2px);
width: calc(36px - 2px);
${({ large }) =>
- large === true &&
- css`
+ large === true &&
+ css`
height: 44px;
width: 44px;
`}
@@ -119,8 +119,8 @@ const ShortcutText = styled.p<{ active?: boolean }>`
word-break: break-all;
text-align: center;
${({ active }) =>
- active === true &&
- css`
+ active === true &&
+ css`
text-decoration: underline;
text-underline-offset: 0.2em;
`}
@@ -172,28 +172,32 @@ export function WorkspaceSelector({
active={active}
onClick={workspaceClickedLoading ? () => {} : onClick}
workspaceClickedLoading={workspaceClickedLoading}
- workspaceCount={workspaceCount}>
-
+ workspaceCount={workspaceCount}
+ >
+
{!hideSideBarIcon && (
- {id === 'add' ? (
- '+'
- ) : id === 'guide' ? (
- '※'
- ) : (
-
- )}
+ id={id === 'add' || id === 'guide' ? 'add-workspace-button' : `workspace-avatar-${id}`}
+ >
+ {id === 'add'
+ ? (
+ '+'
+ )
+ : (id === 'guide'
+ ? (
+ '※'
+ )
+ : )}
)}
{(showSidebarShortcutHints || hideSideBarIcon) && (
- {id === 'add' ? t('WorkspaceSelector.Add') : id === 'guide' ? t('WorkspaceSelector.Guide') : shortWorkspaceName}
+ {id === 'add' ? t('WorkspaceSelector.Add') : (id === 'guide' ? t('WorkspaceSelector.Guide') : shortWorkspaceName)}
)}
diff --git a/src/components/WorkspaceIconAndSelector/index.ts b/src/components/WorkspaceIconAndSelector/index.ts
index 58b2d18f..c3b6895a 100644
--- a/src/components/WorkspaceIconAndSelector/index.ts
+++ b/src/components/WorkspaceIconAndSelector/index.ts
@@ -1,3 +1,3 @@
-export * from './WorkspaceSelector';
export * from './SortableWorkspaceSelector';
export * from './SortableWorkspaceSelectorList';
+export * from './WorkspaceSelector';
diff --git a/src/components/icon/CommandPaletteSVG.tsx b/src/components/icon/CommandPaletteSVG.tsx
index 046ca279..96bdf2c3 100644
--- a/src/components/icon/CommandPaletteSVG.tsx
+++ b/src/components/icon/CommandPaletteSVG.tsx
@@ -4,10 +4,10 @@ import { SVGContainer } from './SVGContainer';
function CommandPaletteSVG(): JSX.Element {
return (
-