Skip to content

Commit

Permalink
pkp/pkp-lib#10444 Add modalStyle to components that use the openDialo…
Browse files Browse the repository at this point in the history
…g api
  • Loading branch information
blesildaramirez committed Oct 9, 2024
1 parent 286fd40 commit 96f6396
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 52 deletions.
5 changes: 3 additions & 2 deletions src/components/Container/WorkflowPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export default {
actions: [
{
label: this.t('common.yes'),
isWarnable: true,
isPrimary: true,
callback: (close) => {
close();
this.createVersion();
Expand Down Expand Up @@ -448,7 +448,7 @@ export default {
this.workingPublication.status === pkp.const.STATUS_SCHEDULED
? this.unscheduleLabel
: this.unpublishLabel,
isPrimary: true,
isWarnable: true,
callback: (close) => {
this.unpublish(this.workingPublication);
close();
Expand All @@ -459,6 +459,7 @@ export default {
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
},
Expand Down
5 changes: 3 additions & 2 deletions src/components/Form/fields/FieldOrcid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export default {
},
},
],
modalStyle: 'primary',
close: () => {},
});
},
Expand Down Expand Up @@ -227,20 +228,20 @@ export default {
actions: [
{
label: this.t('common.yes'),
isPrimary: true,
isWarnable: true,
callback: async (close) => {
await this.deleteOrcid();
close();
},
},
{
label: this.t('common.no'),
isWarnable: true,
callback: (close) => {
close();
},
},
],
modalStyle: 'negative',
close: () => {},
});
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/ListPanel/doi/DoiListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,12 @@ export default {
actions: [
{
label: this.t('common.ok'),
isPrimary: true,
callback: (close) => {
close();
},
},
],
modalStyle: 'negative',
});
},
openVersionModal() {
Expand Down Expand Up @@ -814,6 +814,7 @@ export default {
},
},
],
modalStyle: 'primary',
});
},
triggerDeposit() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListPanel/doi/DoiListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ export default {
actions: [
{
label: this.t('common.ok'),
isPrimary: true,
callback: (close) => {
this.failedDoiActions = [];
close();
},
},
],
modalStyle: 'negative',
bodyComponent: DoiFailedActionDialogBody,
bodyProps: {
failedDoiActions: this.failedDoiActions,
Expand Down
15 changes: 8 additions & 7 deletions src/managers/FileManager/useFileManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,9 @@ export function useFileManagerActions() {
const {openDialog, openDialogNetworkError} = useModal();
openDialog({
actions: [
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
{
label: t('common.ok'),
isWarnable: true,
callback: async (close) => {
const {url} = useLegacyGridUrl({
component: 'api.file.ManageFileApiHandler',
Expand All @@ -146,9 +140,16 @@ export function useFileManagerActions() {
}
},
},
{
label: t('common.cancel'),
callback: (close) => {
close();
},
},
],
title: t('common.delete'),
message: t('common.confirmDelete'),
modalStyle: 'negative',
});
}

Expand Down
17 changes: 9 additions & 8 deletions src/managers/GalleyManager/useGalleyManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,9 @@ export function useGalleyManagerActions() {
const {openDialog, openDialogNetworkError} = useModal();
openDialog({
actions: [
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
finishedCallback();
},
},
{
label: t('common.ok'),
isWarnable: true,
callback: async (close) => {
// http://localhost:7002/index.php/publicknowledge/$$$call$$$/grid/article-galleys/article-galley-grid/delete-galley
// ?submissionId=17&publicationId=22&representationId=9
Expand Down Expand Up @@ -177,9 +170,17 @@ export function useGalleyManagerActions() {
}
},
},
{
label: t('common.cancel'),
callback: (close) => {
close();
finishedCallback();
},
},
],
title: t('common.delete'),
message: t('common.confirmDelete'),
modalStyle: 'negative',
});
}

Expand Down
30 changes: 16 additions & 14 deletions src/managers/ParticipantManager/useParticipantManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,9 @@ export function useParticipantManagerActions() {

openDialog({
actions: [
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
{
label: t('common.ok'),
isWarnable: true,
callback: async (close) => {
// http://localhost:7002/index.php/publicknowledge/
// $$$call$$$/grid/users/stage-participant/stage-participant-grid/delete-participant?submissionId=13&stageId=3&assignmentId=62
Expand Down Expand Up @@ -80,9 +74,16 @@ export function useParticipantManagerActions() {
}
},
},
{
label: t('common.cancel'),
callback: (close) => {
close();
},
},
],
title: t('editor.submission.removeStageParticipant'),
message: t('editor.submission.removeStageParticipant.description'),
modalStyle: 'negative',
});
}

Expand Down Expand Up @@ -124,13 +125,6 @@ export function useParticipantManagerActions() {

openDialog({
actions: [
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
{
label: t('common.ok'),
callback: (close) => {
Expand All @@ -152,9 +146,17 @@ export function useParticipantManagerActions() {
redirectToPage();
},
},
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
],
title: t('grid.action.logInAs'),
message: t('grid.user.confirmLogInAs'),
modalStyle: 'primary',
});
}

Expand Down
30 changes: 16 additions & 14 deletions src/managers/ReviewerManager/useReviewerManagerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,6 @@ export function useReviewerManagerActions() {
openDialog(
{
actions: [
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
{
label: t('common.ok'),
callback: (close) => {
Expand All @@ -446,9 +439,17 @@ export function useReviewerManagerActions() {
redirectToPage();
},
},
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
],
title: t('grid.action.logInAs'),
message: t('grid.user.confirmLogInAs'),
modalStyle: 'primary',
},
finishedCallback,
);
Expand Down Expand Up @@ -500,15 +501,9 @@ export function useReviewerManagerActions() {
openDialog(
{
actions: [
{
label: t('common.cancel'),
isWarnable: true,
callback: (close) => {
close();
},
},
{
label: t('common.ok'),
isWarnable: true,
callback: async (close) => {
// http://localhost:7002/index.php/publicknowledge/$$$call$$$/grid/users/reviewer/reviewer-grid/unconsider-review?submissionId=12&reviewAssignmentId=17&stageId=3

Expand Down Expand Up @@ -537,9 +532,16 @@ export function useReviewerManagerActions() {
}
},
},
{
label: t('common.cancel'),
callback: (close) => {
close();
},
},
],
title: t('editor.review.unconsiderReview'),
message: t('editor.review.unconsiderReviewText'),
modalStyle: 'negative',
},
finishedCallback,
);
Expand Down
1 change: 1 addition & 0 deletions src/pages/acceptInvitation/AcceptInvitationPageStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ export const useAcceptInvitationPageStore = defineComponentStore(
},
},
],
modalStyle: 'success',
});
}
}
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 @@ -261,6 +261,7 @@ export const useUserInvitationPageStore = defineComponentStore(
},
},
],
modalStyle: 'primary',
});
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/workflow/composables/useWorkflowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export function useWorkflowActions({
actions: [
{
label: t('publication.unschedule'),
isPrimary: true,
isWarnable: true,
callback: async (close) => {
const {apiUrl: unschedulePublicationApiUrl} = useUrl(
`submissions/${submission.id}/publications/${selectedPublication.id}/unpublish`,
Expand All @@ -220,6 +220,7 @@ export function useWorkflowActions({
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
}

Expand All @@ -234,7 +235,7 @@ export function useWorkflowActions({
actions: [
{
label: t('publication.unpublish'),
isPrimary: true,
isWarnable: true,
callback: async (close) => {
const {apiUrl: unschedulePublicationApiUrl} = useUrl(
`submissions/${submission.id}/publications/${selectedPublication.id}/unpublish`,
Expand All @@ -252,6 +253,7 @@ export function useWorkflowActions({
callback: (close) => close(),
},
],
modalStyle: 'negative',
});
}

Expand All @@ -265,7 +267,7 @@ export function useWorkflowActions({
actions: [
{
label: t('common.yes'),
isWarnable: true,
isPrimary: true,
callback: async (close) => {
close();

Expand All @@ -291,6 +293,7 @@ export function useWorkflowActions({
callback: (close) => close(),
},
],
modalStyle: 'primary',
});
}

Expand Down

0 comments on commit 96f6396

Please sign in to comment.