Skip to content

Commit

Permalink
feat: updated adomin action docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mle-moni committed Sep 24, 2024
1 parent 5b73642 commit 5c1abc3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/src/content/docs/reference/views/models/global-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ Here is the code needed to add those two buttons to the user interface
return { message: 'Suppression effectuée' }
},
},
{
type: 'link',
name: 'link-to-filtered-ideas',
tooltip: 'Voir les idées filtrées',
icon: 'link',
iconColor: 'blue',
href: '/backoffice/models/Idea?pageIndex=2&pageSize=5',
},
{
type: 'link',
name: 'link-to-google',
tooltip: 'Voir Google',
icon: 'brand-google',
iconColor: 'green',
href: 'https://www.google.com',
openInNewTab: true,
},
]
}
```
Expand Down Expand Up @@ -70,8 +87,14 @@ You can browse the list of available icons at: https://tabler.io/icons

Color of the icon, this will be passed as the css color property, so you can use any valid css color

### type

Must be one of `backend-action` or `link`

### action

Only when type = `backend-action`

Function to execute when the action is triggered

It will be called with the http context as a parameter
Expand All @@ -95,3 +118,21 @@ return response.badRequest({ error: 'Error message' })
```

:::

### href

Only when type = `link`

Link to open, this can be a relative or absolute link

e.g. `/backoffice/models/Idea?pageIndex=2&pageSize=5` and `https://www.google.com` will both work

### openInNewTab

Only when type = `link`

Whether or not to open the link in a new tab

:::tip
You can use a `link` action to show pre-filtered Model views
:::
24 changes: 24 additions & 0 deletions docs/src/content/docs/reference/views/models/instance-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ You can browse the list of available icons at: https://tabler.io/icons

Color of the icon, this will be passed as the css color property, so you can use any valid css color

### type

Must be one of `backend-action` or `link`

### action

Only when type = `backend-action`

Function to execute when the action is triggered

It will be called with the http context as a parameter
Expand Down Expand Up @@ -97,3 +103,21 @@ return response.badRequest({ error: 'Error message' })
```

:::

### href

Only when type = `link`

Link to open, this can be a relative or absolute link

e.g. `/backoffice/models/Idea?pageIndex=2&pageSize=5` and `https://www.google.com` will both work

### openInNewTab

Only when type = `link`

Whether or not to open the link in a new tab

:::tip
You can use a `link` action to show pre-filtered Model views
:::

0 comments on commit 5c1abc3

Please sign in to comment.