Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preferences connect services #796

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
82cffca
Minor modal update
j2trumpet Sep 10, 2021
a34fd2b
First pass at creating personal preferences page
j2trumpet Sep 10, 2021
927b633
Starting migration and integration of personal preferences files
j2trumpet Sep 10, 2021
e862ff3
Starting TSX conversion
j2trumpet Sep 15, 2021
3733ffd
Update PersPrefContacts.tsx
j2trumpet Sep 15, 2021
09ccae9
Code organization
j2trumpet Sep 15, 2021
0872fba
Adding translation
j2trumpet Sep 15, 2021
009a75f
Continuing TSX conversion
j2trumpet Sep 15, 2021
39b23de
Fixing Socials
j2trumpet Sep 15, 2021
b3f8f9e
Preferences wrapper comp and fixing exports
j2trumpet Sep 16, 2021
7d1b9c0
Color update
j2trumpet Sep 17, 2021
bfc733c
Social links overhaul
j2trumpet Sep 17, 2021
c65f5f7
Making the info a card
j2trumpet Sep 17, 2021
5d82516
Getting rid of custom styled comp
j2trumpet Sep 17, 2021
5f679cf
Continuing modal conversion to TSX - lots of errors
j2trumpet Sep 20, 2021
2afb58f
Troubleshooting accordion
j2trumpet Sep 21, 2021
2392d99
Accordions w/o forms
j2trumpet Sep 21, 2021
7d32c94
Finishing accordion options
j2trumpet Sep 24, 2021
378abc9
Getting contact info modal error-free
j2trumpet Sep 27, 2021
ada8863
Details modal
j2trumpet Sep 27, 2021
5aa44d7
Social modal
j2trumpet Sep 27, 2021
01f1c37
Relationships modal
j2trumpet Sep 27, 2021
ae9f5cf
Activating modal content and fixing select options
j2trumpet Sep 27, 2021
f790268
Finishing TSX conversion
j2trumpet Oct 5, 2021
f92a77c
Removing duplicated code after rebase
j2trumpet May 16, 2022
cab4fe3
Fixing TS errors regarding anniversary months/days
j2trumpet May 16, 2022
e253d67
Adding missing translation support
j2trumpet May 17, 2022
6865286
Destructuring current map values
j2trumpet May 17, 2022
43f3a3a
Destructuring remaining current map values
j2trumpet May 17, 2022
8658599
Anniversary refactor
j2trumpet May 17, 2022
e1f855d
Removing old commented-out code
j2trumpet May 17, 2022
abaf5b7
Swapping months name source
j2trumpet May 17, 2022
6d2a75e
Converting to Luxon months array for dates
j2trumpet May 17, 2022
b21b7ca
Translating relationship types and marital statuses
j2trumpet May 17, 2022
8f5b223
Restructured the flex-basis & width values
j2trumpet May 23, 2022
1f2271b
Renaming variables for more context
j2trumpet May 23, 2022
9cfe09e
Removing unnecessary return statement
j2trumpet May 23, 2022
8ce6de9
Made instances of "contact" more specific
j2trumpet May 23, 2022
40b9ce7
Continuing "contact" reference specification
j2trumpet May 23, 2022
6e26f04
Avoiding translation of dynamic content
j2trumpet May 23, 2022
dfb9f86
Conversion to using lab tab components
j2trumpet May 24, 2022
887c43b
Taking out loops to improve readability
j2trumpet May 24, 2022
9f9e2f8
Removing unneeded &
j2trumpet May 24, 2022
2db92f0
Refining repositioning of primary method to front of array
j2trumpet May 24, 2022
361b1d8
Improved variable names and removed redundant translations
j2trumpet May 25, 2022
d82d072
Removing commented out code
j2trumpet May 25, 2022
6d8908d
Removing redundant translation
j2trumpet May 25, 2022
62bc47b
Removed default option values and required options for display
j2trumpet May 25, 2022
4c8d2b0
Removing commented-out code
j2trumpet May 25, 2022
b971fa0
Swapping commented code
j2trumpet May 25, 2022
d5cada3
Adding "type" prop to contact methods for better logic
j2trumpet May 25, 2022
5350a8b
Using filter() instead of findIndex
j2trumpet May 26, 2022
3cc4eb1
Modifying truthy test
j2trumpet May 26, 2022
20966a3
Made the index output dynamic so a default isn't necessary
j2trumpet May 26, 2022
e1e71f5
General cleanup
j2trumpet May 27, 2022
71a155e
MUI5 upgrade + starting refactor
j2trumpet Nov 3, 2022
c72335e
Syncing modal styles
j2trumpet Nov 3, 2022
aa9b9d9
Wrapping content with <Container>
j2trumpet Nov 4, 2022
5049f08
Changing layout back to be in line w/ current app
j2trumpet Nov 4, 2022
2f439a0
Moving work info into main component
j2trumpet Nov 4, 2022
9cdc4c9
Adding comments
j2trumpet Nov 4, 2022
a48a2a7
Switching to Box from custom styled component
j2trumpet Nov 4, 2022
5a2e1d2
Anniversary refactor
j2trumpet Nov 4, 2022
4a8f5c2
Refactoring phone/email accordions
j2trumpet Nov 4, 2022
f7fd143
Refactoring social media links
j2trumpet Nov 4, 2022
68af82f
Fixing margin on expanded accordions
j2trumpet Nov 8, 2022
f9b1be9
Refactoring accordions
j2trumpet Nov 9, 2022
3fb7a03
Cleaning up PersPrefFormWrapper
j2trumpet Nov 10, 2022
ac79450
Converting name fields to <PersPrefFieldWrapper />
j2trumpet Nov 11, 2022
4335382
Getting rid of unnecessary styled components
j2trumpet Nov 11, 2022
5d21890
New form wrapper and input/select fields
j2trumpet Nov 11, 2022
11b8412
Using new PersPrefInput for name fields
j2trumpet Nov 11, 2022
2edbb04
First test at using new PersPrefSelect component
j2trumpet Nov 11, 2022
e917635
Merge branch 'main' into MPDX-7076
caleballdrin Jun 20, 2023
f7c3dab
fix column formatting and update demo content data
caleballdrin Jun 21, 2023
05461e8
Rename Preferences to Settings and Personal to Preferences. Re-organi…
caleballdrin Jun 21, 2023
4afecb7
Add Profile info and edit Profile Modal
caleballdrin Jun 27, 2023
d7eeabb
Merge branch 'main' into MPDX-7076
dr-bizz Jun 27, 2023
e8a6326
Rename to Preferences and add UI changes
caleballdrin Jun 30, 2023
c601f49
Merge branch 'MPDX-7076' of https://github.com/CruGlobal/mpdx-react i…
dr-bizz Jul 5, 2023
01fe1ca
Making shared components for Reports Header and Reports Menu so it ca…
dr-bizz Jul 7, 2023
a127291
Starting Connect Services
dr-bizz Jul 7, 2023
401acec
Starting Connect Services
dr-bizz Jul 7, 2023
f6f04ca
Starting Connect Services
dr-bizz Jul 7, 2023
08abe09
Add Preferences datepicker and adjust spacing
caleballdrin Jul 14, 2023
96d211b
Add connectServices html
caleballdrin Jul 14, 2023
bb87ea9
Fix notifications page select all text
caleballdrin Jul 14, 2023
7cbd96b
Added GraphQl to connect services organizations
dr-bizz Jul 20, 2023
5769f14
Organizations Graph Ql
dr-bizz Jul 24, 2023
d193631
merging main
dr-bizz Jul 24, 2023
697f6b6
fixing lint issyes
dr-bizz Jul 24, 2023
d9a43b8
Integrations - Organizations
dr-bizz Jul 25, 2023
4f2e977
Organizations add account for oauth done. import tntconnect mostly do…
dr-bizz Jul 25, 2023
ef8b534
Add manage accounts html
caleballdrin Aug 15, 2023
fcfe40e
Notifications
dr-bizz Aug 16, 2023
1658c9c
Merge branch 'MPDX-7076' of https://github.com/CruGlobal/mpdx-react i…
dr-bizz Aug 16, 2023
9310496
Adding proxy graphQLs for GetGoogleAccount, GetGoogleIntegrations, Sy…
dr-bizz Aug 18, 2023
92f9a4a
Google integrations, sync, create, delete, add integration, remove ac…
dr-bizz Aug 25, 2023
c03bfbe
Mailchimp corraction and small tests... will do more later
dr-bizz Aug 25, 2023
910e973
Writing mailchimp tests
dr-bizz Aug 25, 2023
7f70a88
Google tests are done
dr-bizz Aug 30, 2023
1a411a5
Fixing lint issues
dr-bizz Aug 30, 2023
3cd79dd
Prayerletters, Mailchimp Proxy GraphQL and components and integrating…
dr-bizz Sep 1, 2023
fd3ec52
Import Data to Organization API and Chalkline components
dr-bizz Sep 1, 2023
c35eeed
Organzations tests
dr-bizz Sep 6, 2023
32756ab
Adding back yarn lint:ts on pushes
dr-bizz Sep 6, 2023
58d9d2c
Fxing lint issues
dr-bizz Sep 6, 2023
833b72e
REmoving password from query after mutation on change organization lo…
dr-bizz Sep 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = withPlugins([
REST_API_URL:
process.env.REST_API_URL ?? 'https://api.stage.mpdx.org/api/v2/',
SITE_URL: siteUrl,
OAUTH_URL: process.env.OAUTH_URL ?? 'https://auth.stage.mpdx.org',
CLIENT_ID: process.env.CLIENT_ID ?? '4027334344069527005',
CLIENT_SECRET: process.env.CLIENT_SECRET,
BEACON_TOKEN: process.env.BEACON_TOKEN,
Expand Down Expand Up @@ -94,6 +95,7 @@ module.exports = withPlugins([
HS_HOME_SUGGESTIONS: process.env.HS_HOME_SUGGESTIONS,
HS_REPORTS_SUGGESTIONS: process.env.HS_REPORTS_SUGGESTIONS,
HS_TASKS_SUGGESTIONS: process.env.HS_TASKS_SUGGESTIONS,
HS_SETUP_FIND_ORGANIZATION: process.env.HS_SETUP_FIND_ORGANIZATION,
ALERT_MESSAGE: process.env.ALERT_MESSAGE,
},
experimental: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import Loading from 'src/components/Loading';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import { useAccountListId } from 'src/hooks/useAccountListId';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { NavReportsList } from 'src/components/Reports/NavReportsList/NavReportsList';
import {
MultiPageMenu,
NavTypeEnum,
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu';

import { suggestArticles } from 'src/lib/helpScout';

const DesignationAccountsReportPageWrapper = styled(Box)(({ theme }) => ({
Expand Down Expand Up @@ -42,12 +46,13 @@ const DesignationAccountsReportPage: React.FC = () => {
<SidePanelsLayout
isScrollBox={false}
leftPanel={
<NavReportsList
<MultiPageMenu
isOpen={isNavListOpen}
selectedId="designationAccounts"
onClose={handleNavListToggle}
designationAccounts={designationAccounts}
setDesignationAccounts={setDesignationAccounts}
navType={NavTypeEnum.Reports}
/>
}
leftOpen={isNavListOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import Loading from 'src/components/Loading';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import { useAccountListId } from 'src/hooks/useAccountListId';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { NavReportsList } from 'src/components/Reports/NavReportsList/NavReportsList';
import { getQueryParam } from 'src/utils/queryParam';
import { ContactsPage } from '../../contacts/ContactsPage';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
import { suggestArticles } from 'src/lib/helpScout';
import {
MultiPageMenu,
NavTypeEnum,
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu';

const DonationsReportPageWrapper = styled(Box)(({ theme }) => ({
backgroundColor: theme.palette.common.white,
Expand Down Expand Up @@ -55,12 +58,13 @@ const DonationsReportPage: React.FC = () => {
<SidePanelsLayout
isScrollBox={false}
leftPanel={
<NavReportsList
<MultiPageMenu
isOpen={isNavListOpen}
selectedId="donations"
onClose={handleNavListToggle}
designationAccounts={designationAccounts}
setDesignationAccounts={setDesignationAccounts}
navType={NavTypeEnum.Reports}
/>
}
leftOpen={isNavListOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { ExpectedMonthlyTotalReport } from '../../../../src/components/Reports/ExpectedMonthlyTotalReport/ExpectedMonthlyTotalReport';
import { suggestArticles } from 'src/lib/helpScout';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import { NavReportsList } from 'src/components/Reports/NavReportsList/NavReportsList';
import {
MultiPageMenu,
NavTypeEnum,
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu';

const ExpectedMonthlyTotalReportPageWrapper = styled(Box)(({ theme }) => ({
backgroundColor: theme.palette.common.white,
Expand Down Expand Up @@ -43,12 +46,13 @@ const ExpectedMonthlyTotalReportPage = (): ReactElement => {
<SidePanelsLayout
isScrollBox={false}
leftPanel={
<NavReportsList
<MultiPageMenu
isOpen={isNavListOpen}
selectedId="expectedMonthlyTotal"
onClose={handleNavListToggle}
designationAccounts={designationAccounts}
setDesignationAccounts={setDesignationAccounts}
navType={NavTypeEnum.Reports}
/>
}
leftOpen={isNavListOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import Loading from 'src/components/Loading';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import { useAccountListId } from 'src/hooks/useAccountListId';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { NavReportsList } from 'src/components/Reports/NavReportsList/NavReportsList';
import {
MultiPageMenu,
NavTypeEnum,
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu';
import { suggestArticles } from 'src/lib/helpScout';
import { getQueryParam } from 'src/utils/queryParam';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
Expand Down Expand Up @@ -55,12 +58,13 @@ const PartnerCurrencyReportPage: React.FC = () => {
<SidePanelsLayout
isScrollBox={false}
leftPanel={
<NavReportsList
<MultiPageMenu
isOpen={isNavListOpen}
selectedId="partnerCurrency"
onClose={handleNavListToggle}
designationAccounts={designationAccounts}
setDesignationAccounts={setDesignationAccounts}
navType={NavTypeEnum.Reports}
/>
}
leftOpen={isNavListOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import Loading from 'src/components/Loading';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import { useAccountListId } from 'src/hooks/useAccountListId';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { NavReportsList } from 'src/components/Reports/NavReportsList/NavReportsList';
import {
MultiPageMenu,
NavTypeEnum,
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu';
import { suggestArticles } from 'src/lib/helpScout';

const ResponsibilityCentersReportPageWrapper = styled(Box)(({ theme }) => ({
Expand Down Expand Up @@ -42,12 +45,13 @@ const ResponsibilityCentersReportPage: React.FC = () => {
<SidePanelsLayout
isScrollBox={false}
leftPanel={
<NavReportsList
<MultiPageMenu
isOpen={isNavListOpen}
selectedId="responsibilityCenters"
onClose={handleNavListToggle}
designationAccounts={designationAccounts}
setDesignationAccounts={setDesignationAccounts}
navType={NavTypeEnum.Reports}
/>
}
leftOpen={isNavListOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import Loading from 'src/components/Loading';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import { useAccountListId } from 'src/hooks/useAccountListId';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { NavReportsList } from 'src/components/Reports/NavReportsList/NavReportsList';
import {
MultiPageMenu,
NavTypeEnum,
} from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenu';
import { suggestArticles } from 'src/lib/helpScout';
import { getQueryParam } from 'src/utils/queryParam';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
Expand Down Expand Up @@ -55,12 +58,13 @@ const SalaryCurrencyReportPage: React.FC = () => {
<SidePanelsLayout
isScrollBox={false}
leftPanel={
<NavReportsList
<MultiPageMenu
isOpen={isNavListOpen}
selectedId="salaryCurrency"
onClose={handleNavListToggle}
designationAccounts={designationAccounts}
setDesignationAccounts={setDesignationAccounts}
navType={NavTypeEnum.Reports}
/>
}
leftOpen={isNavListOpen}
Expand Down
109 changes: 109 additions & 0 deletions pages/accountLists/[accountListId]/settings/integrations.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import React, { ReactElement, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { SettingsWrapper } from './wrapper';
import { suggestArticles } from 'src/lib/helpScout';
import { GetServerSideProps } from 'next';
import { getSession } from 'next-auth/react';
import { AccordionGroup } from 'src/components/Shared/Forms/Accordions/AccordionGroup';
import { TheKeyAccordian } from 'src/components/Settings/integrations/Key/TheKeyAccordian';
import { OrganizationAccordian } from 'src/components/Settings/integrations/Organization/OrganizationAccordian';
import { GoogleAccordian } from 'src/components/Settings/integrations/Google/GoogleAccordian';
import { MailchimpAccordian } from 'src/components/Settings/integrations/Mailchimp/MailchimpAccordian';
import { PrayerlettersAccordian } from 'src/components/Settings/integrations/Prayerletters/PrayerlettersAccordian';
import { ChalklineAccordian } from 'src/components/Settings/integrations/Chalkline/ChalklineAccordian';

interface Props {
apiToken: string;
selectedTab: string;
}

export type IntegrationsContextType = {
apiToken: string;
};
export const IntegrationsContext =
React.createContext<IntegrationsContextType | null>(null);

interface IntegrationsContextProviderProps {
children: React.ReactNode;
apiToken: string;
}
export const IntegrationsContextProvider: React.FC<
IntegrationsContextProviderProps
> = ({ children, apiToken }) => {
return (
<IntegrationsContext.Provider value={{ apiToken }}>
{children}
</IntegrationsContext.Provider>
);
};

const Integrations = ({ apiToken, selectedTab }: Props): ReactElement => {
const { t } = useTranslation();
const [expandedPanel, setExpandedPanel] = useState('');

useEffect(() => {
suggestArticles('HS_SETTINGS_SERVICES_SUGGESTIONS');
setExpandedPanel(selectedTab);
}, []);

const handleAccordionChange = (panel: string) => {
const panelLowercase = panel.toLowerCase();
setExpandedPanel(expandedPanel === panelLowercase ? '' : panelLowercase);
};

return (
<SettingsWrapper
pageTitle={t('Connect Services')}
pageHeading={t('Connect Services')}
>
<IntegrationsContextProvider apiToken={apiToken}>
<AccordionGroup title="">
<TheKeyAccordian
handleAccordionChange={handleAccordionChange}
expandedPanel={expandedPanel}
/>
<OrganizationAccordian
handleAccordionChange={handleAccordionChange}
expandedPanel={expandedPanel}
/>
</AccordionGroup>
<AccordionGroup title={t('External Services')}>
<GoogleAccordian
handleAccordionChange={handleAccordionChange}
expandedPanel={expandedPanel}
/>
<MailchimpAccordian
handleAccordionChange={handleAccordionChange}
expandedPanel={expandedPanel}
/>
<PrayerlettersAccordian
handleAccordionChange={handleAccordionChange}
expandedPanel={expandedPanel}
/>
<ChalklineAccordian
handleAccordionChange={handleAccordionChange}
expandedPanel={expandedPanel}
/>
</AccordionGroup>
</IntegrationsContextProvider>
</SettingsWrapper>
);
};

export const getServerSideProps: GetServerSideProps = async ({
query,
req,
}) => {
const session = await getSession({ req });
const apiToken = session?.user?.apiToken ?? null;
const selectedTab = query?.selectedTab ?? '';

return {
props: {
apiToken,
selectedTab,
},
};
};

export default Integrations;
Loading