Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#10444 Improve dialog component design #415

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/ActionPanel/ActionPanel.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const Default = {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
}
return {
Expand Down
1 change: 1 addition & 0 deletions src/components/Composer/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'primary',
});
},

Expand Down
2 changes: 2 additions & 0 deletions src/components/Container/DecisionPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down Expand Up @@ -266,6 +267,7 @@ export default {
message: this.decisionCompleteDescription,
actions,
close,
modalStyle: 'success',
});
},

Expand Down
5 changes: 4 additions & 1 deletion src/components/Container/ManageEmailsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down Expand Up @@ -187,6 +188,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down Expand Up @@ -224,6 +226,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down Expand Up @@ -325,7 +328,7 @@ export default {
title: mailable ? mailable.name : '',
mailable: this.currentMailable,
onOpenTemplate: this.openTemplate,
onConfirmResetTemplate: this.confirmRemoveTemplate,
onConfirmResetTemplate: this.confirmResetTemplate,
onConfirmRemoveTemplate: this.confirmRemoveTemplate,
});
});
Expand Down
2 changes: 2 additions & 0 deletions src/components/Container/SubmissionWizardPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down Expand Up @@ -661,6 +662,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'primary',
});
},

Expand Down
1 change: 1 addition & 0 deletions src/components/Container/WorkflowPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'primary',
});
},

Expand Down
1 change: 1 addition & 0 deletions src/components/Form/context/NotifyUsersForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'primary',
});
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/Form/fields/FieldShowEnsuringLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
},
mounted() {
/**
* Show the requested message in a modal when the link in the messgae is
* Show the requested message in a modal when the link in the message is
* clicked.
*/
$('.pkpFormField--options__option button', this.$el).click(() => {
Expand All @@ -36,6 +36,7 @@ export default {
callback: (close) => {
close();
},
modalStyle: 'primary',
},
{
height: 'auto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default {
actions: [
{
label: this.t('common.yes'),
isPrimary: true,
isWarnable: true,
callback: (close) => {
var self = this;
$.ajax({
Expand All @@ -233,10 +233,10 @@ export default {
},
{
label: this.t('common.no'),
isWarnable: true,
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down
1 change: 1 addition & 0 deletions src/components/ListPanel/doi/DoiListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'primary',
});
},
/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListPanel/highlights/HighlightsListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default {
actions: [
{
label: this.t('common.yes'),
isPrimary: true,
isWarnable: true,
callback: (close) => {
$.ajax({
url: this.apiUrl + '/' + id,
Expand All @@ -251,10 +251,10 @@ export default {
},
{
label: this.t('common.no'),
isWarnable: true,
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default {
actions: [
{
label: this.t('common.yes'),
isPrimary: true,
isWarnable: true,
callback: (close) => {
var self = this;
$.ajax({
Expand All @@ -235,10 +235,10 @@ export default {
},
{
label: this.t('common.no'),
isWarnable: true,
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default {
actions: [
{
label: this.t('common.yes'),
isPrimary: true,
isWarnable: true,
callback: (close) => {
$.ajax({
url: this.apiUrl + '/' + item.id + '?stageId=' + this.stageId,
Expand All @@ -281,10 +281,10 @@ export default {
},
{
label: this.t('common.no'),
isWarnable: true,
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down
4 changes: 2 additions & 2 deletions src/components/ListPanel/submissions/SubmissionsListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -813,15 +813,15 @@ export default {
actions: [
{
label: this.t('common.yes'),
isPrimary: true,
isWarnable: true,
callback: this.deleteSubmission,
},
{
label: this.t('common.no'),
isWarnable: true,
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},

Expand Down
9 changes: 9 additions & 0 deletions src/components/Modal/Dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ Dialog purpose is to display simple feedback like success and error messages. Or

Dialog are opened via method `openDialog` from [useModal](../?path=/docs/composables-usemodal--docs#opensidemodal) composable. Check out the props description for details.

## Styling

The style of the modal can be changed by passing the prop `modalStyle`. It accepts the following values:

- **`default`**: The standard modal style, which has no special border styling. This serves as the default value for the modal style.
- **`primary`**: A modal style that uses the primary color scheme.
- **`negative`**: Indicates a negative state, typically for error messages or alerts.
- **`success`**: Represents a positive state, often used for success notifications.

## Accessibility

To correctly handle accessibility (title, description) and focus management - [headless-ui](https://headlessui.com) library is used.
Expand Down
Loading