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

feat: remove gcal flag #9251

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
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 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
Loading