Skip to content

Commit

Permalink
Merge branch 'main' into preferences-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Nov 14, 2023
2 parents 261f9c5 + fee58f3 commit 6ab2121
Show file tree
Hide file tree
Showing 40 changed files with 1,893 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { useRouter } from 'next/router';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { CoachingDetail } from 'src/components/Coaching/CoachingDetail/CoachingDetail';
import {
AccountListTypeEnum,
CoachingDetail,
} from 'src/components/Coaching/CoachingDetail/CoachingDetail';
import { useAccountListId } from 'src/hooks/useAccountListId';
import Loading from 'src/components/Loading';

Expand All @@ -23,8 +26,8 @@ const CoachingPage: React.FC = () => {
</Head>
{accountListId && coachingId && isReady ? (
<CoachingDetail
coachingId={coachingId as string}
isAccountListId={false}
accountListId={coachingId as string}
accountListType={AccountListTypeEnum.Coaching}
/>
) : (
<Loading loading />
Expand Down
10 changes: 8 additions & 2 deletions pages/accountLists/[accountListId]/reports/coaching.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
import { useAccountListId } from '../../../../src/hooks/useAccountListId';
import { CoachingDetail } from 'src/components/Coaching/CoachingDetail/CoachingDetail';
import {
AccountListTypeEnum,
CoachingDetail,
} from 'src/components/Coaching/CoachingDetail/CoachingDetail';
import { suggestArticles } from 'src/lib/helpScout';

const CoachingReportPage = (): ReactElement => {
Expand All @@ -24,7 +27,10 @@ const CoachingReportPage = (): ReactElement => {
</title>
</Head>
{accountListId ? (
<CoachingDetail coachingId={accountListId} isAccountListId={true} />
<CoachingDetail
accountListId={accountListId}
accountListType={AccountListTypeEnum.Own}
/>
) : (
<Loading loading />
)}
Expand Down
11 changes: 0 additions & 11 deletions pages/api/Schema/AccountListCoachUser/accountListCoachUser.graphql

This file was deleted.

42 changes: 0 additions & 42 deletions pages/api/Schema/AccountListCoachUser/dataHandler.ts

This file was deleted.

15 changes: 0 additions & 15 deletions pages/api/Schema/AccountListCoachUser/resolvers.ts

This file was deleted.

6 changes: 0 additions & 6 deletions pages/api/Schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import UpdateCommentTypeDefs from './Tasks/Comments/UpdateComments/updateComment
import { UpdateCommentResolvers } from './Tasks/Comments/UpdateComments/resolvers';
import AccountListDonorAccountsTypeDefs from './AccountListDonorAccounts/accountListDonorAccounts.graphql';
import { AccountListDonorAccountsResolvers } from './AccountListDonorAccounts/resolvers';
import AccountListCoachUserTypeDefs from './AccountListCoachUser/accountListCoachUser.graphql';
import { AccountListCoachUserResolvers } from './AccountListCoachUser/resolvers';
import AccountListCoachesTypeDefs from './AccountListCoaches/accountListCoaches.graphql';
import { AccountListCoachesResolvers } from './AccountListCoaches/resolvers';
import ReportsPledgeHistoriesTyeDefs from './reports/pledgeHistories/pledgeHistories.graphql';
Expand Down Expand Up @@ -65,10 +63,6 @@ const schema = buildSubgraphSchema([
typeDefs: AccountListDonorAccountsTypeDefs,
resolvers: AccountListDonorAccountsResolvers,
},
{
typeDefs: AccountListCoachUserTypeDefs,
resolvers: AccountListCoachUserResolvers,
},
{
typeDefs: AppointmentResultsTypeDefs,
resolvers: AppointmentResultsResolvers,
Expand Down
6 changes: 0 additions & 6 deletions pages/api/graphql-rest.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import {
UpdateComment,
} from './Schema/Tasks/Comments/UpdateComments/datahandler';
import { getAccountListDonorAccounts } from './Schema/AccountListDonorAccounts/dataHandler';
import { getAccountListCoachUsers } from './Schema/AccountListCoachUser/dataHandler';
import { getAccountListCoaches } from './Schema/AccountListCoaches/dataHandler';
import { getReportsPledgeHistories } from './Schema/reports/pledgeHistories/dataHandler';
import { DateTime, Duration, Interval } from 'luxon';
Expand Down Expand Up @@ -173,11 +172,6 @@ class MpdxRestApi extends RESTDataSource {
return getAccountListAnalytics(data);
}

async getAccountListCoachUsers(accountListId: string) {
const { data } = await this.get(`account_lists/${accountListId}/coaches`);
return getAccountListCoachUsers(data);
}

async getAppointmentResults(
accountListId: string,
endDate: string,
Expand Down
21 changes: 16 additions & 5 deletions src/components/Coaching/CoachingDetail/CoachingDetail.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React, { ReactElement } from 'react';
import { LoadCoachingDetailQuery } from './LoadCoachingDetail.generated';
import { CoachingDetail } from './CoachingDetail';
import {
LoadAccountListCoachingDetailQuery,
LoadCoachingDetailQuery,
} from './LoadCoachingDetail.generated';
import { AccountListTypeEnum, CoachingDetail } from './CoachingDetail';
import { GqlMockedProvider } from '__tests__/util/graphqlMocking';

export default {
Expand All @@ -21,14 +24,19 @@ export const Default = (): ReactElement => {
},
}}
>
<CoachingDetail coachingId={coachingId} isAccountListId={false} />
<CoachingDetail
accountListId={coachingId}
accountListType={AccountListTypeEnum.Coaching}
/>
</GqlMockedProvider>
);
};

export const AccountListDetail = (): ReactElement => {
return (
<GqlMockedProvider<{ LoadCoachingDetail: LoadCoachingDetailQuery }>
<GqlMockedProvider<{
LoadAccountListCoachingDetail: LoadAccountListCoachingDetailQuery;
}>
mocks={{
LoadAccountListCoachingDetail: {
accountList: {
Expand All @@ -38,7 +46,10 @@ export const AccountListDetail = (): ReactElement => {
},
}}
>
<CoachingDetail coachingId={coachingId} isAccountListId={true} />
<CoachingDetail
accountListId={coachingId}
accountListType={AccountListTypeEnum.Own}
/>
</GqlMockedProvider>
);
};
Loading

0 comments on commit 6ab2121

Please sign in to comment.