Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
NEXT-32832 - Allow toggling the modal footer
Browse files Browse the repository at this point in the history
  • Loading branch information
sydinh authored and jleifeld committed Jan 22, 2024
1 parent 452425c commit 136849c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

All notable changes to this project will be documented in this file.

## [3.0.17] - 19.01.2024

## Added
- Added `showFooter` to `ui.modal` to allow toggling the modal footer

## [3.0.15] - 09.10.2023

## Changed
- Changed `handle` of `channel.ts` to only validate dataset collections and entities
- Changed `handle` of `channel.ts` to only validate dataset collections and entities

## [3.0.13] - 21.07.2023

Expand Down
24 changes: 13 additions & 11 deletions docs/docs/guide/2_api-reference/ui/modals.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ in and directly see some modals (e.g. changelogs of extensions) which all need t
### Open modal
Open a new modal in the current view. The content of the modal is determined by your `locationId`.

#### Usage:
#### Usage:
```ts
ui.modal.open({
title: 'Your modal title',
locationId: 'your-location-id',
variant: 'large',
showHeader: true,
showFooter: false,
closable: true
buttons: [
{
Expand All @@ -40,14 +41,15 @@ ui.modal.open({
```

#### Parameters
| Name | Required | Default | Description |
| :----------- | :------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------- |
| `title` | true | | The title of the modal |
| `locationId` | true | | The id for the content of the modal |
| `variant` | false | 'default' | Determine the size of the modal. Possible values are 'default', 'small', 'large' and 'full' |
| `showHeader` | false | true | Enable the header in the modal which contains the title |
| `closable` | false | true | If this is set to `false` then the modal can only be closed programmatically |
| `buttons` | false | [] | This array contains [button configurations](../../../api/modules/ui_modal.md#buttonprops) which will render buttons in the footer of the modal |
| Name | Required | Default | Description | Available at Shopware |
| :----------- | :------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------|
| `title` | true | | The title of the modal | |
| `locationId` | true | | The id for the content of the modal | |
| `variant` | false | 'default' | Determine the size of the modal. Possible values are 'default', 'small', 'large' and 'full' | |
| `showHeader` | false | true | Enable the header in the modal which contains the title | |
| `showFooter` | false | true | Enable the modal footer | v6.5.8 |
| `closable` | false | true | If this is set to `false` then the modal can only be closed programmatically | |
| `buttons` | false | [] | This array contains [button configurations](../../../api/modules/ui_modal.md#buttonprops) which will render buttons in the footer of the modal | |

#### Example
![Menu item example](./assets/modal-example.png)
Expand Down Expand Up @@ -81,12 +83,12 @@ ui.modal.open({
### Close modal
Closes an opened modal. You need use the correct `locationId` of the modal which should get closed.

#### Usage:
#### Usage:
```ts
ui.modal.close({ locationId: 'your-location-id' })
```

#### Parameters
| Name | Required | Default | Description |
| :----------- | :------- | :------ | :-------------------------------------------------- |
| `locationId` | true | | The locationId of the modal which should get closed |
| `locationId` | true | | The locationId of the modal which should get closed |
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shopware-ag/meteor-admin-sdk",
"license": "MIT",
"version": "3.0.16",
"version": "3.0.17",
"repository": {
"type": "git",
"url": "git://github.com/shopware/meteor-admin-sdk.git"
Expand Down
1 change: 1 addition & 0 deletions src/ui/modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type uiModalOpen =
locationId: string,
variant?: 'default'|'small'|'large'|'full',
showHeader?: boolean,
showFooter?: boolean,
closable?: boolean,
buttons?: buttonProps[],
}
Expand Down

0 comments on commit 136849c

Please sign in to comment.