From 284576339f329edbed174393866b6706417b9dc1 Mon Sep 17 00:00:00 2001 From: Nick O'Ferrall Date: Wed, 29 Nov 2023 16:27:17 +0000 Subject: [PATCH 1/3] remove gcal feature flag --- .../ActivityDetailsSidebar.tsx | 1 - .../ActivityLibrary/ScheduleMeetingButton.tsx | 16 ++----------- .../TeamPrompt/TeamPromptWorkDrawer.tsx | 23 +++++-------------- .../public/typeDefs/updateFeatureFlag.graphql | 2 -- .../graphql/public/types/UserFeatureFlags.ts | 1 - packages/server/graphql/types/UserFlagEnum.ts | 1 - 6 files changed, 8 insertions(+), 36 deletions(-) diff --git a/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx b/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx index 5d8e873f25e..92fad861d2c 100644 --- a/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx +++ b/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx @@ -70,7 +70,6 @@ const ActivityDetailsSidebar = (props: Props) => { graphql` fragment ActivityDetailsSidebar_viewer on User { featureFlags { - gcal adHocTeams noTemplateLimit } diff --git a/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx b/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx index e1aabfede52..9eed73ab946 100644 --- a/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx +++ b/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx @@ -19,7 +19,7 @@ type Props = { } const ScheduleMeetingButton = (props: Props) => { - const {mutationProps, handleStartActivity, teamRef, viewerRef} = props + const {mutationProps, handleStartActivity, teamRef} = props const atmosphere = useAtmosphere() const [hasStartedGcalAuthTeamId, setHasStartedGcalAuthTeamId] = useState(null) const {togglePortal: toggleModal, modalPortal} = useModal({ @@ -27,18 +27,6 @@ const ScheduleMeetingButton = (props: Props) => { }) const {submitting} = mutationProps - const viewer = useFragment( - graphql` - fragment ScheduleMeetingButton_viewer on User { - featureFlags { - gcal - } - } - `, - viewerRef - ) - const hasGcalFlag = viewer.featureFlags.gcal - const team = useFragment( graphql` fragment ScheduleMeetingButton_team on Team { @@ -84,7 +72,7 @@ const ScheduleMeetingButton = (props: Props) => { } }, [hasStartedGcalAuth, viewerGcalIntegration]) - if (!hasGcalFlag || !cloudProvider) return null + if (!cloudProvider) return null return ( <> diff --git a/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx b/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx index 30aef1f47cb..b095e66d6f9 100644 --- a/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx +++ b/packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx @@ -26,13 +26,6 @@ const TeamPromptWorkDrawer = (props: Props) => { const meeting = useFragment( graphql` fragment TeamPromptWorkDrawer_meeting on TeamPromptMeeting { - viewerMeetingMember { - user { - featureFlags { - gcal - } - } - } id teamId ...ParabolTasksPanel_meeting @@ -63,16 +56,12 @@ const TeamPromptWorkDrawer = (props: Props) => { }, {icon: , service: 'github', label: 'GitHub', Component: GitHubIntegrationPanel}, {icon: , service: 'jira', label: 'Jira', Component: JiraIntegrationPanel}, - ...(meeting.viewerMeetingMember?.user.featureFlags.gcal - ? ([ - { - icon: , - service: 'gcal', - label: 'Google Calendar', - Component: GCalIntegrationPanel - } - ] as const) - : []) + { + icon: , + service: 'gcal', + label: 'Google Calendar', + Component: GCalIntegrationPanel + } ] as const const {Component} = baseTabs[activeIdx]! diff --git a/packages/server/graphql/public/typeDefs/updateFeatureFlag.graphql b/packages/server/graphql/public/typeDefs/updateFeatureFlag.graphql index 6f797d6134d..af61b52e3a5 100644 --- a/packages/server/graphql/public/typeDefs/updateFeatureFlag.graphql +++ b/packages/server/graphql/public/typeDefs/updateFeatureFlag.graphql @@ -11,7 +11,6 @@ enum UserFlagEnum { noMeetingHistoryLimit checkoutFlow retrosInDisguise - gcal adHocTeams noTemplateLimit signUpDestinationTeam @@ -30,7 +29,6 @@ type UserFeatureFlags { noMeetingHistoryLimit: Boolean! checkoutFlow: Boolean! retrosInDisguise: Boolean! - gcal: Boolean! adHocTeams: Boolean! noTemplateLimit: Boolean! signUpDestinationTeam: Boolean! diff --git a/packages/server/graphql/public/types/UserFeatureFlags.ts b/packages/server/graphql/public/types/UserFeatureFlags.ts index 6c8066cd169..abd50b1db83 100644 --- a/packages/server/graphql/public/types/UserFeatureFlags.ts +++ b/packages/server/graphql/public/types/UserFeatureFlags.ts @@ -8,7 +8,6 @@ const UserFeatureFlags: UserFeatureFlagsResolvers = { noMeetingHistoryLimit: ({noMeetingHistoryLimit}) => !!noMeetingHistoryLimit, checkoutFlow: ({checkoutFlow}) => !!checkoutFlow, retrosInDisguise: ({retrosInDisguise}) => !!retrosInDisguise, - gcal: ({gcal}) => !!gcal, adHocTeams: ({adHocTeams}) => !!adHocTeams, noTemplateLimit: ({noTemplateLimit}) => !!noTemplateLimit, signUpDestinationTeam: ({signUpDestinationTeam}) => !!signUpDestinationTeam diff --git a/packages/server/graphql/types/UserFlagEnum.ts b/packages/server/graphql/types/UserFlagEnum.ts index f56aa1f8c72..3fa2cf89acf 100644 --- a/packages/server/graphql/types/UserFlagEnum.ts +++ b/packages/server/graphql/types/UserFlagEnum.ts @@ -9,7 +9,6 @@ const UserFlagEnum = new GraphQLEnumType({ noAISummary: {}, noMeetingHistoryLimit: {}, checkoutFlow: {}, - gcal: {}, adHocTeams: {}, noTemplateLimit: {}, signUpDestinationTeam: {} From b50d3d83ed540b2d1b076fec9100cc080e10247a Mon Sep 17 00:00:00 2001 From: Nick O'Ferrall Date: Wed, 29 Nov 2023 18:48:10 +0000 Subject: [PATCH 2/3] remove gcal feature flag --- .../components/ActivityLibrary/ActivityDetailsSidebar.tsx | 2 -- .../components/ActivityLibrary/ScheduleMeetingButton.tsx | 2 -- .../teamDashboard/components/ProviderList/ProviderList.tsx | 1 - .../server/graphql/mutations/helpers/createGcalEvent.ts | 6 +----- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx b/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx index 92fad861d2c..699a4b96fb3 100644 --- a/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx +++ b/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx @@ -78,7 +78,6 @@ const ActivityDetailsSidebar = (props: Props) => { id name } - ...ScheduleMeetingButton_viewer } `, viewerRef @@ -399,7 +398,6 @@ const ActivityDetailsSidebar = (props: Props) => { handleStartActivity={handleStartActivity} mutationProps={mutationProps} teamRef={selectedTeam} - viewerRef={viewer} /> )} diff --git a/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx b/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx index 9eed73ab946..a756aa9bccc 100644 --- a/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx +++ b/packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx @@ -7,7 +7,6 @@ import GcalClientManager from '../../utils/GcalClientManager' import useAtmosphere from '../../hooks/useAtmosphere' import {useFragment} from 'react-relay' import {ScheduleMeetingButton_team$key} from '~/__generated__/ScheduleMeetingButton_team.graphql' -import {ScheduleMeetingButton_viewer$key} from '~/__generated__/ScheduleMeetingButton_viewer.graphql' import {MenuMutationProps} from '../../hooks/useMutationProps' import useModal from '../../hooks/useModal' @@ -15,7 +14,6 @@ type Props = { mutationProps: MenuMutationProps handleStartActivity: (gcalInput?: CreateGcalEventInput) => void teamRef: ScheduleMeetingButton_team$key - viewerRef: ScheduleMeetingButton_viewer$key } const ScheduleMeetingButton = (props: Props) => { diff --git a/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx b/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx index d5b6c1fd464..6e2872ecb8a 100644 --- a/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx +++ b/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx @@ -110,7 +110,6 @@ const query = graphql` featureFlags { azureDevOps msTeams - gcal } } } diff --git a/packages/server/graphql/mutations/helpers/createGcalEvent.ts b/packages/server/graphql/mutations/helpers/createGcalEvent.ts index 0e766e84ab7..6e936a13cab 100644 --- a/packages/server/graphql/mutations/helpers/createGcalEvent.ts +++ b/packages/server/graphql/mutations/helpers/createGcalEvent.ts @@ -21,11 +21,7 @@ const createGcalEvent = async (input: Input) => { if (!gcalInput) { return {error: null} } - const viewer = await dataLoader.get('users').loadNonNull(viewerId) - const {featureFlags} = viewer - if (!featureFlags.includes('gcal')) { - return standardError(new Error('Does not have gcal feature flag'), {userId: viewerId}) - } + const {startTimestamp, endTimestamp, title, timeZone, invitees, videoType} = gcalInput const gcalAuth = await dataLoader.get('freshGcalAuth').load({teamId, userId: viewerId}) From 4bb442bfb5ec8407e73777eefec643dbe3aea797 Mon Sep 17 00:00:00 2001 From: Nick O'Ferrall Date: Thu, 30 Nov 2023 11:14:36 +0000 Subject: [PATCH 3/3] fix provider list --- .../teamDashboard/components/ProviderList/ProviderList.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx b/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx index 6e2872ecb8a..a10e921a271 100644 --- a/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx +++ b/packages/client/modules/teamDashboard/components/ProviderList/ProviderList.tsx @@ -120,7 +120,7 @@ const ProviderList = (props: Props) => { const data = usePreloadedQuery(query, queryRef) const {viewer} = data const { - featureFlags: {azureDevOps: allowAzureDevOps, msTeams: allowMSTeams, gcal: allowGcal} + featureFlags: {azureDevOps: allowAzureDevOps, msTeams: allowMSTeams} } = viewer const integrations = viewer.teamMember?.integrations @@ -172,8 +172,7 @@ const ProviderList = (props: Props) => { { name: 'Gcal Integration', connected: !!integrations?.gcal?.auth, - component: , - hidden: !allowGcal + component: } ]