mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-23 16:38:17 +00:00
UI: Removed group type option for teams with child teams. (#7243)
* removed group type option for teams with child teams. * fixed issue with team count not changing with search results
This commit is contained in:
parent
9ff49c3161
commit
1b19fb32a4
@ -161,7 +161,7 @@ const TeamDetailsV1 = ({
|
||||
isOrganization,
|
||||
searchTerm ? table.length : undefined
|
||||
),
|
||||
[currentTeam, teamUserPagin, searchTerm]
|
||||
[currentTeam, teamUserPagin, searchTerm, table]
|
||||
);
|
||||
|
||||
const createTeamPermission = useMemo(
|
||||
@ -829,6 +829,7 @@ const TeamDetailsV1 = ({
|
||||
<EntitySummaryDetails
|
||||
data={info}
|
||||
isGroupType={isGroupType}
|
||||
showGroupOption={!childTeams.length}
|
||||
teamType={currentTeam.teamType}
|
||||
updateOwner={
|
||||
entityPermissions.EditAll || entityPermissions.EditOwner
|
||||
|
@ -36,6 +36,7 @@ export interface GetInfoElementsProps {
|
||||
tier?: TagLabel;
|
||||
currentTier?: string;
|
||||
teamType?: TeamType;
|
||||
showGroupOption?: boolean;
|
||||
isGroupType?: boolean;
|
||||
updateTier?: (value: string) => void;
|
||||
updateTeamType?: (type: TeamType) => void;
|
||||
@ -47,7 +48,7 @@ const EditIcon = ({ iconClasses }: { iconClasses?: string }): JSX.Element => (
|
||||
className={classNames('tw-cursor-pointer tw-align-text-top', iconClasses)}
|
||||
icon={Icons.EDIT}
|
||||
title="Edit"
|
||||
width="15px"
|
||||
width="16px"
|
||||
/>
|
||||
);
|
||||
|
||||
@ -66,6 +67,7 @@ const EntitySummaryDetails = ({
|
||||
isGroupType,
|
||||
tier,
|
||||
teamType,
|
||||
showGroupOption,
|
||||
updateOwner,
|
||||
updateTier,
|
||||
updateTeamType,
|
||||
@ -307,6 +309,7 @@ const EntitySummaryDetails = ({
|
||||
showTypeSelector ? (
|
||||
<TeamTypeSelect
|
||||
handleShowTypeSelector={handleShowTypeSelector}
|
||||
showGroupOption={showGroupOption ?? false}
|
||||
teamType={teamType ?? TeamType.Department}
|
||||
updateTeamType={updateTeamType}
|
||||
/>
|
||||
|
@ -21,6 +21,7 @@ import { getTeamTypeOptions } from './TeamTypeSelect.utils';
|
||||
|
||||
function TeamTypeSelect({
|
||||
handleShowTypeSelector,
|
||||
showGroupOption,
|
||||
teamType,
|
||||
updateTeamType,
|
||||
}: TeamTypeSelectProps) {
|
||||
@ -38,7 +39,7 @@ function TeamTypeSelect({
|
||||
updateTeamType && updateTeamType(value);
|
||||
};
|
||||
|
||||
const options = useMemo(() => getTeamTypeOptions(), []);
|
||||
const options = useMemo(() => getTeamTypeOptions(showGroupOption), []);
|
||||
|
||||
return (
|
||||
<Space align="center" className="team-type-select" size={4}>
|
||||
|
@ -16,5 +16,6 @@ import { TeamType } from '../../../generated/entity/teams/team';
|
||||
export interface TeamTypeSelectProps {
|
||||
handleShowTypeSelector: (value: boolean) => void;
|
||||
teamType: TeamType;
|
||||
showGroupOption: boolean;
|
||||
updateTeamType?: (type: TeamType) => void;
|
||||
}
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
import { TeamType } from '../../../generated/entity/teams/team';
|
||||
|
||||
export const getTeamTypeOptions = () => {
|
||||
const teamTypesArray = Object.values(TeamType).filter(
|
||||
(key) => key !== TeamType.Organization
|
||||
export const getTeamTypeOptions = (showGroupOption: boolean) => {
|
||||
const teamTypesArray = Object.values(TeamType).filter((key) =>
|
||||
key === TeamType.Group ? showGroupOption : key !== TeamType.Organization
|
||||
);
|
||||
|
||||
return teamTypesArray.map((teamType) => ({
|
||||
|
Loading…
x
Reference in New Issue
Block a user