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(admin_ui): type mismatch in apsara datatable #644

Merged
merged 1 commit into from
Jun 13, 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
@@ -1,5 +1,4 @@
import { Avatar, Flex, Text } from "@raystack/apsara";
import { ColumnDef } from "@tanstack/react-table";
import { ApsaraColumnDef, Avatar, Flex, Text } from "@raystack/apsara";
import Skeleton from "react-loading-skeleton";
import { V1Beta1BillingTransaction } from "@raystack/frontier";
import * as R from "ramda";
Expand All @@ -17,7 +16,7 @@ const TxnEventSourceMap = {

export const getColumns: (
options: getColumnsOptions
) => ColumnDef<V1Beta1BillingTransaction, any>[] = ({ isLoading }) => [
) => ApsaraColumnDef<V1Beta1BillingTransaction>[] = ({ isLoading }) => [
{
header: "Date",
accessorKey: "created_at",
Expand Down
13 changes: 5 additions & 8 deletions ui/src/containers/organisations.list/serviceusers/columns.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import { CheckCircledIcon } from "@radix-ui/react-icons";
import { ApsaraColumnDef } from "@raystack/apsara";
import { V1Beta1ServiceUser, V1Beta1User } from "@raystack/frontier";
import type { ColumnDef } from "@tanstack/react-table";
import { createColumnHelper } from "@tanstack/react-table";
import { Link } from "react-router-dom";

const columnHelper = createColumnHelper<V1Beta1User>();

interface getColumnsOptions {
orgId: string;
platformUsers: V1Beta1ServiceUser[];
}
export const getColumns: (
opt: getColumnsOptions
) => ColumnDef<V1Beta1User, any>[] = ({ orgId, platformUsers }) => {
) => ApsaraColumnDef<V1Beta1User>[] = ({ orgId, platformUsers }) => {
const platformUsersIdSet = new Set(platformUsers?.map((user) => user?.id));
return [
columnHelper.accessor("id", {
{
id: "id",
header: "ID",
//@ts-ignore
filterVariant: "text",
cell: ({ row, getValue }) => {
const serviceUserId = getValue();
Expand All @@ -27,7 +24,7 @@ export const getColumns: (
</Link>
);
},
}),
},
{
header: "Title",
accessorKey: "title",
Expand Down
Loading