Bugzilla – Attachment 188772 Details for
Bug 40191
Design pattern: Redirect user to a view of the record after saving instead of list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40191: Change button text from 'Submit' to 'Save' for clarity
Bug-40191-Change-button-text-from-Submit-to-Save-f.patch (text/plain), 7.25 KB, created by
Martin Renvoize (ashimema)
on 2025-10-31 08:59:37 UTC
(
hide
)
Description:
Bug 40191: Change button text from 'Submit' to 'Save' for clarity
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-31 08:59:37 UTC
Size:
7.25 KB
patch
obsolete
>From 1ac164a97b96836ff68881041c69c4088916ddf9 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Mon, 20 Oct 2025 14:13:36 +0100 >Subject: [PATCH] Bug 40191: Change button text from 'Submit' to 'Save' for > clarity >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Updates ResourceFormSave component button labels: >- "Submit" â "Save" (more intuitive for editing forms) >- "Submit and [action]" â "Save and [action]" > >Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > .../js/vue/components/ResourceFormSave.vue | 85 +++++++++++-------- > 1 file changed, 50 insertions(+), 35 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue >index 70e33400784..f5cc061bfe5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceFormSave.vue >@@ -93,8 +93,11 @@ > !instancedResource.stickyToolbar.includes('Form')) > " > > >- <DropdownButtons :dropdownButtons="dropdownButtons" :cssClass="'btn-primary'"> >- <ButtonSubmit :title="buttonTextLeader" /> >+ <DropdownButtons >+ :dropdownButtons="dropdownButtons" >+ :cssClass="'btn-primary'" >+ > >+ <ButtonSubmit :title="$__('Save')" /> > </DropdownButtons> > <router-link > :to="{ name: instancedResource.components.list }" >@@ -114,7 +117,7 @@ import ButtonSubmit from "./ButtonSubmit.vue"; > import DropdownButtons from "./DropdownButtons.vue"; > import TabsWrapper from "./TabsWrapper.vue"; > import AccordionWrapper from "./AccordionWrapper.vue"; >-import { $__ } from "@koha-vue/i18n" >+import { $__ } from "@koha-vue/i18n"; > > export default { > inheritAttrs: false, >@@ -122,7 +125,6 @@ export default { > const initialized = ref(false); > const resource = ref(null); > const editMode = ref(false); >- const buttonTextLeader = computed(() => editMode.value ? $__("Save") : $__("Submit")) > > const resourceToSave = computed(() => { > return ( >@@ -145,7 +147,7 @@ export default { > props.instancedResource.idAttr > ] > ) { >- editMode.value = true >+ editMode.value = true; > props.instancedResource.getResource( > props.instancedResource.route.params[ > props.instancedResource.idAttr >@@ -163,60 +165,74 @@ export default { > }); > > const saveAndNavigate = ($event, resourceToSave) => { >- const { components, navigationOnFormSave, onFormSave, router, idAttr } = props.instancedResource >+ const { >+ components, >+ navigationOnFormSave, >+ onFormSave, >+ router, >+ idAttr, >+ } = props.instancedResource; > // Default to show >- const navigationAction = saveOptionSelected.value || navigationOnFormSave || components.show >- const idParamRequired = navigationAction === components.show || navigationAction === components.edit >+ const navigationAction = >+ saveOptionSelected.value || >+ navigationOnFormSave || >+ components.show; >+ const idParamRequired = >+ navigationAction === components.show || >+ navigationAction === components.edit; > onFormSave($event, resourceToSave).then(resource => { >- if(resource) { >+ if (resource) { > router.push({ > name: navigationAction, > ...(idParamRequired && { > params: { >- [idAttr]: resource[idAttr] >- } >- }) >- }) >+ [idAttr]: resource[idAttr], >+ }, >+ }), >+ }); > } >- }) >- } >+ }); >+ }; > >- const saveOptionSelected = ref(props.instancedResource.navigationOnFormSave) >+ const saveOptionSelected = ref( >+ props.instancedResource.navigationOnFormSave >+ ); > const dropdownButtons = computed(() => { >- const { components, navigationOnFormSave } = props.instancedResource >+ const { components, navigationOnFormSave } = >+ props.instancedResource; > > const buttonOptions = { > list: { >- title: $__("%s and return to list").format(buttonTextLeader.value), >+ title: $__("Save and return to list"), > action: "submit", > cssClass: "btn btn-default", > callback: () => { >- saveOptionSelected.value = components.list >- } >+ saveOptionSelected.value = components.list; >+ }, > }, > show: { >- title: $__("%s and show").format(buttonTextLeader.value), >+ title: $__("Save and show"), > action: "submit", > cssClass: "btn btn-default", > callback: () => { >- saveOptionSelected.value = components.show >- } >+ saveOptionSelected.value = components.show; >+ }, > }, > edit: { >- title: $__("%s and continue editing").format(buttonTextLeader.value), >+ title: $__("Save and continue editing"), > action: "submit", > cssClass: "btn btn-default", > callback: () => { >- saveOptionSelected.value = components.edit >- } >- } >- } >+ saveOptionSelected.value = components.edit; >+ }, >+ }, >+ }; > return Object.keys(buttonOptions).reduce((acc, key) => { >- if(key === "show" && !navigationOnFormSave) return acc >- if(components[key] === navigationOnFormSave) return acc >- return [buttonOptions[key], ...acc] >- },[]) >- }) >+ if (key === "show" && !navigationOnFormSave) return acc; >+ if (components[key] === navigationOnFormSave) return acc; >+ return [buttonOptions[key], ...acc]; >+ }, []); >+ }); > > return { > initialized, >@@ -226,7 +242,6 @@ export default { > saveAndNavigate, > editMode, > dropdownButtons, >- buttonTextLeader > }; > }, > props: { >@@ -237,7 +252,7 @@ export default { > FormElement, > TabsWrapper, > AccordionWrapper, >- DropdownButtons >+ DropdownButtons, > }, > name: "ResourceFormSave", > }; >-- >2.51.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40191
:
188107
|
188108
|
188109
|
188137
|
188138
|
188139
|
188164
|
188165
|
188167
|
188193
|
188194
|
188195
|
188196
|
188197
|
188198
|
188201
|
188202
|
188203
|
188768
|
188769
|
188770
|
188771
| 188772 |
188773
|
188774
|
188775
|
188776