diff --git a/apps/web/modules/members/members-view.tsx b/apps/web/modules/members/members-view.tsx index 8f89e88b16..b03c97375f 100644 --- a/apps/web/modules/members/members-view.tsx +++ b/apps/web/modules/members/members-view.tsx @@ -13,8 +13,6 @@ const MembersPage: React.FC = () => { title={t("organization_members")} description={t("organization_description")} withoutSeo - heading={t("organization_members")} - hideHeadingOnMobile subtitle={t("organization_description")}> diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 08b4923889..1c2067e65d 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -2825,6 +2825,7 @@ "disable_org_url_description": "Redirects {{orgSlug}}.cal.com to {{destination}}", "single_select": "Single Select", "multi_select": "Multi Select", + "group_meeting": "Group Meeting", "ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" } diff --git a/packages/features/data-table/components/DataTableSelectionBar.tsx b/packages/features/data-table/components/DataTableSelectionBar.tsx index eab89a52aa..32d6da6147 100644 --- a/packages/features/data-table/components/DataTableSelectionBar.tsx +++ b/packages/features/data-table/components/DataTableSelectionBar.tsx @@ -4,6 +4,7 @@ import type { Table } from "@tanstack/react-table"; import { forwardRef } from "react"; import { classNames } from "@calcom/lib"; +import { Button, Icon } from "@calcom/ui"; import type { IconName } from "@calcom/ui"; export type ActionItem = @@ -20,19 +21,41 @@ export type ActionItem = needsXSelected?: number; }; +type ResponsiveButtonProps = { + className?: string; + icon: IconName; + onClick?: () => void; + children: string; +}; + +const ResponsiveButton = forwardRef( + ({ className, icon, onClick, children }, ref) => { + return ( + + ); + } +); + +ResponsiveButton.displayName = "ResponsiveButton"; + const Root = forwardRef< HTMLDivElement, React.HTMLAttributes & { showSelectionCount?: boolean } >(({ children, ...props }, ref) => { + const { className, style, ...rest } = props; return (
+ style={{ ...style }} + {...rest}> {children}
); @@ -42,4 +65,5 @@ Root.displayName = "Root"; export const DataTableSelectionBar = { Root, + Button: ResponsiveButton, }; diff --git a/packages/features/ee/teams/components/DeleteBulkTeamMembers.tsx b/packages/features/ee/teams/components/DeleteBulkTeamMembers.tsx index f131747375..6938a0e14f 100644 --- a/packages/features/ee/teams/components/DeleteBulkTeamMembers.tsx +++ b/packages/features/ee/teams/components/DeleteBulkTeamMembers.tsx @@ -1,6 +1,7 @@ +import { DataTableSelectionBar } from "@calcom/features/data-table"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Button, ConfirmationDialogContent, Dialog, DialogTrigger, showToast } from "@calcom/ui"; +import { ConfirmationDialogContent, Dialog, DialogTrigger, showToast } from "@calcom/ui"; import type { User } from "./MemberList"; @@ -30,7 +31,7 @@ export default function DeleteBulkTeamMembers({ users, onRemove, isOrg, teamId } return ( - + {t("Delete")} - + {t("add_to_event_type")} @@ -108,7 +109,7 @@ export function EventTypesList({ table, teamId }: Props) { if (events.length === 0 || !teamId) return null; return ( - <> + {events.map((event) => { const hosts = event.hosts; const areAllUsersHostForEventType = selectedUsers.every((user) => @@ -143,7 +144,7 @@ export function EventTypesList({ table, teamId }: Props) { /> ); })} - + ); })} diff --git a/packages/features/ee/teams/components/MemberList.tsx b/packages/features/ee/teams/components/MemberList.tsx index 957d0dac07..f5fdc0cca4 100644 --- a/packages/features/ee/teams/components/MemberList.tsx +++ b/packages/features/ee/teams/components/MemberList.tsx @@ -674,19 +674,21 @@ export default function MemberList(props: Props) { {numberOfSelectedRows >= 2 && dynamicLinkVisible && ( - + )} {numberOfSelectedRows > 0 && ( - -

- {numberOfSelectedRows} selected + +

+ {t("number_selected", { count: numberOfSelectedRows })}

{numberOfSelectedRows >= 2 && ( - + setDynamicLinkVisible(!dynamicLinkVisible)} + icon="handshake"> + {t("group_meeting")} + )} pathname?.startsWith("/apps/routing-forms/") ?? false, + moreOnMobile: true, }, { name: "workflows", href: "/workflows", icon: "zap", + moreOnMobile: true, }, { name: "insights", href: "/insights", icon: "chart-bar", isCurrent: ({ pathname: path, item }) => path?.startsWith(item.href) ?? false, + moreOnMobile: true, child: [ { name: "bookings", @@ -150,36 +154,27 @@ const platformNavigationItems: NavigationItemType[] = [ name: "Billing", href: "/settings/platform/billing", icon: "credit-card", + moreOnMobile: true, }, { name: "Members", href: "/settings/platform/members", icon: "users", + moreOnMobile: true, }, ]; const useNavigationItems = (isPlatformNavigation = false) => { const orgBranding = useOrgBranding(); return useMemo(() => { - const navigationType = !isPlatformNavigation ? getNavigationItems(orgBranding) : platformNavigationItems; - const moreSeparatorIndex = navigationType.findIndex((item) => item.name === MORE_SEPARATOR_NAME); + const items = !isPlatformNavigation ? getNavigationItems(orgBranding) : platformNavigationItems; - const { desktopNavigationItems, mobileNavigationBottomItems, mobileNavigationMoreItems } = ( - !isPlatformNavigation ? getNavigationItems(orgBranding) : platformNavigationItems - ).reduce>( - (items, item, index) => { - // We filter out the "more" separator in` desktop navigation - if (item.name !== MORE_SEPARATOR_NAME) items.desktopNavigationItems.push(item); - // Items for mobile bottom navigation - if (index < moreSeparatorIndex + 1 && !item.onlyDesktop) { - items.mobileNavigationBottomItems.push(item); - } // Items for the "more" menu in mobile navigation - else { - items.mobileNavigationMoreItems.push(item); - } - return items; - }, - { desktopNavigationItems: [], mobileNavigationBottomItems: [], mobileNavigationMoreItems: [] } + const desktopNavigationItems = items.filter((item) => item.name !== MORE_SEPARATOR_NAME); + const mobileNavigationBottomItems = items.filter( + (item) => (!item.moreOnMobile && !item.onlyDesktop) || item.name === MORE_SEPARATOR_NAME + ); + const mobileNavigationMoreItems = items.filter( + (item) => item.moreOnMobile && !item.onlyDesktop && item.name !== MORE_SEPARATOR_NAME ); return { desktopNavigationItems, mobileNavigationBottomItems, mobileNavigationMoreItems }; diff --git a/packages/features/shell/navigation/NavigationItem.tsx b/packages/features/shell/navigation/NavigationItem.tsx index 2dcd5f4c92..0b0dd4d02f 100644 --- a/packages/features/shell/navigation/NavigationItem.tsx +++ b/packages/features/shell/navigation/NavigationItem.tsx @@ -21,6 +21,7 @@ export type NavigationItemType = { pro?: true; onlyMobile?: boolean; onlyDesktop?: boolean; + moreOnMobile?: boolean; isCurrent?: ({ item, isChild, diff --git a/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx b/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx index 1cbb879bdd..55b7619d50 100644 --- a/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx +++ b/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx @@ -1,6 +1,7 @@ +import { DataTableSelectionBar } from "@calcom/features/data-table"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Button, ConfirmationDialogContent, Dialog, DialogTrigger, showToast } from "@calcom/ui"; +import { ConfirmationDialogContent, Dialog, DialogTrigger, showToast } from "@calcom/ui"; import type { UserTableUser } from "../types"; @@ -38,7 +39,7 @@ export function DeleteBulkUsers({ users, onRemove }: Props) { return ( - + {t("Delete")} ({ <> {isVisible ? (
-
-

{domainWithoutHttps}

+
+

{domainWithoutHttps}

-
+
diff --git a/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx b/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx index 1b634fc8af..86117bb165 100644 --- a/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx +++ b/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx @@ -2,6 +2,7 @@ import type { Table } from "@tanstack/react-table"; import type { Dispatch, SetStateAction } from "react"; import { useState, Fragment } from "react"; +import { DataTableSelectionBar } from "@calcom/features/data-table"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { SchedulingType } from "@calcom/prisma/enums"; @@ -97,7 +98,7 @@ export function EventTypesList({ table, orgTeams }: Props) { <> - + {t("add_to_event_type")} diff --git a/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx b/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx index 861c5ab977..9cdb09d5e9 100644 --- a/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx +++ b/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx @@ -3,6 +3,7 @@ import type { ColumnFiltersState } from "@tanstack/react-table"; import { createContext, useContext, useState, useMemo, type PropsWithChildren } from "react"; import type { Dispatch, SetStateAction } from "react"; +import { DataTableSelectionBar } from "@calcom/features/data-table"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import slugify from "@calcom/lib/slugify"; @@ -329,7 +330,7 @@ function MassAssignAttributesBulkActionComponent({ table, filters }: Props) { } }}> - + {t("add_attributes")} {/* We dont really use shadows much - but its needed here */} diff --git a/packages/features/users/components/UserTable/BulkActions/TeamList.tsx b/packages/features/users/components/UserTable/BulkActions/TeamList.tsx index 4496229fa4..5f9bc5af40 100644 --- a/packages/features/users/components/UserTable/BulkActions/TeamList.tsx +++ b/packages/features/users/components/UserTable/BulkActions/TeamList.tsx @@ -2,6 +2,7 @@ import type { Table } from "@tanstack/react-table"; import type { Dispatch, SetStateAction } from "react"; import { useState } from "react"; +import { DataTableSelectionBar } from "@calcom/features/data-table"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc"; @@ -86,7 +87,7 @@ export function TeamListBulkAction({ table }: Props) { <> - + {t("add_to_team")} {/* We dont really use shadows much - but its needed here */} diff --git a/packages/features/users/components/UserTable/UserListTable.tsx b/packages/features/users/components/UserTable/UserListTable.tsx index e02ee4d4dc..3f139745aa 100644 --- a/packages/features/users/components/UserTable/UserListTable.tsx +++ b/packages/features/users/components/UserTable/UserListTable.tsx @@ -34,7 +34,7 @@ import { import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc"; -import { Avatar, Badge, Button, Checkbox, showToast } from "@calcom/ui"; +import { Avatar, Badge, Checkbox, showToast } from "@calcom/ui"; import { useGetUserAttributes } from "@calcom/web/components/settings/platform/hooks/useGetUserAttributes"; import { DeleteBulkUsers } from "./BulkActions/DeleteBulkUsers"; @@ -176,6 +176,7 @@ export function UserListTable() { meta: { filterType: attribute.type.toLowerCase() === "text" ? "text" : "select", }, + size: 120, accessorFn: (data) => data.attributes.find((attr) => attr.attributeId === attribute.id)?.value, cell: ({ row }) => { const attributeValues = row.original.attributes.filter( @@ -280,6 +281,7 @@ export function UserListTable() { id: "role", accessorFn: (data) => data.role, header: "Role", + size: 100, cell: ({ row, table }) => { const { role, username } = row.original; return ( @@ -307,7 +309,7 @@ export function UserListTable() { id: "teams", accessorFn: (data) => data.teams.map((team) => team.name), header: "Teams", - size: 200, + size: 140, cell: ({ row, table }) => { const { teams, accepted, email, username } = row.original; // TODO: Implement click to filter @@ -546,22 +548,24 @@ export function UserListTable() {
{numberOfSelectedRows >= 2 && dynamicLinkVisible && ( - + )} {numberOfSelectedRows > 0 && ( - -

- {numberOfSelectedRows} selected + +

+ {t("number_selected", { count: numberOfSelectedRows })}

{!isPlatformUser ? ( <> {numberOfSelectedRows >= 2 && ( - + setDynamicLinkVisible(!dynamicLinkVisible)} + icon="handshake"> + {t("group_meeting")} + )}