Skip to content

Commit

Permalink
feat: change sort of last invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Sep 7, 2024
1 parent 1727ce4 commit 05b8538
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function DataTableFilter<TData, TValue>({
const selectedValues = new Set(column?.getFilterValue() as string[]);

options = Array.from(
options || facets?.keys().map((value) => ({ value, label: value })) || [],
options || facets?.keys?.().map((value) => ({ value, label: value })) || [],
);

return (
Expand Down
9 changes: 4 additions & 5 deletions packages/dashboard/src/routes/errors/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useState } from "react";

import { DataTable } from "@/components/tables/data-table";
import { StatsChart } from "@/components/stats/stats-chart";
import { Button } from "@/components/ui/button";

import { columns } from "./columns";
import { useData } from "@/lib/api";
import { DataTableFilter } from "@/components/tables/data-table-filter";
import { useMemo, useState } from "react";
import { Button } from "@/components/ui/button";
import { columns } from "./columns";

const Errors = () => {
const [startKey, setStartKey] = useState("");
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard/src/routes/functions/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const columns: ColumnDef<FunctionItem>[] = [
header: "Last invoked",
cell: ({ row }) => {
const lastInvocation = row.getValue("lastInvocation");
if (!lastInvocation) return <span>-</span>;
if (!lastInvocation || lastInvocation === '0') return <span>-</span>;
return (
<span>{formatRelative(new Date(lastInvocation), new Date())}</span>
);
Expand Down
1 change: 1 addition & 0 deletions packages/dashboard/src/routes/functions/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const Functions = () => {
const mappedFunctions = useMemo(() => {
return functions.map((func) => ({
...func,
lastInvocation: func.lastInvocation || '0',
tags: Object.entries(func.tags || {})
.filter(([tag]) => !tag.startsWith("aws:cloudformation:"))
.filter(([tag]) => !tag.startsWith("lumigo:"))
Expand Down

0 comments on commit 05b8538

Please sign in to comment.