Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
21e8838
init next example
mhrrmk Sep 10, 2021
943f359
add ssr example project. hack until react-router
mhrrmk Sep 13, 2021
e365b90
use react-router-dom everywhere
mhrrmk Sep 13, 2021
4b424d7
get client side router elements from props
mhrrmk Sep 14, 2021
645507e
add router provider for react-router as a standalone package
mhrrmk Sep 14, 2021
2a7a9b6
Merge branch 'ssr-support' into test-hooks-injection
mhrrmk Sep 14, 2021
a7a0429
init nextjs-router
mhrrmk Sep 14, 2021
4c4fe8a
remove react-router from core
mhrrmk Sep 14, 2021
1890dd6
fix temporary router provider components
mhrrmk Sep 15, 2021
714e861
update core package-lock
mhrrmk Sep 15, 2021
697a12f
add resources prop to Refine
mhrrmk Sep 16, 2021
dd9f6a6
add hooks to nextjs router provider
mhrrmk Sep 20, 2021
f49f3f9
Merge branch 'master' into ssr-support
omeraplak Sep 20, 2021
bb966f6
add crud compontns to NextRouteComponent
mhrrmk Sep 20, 2021
11afbef
remoce css components example from nextjs example
mhrrmk Sep 20, 2021
f21410f
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
mhrrmk Sep 20, 2021
fe97445
add remaining crud operations to next example
mhrrmk Sep 20, 2021
16a7aac
handle custom routes
mhrrmk Sep 21, 2021
d432c8b
react query ssr
salihozdemir Sep 24, 2021
a0dd745
refine, nextjs ssr for custom routes
omeraplak Sep 24, 2021
2fd5c44
handle authentication
mhrrmk Sep 24, 2021
6f65a6d
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
mhrrmk Sep 24, 2021
a70abbf
remove unnecessary custom routes read
mhrrmk Sep 24, 2021
4d61d77
syncWithLocation for server side rendering
salihozdemir Sep 24, 2021
21b613c
remove console log
salihozdemir Sep 24, 2021
6f3e49e
Merge branch 'ssr-support' of github.com:pankod/refine into ssr-support
salihozdemir Sep 24, 2021
57cc69d
Merge branch 'master' of github.com:pankod/refine into ssr-support
salihozdemir Sep 24, 2021
7ae109e
turn off router types
salihozdemir Sep 27, 2021
a4b944c
remove unused import
salihozdemir Sep 27, 2021
4c0d530
remove console.log's
salihozdemir Sep 27, 2021
f306435
fix sider active menu item
salihozdemir Sep 27, 2021
4f810b4
fix active menu item
salihozdemir Sep 27, 2021
c6e186c
create router context
salihozdemir Sep 27, 2021
9497c6a
delete router props in refine context
salihozdemir Sep 27, 2021
7e46695
use router context in core
salihozdemir Sep 27, 2021
262f251
change reactrouter package name to react-router
mhrrmk Sep 28, 2021
e5e1dbf
react-router package-lock
mhrrmk Sep 28, 2021
d5293fe
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
mhrrmk Sep 28, 2021
39b2a43
Prompt for nextjs-router (#1120)
mhrrmk Sep 28, 2021
34e2346
fix ssr tests (#1121)
salihozdemir Sep 28, 2021
1a0aa03
componentize nextjs-router. add nextroutecomponent to nextjs-router.
mhrrmk Sep 28, 2021
c9deb48
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
mhrrmk Sep 28, 2021
6210a31
use only one hooks import
mhrrmk Sep 28, 2021
68143e3
add useRefineContext. use nextroutecomponent from nextjs-route
mhrrmk Sep 28, 2021
df199d4
use hooks from within the package
mhrrmk Sep 28, 2021
f5a2509
rename react-router package name in base example
salihozdemir Sep 29, 2021
3c4d0f3
route provider move to react-router package
salihozdemir Sep 29, 2021
582476f
change NextRouteComponent import
salihozdemir Sep 30, 2021
c75b1ed
Merge branch 'master' into ssr-support
omeraplak Sep 30, 2021
4914f08
add versioning for doc
omeraplak Sep 30, 2021
bbd1b61
add roureProvider to fineFoods. export Link from routerProvider packa…
mhrrmk Sep 30, 2021
265796d
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
omeraplak Sep 30, 2021
f46e0a9
re-organize kubectl auth
omeraplak Sep 30, 2021
89a0666
update pr doc deployment timeout
omeraplak Sep 30, 2021
972e7a5
add BrowserRouterProps ro RouterComponent
mhrrmk Sep 30, 2021
b5aac2a
fix ssr tests
omeraplak Sep 30, 2021
5948539
fix syncWithLocationIssues on fineFoods
omeraplak Oct 1, 2021
f7d9e4b
add catchAll prop to refine context
omeraplak Oct 1, 2021
1626be2
update pr doc deploy helm timeout 15m to 20m
omeraplak Oct 4, 2021
3f59306
Merge branch 'master' into ssr-support
omeraplak Oct 4, 2021
5ff5b2e
delete Resource component
omeraplak Oct 4, 2021
6b14ef0
update examples with new resources prop
omeraplak Oct 4, 2021
d62a96a
update examples with new resources prop
omeraplak Oct 4, 2021
e3e2d79
add routerProvider support for examples
omeraplak Oct 4, 2021
9c1b0bf
update doc website Dockerfile
omeraplak Oct 4, 2021
59dbd37
delete examples folder from lerna
omeraplak Oct 4, 2021
5d21cab
delete package-lock files for examples
omeraplak Oct 4, 2021
56371e8
add missing deps and scripts for examples projects
omeraplak Oct 4, 2021
da3cd6a
version bump 1.1.0 for core
omeraplak Oct 4, 2021
0541c6e
update nextjs-router and react-router versions
omeraplak Oct 4, 2021
2975481
router provider function convert to object
salihozdemir Oct 5, 2021
c73ee91
fix examples
salihozdemir Oct 5, 2021
65f31f8
handle ssr authentication
mhrrmk Oct 5, 2021
36f8526
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
mhrrmk Oct 5, 2021
d72638b
extract checkAuthentication to nextjs-router package
mhrrmk Oct 5, 2021
3436468
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
omeraplak Oct 5, 2021
3b3c295
add fineFoods package-lock
omeraplak Oct 5, 2021
492bdb4
redirect to lastpath when user successfully login
salihozdemir Oct 5, 2021
d40bb9a
Merge branch 'ssr-support' of https://github.com/pankod/refine into s…
salihozdemir Oct 5, 2021
bc571d2
update redirect path
salihozdemir Oct 5, 2021
93e270f
fix redirect path logic
salihozdemir Oct 6, 2021
536809c
remove redirect when go to root path
salihozdemir Oct 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 16 additions & 16 deletions .github/workflows/master-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ jobs:
with:
format: DDMMHm
utcOffset: "+03:00"
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: web docker build
uses: docker/build-push-action@v1
with:
Expand All @@ -45,6 +37,14 @@ jobs:
registry: docker.pkg.github.com
repository: pankod/refine/refine-example
tags: sha-${{ steps.current-time.outputs.formattedTime }}
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-example to k8s
run: |
cd examples/fineFoods
Expand Down Expand Up @@ -92,14 +92,6 @@ jobs:
with:
format: DDMMHm
utcOffset: "+03:00"
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: web docker build
uses: docker/build-push-action@v1
with:
Expand All @@ -109,6 +101,14 @@ jobs:
repository: pankod/refine/refine-documentation
path: documentation
tags: sha-${{ steps.current-time.outputs.formattedTime }}
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-documentation to k8s
run: |
cd documentation
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pull-request-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: documentation docker build
uses: docker/build-push-action@v1
with:
Expand All @@ -54,6 +46,14 @@ jobs:
repository: pankod/refine/refine-documentation
path: documentation
tag_with_sha: true
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-documentation to k8s
run: |
cd documentation
Expand All @@ -62,7 +62,7 @@ jobs:
echo -e "\r\nappVersion: sha-${GITHUB_SHA::7}\r\n" >> ./k8s/refine-documentation/Chart.yaml &&
cat ./k8s/refine-documentation/Chart.yaml
helm delete ${{ env.branch }}-refine-documentation || :
helm upgrade ${{ env.branch }}-refine-documentation ./k8s/refine-documentation --install --atomic --values=./k8s/refine-documentation/values.yaml \
helm upgrade ${{ env.branch }}-refine-documentation ./k8s/refine-documentation --install --atomic --timeout 20m0s --values=./k8s/refine-documentation/values.yaml \
--set ingress.enabled=true \
--set ingress.annotations."kubernetes\.io/ingress\.class"=nginx \
--set ingress.annotations."cert-manager\.io/issuer"=letsencrypt-prod \
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: backoffice docker build
uses: docker/build-push-action@v1
with:
Expand All @@ -55,6 +47,14 @@ jobs:
registry: docker.pkg.github.com
repository: pankod/refine/refine-example
tag_with_sha: true
- name: Set up kubectl
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: pankod-k8s
expirationTime: 1200
- name: Get nodes
run: kubectl get nodes
- name: Deploy refine-example to k8s
run: |
cd examples/fineFoods
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ yarn-error.log*
example/.eslintcache
example/.cache

examples/**/*/package-lock.json
examples/*/package-lock.json
!examples/fineFoods/package-lock.json

.next
10 changes: 9 additions & 1 deletion documentation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@ COPY . /opt/app

RUN npm run build

CMD npm run serve -- --build --port 80 --host 0.0.0.0
FROM node:14-alpine

COPY --from=0 /opt/app/build /opt/app
WORKDIR /opt/app/

ENV NODE_ENV=production

RUN npm install -g serve

CMD serve -l 80
5 changes: 5 additions & 0 deletions documentation/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ const siteConfig = {
label: "Guides",
position: "left",
},
{
type: "docsVersionDropdown",
position: "right",
dropdownActiveClassDisabled: true,
},
{
href: "https://github.com/pankod/refine",
position: "right",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ spec:
httpGet:
path: /
port: http
initialDelaySeconds: 90
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 90
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
id: authenticated
title: <Authenticated>
---

`<Authenticated>` is the component form of [`useAuthenticated`][useAuthenticated]. It internally uses [`useAuthenticated`][useAuthenticated] to provide it's functionality.

For an example use, see [Custom Pages Example][Custom Pages Example] and [it's explanation][Custom Pages Explanation].

## API Reference

### Properties

| Property | Description | Type | Default |
| -------- | --------------------------------------------------------------------- | ----------- | ------- |
| fallback | Content to show if user is not logged in. If undefined, routes to `/` | `ReactNode` | |
| loading | Content to show while checking whether user is logged in | `ReactNode` | |

[useAuthenticated]: /api-references/hooks/auth/useAuthenticated.md
[Custom Pages Explanation]: /guides-and-concepts/custom-pages.md#authenticated-custom-pages
[Custom Pages Example]: /examples/custom-pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
id: create
title: Create
---

import pageHeaderPropsUsage from '@site/static/img/guides-and-concepts/basic-views/create/pageHeaderPropsUsage.png'
import actionButtonsUsage from '@site/static/img/guides-and-concepts/basic-views/create/actionButtonsUsage.png'

`<Create>` provides us a layout to display the page. It does not contain any logic but adds extra functionalities like action buttons and giving titles to the page.

We'll show what `<Create>` does using properties with examples.

## Properties

### `title`

It allows adding title inside the `<Create>` component. if you don't pass title props it uses "Create" prefix and singular resource name by default. For example, for the `/posts/create` resource, it will be "Create post".

```tsx twoslash
import { Create } from "@pankod/refine";

export const CreatePage: React.FC = () => {
return <Create title="Custom Title">...</Create>;
};
```

### `saveButtonProps`

`<Create>` component has a default button that submits the form. If you want to customize this button you can use the `saveButtonProps` property like the code below.


[Refer to the `<SaveButton>` documentation for detailed usage. &#8594](/api-references/components/buttons/save.md)

```tsx twoslash
import { Create } from "@pankod/refine";

export const CreatePage: React.FC = () => {
return <Create saveButtonProps={{ size: "small" }}>...</Create>;
};
```

### `actionButtons`

`<Create>` uses the Ant Design [`<Card>`](https://ant.design/components/card) component. The `action` prop of the `<Card>` component shows `<SaveButton>` and `<DeleteButton>` depending on your resource definition on the `<Resource>` components. If you want to use other things instead of these buttons, you can use the `actionButton` property like the code below.

```tsx twoslash
import { Create, Button } from "@pankod/refine";

export const CreatePage: React.FC = () => {
return (
<Create
actionButtons={
<>
<Button type="primary">Custom Button 1</Button>
<Button size="small">Custom Button 2</Button>
</>
}
>
...
</Create>
);
};
```

<br/>
<div class="img-container">
<div class="window">
<div class="control red"></div>
<div class="control orange"></div>
<div class="control green"></div>
</div>
<img src={actionButtonsUsage} alt="actionButton Usage" />
</div>
<br/>

### `pageHeaderProps`

`<Create>` uses the Ant Design `<PageHeader>` components so you can customize with the props of `pageHeaderProps`.

[Refer to the `<PageHeader>` documentation for detailed usage. &#8594](https://ant.design/components/page-header/#API)

```tsx twoslash
import { Create } from "@pankod/refine";

export const CreatePage: React.FC = () => {
return (
<Create
pageHeaderProps={{
onBack: () => console.log("Hello, refine"),
subTitle: "Subtitle",
}}
>
...
</Create>
);
};
```

<br/>
<div class="img-container">
<div class="window">
<div class="control red"></div>
<div class="control orange"></div>
<div class="control green"></div>
</div>
<img src={pageHeaderPropsUsage} alt="pageHeaderProps Usage"/>
</div>
<br/>

### `resource`

The `<Create>` component reads the `resource` information from the route by default. This default behavior will not work on custom pages. If you want to use the `<Create>` component in a custom page, you can use the `resource` prop.

[Refer to the custom pages documentation for detailed usage. &#8594](/guides-and-concepts/custom-pages.md)

```tsx twoslash {2-4, 11-17}
import { Refine, Resource, Create } from "@pankod/refine";
import dataProvider from "@pankod/refine-simple-rest";

const CustomPage = () => {
return <Create resource="posts">...</Create>;
};

export const App: React.FC = () => {
return (
<Refine
dataProvider={dataProvider("https://api.fake-rest.refine.dev/")}
routes={[
{
exact: true,
component: CustomPage,
path: "/custom",
},
]}
>
<Resource name="posts" />
</Refine>
);
};
```
## API Reference

### Properties

| Property | Description | Type | Default |
| --------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| saveButtonProps | Adds props for create button | `{ disabled: boolean; onClick: () => void; loading: boolean; }` | `<SaveButton>` |
| title | Adds title | `string` | `"Edit"` prefix and singular of `resource.name` |
| actionButtons | Passes the props for `<PageHeader>` | `React.ReactNode` | `<SaveButton>` and depending on your `<Resource>` configuration (`canDelete` prop) |
| pageHeaderProps | Passes the props for `<PageHeader>` | [PageHeaderProps](https://ant.design/components/page-header/#API) | { ghost: false, [title](#title), extra: `<ListButton>` and `<RefreshButton>` } |
| resource | [`Resource`](/api-references/components/resource.md) for API data interactions | `string` | Resource name that it reads from the URL. |
Loading