Browse Source

ref(ui): Deprecate withTeams (#29929)

All usages of withTeams to provide a list of teams that components would assume is all teams have been removed. This HOC should be deprecated in favor of useTeams or Teams which allow components to have more granularity of the list of teams they want to request and provide searching/pagination functionality.

Marked withTeams as deprecated
Added TODOs for remaining usages
David Wang 3 years ago
parent
commit
38c37e4642

+ 2 - 0
static/app/utils/withTeams.tsx

@@ -10,6 +10,8 @@ type InjectedTeamsProps = {
 
 /**
  * Higher order component that provides a list of teams
+ *
+ * @deprecated Prefer `useTeams` or `<Teams />`.
  */
 const withTeams = <P extends InjectedTeamsProps>(
   WrappedComponent: React.ComponentType<P>

+ 1 - 0
static/app/views/onboarding/platform.tsx

@@ -187,4 +187,5 @@ class OnboardingPlatform extends Component<Props, State> {
   }
 }
 
+// TODO(davidenwang): change to functional component and replace withTeams with useTeams
 export default withApi(withTeams(OnboardingPlatform));

+ 1 - 0
static/app/views/projectInstall/createProject.tsx

@@ -318,6 +318,7 @@ class CreateProject extends React.Component<Props, State> {
   }
 }
 
+// TODO(davidenwang): change to functional component and replace withTeams with useTeams
 export default withApi(withRouter(withOrganization(withTeams(CreateProject))));
 export {CreateProject};
 

+ 1 - 0
static/app/views/settings/organizationTeams/teamDetails.tsx

@@ -207,6 +207,7 @@ class TeamDetails extends React.Component<Props, State> {
   }
 }
 
+// TODO(davidenwang): change to functional component and replace withTeams with useTeams
 export default withApi(withOrganization(withTeams(TeamDetails)));
 
 const RequestAccessWrapper = styled('div')`