-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Get Google ContactGroup data from rest API * Add Google Import UI * Add optional button to NoData * Add appName to Google Account Deletion * Renaming variables, adding button, adding modal, cleaning up code * Add API request to import data * Move import pages to a folder * Add message for when the account has no contact groups * Add tests * Use router.push and update tests * Update tool page links
- Loading branch information
1 parent
bb8186c
commit 9803ed9
Showing
15 changed files
with
1,197 additions
and
26 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
pages/accountLists/[accountListId]/tools/import/google.page.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { ThemeProvider } from '@mui/material/styles'; | ||
import { render } from '@testing-library/react'; | ||
import TestRouter from '__tests__/util/TestRouter'; | ||
import TestWrapper from '__tests__/util/TestWrapper'; | ||
import theme from 'src/theme'; | ||
import GoogleImportPage from './google.page'; | ||
|
||
const accountListId = 'accountListId'; | ||
const router = { | ||
query: { accountListId }, | ||
isReady: true, | ||
}; | ||
|
||
const RenderGoogleImportPage = () => ( | ||
<TestWrapper> | ||
<TestRouter router={router}> | ||
<ThemeProvider theme={theme}> | ||
<GoogleImportPage /> | ||
</ThemeProvider> | ||
</TestRouter> | ||
</TestWrapper> | ||
); | ||
describe('render', () => { | ||
it('google import page', async () => { | ||
const { findByText } = render(<RenderGoogleImportPage />); | ||
|
||
expect(await findByText('Import from Google')).toBeVisible(); | ||
}); | ||
}); |
33 changes: 33 additions & 0 deletions
33
pages/accountLists/[accountListId]/tools/import/google.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Head from 'next/head'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { loadSession } from 'pages/api/utils/pagePropsHelpers'; | ||
import Loading from 'src/components/Loading'; | ||
import GoogleImport from 'src/components/Tool/GoogleImport/GoogleImport'; | ||
import { useAccountListId } from 'src/hooks/useAccountListId'; | ||
import useGetAppSettings from 'src/hooks/useGetAppSettings'; | ||
|
||
const GoogleImportPage: React.FC = () => { | ||
const { t } = useTranslation(); | ||
const accountListId = useAccountListId(); | ||
const { appName } = useGetAppSettings(); | ||
|
||
return ( | ||
<> | ||
<Head> | ||
<title> | ||
{appName} | {t('Import from Google')} | ||
</title> | ||
</Head> | ||
{accountListId ? ( | ||
<GoogleImport accountListId={accountListId} /> | ||
) : ( | ||
<Loading loading /> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export const getServerSideProps = loadSession; | ||
|
||
export default GoogleImportPage; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.