chore(ui): restore users tab for teams page (#18531)

* chore(ui): restore users tab for teams page

* remove unwanted seprator

* restict add and join user, to team page other than Group types

* minor textual change

---------

Co-authored-by: Ashish Gupta <ashish@getcollate.io>
This commit is contained in:
Chirag Madlani 2024-11-26 12:08:33 +05:30 committed by GitHub
parent 09db201a57
commit 678d87f4b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 50 additions and 5 deletions

View File

@ -917,6 +917,7 @@ const TeamDetailsV1 = ({
() => () =>
!isOrganization && !isOrganization &&
!isUndefined(currentUser) && !isUndefined(currentUser) &&
isGroupType &&
(isAlreadyJoinedTeam ? ( (isAlreadyJoinedTeam ? (
<Button <Button
ghost ghost
@ -937,7 +938,14 @@ const TeamDetailsV1 = ({
) )
)), )),
[currentUser, isAlreadyJoinedTeam, isAdminUser, joinTeam, deleteUserHandler] [
currentUser,
isAlreadyJoinedTeam,
isGroupType,
isAdminUser,
joinTeam,
deleteUserHandler,
]
); );
const teamsCollapseHeader = useMemo( const teamsCollapseHeader = useMemo(
@ -1074,7 +1082,13 @@ const TeamDetailsV1 = ({
const tabs = useMemo( const tabs = useMemo(
() => () =>
getTabs(currentTeam, isGroupType, teamCount, assetsCount).map((tab) => ({ getTabs(
currentTeam,
isGroupType,
isOrganization,
teamCount,
assetsCount
).map((tab) => ({
...tab, ...tab,
label: ( label: (
<TabsLabel <TabsLabel
@ -1089,6 +1103,7 @@ const TeamDetailsV1 = ({
[ [
currentTeam, currentTeam,
searchTerm, searchTerm,
isOrganization,
teamCount, teamCount,
currentTab, currentTab,
assetsCount, assetsCount,

View File

@ -18,6 +18,7 @@ import { TeamsPageTab } from './team.interface';
export const getTabs = ( export const getTabs = (
currentTeam: Team, currentTeam: Team,
isGroupType: boolean, isGroupType: boolean,
isOrganization: boolean,
teamsCount: number, teamsCount: number,
assetsCount: number assetsCount: number
) => { ) => {
@ -51,9 +52,13 @@ export const getTabs = (
const commonTabs = [tabs.roles, tabs.policies]; const commonTabs = [tabs.roles, tabs.policies];
if (isOrganization) {
return [tabs.teams, ...commonTabs];
}
if (isGroupType) { if (isGroupType) {
return [tabs.users, tabs.assets, ...commonTabs]; return [tabs.users, tabs.assets, ...commonTabs];
} }
return [tabs.teams, ...commonTabs]; return [tabs.teams, tabs.users, ...commonTabs];
}; };

View File

@ -323,7 +323,6 @@ const TeamsInfo = ({
<Divider type="vertical" /> <Divider type="vertical" />
<Space size={4}> <Space size={4}>
<Divider type="vertical" />
<Typography.Text className="text-grey-muted d-flex items-center"> <Typography.Text className="text-grey-muted d-flex items-center">
{t('label.total-user-plural')} {t('label.total-user-plural')}
<Tooltip <Tooltip

View File

@ -37,6 +37,7 @@ import {
TabSpecificField, TabSpecificField,
} from '../../../../../enums/entity.enum'; } from '../../../../../enums/entity.enum';
import { SearchIndex } from '../../../../../enums/search.enum'; import { SearchIndex } from '../../../../../enums/search.enum';
import { TeamType } from '../../../../../generated/entity/teams/team';
import { User } from '../../../../../generated/entity/teams/user'; import { User } from '../../../../../generated/entity/teams/user';
import { EntityReference } from '../../../../../generated/entity/type'; import { EntityReference } from '../../../../../generated/entity/type';
import { Paging } from '../../../../../generated/type/paging'; import { Paging } from '../../../../../generated/type/paging';
@ -90,6 +91,11 @@ export const UserTab = ({
showPagination, showPagination,
} = usePaging(PAGE_SIZE_MEDIUM); } = usePaging(PAGE_SIZE_MEDIUM);
const isGroupType = useMemo(
() => currentTeam.teamType === TeamType.Group,
[currentTeam.teamType]
);
/** /**
* Make API call to fetch current team user data * Make API call to fetch current team user data
*/ */
@ -301,7 +307,7 @@ export const UserTab = ({
}, [permission, isTeamDeleted]); }, [permission, isTeamDeleted]);
if (isEmpty(users) && !searchText && !isLoading) { if (isEmpty(users) && !searchText && !isLoading) {
return ( return isGroupType ? (
<ErrorPlaceHolder <ErrorPlaceHolder
button={ button={
<Space> <Space>
@ -339,6 +345,12 @@ export const UserTab = ({
permission={permission.EditAll} permission={permission.EditAll}
type={ERROR_PLACEHOLDER_TYPE.ASSIGN} type={ERROR_PLACEHOLDER_TYPE.ASSIGN}
/> />
) : (
<ErrorPlaceHolder
placeholderText={t('message.no-user-part-of-team', {
team: getEntityName(currentTeam),
})}
/>
); );
} }

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Kein Token verfügbar", "no-token-available": "Kein Token verfügbar",
"no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights", "no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights",
"no-user-available": "Kein Benutzer verfügbar", "no-user-available": "Kein Benutzer verfügbar",
"no-user-part-of-team": "Kein Benutzer ist Teil dieses {{team}}-Teams",
"no-username-available": "Kein Benutzer verfügbar mit dem Namen <0>{{user}}</0>", "no-username-available": "Kein Benutzer verfügbar mit dem Namen <0>{{user}}</0>",
"no-users": "Es gibt keine Benutzer {{text}}", "no-users": "Es gibt keine Benutzer {{text}}",
"no-version-type-available": "Keine {{type}}-Version verfügbar", "no-version-type-available": "Keine {{type}}-Version verfügbar",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "No token available", "no-token-available": "No token available",
"no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights", "no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights",
"no-user-available": "No user available", "no-user-available": "No user available",
"no-user-part-of-team": "No users is part of this {{team}} Team",
"no-username-available": "No user available with name <0>{{user}}</0>", "no-username-available": "No user available with name <0>{{user}}</0>",
"no-users": "There are no users {{text}}", "no-users": "There are no users {{text}}",
"no-version-type-available": "No {{type}} version available", "no-version-type-available": "No {{type}} version available",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "No hay tokens disponibles", "no-token-available": "No hay tokens disponibles",
"no-total-data-assets": "Los insights de datos proporcionan una comprensión clara del panorama de datos en evolución en tu organización.", "no-total-data-assets": "Los insights de datos proporcionan una comprensión clara del panorama de datos en evolución en tu organización.",
"no-user-available": "No hay usuarios disponibles", "no-user-available": "No hay usuarios disponibles",
"no-user-part-of-team": "Ningún usuario forma parte de este equipo {{team}}",
"no-username-available": "No hay usuarios disponibles con el nombre <0>{{user}}</0>", "no-username-available": "No hay usuarios disponibles con el nombre <0>{{user}}</0>",
"no-users": "No hay usuarios {{text}}", "no-users": "No hay usuarios {{text}}",
"no-version-type-available": "No hay versiones de {{type}} disponibles", "no-version-type-available": "No hay versiones de {{type}} disponibles",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Aucun jeton disponible", "no-token-available": "Aucun jeton disponible",
"no-total-data-assets": "Les Data Insights fournissent une vision claire du paysage des données évoluant dans votre organisation. Ils offrent des réponses aux question telles que le nombres d'actifs de données vous avez, le nombre d'actifs ajoutés pendant une période, et bien plus. Référez-vous au <0>{{setup}}</0> pour bénéficier de ces insights", "no-total-data-assets": "Les Data Insights fournissent une vision claire du paysage des données évoluant dans votre organisation. Ils offrent des réponses aux question telles que le nombres d'actifs de données vous avez, le nombre d'actifs ajoutés pendant une période, et bien plus. Référez-vous au <0>{{setup}}</0> pour bénéficier de ces insights",
"no-user-available": "Aucun utilisateur disponible", "no-user-available": "Aucun utilisateur disponible",
"no-user-part-of-team": "Aucun utilisateur ne fait partie de cette équipe {{team}}",
"no-username-available": "Aucun utilisateur disponible avec le nom <0>{{user}}</0>", "no-username-available": "Aucun utilisateur disponible avec le nom <0>{{user}}</0>",
"no-users": "Il n'y a aucun utilisateur {{text}}", "no-users": "Il n'y a aucun utilisateur {{text}}",
"no-version-type-available": "Aucun type de {{type}} version disponible", "no-version-type-available": "Aucun type de {{type}} version disponible",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Non hai tokens dispoñibles", "no-token-available": "Non hai tokens dispoñibles",
"no-total-data-assets": "Os Insights de Datos proporcionan unha comprensión clara da paisaxe de datos en evolución na túa organización. Ofrecen respostas a preguntas como cantos activos de datos tes, a taxa á que se engaden novos activos, e máis. Descubre máis sobre <0>{{setup}}</0> para aproveitar estes insights", "no-total-data-assets": "Os Insights de Datos proporcionan unha comprensión clara da paisaxe de datos en evolución na túa organización. Ofrecen respostas a preguntas como cantos activos de datos tes, a taxa á que se engaden novos activos, e máis. Descubre máis sobre <0>{{setup}}</0> para aproveitar estes insights",
"no-user-available": "Non hai usuarios dispoñibles", "no-user-available": "Non hai usuarios dispoñibles",
"no-user-part-of-team": "Ningún usuario forma parte deste equipo {{team}}",
"no-username-available": "Non hai usuarios dispoñibles co nome <0>{{user}}</0>", "no-username-available": "Non hai usuarios dispoñibles co nome <0>{{user}}</0>",
"no-users": "Non hai usuarios {{text}}", "no-users": "Non hai usuarios {{text}}",
"no-version-type-available": "Non hai versións de {{type}} dispoñibles", "no-version-type-available": "Non hai versións de {{type}} dispoñibles",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "אין טוקן זמין", "no-token-available": "אין טוקן זמין",
"no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights", "no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights",
"no-user-available": "אין משתמש זמין", "no-user-available": "אין משתמש זמין",
"no-user-part-of-team": "אין משתמש חלק מצוות {{team}}",
"no-username-available": "אין משתמש זמין בשם <0>{{user}}</0>", "no-username-available": "אין משתמש זמין בשם <0>{{user}}</0>",
"no-users": "אין משתמשים {{text}}", "no-users": "אין משתמשים {{text}}",
"no-version-type-available": "לא קיימת גרסה של {{type}}", "no-version-type-available": "לא קיימת גרסה של {{type}}",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "No token available", "no-token-available": "No token available",
"no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights", "no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights",
"no-user-available": "No user available", "no-user-available": "No user available",
"no-user-part-of-team": "この{{team}}チームの一員ではないユーザーはいます",
"no-username-available": "No user available with name <0>{{user}}</0>", "no-username-available": "No user available with name <0>{{user}}</0>",
"no-users": "ユーザ{{text}}は存在しません", "no-users": "ユーザ{{text}}は存在しません",
"no-version-type-available": "No {{type}} version available", "no-version-type-available": "No {{type}} version available",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Geen token beschikbaar", "no-token-available": "Geen token beschikbaar",
"no-total-data-assets": "Data-inzicht biedt een duidelijk inzicht in het zich ontwikkelende datalandschap in uw organisatie. Ze geven antwoord op vragen als hoeveel data-assets je hebt, de snelheid waarmee nieuwe assets worden toegevoegd en meer. Ontdek meer over <0>{{setup}}</0> om deze inzichten te benutten", "no-total-data-assets": "Data-inzicht biedt een duidelijk inzicht in het zich ontwikkelende datalandschap in uw organisatie. Ze geven antwoord op vragen als hoeveel data-assets je hebt, de snelheid waarmee nieuwe assets worden toegevoegd en meer. Ontdek meer over <0>{{setup}}</0> om deze inzichten te benutten",
"no-user-available": "Geen gebruiker beschikbaar", "no-user-available": "Geen gebruiker beschikbaar",
"no-user-part-of-team": "Geen enkele gebruiker maakt deel uit van dit {{team}}-team",
"no-username-available": "Geen gebruiker beschikbaar met de naam <0>{{user}}</0>", "no-username-available": "Geen gebruiker beschikbaar met de naam <0>{{user}}</0>",
"no-users": "Er zijn geen gebruikers {{text}}", "no-users": "Er zijn geen gebruikers {{text}}",
"no-version-type-available": "Geen {{type}} versie beschikbaar", "no-version-type-available": "Geen {{type}} versie beschikbaar",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "هیچ توکنی در دسترس نیست.", "no-token-available": "هیچ توکنی در دسترس نیست.",
"no-total-data-assets": "بینش‌های داده‌ای درک واضحی از چشم‌انداز داده‌ای در حال تغییر در سازمان شما فراهم می‌کند. آنها پاسخ‌هایی به سوالاتی مانند تعداد دارایی‌های داده‌ای شما، سرعت اضافه شدن دارایی‌های جدید و موارد دیگر ارائه می‌دهند. درباره <0>{{setup}}</0> بیشتر بدانید تا از این بینش‌ها بهره‌برداری کنید.", "no-total-data-assets": "بینش‌های داده‌ای درک واضحی از چشم‌انداز داده‌ای در حال تغییر در سازمان شما فراهم می‌کند. آنها پاسخ‌هایی به سوالاتی مانند تعداد دارایی‌های داده‌ای شما، سرعت اضافه شدن دارایی‌های جدید و موارد دیگر ارائه می‌دهند. درباره <0>{{setup}}</0> بیشتر بدانید تا از این بینش‌ها بهره‌برداری کنید.",
"no-user-available": "هیچ کاربری موجود نیست.", "no-user-available": "هیچ کاربری موجود نیست.",
"no-user-part-of-team": "هیچ کاربری جزئی از تیم {{team}} نیست",
"no-username-available": "هیچ کاربری با نام <0>{{user}}</0> موجود نیست.", "no-username-available": "هیچ کاربری با نام <0>{{user}}</0> موجود نیست.",
"no-users": "هیچ کاربری {{text}} وجود ندارد.", "no-users": "هیچ کاربری {{text}} وجود ندارد.",
"no-version-type-available": "هیچ نسخه {{type}} در دسترس نیست.", "no-version-type-available": "هیچ نسخه {{type}} در دسترس نیست.",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Nenhum token disponível", "no-token-available": "Nenhum token disponível",
"no-total-data-assets": "Data Insights fornecem uma compreensão clara do cenário de dados em evolução em sua organização. Elas oferecem respostas a perguntas como quantos ativos de dados você possui, a taxa de adição de novos ativos e muito mais. Descubra mais sobre <0>{{setup}}</0> para aproveitar essas informações", "no-total-data-assets": "Data Insights fornecem uma compreensão clara do cenário de dados em evolução em sua organização. Elas oferecem respostas a perguntas como quantos ativos de dados você possui, a taxa de adição de novos ativos e muito mais. Descubra mais sobre <0>{{setup}}</0> para aproveitar essas informações",
"no-user-available": "Nenhum usuário disponível", "no-user-available": "Nenhum usuário disponível",
"no-user-part-of-team": "Nenhum usuário faz parte desta equipe {{team}}",
"no-username-available": "Nenhum usuário disponível com o nome <0>{{user}}</0>", "no-username-available": "Nenhum usuário disponível com o nome <0>{{user}}</0>",
"no-users": "Não há usuários {{text}}", "no-users": "Não há usuários {{text}}",
"no-version-type-available": "Nenhuma versão {{type}} disponível", "no-version-type-available": "Nenhuma versão {{type}} disponível",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Nenhum token disponível", "no-token-available": "Nenhum token disponível",
"no-total-data-assets": "Data Insights fornecem uma compreensão clara do cenário de dados em evolução em sua organização. Elas oferecem respostas a perguntas como quantos ativos de dados você possui, a taxa de adição de novos ativos e muito mais. Descubra mais sobre <0>{{setup}}</0> para aproveitar essas informações", "no-total-data-assets": "Data Insights fornecem uma compreensão clara do cenário de dados em evolução em sua organização. Elas oferecem respostas a perguntas como quantos ativos de dados você possui, a taxa de adição de novos ativos e muito mais. Descubra mais sobre <0>{{setup}}</0> para aproveitar essas informações",
"no-user-available": "Nenhum utilizador disponível", "no-user-available": "Nenhum utilizador disponível",
"no-user-part-of-team": "Nenhum usuário faz parte desta equipe {{team}}",
"no-username-available": "Nenhum utilizador disponível com o nome <0>{{user}}</0>", "no-username-available": "Nenhum utilizador disponível com o nome <0>{{user}}</0>",
"no-users": "Não há Utilizadores {{text}}", "no-users": "Não há Utilizadores {{text}}",
"no-version-type-available": "Nenhuma versão {{type}} disponível", "no-version-type-available": "Nenhuma versão {{type}} disponível",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "Токен недоступен", "no-token-available": "Токен недоступен",
"no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights", "no-total-data-assets": "Data Insights provide a clear understanding of the evolving data landscape in your organization. They offer answers to questions like how many data assets you have, the rate at which new assets are added, and more. Discover more about <0>{{setup}}</0> to leverage these insights",
"no-user-available": "Нет доступных пользователей", "no-user-available": "Нет доступных пользователей",
"no-user-part-of-team": "Ни один пользователь не является частью команды {{team}}",
"no-username-available": "Нет доступных пользователей с именем", "no-username-available": "Нет доступных пользователей с именем",
"no-users": "Нет пользователей {{text}}", "no-users": "Нет пользователей {{text}}",
"no-version-type-available": "Версия {{type}} недоступна", "no-version-type-available": "Версия {{type}} недоступна",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "ไม่มีโทเค็นที่สามารถใช้งานได้", "no-token-available": "ไม่มีโทเค็นที่สามารถใช้งานได้",
"no-total-data-assets": "ข้อมูลเชิงลึกให้ความเข้าใจที่ชัดเจนเกี่ยวกับภูมิทัศน์ข้อมูลที่พัฒนาในองค์กรของคุณ มันให้คำตอบสำหรับคำถามเช่น จำนวนสินทรัพย์ข้อมูลที่คุณมี อัตราที่สินทรัพย์ใหม่ถูกเพิ่มเข้าไป และอื่น ๆ ค้นพบเพิ่มเติมเกี่ยวกับ <0>{{setup}}</0> เพื่อใช้ประโยชน์จากข้อมูลเชิงลึกเหล่านี้", "no-total-data-assets": "ข้อมูลเชิงลึกให้ความเข้าใจที่ชัดเจนเกี่ยวกับภูมิทัศน์ข้อมูลที่พัฒนาในองค์กรของคุณ มันให้คำตอบสำหรับคำถามเช่น จำนวนสินทรัพย์ข้อมูลที่คุณมี อัตราที่สินทรัพย์ใหม่ถูกเพิ่มเข้าไป และอื่น ๆ ค้นพบเพิ่มเติมเกี่ยวกับ <0>{{setup}}</0> เพื่อใช้ประโยชน์จากข้อมูลเชิงลึกเหล่านี้",
"no-user-available": "ไม่มีผู้ใช้ที่สามารถใช้งานได้", "no-user-available": "ไม่มีผู้ใช้ที่สามารถใช้งานได้",
"no-user-part-of-team": "ไม่มีผู้ใช้คนใดเป็นส่วนหนึ่งของทีม {{team}}",
"no-username-available": "ไม่มีผู้ใช้ที่มีชื่อ <0>{{user}}</0>", "no-username-available": "ไม่มีผู้ใช้ที่มีชื่อ <0>{{user}}</0>",
"no-users": "ไม่มีผู้ใช้ {{text}}", "no-users": "ไม่มีผู้ใช้ {{text}}",
"no-version-type-available": "ไม่พบเวอร์ชัน {{type}}", "no-version-type-available": "ไม่พบเวอร์ชัน {{type}}",

View File

@ -1750,6 +1750,7 @@
"no-token-available": "无可用令牌", "no-token-available": "无可用令牌",
"no-total-data-assets": "数据洞察可让您清楚地了解组织内不断变化的数据状况。数据洞察可回答您拥有多少数据资产、新增资产的速度等问题。了解有关<0>{{setup}}</0>更多信息,以利用这些洞察力", "no-total-data-assets": "数据洞察可让您清楚地了解组织内不断变化的数据状况。数据洞察可回答您拥有多少数据资产、新增资产的速度等问题。了解有关<0>{{setup}}</0>更多信息,以利用这些洞察力",
"no-user-available": "无可用用户", "no-user-available": "无可用用户",
"no-user-part-of-team": "没有用户是 {{team}} 团队的一部分",
"no-username-available": "没有用户名为 <0>{{user}}</0>", "no-username-available": "没有用户名为 <0>{{user}}</0>",
"no-users": "没有用户{{text}}", "no-users": "没有用户{{text}}",
"no-version-type-available": "无{{type}}版本可用", "no-version-type-available": "无{{type}}版本可用",