Skip to content

Commit

Permalink
fix: admin ui TS issues while build (#720)
Browse files Browse the repository at this point in the history
* fix: admin ui TS issues while build

* fix: add optional chaining
  • Loading branch information
rsbh authored Aug 12, 2024
1 parent 720b7d4 commit 5df6a23
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 156 deletions.
155 changes: 9 additions & 146 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ export default function AddTokens() {
<Select.Content style={{ width: "320px" }}>
<Select.Group>
{products.map((p) => (
<Select.Item key={p.id} value={p.id}>
{p.title || p.name}
<Select.Item key={p?.id} value={p?.id || ""}>
{p?.title || p?.name}
</Select.Item>
))}
</Select.Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function DeleteConfirmDialog({
function onClick() {
onConfirm(tokenId);
}

function onCheckedChange(value: boolean) {
setIsAcknowledged(value);
}
return (
<Dialog open={open}>
{/* @ts-ignore */}
Expand All @@ -83,9 +87,8 @@ function DeleteConfirmDialog({
</Text>
<Flex>
<Checkbox
//@ts-ignore
checked={isAcknowledged}
onCheckedChange={setIsAcknowledged}
onCheckedChange={onCheckedChange}
></Checkbox>
<Text size={2}>I acknowledge to delete the service user token</Text>
</Flex>
Expand Down
10 changes: 4 additions & 6 deletions ui/src/containers/organisations.list/users/columns.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
DotsHorizontalIcon,
Pencil2Icon,
TrashIcon,
UpdateIcon,
} from "@radix-ui/react-icons";
Expand All @@ -12,7 +11,7 @@ import {
V1Beta1User,
} from "@raystack/frontier";
import type { ColumnDef } from "@tanstack/react-table";
import { Link, NavLink } from "react-router-dom";
import { Link } from "react-router-dom";
import * as R from "ramda";
import { useFrontier } from "@raystack/frontier/react";
import { toast } from "sonner";
Expand Down Expand Up @@ -132,13 +131,11 @@ const MembersActions = ({
try {
const resource = `app/organization:${organizationId}`;
const principal = `app/user:${member?.id}`;
const {
// @ts-ignore
data: { policies = [] },
} = await client?.frontierServiceListPolicies({
const resp = await client?.frontierServiceListPolicies({
org_id: organizationId,
user_id: member.id,
});
const policies = resp?.data?.policies || [];
const deletePromises = policies.map((p: V1Beta1Policy) =>
client?.frontierServiceDeletePolicy(p.id as string)
);
Expand All @@ -160,6 +157,7 @@ const MembersActions = ({
}

return (
// @ts-ignore
<DropdownMenu style={{ padding: "0 !important" }}>
<DropdownMenu.Trigger asChild style={{ cursor: "pointer" }}>
<DotsHorizontalIcon />
Expand Down

0 comments on commit 5df6a23

Please sign in to comment.