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

chore: Remove adhoc teams #9678

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -35,7 +35,6 @@ graphql`
export const query = graphql`
query ActivityDetailsQuery($activityId: ID!) {
viewer {
...ActivityDetailsSidebar_viewer
activityLibrarySearch
preferredTeamId
activity(activityId: $activityId) {
Expand Down Expand Up @@ -138,7 +137,6 @@ const ActivityDetails = (props: Props) => {
teamsRef={teams}
type={activity.type}
preferredTeamId={preferredTeamId}
viewerRef={viewer}
/>
</div>
</div>
Expand All @@ -148,7 +146,6 @@ const ActivityDetails = (props: Props) => {
teamsRef={teams}
type={activity.type}
preferredTeamId={preferredTeamId}
viewerRef={viewer}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {useFragment} from 'react-relay'
import {useHistory} from 'react-router'
import {ActivityDetailsSidebar_teams$key} from '~/__generated__/ActivityDetailsSidebar_teams.graphql'
import {ActivityDetailsSidebar_template$key} from '~/__generated__/ActivityDetailsSidebar_template.graphql'
import {ActivityDetailsSidebar_viewer$key} from '~/__generated__/ActivityDetailsSidebar_viewer.graphql'
import StartRetrospectiveMutation from '~/mutations/StartRetrospectiveMutation'
import StartSprintPokerMutation from '~/mutations/StartSprintPokerMutation'
import UpdateReflectTemplateScopeMutation from '~/mutations/UpdateReflectTemplateScopeMutation'
Expand Down Expand Up @@ -41,11 +40,10 @@ interface Props {
teamsRef: ActivityDetailsSidebar_teams$key
type: MeetingTypeEnum
preferredTeamId: string | null
viewerRef: ActivityDetailsSidebar_viewer$key
}

const ActivityDetailsSidebar = (props: Props) => {
const {selectedTemplateRef, teamsRef, type, preferredTeamId, viewerRef} = props
const {selectedTemplateRef, teamsRef, type, preferredTeamId} = props
const [isMinimized, setIsMinimized] = useState(false)
const isMobile = !useBreakpoint(Breakpoint.INVOICE)
const selectedTemplate = useFragment(
Expand All @@ -61,22 +59,6 @@ const ActivityDetailsSidebar = (props: Props) => {
selectedTemplateRef
)

const viewer = useFragment(
graphql`
fragment ActivityDetailsSidebar_viewer on User {
featureFlags {
adHocTeams
}
...AdhocTeamMultiSelect_viewer
organizations {
id
name
}
}
`,
viewerRef
)

const teams = useFragment(
graphql`
fragment ActivityDetailsSidebar_teams on Team @relay(plural: true) {
Expand Down Expand Up @@ -278,7 +260,6 @@ const ActivityDetailsSidebar = (props: Props) => {
selectedTeamRef={selectedTeam}
teamsRef={availableTeams}
customPortal={teamScopePopover}
allowAddTeam={viewer.featureFlags.adHocTeams}
/>
{type === 'retrospective' && (
<>
Expand Down
25 changes: 1 addition & 24 deletions packages/client/components/NewMeetingTeamPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import React from 'react'
import {useFragment} from 'react-relay'
import {NewMeetingTeamPicker_selectedTeam$key} from '~/__generated__/NewMeetingTeamPicker_selectedTeam.graphql'
import {NewMeetingTeamPicker_teams$key} from '~/__generated__/NewMeetingTeamPicker_teams.graphql'
import AddTeamDialogRoot from '~/components/AddTeamDialogRoot'
import SendClientSideEvent from '~/utils/SendClientSideEvent'
import useAtmosphere from '../hooks/useAtmosphere'
import {MenuPosition} from '../hooks/useCoords'
import useMenu from '../hooks/useMenu'
Expand All @@ -28,33 +26,24 @@ interface Props {
onSelectTeam: (teamId: string) => void
positionOverride?: MenuPosition
customPortal?: React.ReactNode
allowAddTeam?: boolean
}

const NewMeetingTeamPicker = (props: Props) => {
const {selectedTeamRef, teamsRef, onSelectTeam, positionOverride, customPortal, allowAddTeam} =
props
const {selectedTeamRef, teamsRef, onSelectTeam, positionOverride, customPortal} = props
const {togglePortal, menuPortal, originRef, menuProps, portalStatus} = useMenu<HTMLDivElement>(
positionOverride ?? MenuPosition.LOWER_RIGHT,
{
isDropdown: true
}
)

const [addTeamDialogOpen, setAddTeamDialogOpen] = React.useState(false)

const atmosphere = useAtmosphere()

const handleSelectTeam = (teamId: string) => {
setPreferredTeamId(atmosphere, teamId)
onSelectTeam(teamId)
}

const handleAddTeamClick = () => {
SendClientSideEvent(atmosphere, 'Add Team Clicked')
setAddTeamDialogOpen(true)
}

const selectedTeam = useFragment(
graphql`
fragment NewMeetingTeamPicker_selectedTeam on Team {
Expand Down Expand Up @@ -97,21 +86,9 @@ const NewMeetingTeamPicker = (props: Props) => {
menuProps={menuProps}
teams={teams}
teamHandleClick={handleSelectTeam}
onAddTeamClick={allowAddTeam ? handleAddTeamClick : undefined}
/>
)
)}
{addTeamDialogOpen && (
<AddTeamDialogRoot
onAddTeam={(teamId) => {
setAddTeamDialogOpen(false)
handleSelectTeam(teamId)
}}
onClose={() => {
setAddTeamDialogOpen(false)
}}
/>
)}
</>
)
}
Expand Down
20 changes: 2 additions & 18 deletions packages/client/components/SelectTeamDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from '@emotion/styled'
import {Add} from '@mui/icons-material'
import graphql from 'babel-plugin-relay/macro'
import React from 'react'
import {useFragment} from 'react-relay'
Expand All @@ -14,15 +13,14 @@ interface Props {
menuProps: MenuProps
teamHandleClick: (teamId: string, e: React.MouseEvent) => void
teams: SelectTeamDropdown_teams$key
onAddTeamClick?: () => void
}

const TeamMenu = styled(Menu)({
maxWidth: 'none'
})

const SelectTeamDropdown = (props: Props) => {
const {teams: teamsRef, menuProps, teamHandleClick, onAddTeamClick} = props
const {teams: teamsRef, menuProps, teamHandleClick} = props
const teams = useFragment(
graphql`
fragment SelectTeamDropdown_teams on Team @relay(plural: true) {
Expand All @@ -34,21 +32,7 @@ const SelectTeamDropdown = (props: Props) => {
)
return (
<TeamMenu ariaLabel={'Select the team associated with the new task'} {...menuProps}>
{onAddTeamClick ? (
<MenuItem
label={
<div
className='text-md flex w-full items-center px-2 font-semibold leading-8 text-sky-500'
onClick={onAddTeamClick}
>
<Add className='mr-1' />
Add Team
</div>
}
/>
) : (
<DropdownMenuLabel>Select Team:</DropdownMenuLabel>
)}
<DropdownMenuLabel>Select Team:</DropdownMenuLabel>
{teams.map((team) => {
return (
<MenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ enum UserFlagEnum {
recurrence
noAISummary
noMeetingHistoryLimit
adHocTeams
signUpDestinationTeam
}

Expand All @@ -20,7 +19,6 @@ type UserFeatureFlags {
recurrence: Boolean!
noAISummary: Boolean!
noMeetingHistoryLimit: Boolean!
adHocTeams: 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 @@ -4,7 +4,6 @@ const UserFeatureFlags: UserFeatureFlagsResolvers = {
insights: ({insights}) => !!insights,
noAISummary: ({noAISummary}) => !!noAISummary,
noMeetingHistoryLimit: ({noMeetingHistoryLimit}) => !!noMeetingHistoryLimit,
adHocTeams: ({adHocTeams}) => !!adHocTeams,
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 @@ -7,7 +7,6 @@ const UserFlagEnum = new GraphQLEnumType({
azureDevOps: {},
noAISummary: {},
noMeetingHistoryLimit: {},
adHocTeams: {},
signUpDestinationTeam: {}
}
})
Expand Down
Loading