Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(page-members): add member column count #1796

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { memo, useEffect, useMemo, useRef } from 'react'
import { useParams } from 'react-router-dom'
import { ENVIRONMENT_LOGS_URL, ENVIRONMENT_STAGES_URL } from '@qovery/shared/routes'
import { Icon, Indicator, Link, LoaderSpinner, TablePrimitives } from '@qovery/shared/ui'
import { Icon, Indicator, Link, LoaderDots, TablePrimitives } from '@qovery/shared/ui'
import { HeaderPreCheckLogs } from '../header-pre-check-logs/header-pre-check-logs'
import { type EnvironmentPreCheckLogId, usePreCheckLogs } from '../hooks/use-pre-check-logs/use-pre-check-logs'
import { RowPreCheckLogs } from './row-pre-check-logs/row-pre-check-logs'
Expand Down Expand Up @@ -61,8 +61,9 @@ export function ListPreCheckLogs({ environment, environmentStatus, preCheckStage
return (
<div className="h-full p-1">
<HeaderPreCheckLogs preCheckStage={preCheckStage} />
<div className="flex h-[calc(100%-44px)] w-full justify-center border border-t-0 border-neutral-500 bg-neutral-600 pt-11">
<LoaderSpinner className="h-6 w-6" theme="dark" />
<div className="flex h-[calc(100%-44px)] w-full flex-col items-center justify-center gap-5 border border-t-0 border-neutral-500 bg-neutral-600 pt-11">
<LoaderDots />
<p className="text-neutral-300">Pre-check logs are loading…</p>
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useEffect, useState } from 'react'
import { NeedHelp } from '@qovery/shared/assistant/feature'
import { MemberRoleEnum } from '@qovery/shared/enums'
import { Button, Heading, Icon, Section, Table, type TableFilterProps } from '@qovery/shared/ui'
import { pluralize } from '@qovery/shared/util-js'
import RowMember from './row-member/row-member'

export interface PageOrganizationMembersProps {
Expand All @@ -25,37 +26,6 @@ export interface PageOrganizationMembersProps {
onAddMember?: () => void
}

const membersHead = [
{
title: 'Member',
className: 'px-4 py-2 border-r border-neutral-200 h-full',
},
{
title: 'Roles',
filter: [
{
search: true,
title: 'Filter by role',
key: 'role_name',
},
],
},
{
title: 'Last activity',
className: 'px-4',
sort: {
key: 'last_activity_at',
},
},
{
title: 'Member since',
className: 'px-4',
sort: {
key: 'created_at',
},
},
]

const inviteMembersHead = [
{
title: 'Pending members',
Expand Down Expand Up @@ -93,6 +63,37 @@ export function PageOrganizationMembers(props: PageOrganizationMembersProps) {
resendInvite,
} = props

const membersHead = [
{
title: `${pluralize(members.length, 'Member', 'Members')} (${members.length})`,
className: 'px-4 py-2 border-r border-neutral-200 h-full',
},
{
title: 'Roles',
filter: [
{
search: true,
title: 'Filter by role',
key: 'role_name',
},
],
},
{
title: 'Last activity',
className: 'px-4',
sort: {
key: 'last_activity_at',
},
},
{
title: 'Member since',
className: 'px-4',
sort: {
key: 'created_at',
},
},
]

const columnsWidth = '35% 22% 21% 21%'

const [filterMembers, setFilterMembers] = useState<TableFilterProps[]>([])
Expand Down
Loading