Commit 2f159fd7 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Update confirmation button text in edit modals

Changelog: fixed
EE: true
parent c6982077
...@@ -16,6 +16,7 @@ export const i18n = { ...@@ -16,6 +16,7 @@ export const i18n = {
cancel: __('Cancel'), cancel: __('Cancel'),
addEscalationPolicy: s__('EscalationPolicies|Add escalation policy'), addEscalationPolicy: s__('EscalationPolicies|Add escalation policy'),
editEscalationPolicy: s__('EscalationPolicies|Edit escalation policy'), editEscalationPolicy: s__('EscalationPolicies|Edit escalation policy'),
saveChanges: __('Save changes'),
}; };
export default { export default {
...@@ -58,10 +59,13 @@ export default { ...@@ -58,10 +59,13 @@ export default {
title() { title() {
return this.isEditMode ? i18n.editEscalationPolicy : i18n.addEscalationPolicy; return this.isEditMode ? i18n.editEscalationPolicy : i18n.addEscalationPolicy;
}, },
primaryBtnText() {
return this.isEditMode ? i18n.saveChanges : i18n.addEscalationPolicy;
},
actionsProps() { actionsProps() {
return { return {
primary: { primary: {
text: this.title, text: this.primaryBtnText,
attributes: [ attributes: [
{ variant: 'info' }, { variant: 'info' },
{ loading: this.loading }, { loading: this.loading },
......
...@@ -13,6 +13,7 @@ export const i18n = { ...@@ -13,6 +13,7 @@ export const i18n = {
cancel: __('Cancel'), cancel: __('Cancel'),
addSchedule: s__('OnCallSchedules|Add schedule'), addSchedule: s__('OnCallSchedules|Add schedule'),
editSchedule: s__('OnCallSchedules|Edit schedule'), editSchedule: s__('OnCallSchedules|Edit schedule'),
saveChanges: __('Save changes'),
addErrorMsg: s__('OnCallSchedules|Failed to edit schedule'), addErrorMsg: s__('OnCallSchedules|Failed to edit schedule'),
editErrorMsg: s__('OnCallSchedules|Failed to add schedule'), editErrorMsg: s__('OnCallSchedules|Failed to add schedule'),
}; };
...@@ -60,7 +61,7 @@ export default { ...@@ -60,7 +61,7 @@ export default {
actionsProps() { actionsProps() {
return { return {
primary: { primary: {
text: this.title, text: this.primaryBtnText,
attributes: [ attributes: [
{ variant: 'info' }, { variant: 'info' },
{ loading: this.loading }, { loading: this.loading },
...@@ -90,6 +91,9 @@ export default { ...@@ -90,6 +91,9 @@ export default {
title() { title() {
return this.isEditMode ? i18n.editSchedule : i18n.addSchedule; return this.isEditMode ? i18n.editSchedule : i18n.addSchedule;
}, },
primaryBtnText() {
return this.isEditMode ? i18n.saveChanges : i18n.addSchedule;
},
}, },
methods: { methods: {
createSchedule() { createSchedule() {
......
...@@ -23,6 +23,7 @@ export const i18n = { ...@@ -23,6 +23,7 @@ export const i18n = {
editedRotation: s__('OnCallSchedules|Successfully edited your rotation'), editedRotation: s__('OnCallSchedules|Successfully edited your rotation'),
addRotation: s__('OnCallSchedules|Add rotation'), addRotation: s__('OnCallSchedules|Add rotation'),
editRotation: s__('OnCallSchedules|Edit rotation'), editRotation: s__('OnCallSchedules|Edit rotation'),
saveChanges: __('Save changes'),
cancel: __('Cancel'), cancel: __('Cancel'),
}; };
...@@ -115,7 +116,7 @@ export default { ...@@ -115,7 +116,7 @@ export default {
actionsProps() { actionsProps() {
return { return {
primary: { primary: {
text: this.title, text: this.primaryBtnText,
attributes: [ attributes: [
{ variant: 'info' }, { variant: 'info' },
{ loading: this.loading }, { loading: this.loading },
...@@ -179,7 +180,10 @@ export default { ...@@ -179,7 +180,10 @@ export default {
return variables; return variables;
}, },
title() { title() {
return this.isEditMode ? this.$options.i18n.editRotation : this.$options.i18n.addRotation; return this.isEditMode ? i18n.editRotation : i18n.addRotation;
},
primaryBtnText() {
return this.isEditMode ? i18n.saveChanges : i18n.addRotation;
}, },
isEndDateValid() { isEndDateValid() {
const startsAt = new Date(this.form.startsAt.date).getTime(); const startsAt = new Date(this.form.startsAt.date).getTime();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment