Skip to content

Commit

Permalink
feat: remove gcal flag (#9251)
Browse files Browse the repository at this point in the history
* remove gcal feature flag

* remove gcal feature flag

* fix provider list
  • Loading branch information
nickoferrall committed Nov 30, 2023
1 parent bfaccd8 commit 9961e63
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const ActivityDetailsSidebar = (props: Props) => {
graphql`
fragment ActivityDetailsSidebar_viewer on User {
featureFlags {
gcal
adHocTeams
noTemplateLimit
}
Expand All @@ -79,7 +78,6 @@ const ActivityDetailsSidebar = (props: Props) => {
id
name
}
...ScheduleMeetingButton_viewer
}
`,
viewerRef
Expand Down Expand Up @@ -400,7 +398,6 @@ const ActivityDetailsSidebar = (props: Props) => {
handleStartActivity={handleStartActivity}
mutationProps={mutationProps}
teamRef={selectedTeam}
viewerRef={viewer}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,24 @@ 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'

type Props = {
mutationProps: MenuMutationProps
handleStartActivity: (gcalInput?: CreateGcalEventInput) => void
teamRef: ScheduleMeetingButton_team$key
viewerRef: ScheduleMeetingButton_viewer$key
}

const ScheduleMeetingButton = (props: Props) => {
const {mutationProps, handleStartActivity, teamRef, viewerRef} = props
const {mutationProps, handleStartActivity, teamRef} = props
const atmosphere = useAtmosphere()
const [hasStartedGcalAuthTeamId, setHasStartedGcalAuthTeamId] = useState<null | string>(null)
const {togglePortal: toggleModal, modalPortal} = useModal({
id: 'createGcalEventModal'
})
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 {
Expand Down Expand Up @@ -84,7 +70,7 @@ const ScheduleMeetingButton = (props: Props) => {
}
}, [hasStartedGcalAuth, viewerGcalIntegration])

if (!hasGcalFlag || !cloudProvider) return null
if (!cloudProvider) return null
return (
<>
<SecondaryButton onClick={handleClick} waiting={submitting} className='h-14'>
Expand Down
23 changes: 6 additions & 17 deletions packages/client/components/TeamPrompt/TeamPromptWorkDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,16 +56,12 @@ const TeamPromptWorkDrawer = (props: Props) => {
},
{icon: <GitHubSVG />, service: 'github', label: 'GitHub', Component: GitHubIntegrationPanel},
{icon: <JiraSVG />, service: 'jira', label: 'Jira', Component: JiraIntegrationPanel},
...(meeting.viewerMeetingMember?.user.featureFlags.gcal
? ([
{
icon: <img className='h-6 w-6' src={gcalLogo} />,
service: 'gcal',
label: 'Google Calendar',
Component: GCalIntegrationPanel
}
] as const)
: [])
{
icon: <img className='h-6 w-6' src={gcalLogo} />,
service: 'gcal',
label: 'Google Calendar',
Component: GCalIntegrationPanel
}
] as const

const {Component} = baseTabs[activeIdx]!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ const query = graphql`
featureFlags {
azureDevOps
msTeams
gcal
}
}
}
Expand All @@ -121,7 +120,7 @@ const ProviderList = (props: Props) => {
const data = usePreloadedQuery<ProviderListQuery>(query, queryRef)
const {viewer} = data
const {
featureFlags: {azureDevOps: allowAzureDevOps, msTeams: allowMSTeams, gcal: allowGcal}
featureFlags: {azureDevOps: allowAzureDevOps, msTeams: allowMSTeams}
} = viewer

const integrations = viewer.teamMember?.integrations
Expand Down Expand Up @@ -173,8 +172,7 @@ const ProviderList = (props: Props) => {
{
name: 'Gcal Integration',
connected: !!integrations?.gcal?.auth,
component: <GcalProviderRow viewerRef={viewer} teamId={teamId} />,
hidden: !allowGcal
component: <GcalProviderRow viewerRef={viewer} teamId={teamId} />
}
]

Expand Down
6 changes: 1 addition & 5 deletions packages/server/graphql/mutations/helpers/createGcalEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ enum UserFlagEnum {
noMeetingHistoryLimit
checkoutFlow
retrosInDisguise
gcal
adHocTeams
noTemplateLimit
signUpDestinationTeam
Expand All @@ -30,7 +29,6 @@ type UserFeatureFlags {
noMeetingHistoryLimit: Boolean!
checkoutFlow: Boolean!
retrosInDisguise: Boolean!
gcal: Boolean!
adHocTeams: Boolean!
noTemplateLimit: Boolean!
signUpDestinationTeam: Boolean!
Expand Down
1 change: 0 additions & 1 deletion packages/server/graphql/public/types/UserFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion packages/server/graphql/types/UserFlagEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const UserFlagEnum = new GraphQLEnumType({
noAISummary: {},
noMeetingHistoryLimit: {},
checkoutFlow: {},
gcal: {},
adHocTeams: {},
noTemplateLimit: {},
signUpDestinationTeam: {}
Expand Down

0 comments on commit 9961e63

Please sign in to comment.