Skip to content

Commit 067169e

Browse files
Merge branch 'fastapi:master' into refactor-status-code
2 parents 5b015aa + 6768359 commit 067169e

File tree

9 files changed

+278
-140
lines changed

9 files changed

+278
-140
lines changed

.github/workflows/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/labeler@v5
20+
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
21+
- run: echo "Done adding labels"
2022
# Run this after labeler applied labels
2123
check-labels:
2224
needs:

.github/workflows/smokeshow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
statuses: write
1515

1616
steps:
17+
- uses: actions/checkout@v4
1718
- uses: actions/setup-python@v5
1819
with:
1920
python-version: "3.10"

development.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ Adminer: http://localhost:8080
186186

187187
Traefik UI: http://localhost:8090
188188

189+
MailCatcher: http://localhost:1080
190+
189191
### Development URLs with `localhost.tiangolo.com` Configured
190192

191193
Development URLs, for local development.
@@ -194,10 +196,12 @@ Frontend: http://dashboard.localhost.tiangolo.com
194196

195197
Backend: http://api.localhost.tiangolo.com
196198

197-
Automatic Interactive Docs (Swagger UI): http://api.localhost.tiangolo.comdocs
199+
Automatic Interactive Docs (Swagger UI): http://api.localhost.tiangolo.com/docs
198200

199-
Automatic Alternative Docs (ReDoc): http://api.localhost.tiangolo.comredoc
201+
Automatic Alternative Docs (ReDoc): http://api.localhost.tiangolo.com/redoc
200202

201203
Adminer: http://localhost.tiangolo.com:8080
202204

203205
Traefik UI: http://localhost.tiangolo.com:8090
206+
207+
MailCatcher: http://localhost.tiangolo.com:1080

frontend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ openapi.json
2727
/playwright-report/
2828
/blob-report/
2929
/playwright/.cache/
30+
/playwright/.auth/

frontend/package-lock.json

Lines changed: 208 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Button, Flex } from "@chakra-ui/react"
2+
3+
type PaginationFooterProps = {
4+
hasNextPage?: boolean
5+
hasPreviousPage?: boolean
6+
onChangePage: (newPage: number) => void
7+
page: number
8+
}
9+
10+
export function PaginationFooter({
11+
hasNextPage,
12+
hasPreviousPage,
13+
onChangePage,
14+
page,
15+
}: PaginationFooterProps) {
16+
return (
17+
<Flex
18+
gap={4}
19+
alignItems="center"
20+
mt={4}
21+
direction="row"
22+
justifyContent="flex-end"
23+
>
24+
<Button
25+
onClick={() => onChangePage(page - 1)}
26+
isDisabled={!hasPreviousPage || page <= 1}
27+
>
28+
Previous
29+
</Button>
30+
<span>Page {page}</span>
31+
<Button isDisabled={!hasNextPage} onClick={() => onChangePage(page + 1)}>
32+
Next
33+
</Button>
34+
</Flex>
35+
)
36+
}

frontend/src/routes/_layout/admin.tsx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
Badge,
33
Box,
4-
Button,
54
Container,
65
Flex,
76
Heading,
@@ -23,6 +22,7 @@ import { type UserPublic, UsersService } from "../../client"
2322
import AddUser from "../../components/Admin/AddUser"
2423
import ActionsMenu from "../../components/Common/ActionsMenu"
2524
import Navbar from "../../components/Common/Navbar"
25+
import { PaginationFooter } from "../../components/Common/PaginationFooter.tsx"
2626

2727
const usersSearchSchema = z.object({
2828
page: z.number().catch(1),
@@ -128,7 +128,7 @@ function UsersTable() {
128128
<ActionsMenu
129129
type="User"
130130
value={user}
131-
disabled={currentUser?.id === user.id ? true : false}
131+
disabled={currentUser?.id === user.id}
132132
/>
133133
</Td>
134134
</Tr>
@@ -137,21 +137,12 @@ function UsersTable() {
137137
)}
138138
</Table>
139139
</TableContainer>
140-
<Flex
141-
gap={4}
142-
alignItems="center"
143-
mt={4}
144-
direction="row"
145-
justifyContent="flex-end"
146-
>
147-
<Button onClick={() => setPage(page - 1)} isDisabled={!hasPreviousPage}>
148-
Previous
149-
</Button>
150-
<span>Page {page}</span>
151-
<Button isDisabled={!hasNextPage} onClick={() => setPage(page + 1)}>
152-
Next
153-
</Button>
154-
</Flex>
140+
<PaginationFooter
141+
onChangePage={setPage}
142+
page={page}
143+
hasNextPage={hasNextPage}
144+
hasPreviousPage={hasPreviousPage}
145+
/>
155146
</>
156147
)
157148
}

