Skip to content

Commit 0114337

Browse files
committed
fix: ts errors
1 parent 66cb36e commit 0114337

File tree

7 files changed

+23
-13
lines changed

7 files changed

+23
-13
lines changed

packages/runnable-app/app/api/context.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { User } from '../models/user';
2-
31
export interface RunnableAppContext {
42
/**
53
* Authentication
@@ -13,3 +11,9 @@ export interface RunnableAppContext {
1311
export interface RunnableContext {
1412
user: User;
1513
}
14+
15+
export interface User {
16+
id: string;
17+
name?: string;
18+
email: string;
19+
}

packages/runnable-app/app/components/forms/TableInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
RadioGroup,
1313
} from '@chakra-ui/react';
1414
import React from 'react';
15+
import { TableCellValue } from '../../api/io';
1516
import { TableCell } from './TableCell';
1617

1718
interface Props {
@@ -20,7 +21,7 @@ interface Props {
2021
headers: string[];
2122
isMultiSelect: boolean;
2223
initialSelection?: string[];
23-
rows: { key: string; cells: string[] }[];
24+
rows: { key: string; cells: TableCellValue[] }[];
2425
}
2526

2627
export const TableInput: React.FC<Props> = ({ name, headers, isMultiSelect, initialSelection, helperText, rows }) => {

packages/runnable-app/app/models/user.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/runnable-app/app/models/workflows/workflow.server.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,18 @@ export class Workflow {
191191
return found;
192192
})
193193
.validate(opts.validation)
194-
.formatBreadcrumbs((value) => [{ key: opts.label, value: opts.getColumns(value)[0] }])
194+
.formatBreadcrumbs((value) => [
195+
{
196+
key: opts.label,
197+
value:
198+
opts
199+
.getColumns(value)
200+
.find((v) => typeof v === 'string')
201+
?.toString() ||
202+
opts.getColumns(value)[0]?.toString() ||
203+
'',
204+
},
205+
])
195206
.build();
196207

197208
return this.asFormPromise(input);

packages/runnable-app/app/routes/actions/$actionId.workflows.$workflowId.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
Tr,
1515
VStack,
1616
} from '@chakra-ui/react';
17-
import { ActionFunction, LoaderFunction, MetaFunction, redirect , json } from '@remix-run/node';
17+
import { ActionFunction, LoaderFunction, MetaFunction, json } from '@remix-run/node';
1818
import { Form, useActionData, useLoaderData, useLocation, useTransition } from '@remix-run/react';
1919
import invariant from 'tiny-invariant';
2020

packages/runnable-app/app/types/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export type IOForm<T = any> =
7676
headers: string[];
7777
isMultiSelect: boolean;
7878
initialSelection?: string[];
79-
rows: { key: string; cells: string[] }[];
79+
rows: { key: string; cells: TableCellValue[] }[];
8080
};
8181

8282
export interface ActionResponse<T = any> extends ActionViewResponse<T> {

packages/runnable-app/app/utils/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useMatches } from '@remix-run/react';
22
import { useMemo } from 'react';
3-
4-
import type { User } from '~/models/user';
3+
import { User } from '../api/context';
54

65
const DEFAULT_REDIRECT = '/';
76

0 commit comments

Comments
 (0)