revert: team availability view (#17222)
This commit is contained in:
1 parent
86af6bd626
commit
9d01025a1f
2 files changed
+7
-5
No files matched your search
@@ -201,7 +201,7 @@ export default function AvailabilityPage({ currentOrg }: PageProps) {
|
||||
(data && (data.user.role === MembershipRole.OWNER || data.user.role === MembershipRole.ADMIN)) ?? false;
|
||||
const isOrgAndPrivate = data?.isOrganization && data.isPrivate;
|
||||
|
||||
const canViewTeamAvailability = isOrg && (isOrgAdminOrOwner || !isOrgAndPrivate);
|
||||
const canViewTeamAvailability = isOrgAdminOrOwner || !isOrgAndPrivate;
|
||||
|
||||
const toggleGroupOptions = [{ value: "mine", label: t("my_availability") }];
|
||||
|
||||
@@ -233,7 +233,7 @@ export default function AvailabilityPage({ currentOrg }: PageProps) {
|
||||
</div>
|
||||
}>
|
||||
{searchParams?.get("type") === "team" && canViewTeamAvailability ? (
|
||||
<AvailabilitySliderTable userTimeFormat={me?.data?.timeFormat ?? null} />
|
||||
<AvailabilitySliderTable userTimeFormat={me?.data?.timeFormat ?? null} isOrg={isOrg} />
|
||||
) : (
|
||||
<AvailabilityListWithQuery />
|
||||
)}
|
||||
|
||||
@@ -58,7 +58,7 @@ function UpgradeTeamTip() {
|
||||
);
|
||||
}
|
||||
|
||||
export function AvailabilitySliderTable(props: { userTimeFormat: number | null }) {
|
||||
export function AvailabilitySliderTable(props: { userTimeFormat: number | null; isOrg: boolean }) {
|
||||
const tableContainerRef = useRef<HTMLDivElement>(null);
|
||||
const [browsingDate, setBrowsingDate] = useState(dayjs());
|
||||
const [editSheetOpen, setEditSheetOpen] = useState(false);
|
||||
@@ -210,8 +210,10 @@ export function AvailabilitySliderTable(props: { userTimeFormat: number | null }
|
||||
table={table}
|
||||
tableContainerRef={tableContainerRef}
|
||||
onRowMouseclick={(row) => {
|
||||
setEditSheetOpen(true);
|
||||
setSelectedUser(row.original);
|
||||
if (props.isOrg) {
|
||||
setEditSheetOpen(true);
|
||||
setSelectedUser(row.original);
|
||||
}
|
||||
}}
|
||||
isPending={isPending}
|
||||
onScroll={(e) => fetchMoreOnBottomReached(e.target as HTMLDivElement)}>
|
||||
|
||||
Reference in new issue
Block a user