frontend/src/routes/_layout/items.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import {
2-
Button,
32
Container,
4-
Flex,
53
Heading,
64
SkeletonText,
75
Table,
@@ -21,6 +19,7 @@ import { ItemsService } from "../../client"
2119
import ActionsMenu from "../../components/Common/ActionsMenu"
2220
import Navbar from "../../components/Common/Navbar"
2321
import AddItem from "../../components/Items/AddItem"
22+
import { PaginationFooter } from "../../components/Common/PaginationFooter.tsx"
2423

2524
const itemsSearchSchema = z.object({
2625
page: z.number().catch(1),
@@ -112,21 +111,12 @@ function ItemsTable() {
112111
)}
113112
</Table>
114113
</TableContainer>
115-
<Flex
116-
gap={4}
117-
alignItems="center"
118-
mt={4}
119-
direction="row"
120-
justifyContent="flex-end"
121-
>
122-
<Button onClick={() => setPage(page - 1)} isDisabled={!hasPreviousPage}>
123-
Previous
124-
</Button>
125-
<span>Page {page}</span>
126-
<Button isDisabled={!hasNextPage} onClick={() => setPage(page + 1)}>
127-
Next
128-
</Button>
129-
</Flex>
114+
<PaginationFooter
115+
page={page}
116+
onChangePage={setPage}
117+
hasNextPage={hasNextPage}
118+
hasPreviousPage={hasPreviousPage}
119+
/>
130120
</>
131121
)
132122
}

release-notes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44

55
### Refactors
66

7+
* ♻️ Add PaginationFooter component. PR [#1381](https://github.com/fastapi/full-stack-fastapi-template/pull/1381) by [@saltie2193](https://github.com/saltie2193).
78
* ♻️ Refactored code to use encryption algorithm name from settings for consistency. PR [#1160](https://github.com/fastapi/full-stack-fastapi-template/pull/1160) by [@sameeramin](https://github.com/sameeramin).
89
* 🔊 Enable logging for email utils by default. PR [#1374](https://github.com/fastapi/full-stack-fastapi-template/pull/1374) by [@ihmily](https://github.com/ihmily).
910
* 🔧 Add `ENV PYTHONUNBUFFERED=1` to log output directly to Docker. PR [#1378](https://github.com/fastapi/full-stack-fastapi-template/pull/1378) by [@tiangolo](https://github.com/tiangolo).
1011
* 💡 Remove unnecessary comment. PR [#1260](https://github.com/fastapi/full-stack-fastapi-template/pull/1260) by [@sebhani](https://github.com/sebhani).
1112

13+
### Docs
14+
15+
* 📝 Add MailCatcher to `development.md`. PR [#1387](https://github.com/fastapi/full-stack-fastapi-template/pull/1387) by [@tobiase](https://github.com/tobiase).
16+
1217
### Internal
1318

19+
* 👷 Fix smokeshow, checkout files on CI. PR [#1395](https://github.com/fastapi/full-stack-fastapi-template/pull/1395) by [@tiangolo](https://github.com/tiangolo).
20+
* 👷 Update `labeler.yml`. PR [#1388](https://github.com/fastapi/full-stack-fastapi-template/pull/1388) by [@tiangolo](https://github.com/tiangolo).
21+
* 🔧 Add .auth playwright folder to `.gitignore`. PR [#1383](https://github.com/fastapi/full-stack-fastapi-template/pull/1383) by [@justin-p](https://github.com/justin-p).
22+
* ⬆️ Bump rollup from 4.6.1 to 4.22.5 in /frontend. PR [#1379](https://github.com/fastapi/full-stack-fastapi-template/pull/1379) by [@dependabot[bot]](https://github.com/apps/dependabot).
1423
* ⬆ Bump astral-sh/setup-uv from 2 to 3. PR [#1364](https://github.com/fastapi/full-stack-fastapi-template/pull/1364) by [@dependabot[bot]](https://github.com/apps/dependabot).
1524
* 👷 Update pre-commit end-of-file-fixer hook to exclude email-templates. PR [#1296](https://github.com/fastapi/full-stack-fastapi-template/pull/1296) by [@goabonga](https://github.com/goabonga).
1625
* ⬆ Bump tiangolo/issue-manager from 0.5.0 to 0.5.1. PR [#1332](https://github.com/fastapi/full-stack-fastapi-template/pull/1332) by [@dependabot[bot]](https://github.com/apps/dependabot).

0 commit comments

Comments
 (0)