Skip to content
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 @@ -69,9 +69,10 @@ const Pagination = () => {
}
)

const count = data?.is_estimate ? formatEstimatedCount(data.count) : data?.count.toLocaleString()
const maxPages = Math.ceil((data?.count ?? 0) / tableEditorSnap.rowsPerPage)
const totalPages = (data?.count ?? 0) > 0 ? maxPages : 1
const count = data?.count ?? 0
const countString = data?.is_estimate ? formatEstimatedCount(count) : count.toLocaleString()
const maxPages = Math.ceil(count / tableEditorSnap.rowsPerPage)
const totalPages = count > 0 ? maxPages : 1

const onPreviousPage = () => {
if (page > 1) {
Expand Down Expand Up @@ -202,7 +203,7 @@ const Pagination = () => {

<div className="flex items-center gap-x-2">
<p className="text-xs text-foreground-light">
{`${count} ${data.count === 0 || data.count > 1 ? `records` : 'record'}`}{' '}
{`${countString} ${count === 0 || count > 1 ? `records` : 'record'}`}{' '}
{data.is_estimate ? '(estimated)' : ''}
</p>

Expand All @@ -217,7 +218,7 @@ const Pagination = () => {
icon={<HelpCircle />}
onClick={() => {
// Show warning if either NOT a table entity, or table rows estimate is beyond threshold
if (rowsCountEstimate === null || data.count > THRESHOLD_COUNT) {
if (rowsCountEstimate === null || count > THRESHOLD_COUNT) {
setIsConfirmFetchExactCountModalOpen(true)
} else snap.setEnforceExactCount(true)
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { BillingChangeBadge } from '../ui/BillingChangeBadge'
import FormMessage from '../ui/FormMessage'
import { NoticeBar } from '../ui/NoticeBar'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'

/**
* to do: this could be a type from api-types
Expand All @@ -55,6 +56,8 @@ export function ComputeSizeField({ form, disabled }: ComputeSizeFieldProps) {
const { data: org } = useSelectedOrganizationQuery()
const { data: project, isLoading: isProjectLoading } = useSelectedProjectQuery()

const showComputePrice = useIsFeatureEnabled('project_addons:show_compute_price')

const { computeSize, storageType } = form.watch()

const {
Expand Down Expand Up @@ -221,21 +224,23 @@ export function ComputeSizeField({ form, disabled }: ComputeSizeFieldProps) {
<Lock size={14} />
</div>
) : (
<>
<span
className="text-foreground text-sm font-semibold"
translate="no"
>
${price}
</span>
<span className="text-foreground-light translate-y-[1px]">
{' '}
/{' '}
{compute.price_interval === 'monthly'
? 'month'
: 'hour'}
</span>
</>
showComputePrice && (
<>
<span
className="text-foreground text-sm font-semibold"
translate="no"
>
${price}
</span>
<span className="text-foreground-light translate-y-[1px]">
{' '}
/{' '}
{compute.price_interval === 'monthly'
? 'month'
: 'hour'}
</span>
</>
)
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export const ProjectCard = ({
resourceWarnings,
}: ProjectCardProps) => {
const { name, ref: projectRef } = project
const infraInformation = project.databases.find((x) => x.identifier === project.ref)
const desc = `${infraInformation?.cloud_provider} | ${project.region}`
const desc = `${project.cloud_provider} | ${project.region}`

const { projectHomepageShowInstanceSize } = useIsFeatureEnabled([
'project_homepage:show_instance_size',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const ProjectTableRow = ({
</TableCell>
<TableCell>
<span className="lowercase text-sm text-foreground-light">
{infraInformation?.cloud_provider} | {project.region || 'N/A'}
{project.cloud_provider} | {project.region || 'N/A'}
</span>
</TableCell>
<TableCell>
Expand Down
Loading
Loading