| 
									
										
										
										
											2022-03-17 01:09:17 +00:00
										 |  |  | import { LogoutIcon } from "@heroicons/react/outline"; | 
					
						
							|  |  |  | import { | 
					
						
							|  |  |  |   ExternalLinkIcon, | 
					
						
							|  |  |  |   TrashIcon, | 
					
						
							|  |  |  |   LinkIcon, | 
					
						
							|  |  |  |   DotsHorizontalIcon, | 
					
						
							|  |  |  |   PencilIcon, | 
					
						
							|  |  |  | } from "@heroicons/react/solid"; | 
					
						
							| 
									
										
										
										
											2022-03-22 15:22:20 +00:00
										 |  |  | import { MembershipRole } from "@prisma/client"; | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  | import Link from "next/link"; | 
					
						
							| 
									
										
										
										
											2021-09-22 19:52:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-16 23:36:43 +00:00
										 |  |  | import { useLocale } from "@calcom/lib/hooks/useLocale"; | 
					
						
							|  |  |  | import showToast from "@calcom/lib/notification"; | 
					
						
							|  |  |  | import Button from "@calcom/ui/Button"; | 
					
						
							|  |  |  | import { Dialog, DialogTrigger } from "@calcom/ui/Dialog"; | 
					
						
							| 
									
										
										
										
											2022-03-16 19:55:18 +00:00
										 |  |  | import Dropdown, { | 
					
						
							|  |  |  |   DropdownMenuContent, | 
					
						
							|  |  |  |   DropdownMenuItem, | 
					
						
							|  |  |  |   DropdownMenuTrigger, | 
					
						
							|  |  |  |   DropdownMenuSeparator, | 
					
						
							|  |  |  | } from "@calcom/ui/Dropdown"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  | import classNames from "@lib/classNames"; | 
					
						
							|  |  |  | import { getPlaceholderAvatar } from "@lib/getPlaceholderAvatar"; | 
					
						
							|  |  |  | import { trpc, inferQueryOutput } from "@lib/trpc"; | 
					
						
							| 
									
										
										
										
											2021-09-22 19:52:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | import { Tooltip } from "@components/Tooltip"; | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  | import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent"; | 
					
						
							| 
									
										
										
										
											2021-09-14 08:45:28 +00:00
										 |  |  | import Avatar from "@components/ui/Avatar"; | 
					
						
							| 
									
										
										
										
											2021-09-22 19:52:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-07 23:35:26 +00:00
										 |  |  | import { TeamRole } from "./TeamPill"; | 
					
						
							| 
									
										
										
										
											2021-06-05 22:53:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  | interface Props { | 
					
						
							|  |  |  |   team: inferQueryOutput<"viewer.teams.list">[number]; | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |   key: number; | 
					
						
							|  |  |  |   onActionSelect: (text: string) => void; | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-05 22:53:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  | export default function TeamListItem(props: Props) { | 
					
						
							|  |  |  |   const { t } = useLocale(); | 
					
						
							|  |  |  |   const utils = trpc.useContext(); | 
					
						
							|  |  |  |   const team = props.team; | 
					
						
							| 
									
										
										
										
											2021-06-05 22:53:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |   const acceptOrLeaveMutation = trpc.useMutation("viewer.teams.acceptOrLeave", { | 
					
						
							|  |  |  |     onSuccess: () => { | 
					
						
							|  |  |  |       utils.invalidateQueries(["viewer.teams.list"]); | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   function acceptOrLeave(accept: boolean) { | 
					
						
							|  |  |  |     acceptOrLeaveMutation.mutate({ | 
					
						
							|  |  |  |       teamId: team?.id as number, | 
					
						
							|  |  |  |       accept, | 
					
						
							| 
									
										
										
										
											2021-08-02 20:51:57 +00:00
										 |  |  |     }); | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |   } | 
					
						
							|  |  |  |   const acceptInvite = () => acceptOrLeave(true); | 
					
						
							|  |  |  |   const declineInvite = () => acceptOrLeave(false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const isOwner = props.team.role === MembershipRole.OWNER; | 
					
						
							|  |  |  |   const isInvitee = !props.team.accepted; | 
					
						
							|  |  |  |   const isAdmin = props.team.role === MembershipRole.OWNER || props.team.role === MembershipRole.ADMIN; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if (!team) return <></>; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const teamInfo = ( | 
					
						
							|  |  |  |     <div className="flex px-5 py-5"> | 
					
						
							|  |  |  |       <Avatar | 
					
						
							|  |  |  |         size={9} | 
					
						
							|  |  |  |         imageSrc={getPlaceholderAvatar(team?.logo, team?.name as string)} | 
					
						
							|  |  |  |         alt="Team Logo" | 
					
						
							| 
									
										
										
										
											2022-02-09 22:32:31 +00:00
										 |  |  |         className="min-h-9 min-w-9 h-9 w-9 rounded-full" | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |       /> | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |       <div className="ml-3 inline-block"> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |         <span className="text-sm font-bold text-neutral-700">{team.name}</span> | 
					
						
							|  |  |  |         <span className="block text-xs text-gray-400"> | 
					
						
							| 
									
										
										
										
											2022-03-26 00:39:38 +00:00
										 |  |  |           {process.env.NEXT_PUBLIC_WEBSITE_URL}/team/{team.slug} | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |         </span> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   ); | 
					
						
							| 
									
										
										
										
											2021-06-05 22:53:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-02 20:51:57 +00:00
										 |  |  |   return ( | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |     <li className="divide-y"> | 
					
						
							|  |  |  |       <div | 
					
						
							|  |  |  |         className={classNames( | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |           "flex items-center  justify-between", | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |           !isInvitee && "group hover:bg-neutral-50" | 
					
						
							|  |  |  |         )}> | 
					
						
							|  |  |  |         {!isInvitee ? ( | 
					
						
							|  |  |  |           <Link href={"/settings/teams/" + team.id}> | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |             <a className="flex-grow cursor-pointer truncate text-sm" title={`${team.name}`}> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |               {teamInfo} | 
					
						
							|  |  |  |             </a> | 
					
						
							|  |  |  |           </Link> | 
					
						
							|  |  |  |         ) : ( | 
					
						
							|  |  |  |           teamInfo | 
					
						
							|  |  |  |         )} | 
					
						
							|  |  |  |         <div className="px-5 py-5"> | 
					
						
							|  |  |  |           {isInvitee && ( | 
					
						
							|  |  |  |             <> | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |               <Button type="button" color="secondary" onClick={declineInvite}> | 
					
						
							| 
									
										
										
										
											2021-10-08 11:43:48 +00:00
										 |  |  |                 {t("reject")} | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |               </Button> | 
					
						
							| 
									
										
										
										
											2022-02-01 22:17:37 +00:00
										 |  |  |               <Button type="button" color="primary" className="ltr:ml-2 rtl:mr-2" onClick={acceptInvite}> | 
					
						
							| 
									
										
										
										
											2021-10-08 11:43:48 +00:00
										 |  |  |                 {t("accept")} | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |               </Button> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |             </> | 
					
						
							| 
									
										
										
										
											2021-08-02 20:51:57 +00:00
										 |  |  |           )} | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |           {!isInvitee && ( | 
					
						
							| 
									
										
										
										
											2022-03-13 22:09:39 +00:00
										 |  |  |             <div className="flex rtl:space-x-reverse"> | 
					
						
							| 
									
										
										
										
											2022-02-07 23:35:26 +00:00
										 |  |  |               <TeamRole role={team.role} /> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |               <Tooltip content={t("copy_link_team")}> | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |                 <Button | 
					
						
							|  |  |  |                   onClick={() => { | 
					
						
							| 
									
										
										
										
											2022-03-26 00:39:38 +00:00
										 |  |  |                     navigator.clipboard.writeText(process.env.NEXT_PUBLIC_WEBSITE_URL + "/team/" + team.slug); | 
					
						
							| 
									
										
										
										
											2021-10-08 11:43:48 +00:00
										 |  |  |                     showToast(t("link_copied"), "success"); | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |                   }} | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |                   className="h-10 w-10 transition-none" | 
					
						
							| 
									
										
										
										
											2021-09-30 11:31:04 +00:00
										 |  |  |                   size="icon" | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |                   color="minimal" | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                   type="button"> | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |                   <LinkIcon className="h-5 w-5 group-hover:text-gray-600" /> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                 </Button> | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |               </Tooltip> | 
					
						
							| 
									
										
										
										
											2021-09-15 12:33:00 +00:00
										 |  |  |               <Dropdown> | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |                 <DropdownMenuTrigger className="group h-10 w-10 border border-transparent p-0 text-neutral-400 hover:border-gray-200 "> | 
					
						
							|  |  |  |                   <DotsHorizontalIcon className="h-5 w-5 group-hover:text-gray-800" /> | 
					
						
							| 
									
										
										
										
											2021-09-15 12:33:00 +00:00
										 |  |  |                 </DropdownMenuTrigger> | 
					
						
							|  |  |  |                 <DropdownMenuContent> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                   {isAdmin && ( | 
					
						
							|  |  |  |                     <DropdownMenuItem> | 
					
						
							|  |  |  |                       <Link href={"/settings/teams/" + team.id}> | 
					
						
							|  |  |  |                         <a> | 
					
						
							| 
									
										
										
										
											2021-12-17 00:16:59 +00:00
										 |  |  |                           <Button | 
					
						
							|  |  |  |                             color="minimal" | 
					
						
							| 
									
										
										
										
											2022-03-17 01:09:17 +00:00
										 |  |  |                             size="sm" | 
					
						
							|  |  |  |                             className="w-full rounded-none font-medium" | 
					
						
							| 
									
										
										
										
											2021-12-17 00:16:59 +00:00
										 |  |  |                             StartIcon={PencilIcon}> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                             {t("edit_team")} | 
					
						
							|  |  |  |                           </Button> | 
					
						
							|  |  |  |                         </a> | 
					
						
							|  |  |  |                       </Link> | 
					
						
							|  |  |  |                     </DropdownMenuItem> | 
					
						
							|  |  |  |                   )} | 
					
						
							| 
									
										
										
										
											2021-09-15 12:33:00 +00:00
										 |  |  |                   <DropdownMenuItem> | 
					
						
							| 
									
										
										
										
											2022-03-26 00:39:38 +00:00
										 |  |  |                     <Link href={`${process.env.NEXT_PUBLIC_WEBSITE_URL}/team/${team.slug}`} passHref={true}> | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |                       <a target="_blank"> | 
					
						
							| 
									
										
										
										
											2021-12-17 00:16:59 +00:00
										 |  |  |                         <Button | 
					
						
							|  |  |  |                           color="minimal" | 
					
						
							| 
									
										
										
										
											2022-03-17 01:09:17 +00:00
										 |  |  |                           size="sm" | 
					
						
							|  |  |  |                           className="w-full rounded-none font-medium" | 
					
						
							| 
									
										
										
										
											2021-12-17 00:16:59 +00:00
										 |  |  |                           StartIcon={ExternalLinkIcon}> | 
					
						
							| 
									
										
										
										
											2021-10-08 11:43:48 +00:00
										 |  |  |                           {t("preview_team")} | 
					
						
							| 
									
										
											  
											
												Cal 262 refactor edit teams according to the design reference (#516)
* refactored settings/team landing page
* changed team edit flow, WIP
* merge conflict fix for teams.tsx
* minor fixes to edit team, WIP
* invite-member and disband team APIs attached inside edit-team page
* added remove-member API in edit-team page, minor fixes
* minor code fix, WIP
* WIP
* add logo, bio, branding to team schema
* bio, logo, branding, slug patch API and minor code fix-- WIP
* fn to Disband team directly from the dropdown menu in settings/teams page, removed debug remnants --WIP
* Pull latest data after an action in settings/teams-edit page
* added slug conflict check at Patch time
* code clean-up
* initial change request fixes --WIP
* prop type fix and add warn button color theme --WIP
* added warn Button to Dialog
* remaining change request fixes
* added noop from react-query
* updated invited team-list design
* prettier fix for api/teams/profile
* removed noop import and added custom noop
* minor Button fix
* requested changes addressed
											
										 
											2021-09-06 13:22:22 +00:00
										 |  |  |                         </Button> | 
					
						
							|  |  |  |                       </a> | 
					
						
							|  |  |  |                     </Link> | 
					
						
							| 
									
										
										
										
											2021-09-15 12:33:00 +00:00
										 |  |  |                   </DropdownMenuItem> | 
					
						
							| 
									
										
										
										
											2021-12-17 00:16:59 +00:00
										 |  |  |                   <DropdownMenuSeparator className="h-px bg-gray-200" /> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                   {isOwner && ( | 
					
						
							|  |  |  |                     <DropdownMenuItem> | 
					
						
							|  |  |  |                       <Dialog> | 
					
						
							|  |  |  |                         <DialogTrigger asChild> | 
					
						
							|  |  |  |                           <Button | 
					
						
							|  |  |  |                             onClick={(e) => { | 
					
						
							|  |  |  |                               e.stopPropagation(); | 
					
						
							|  |  |  |                             }} | 
					
						
							|  |  |  |                             color="warn" | 
					
						
							| 
									
										
										
										
											2022-03-17 01:09:17 +00:00
										 |  |  |                             size="sm" | 
					
						
							|  |  |  |                             className="w-full rounded-none font-medium" | 
					
						
							|  |  |  |                             StartIcon={TrashIcon}> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                             {t("disband_team")} | 
					
						
							|  |  |  |                           </Button> | 
					
						
							|  |  |  |                         </DialogTrigger> | 
					
						
							|  |  |  |                         <ConfirmationDialogContent | 
					
						
							|  |  |  |                           variety="danger" | 
					
						
							|  |  |  |                           title={t("disband_team")} | 
					
						
							|  |  |  |                           confirmBtnText={t("confirm_disband_team")} | 
					
						
							|  |  |  |                           onConfirm={() => props.onActionSelect("disband")}> | 
					
						
							|  |  |  |                           {t("disband_team_confirmation_message")} | 
					
						
							|  |  |  |                         </ConfirmationDialogContent> | 
					
						
							|  |  |  |                       </Dialog> | 
					
						
							|  |  |  |                     </DropdownMenuItem> | 
					
						
							|  |  |  |                   )} | 
					
						
							| 
									
										
										
										
											2021-12-17 00:16:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                   {!isOwner && ( | 
					
						
							|  |  |  |                     <DropdownMenuItem> | 
					
						
							|  |  |  |                       <Dialog> | 
					
						
							|  |  |  |                         <DialogTrigger asChild> | 
					
						
							|  |  |  |                           <Button | 
					
						
							|  |  |  |                             type="button" | 
					
						
							|  |  |  |                             color="warn" | 
					
						
							| 
									
										
										
										
											2022-03-16 19:55:18 +00:00
										 |  |  |                             size="lg" | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                             StartIcon={LogoutIcon} | 
					
						
							| 
									
										
										
										
											2022-03-16 19:55:18 +00:00
										 |  |  |                             className="w-full rounded-none" | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |                             onClick={(e) => { | 
					
						
							|  |  |  |                               e.stopPropagation(); | 
					
						
							|  |  |  |                             }}> | 
					
						
							|  |  |  |                             {t("leave_team")} | 
					
						
							|  |  |  |                           </Button> | 
					
						
							|  |  |  |                         </DialogTrigger> | 
					
						
							|  |  |  |                         <ConfirmationDialogContent | 
					
						
							|  |  |  |                           variety="danger" | 
					
						
							|  |  |  |                           title={t("leave_team")} | 
					
						
							|  |  |  |                           confirmBtnText={t("confirm_leave_team")} | 
					
						
							|  |  |  |                           onConfirm={declineInvite}> | 
					
						
							|  |  |  |                           {t("leave_team_confirmation_message")} | 
					
						
							|  |  |  |                         </ConfirmationDialogContent> | 
					
						
							|  |  |  |                       </Dialog> | 
					
						
							|  |  |  |                     </DropdownMenuItem> | 
					
						
							|  |  |  |                   )} | 
					
						
							| 
									
										
										
										
											2021-09-15 12:33:00 +00:00
										 |  |  |                 </DropdownMenuContent> | 
					
						
							| 
									
										
										
										
											2021-08-02 20:51:57 +00:00
										 |  |  |               </Dropdown> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           )} | 
					
						
							| 
									
										
										
										
											2021-06-05 22:53:33 +00:00
										 |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2021-12-09 23:51:30 +00:00
										 |  |  |       </div> | 
					
						
							|  |  |  |     </li> | 
					
						
							| 
									
										
										
										
											2021-08-02 20:51:57 +00:00
										 |  |  |   ); | 
					
						
							| 
									
										
										
										
											2021-07-30 23:05:38 +00:00
										 |  |  | } |