Skip to content

Commit f515dcd

Browse files
authored
Dev (#303)
* cursors update and set default cursors plus tests * update frontend cursors - now broken * use custom error callout instead of builtin mrts * update custom rutime * use single cursor * cursor state shenanigans * some notes * note to fix cursors with fetchNextPage and cursor useInfiniteQueryParam * dynamic nextCursor and fix mrt dynamic column pagination * fetch next page with conservative hasMore check * auto scroll on cursor param change to prevent fetching more * tristate deleted user filter switch * msw * shared entity fields map generated by xo * msw test example * update notes for msw pagination tests * timeout * debug ci * debug ci * debug ci * fix msw test setup * update kin-openapi * update otel libs and use ctx in event server listener * update more libs * vendor update * clean comments * remove useless stop * refactor
1 parent 6fee66a commit f515dcd

File tree

472 files changed

+27291
-20630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

472 files changed

+27291
-20630
lines changed

.env.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ API_PORT=8090
2222
FRONTEND_PORT=80
2323
OIDC_CLIENT_ID=web
2424
OIDC_CLIENT_SECRET=secret
25-
AUTH_SERVER_UI_PROFILE="https://authserver.local.localhost/oidc/profile"
2625
MOCK_OIDC_SERVER_PATH_PREFIX="/oidc"
26+
AUTH_SERVER_UI_PROFILE="https://authserver.local.localhost/oidc/profile"
2727
OIDC_DOMAIN="authserver.local.localhost"
2828
OIDC_ISSUER="https://authserver.local.localhost/oidc"
2929
OIDC_SCOPES="openid profile email auth"

.github/workflows/tests.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
3535
project lint
3636
37+
- name: Test frontend
38+
run: |
39+
source .envrc
40+
41+
project test.frontend
42+
3743
- name: Diff check
3844
run: |
3945
# debug gen: run with --x-force-regen
@@ -77,11 +83,6 @@ jobs:
7783
if: failure() # always()
7884
run: docker logs postgres_db_openapi-go-gin
7985

80-
- name: Test frontend
81-
run: |
82-
source .envrc
83-
84-
project test.frontend
8586

8687
- name: Test E2E
8788
run: |

bin/project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ x.gen.frontend() {
974974
deps=(
975975
"$orval_config"
976976
"frontend/src/react-query.ts"
977+
"frontend/src/react-query.default.ts"
977978
"frontend/scripts/"
978979
"frontend/package.json"
979980
)

bin/templates/crud-api-tests.go.tmpl.bash

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestHandlers_Delete${pascal_name}(t *testing.T) {
3333
$(test -n "$with_project" && echo " pj := models.ProjectDemo
3434
projectID := internal.ProjectIDByName[pj]")
3535
36-
srv, err := runTestServer(t, testPool)
36+
srv, err := runTestServer(t, context.Background(), testPool)
3737
srv.setupCleanup(t)
3838
require.NoError(t, err, "Couldn't run test server: %s\n")
3939
@@ -85,7 +85,7 @@ func TestHandlers_Create${pascal_name}(t *testing.T) {
8585
8686
logger := testutil.NewLogger(t)
8787
88-
srv, err := runTestServer(t, testPool)
88+
srv, err := runTestServer(t, context.Background(), testPool)
8989
srv.setupCleanup(t)
9090
require.NoError(t, err, "Couldn't run test server: %s\n")
9191
@@ -130,7 +130,7 @@ func TestHandlers_Get${pascal_name}(t *testing.T) {
130130
131131
logger := testutil.NewLogger(t)
132132
133-
srv, err := runTestServer(t, testPool)
133+
srv, err := runTestServer(t, context.Background(), testPool)
134134
srv.setupCleanup(t)
135135
require.NoError(t, err, "Couldn't run test server: %s\n")
136136
@@ -181,7 +181,7 @@ func TestHandlers_Update${pascal_name}(t *testing.T) {
181181
$(test -n "$with_project" && echo " pj := models.ProjectDemo
182182
projectID := internal.ProjectIDByName[pj]")
183183
184-
srv, err := runTestServer(t, testPool)
184+
srv, err := runTestServer(t, context.Background(), testPool)
185185
srv.setupCleanup(t)
186186
require.NoError(t, err, "Couldn't run test server: %s\n")
187187

e2e/client/gen/model/getPaginatedUsersFilterObjectsItem.ts renamed to e2e/client/gen/model/anyValue.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* OpenAPI spec version: 2.0.0
77
*/
88

9-
export type GetPaginatedUsersFilterObjectsItem = {
10-
nestedObj?: string
11-
}
9+
/**
10+
* represents any value, including `null`
11+
*/
12+
export type AnyValue = unknown | null

e2e/client/gen/model/getPaginatedNotificationsParams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ import type { Direction } from './direction'
1010
export type GetPaginatedNotificationsParams = {
1111
limit: number
1212
direction: Direction
13-
cursor: string
13+
cursor?: string | null
1414
}

e2e/client/gen/model/getPaginatedUsersNestedObj.ts

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

e2e/client/gen/model/getPaginatedUsersParams.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,11 @@
77
*/
88
import type { Direction } from './direction'
99
import type { GetPaginatedUsersQueryParameters } from './getPaginatedUsersQueryParameters'
10-
import type { GetPaginatedUsersFilterObjectsItem } from './getPaginatedUsersFilterObjectsItem'
11-
import type { GetPaginatedUsersNestedObj } from './getPaginatedUsersNestedObj'
1210

1311
export type GetPaginatedUsersParams = {
1412
limit: number
1513
direction: Direction
16-
cursor: string
14+
cursor?: string | null
15+
column: string
1716
searchQuery?: GetPaginatedUsersQueryParameters
18-
filter?: {
19-
bools?: boolean[]
20-
ints?: number[]
21-
objects?: GetPaginatedUsersFilterObjectsItem[]
22-
post?: string[]
23-
}
24-
nested?: {
25-
obj?: GetPaginatedUsersNestedObj
26-
}
2717
}

e2e/client/gen/model/getPaginatedUsersQueryParameters.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
* openapi-go-gin-postgres-sqlc
66
* OpenAPI spec version: 2.0.0
77
*/
8-
import type { PaginationCursors } from './paginationCursors'
98
import type { PaginationItems } from './paginationItems'
109
import type { Role } from './role'
1110

1211
export interface GetPaginatedUsersQueryParameters {
13-
cursors: PaginationCursors
1412
items?: PaginationItems
1513
role?: Role
1614
}

e2e/client/gen/model/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
export * from './activity'
10+
export * from './anyValue'
1011
export * from './createActivityRequest'
1112
export * from './createDemoTwoWorkItemRequest'
1213
export * from './createDemoTwoWorkItemRequestProjectName'
@@ -69,8 +70,6 @@ export * from './eventsParams'
6970
export * from './getCacheDemoWorkItemQueryParameters'
7071
export * from './getCurrentUserQueryParameters'
7172
export * from './getPaginatedNotificationsParams'
72-
export * from './getPaginatedUsersFilterObjectsItem'
73-
export * from './getPaginatedUsersNestedObj'
7473
export * from './getPaginatedUsersParams'
7574
export * from './getPaginatedUsersQueryParameters'
7675
export * from './getProjectWorkitemsParams'
@@ -84,7 +83,6 @@ export * from './paginatedUsersResponse'
8483
export * from './pagination'
8584
export * from './paginationCursor'
8685
export * from './paginationCursorValue'
87-
export * from './paginationCursors'
8886
export * from './paginationFilter'
8987
export * from './paginationFilterArray'
9088
export * from './paginationFilterArrayFilterMode'

0 commit comments

Comments
 (0)