Skip to content

Commit

Permalink
fix(dashboard): explicitly state none found (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryson-g authored Feb 23, 2025
1 parent 83d13a6 commit 63d70a8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'
import { SEARCH_DEFAULT_LIMIT, SEARCH_ENTITIES, SearchType } from '@/app/constants'
import useSWRInfinite from 'swr/infinite'
import { RefreshCwIcon } from 'lucide-react'
import { useParams, useSearchParams } from 'next/navigation'
import { FC, useState } from 'react'
import useSWRInfinite from 'swr/infinite'
import { SearchFooter } from './SearchFooter'
import { SearchHeader } from './SearchHeader'
import { SearchResponse, search } from './searchAction'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { ExternalEventDefId } from 'littlehorse-client/proto'
import LinkWithTenant from '../LinkWithTenant'
import { FC, Fragment } from 'react'
import { SearchResultProps } from '.'
import { SelectionLink } from '../SelectionLink'

export const ExternalEventDefTable: FC<SearchResultProps> = ({ pages = [] }) => {
if (pages.length === 0) {
if (pages.every(page => page.results.length === 0)) {
return <div className="flex min-h-[360px] items-center justify-center text-center italic">No ExternalEventDefs</div>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { TaskDefId } from 'littlehorse-client/proto'
import { useParams } from 'next/navigation'
import { FC, Fragment } from 'react'
import { SearchResultProps } from '.'
import { useParams } from 'next/navigation'
import { SelectionLink } from '../SelectionLink'

export const TaskDefTable: FC<SearchResultProps> = ({ pages = [] }) => {
const { tenantId } = useParams()

if (pages.length === 0) {
if (pages.every(page => page.results.length === 0)) {
return <div className="flex min-h-[360px] items-center justify-center text-center italic">No TaskDefs</div>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Separator } from '@/components/ui/separator'
import { UserTaskDefId } from 'littlehorse-client/proto'
import { FC, Fragment } from 'react'
import { SearchResultProps } from '.'
import { SelectionLink } from '../SelectionLink'
import VersionTag from '../VersionTag'

export const UserTaskDefTable: FC<SearchResultProps> = ({ pages = [] }) => {
if (pages.length === 0) {
if (pages.every(page => page.results.length === 0)) {
return <div className="flex min-h-[360px] items-center justify-center text-center italic">No UserTaskDefs</div>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const WfSpecTable: FC<SearchResultProps> = ({ pages = [] }) => {
getLatestWfSpecs(tenantId, wfSpecNames).then(setWfSpecs)
}, [pages, tenantId])

if (pages.length === 0) {
if (pages.every(page => page.results.length === 0)) {
return <div className="flex min-h-[360px] items-center justify-center text-center italic">No WfSpecs</div>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { WorkflowEventDefId } from 'littlehorse-client/proto'
import { useParams } from 'next/navigation'
import { FC, Fragment } from 'react'
import { SearchResultProps } from '.'
import { useParams } from 'next/navigation'
import LinkWithTenant from '../LinkWithTenant'
import { SelectionLink } from '../SelectionLink'

export const WorkflowEventDefTable: FC<SearchResultProps> = ({ pages = [] }) => {
const { tenantId } = useParams()

if (pages.length === 0) {
if (pages.every(page => page.results.length === 0)) {
return <div className="flex min-h-[360px] items-center justify-center text-center italic">No WorkflowEventDefs</div>
}

Expand Down

0 comments on commit 63d70a8

Please sign in to comment.