Skip to content

Commit

Permalink
pkp/pkp-lib#10444 Add modalStyle to new dialogs related to user invit…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
blesildaramirez committed Nov 8, 2024
1 parent 74baf4b commit e9b09e5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const useUserInvitationManagerStore = defineComponentStore(
},
},
],
modalStyle: 'primary',
});
}

Expand Down Expand Up @@ -135,7 +136,7 @@ export const useUserInvitationManagerStore = defineComponentStore(
actions: [
{
label: t('invitation.cancelInvite.title'),
isPrimary: true,
isWarnable: true,
callback: async (close) => {
const {apiUrl: cancelApiUrl} = useUrl(
`invitations/${invitationObj.id}/cancel`,
Expand All @@ -154,12 +155,12 @@ export const useUserInvitationManagerStore = defineComponentStore(
},
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
],
modalStyle: 'negative',
});
}

Expand Down
4 changes: 3 additions & 1 deletion src/mixins/dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default {
],
close: () => {
// dialog has been closed
}
},
modalStyle: 'primary',
});
}
}
Expand All @@ -58,6 +59,7 @@ The `openDialog()` method accepts a configuration object with the following para
| `title` | A localized title to display in the dialog. |
| `message` | A localized message to display in the dialog. |
| `close` | A callback function that will be fired when the dialog is closed. |
| `modalStyle` | The visual style of the modal: 'basic' (no border style)', 'primary', 'negative', or 'success'. |
| `actions` | An array of buttons to add to the dialog. |
| `actions[0].label` | The label for the button. |
| `actions[0].callback` | A callback function that will be fired when the button is pressed. |
Expand Down
2 changes: 2 additions & 0 deletions src/pages/acceptInvitation/AcceptInvitationPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const useAcceptInvitationPageStore = defineComponentStore(
const {redirectToPage} = useUrl('submissions');
redirectToPage();
},
modalStyle: 'negative',
});
} else {
email.value = data.value.email;
Expand Down Expand Up @@ -394,6 +395,7 @@ export const useAcceptInvitationPageStore = defineComponentStore(
},
},
],
modalStyle: 'negative',
});
}

Expand Down
1 change: 1 addition & 0 deletions src/pages/userInvitation/UserInvitationPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ export const useUserInvitationPageStore = defineComponentStore(
},
},
],
modalStyle: 'negative',
});
}

Expand Down
1 change: 1 addition & 0 deletions src/pages/userInvitation/UserInvitationUserGroupsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ function removeUserGroup(userGroup, index) {
},
},
],
modalStyle: 'negative',
});
}
Expand Down

0 comments on commit e9b09e5

Please sign in to comment.