Skip to content

Commit

Permalink
Complete coaching sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Nov 8, 2023
1 parent efe00c5 commit ea24882
Show file tree
Hide file tree
Showing 21 changed files with 1,002 additions and 257 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const CoachingPage: React.FC = () => {
</Head>
{accountListId && coachingId && isReady ? (
<CoachingDetail
coachingId={coachingId as string}
isAccountListId={false}
accountListId={coachingId as string}
accountListType="coached"
/>
) : (
<Loading loading />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CoachingReportPage = (): ReactElement => {
</title>
</Head>
{accountListId ? (
<CoachingDetail coachingId={accountListId} isAccountListId={true} />
<CoachingDetail accountListId={accountListId} accountListType="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
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { ReactElement } from 'react';
import { LoadCoachingDetailQuery } from './LoadCoachingDetail.generated';
import {
LoadAccountListCoachingDetailQuery,
LoadCoachingDetailQuery,
} from './LoadCoachingDetail.generated';
import { CoachingDetail } from './CoachingDetail';
import { GqlMockedProvider } from '__tests__/util/graphqlMocking';

Expand All @@ -21,14 +24,16 @@ export const Default = (): ReactElement => {
},
}}
>
<CoachingDetail coachingId={coachingId} isAccountListId={false} />
<CoachingDetail accountListId={coachingId} accountListType="coached" />
</GqlMockedProvider>
);
};

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

0 comments on commit ea24882

Please sign in to comment.