diff --git a/example/my-app/src/App.css b/example/my-app/src/App.css index 5fe6895d..16ad6715 100644 --- a/example/my-app/src/App.css +++ b/example/my-app/src/App.css @@ -9,6 +9,7 @@ aside { width: 300px; margin: 0 10px 0 0; } + main { float: left; width: calc(100% - 310px); @@ -24,9 +25,11 @@ span { span.schedguled { background-color: #b8975d; } + span.error { background-color: #de7773; } + span.await { background-color: #52d2d2; } @@ -102,14 +105,50 @@ table > thead .filter-rules { float: right; } -.filter-rules { +/* make definitions inline, but new definition term must start from new line + definition is on right side, and wraps text */ +dl { + margin: 0 10px 0 0; + padding: 0; + overflow: auto; +} +dt { + float: left; + clear: left; + font-weight: normal; + text-align: right; + margin: 0; + padding: 2px 10px; + width: 30px; +} + +dd { + float: left; + padding: 2px 0; + margin-bottom: 5px; + text-wrap: normal; +} + +dt:hover { + background-color: #51887a; + color: #ffffff; + padding: 2px 10px; } + .filter-group, .filter-rule { margin-left: 40px; } +.filter-in, +.filter-out { + font-size: 0.8em; + padding: 2px 10px; + background-color: #97a8a4; + border: none; +} + table > tbody > tr { border-bottom: 1px solid #dddddd; } @@ -129,10 +168,11 @@ tfoot tr { font-size: 1.2em; } -button.next-page{ +button.next-page { float: right; } -button.prev-page{ + +button.prev-page { float: left; } @@ -142,6 +182,7 @@ table table { font-size: 0.8em; min-width: 0; } + table table th, td { padding: 5px 10px; } @@ -179,4 +220,13 @@ table table th, td { .sort-asc, .sort-desc { cursor: pointer; +} + +.debug-window { + background-color: #ffffff; + border: 1px solid #cccccc; + overflow: auto; + padding: 10px; + font-size: 0.8em; + color: #666666; } \ No newline at end of file diff --git a/example/my-app/src/App.tsx b/example/my-app/src/App.tsx index 20ad6b25..cd0ea138 100644 --- a/example/my-app/src/App.tsx +++ b/example/my-app/src/App.tsx @@ -725,6 +725,9 @@ function App() { + sort={{ + "ID": true, + }} load={(state) => { return listFlows({ ...state, @@ -746,9 +749,18 @@ function App() { }, ]} /> + +
+ +
Func output: {output}
+
Workflow output: {JSON.stringify(state, null, 2)} 
+
+ sort={{ + "ID": true, + }} load={(state) => { return listStates({ ...state, @@ -799,9 +811,11 @@ function App() { return ( <> workflow.Done - +
+ +
@@ -827,7 +841,7 @@ function App() { } } })} - className={"filter filter-in"}>only + className={"filter filter-in"}>show only - {done.Result["schema.String"]} +
+ {done.Result["schema.String"]} +
+ @@ -868,10 +885,12 @@ function App() {
{error.Code}
Message
{error.Reason}
+
Retried
+
{error.Retried} / {error.BaseState?.DefaultMaxRetries}
- + ctx.refresh()}/> case "workflow.Await": @@ -915,6 +934,7 @@ function App() { submitCallbackResult(await_.CallbackID, { "schema.String": (document.getElementById("callbackValue") as HTMLInputElement).value }, (data) => { + ctx.refresh() setState(data) }) }}> @@ -940,7 +960,9 @@ function App() { @@ -961,7 +983,9 @@ function App() { @@ -973,11 +997,6 @@ function App() { }}/> - - -
Func output: {output}
-
Workflow output: {JSON.stringify(state, null, 2)} 
- @@ -1323,8 +1342,9 @@ const recover = (runID: string) => { .then(data => data as workflow.State) } -function TryRecover(props: { error: workflow.Error }) { - return } diff --git a/example/my-app/src/component/PaginatedTable.tsx b/example/my-app/src/component/PaginatedTable.tsx index 2ec9f71f..1302c056 100644 --- a/example/my-app/src/component/PaginatedTable.tsx +++ b/example/my-app/src/component/PaginatedTable.tsx @@ -71,7 +71,11 @@ export function PaginatedTable(props: PaginatedTableProps) { filter: (x: predicate.WherePredicates) => { setState({ ...state, - where: mergeFilters(state.where, x) + where: mergeFilters(state.where, x), + // always reset the cursor when filtering + // user can be on a page that doesn't exist anymore + nextPage: undefined, + prevPage: undefined }) } } as PaginatedTableContext @@ -195,7 +199,7 @@ export function PaginatedTable(props: PaginatedTableProps) { return - - - - + @@ -229,9 +231,18 @@ export function PaginatedTable(props: PaginatedTableProps) { return ( - - - + ); @@ -243,7 +254,7 @@ export function PaginatedTable(props: PaginatedTableProps) { -
+ {props.actions && props.actions.map((action) => { @@ -216,11 +220,9 @@ export function PaginatedTable(props: PaginatedTableProps) {
- + IDTypeVersionProp Data
{item.ID}{item.Type}{item.Version} +
+
ID
+
{item.ID}
+ +
Type
+
{item.Type}
+ +
Version
+
{item.Version}
+
+
{props.mapData && props.mapData(item, ctx)}
+ {data.Next && } {data.Prev && }