Bugzilla – Attachment 154200 Details for
Bug 30708
Creation of a new 'Preservation' module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30708: Rebase - Use name instead of url for router-links
Bug-30708-Rebase---Use-name-instead-of-url-for-rou.patch (text/plain), 25.29 KB, created by
Jonathan Druart
on 2023-08-03 08:24:27 UTC
(
hide
)
Description:
Bug 30708: Rebase - Use name instead of url for router-links
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-08-03 08:24:27 UTC
Size:
25.29 KB
patch
obsolete
>From 867779a5457107acb0316a0f8da990e8a2a0d8bd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 6 Jul 2023 11:27:50 +0200 >Subject: [PATCH] Bug 30708: Rebase - Use name instead of url for router-links > >Adjust code to match changes done by bug 32932. > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> >--- > .../js/vue/components/Preservation/Main.vue | 12 +++------ > .../vue/components/Preservation/Settings.vue | 2 +- > .../Preservation/SettingsProcessings.vue | 12 ++++++--- > .../SettingsProcessingsFormAdd.vue | 6 ++--- > .../Preservation/SettingsProcessingsShow.vue | 11 ++++---- > .../components/Preservation/TrainsFormAdd.vue | 6 ++--- > .../Preservation/TrainsFormAddItem.vue | 23 +++++++++-------- > .../Preservation/TrainsFormAddItems.vue | 11 ++++---- > .../components/Preservation/TrainsList.vue | 25 ++++++++++--------- > .../components/Preservation/TrainsShow.vue | 23 ++++++++++------- > .../components/Preservation/WaitingList.vue | 13 +++++----- > .../prog/js/vue/routes/preservation.js | 13 ++++++++++ > 12 files changed, 91 insertions(+), 66 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue >index 07794196f2b..214fc20a7ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Main.vue >@@ -17,16 +17,14 @@ > <h5>{{ $__("Preservation") }}</h5> > <ul> > <li> >- <router-link >- to="/cgi-bin/koha/preservation/home.pl" >- > >+ <router-link :to="{ name: 'Home' }"> > <i class="fa fa-home"></i> > {{ $__("Home") }}</router-link > > > </li> > <li> > <router-link >- to="/cgi-bin/koha/preservation/trains" >+ :to="{ name: 'TrainsList' }" > > > <i class="fa fa-train"></i> > {{ $__("Trains") }}</router-link >@@ -34,16 +32,14 @@ > </li> > <li> > <router-link >- to="/cgi-bin/koha/preservation/waiting-list" >+ :to="{ name: 'WaitingList' }" > > > <i class="fa fa-recycle"></i> > {{ $__("Waiting list") }} > </router-link> > </li> > <li> >- <router-link >- to="/cgi-bin/koha/preservation/settings" >- > >+ <router-link :to="{ name: 'Settings' }"> > <i class="fa fa-cog"></i> > {{ $__("Settings") }} > </router-link> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Settings.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Settings.vue >index a093bef9fa0..29d8f1a4199 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Settings.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Settings.vue >@@ -59,7 +59,7 @@ > <fieldset class="action"> > <input type="submit" value="Submit" /> > <router-link >- to="/cgi-bin/koha/preservation/home.pl" >+ :to="{ name: 'Home' }" > role="button" > class="cancel" > >{{ $__("Cancel") }}</router-link >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessings.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessings.vue >index 5c0c9c5f186..597161e0d10 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessings.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessings.vue >@@ -9,7 +9,10 @@ > v-bind:key="counter" > > > <router-link >- :to="`/cgi-bin/koha/preservation/settings/processings/${processing.processing_id}`" >+ :to="{ >+ name: 'SettingsProcessingsShow', >+ params: { processing_id: processing.processing_id }, >+ }" > > > {{ processing.name }} > </router-link> >@@ -21,7 +24,10 @@ > > > > <router-link >- :to="`/cgi-bin/koha/preservation/settings/processings/edit/${processing.processing_id}`" >+ :to="{ >+ name: 'SettingsProcessingsFormEdit', >+ params: { processing_id: processing.processing_id }, >+ }" > ><i class="fa fa-pencil"></i> > {{ $__("Edit this processing") }}</router-link > > >@@ -29,7 +35,7 @@ > </li> > </ol> > <router-link >- to="/cgi-bin/koha/preservation/settings/processings/add" >+ :to="{ name: 'SettingsProcessingsFormAdd' }" > role="button" > class="btn btn-default" > ><font-awesome-icon icon="plus" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue >index 7ca15585e12..6504cb6a0bb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsFormAdd.vue >@@ -168,7 +168,7 @@ > <fieldset class="action"> > <input type="submit" value="Submit" /> > <router-link >- to="/cgi-bin/koha/preservation/settings" >+ :to="{ name: 'Settings' }" > role="button" > class="cancel" > >{{ $__("Cancel") }}</router-link >@@ -276,7 +276,7 @@ export default { > client.processings.update(processing, processing_id).then( > success => { > this.setMessage(this.$__("Processing updated")) >- this.$router.push("/cgi-bin/koha/preservation/settings") >+ this.$router.push({ name: "Settings" }) > }, > error => {} > ) >@@ -284,7 +284,7 @@ export default { > client.processings.create(processing).then( > success => { > this.setMessage(this.$__("Processing created")) >- this.$router.push("/cgi-bin/koha/preservation/settings") >+ this.$router.push({ name: "Settings" }) > }, > error => {} > ) >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsShow.vue >index 25a34781f3e..72e9f9d07e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/SettingsProcessingsShow.vue >@@ -5,7 +5,10 @@ > {{ $__("Processing #%s").format(processing.processing_id) }} > <span class="action_links"> > <router-link >- :to="`/cgi-bin/koha/preservation/settings/processings/edit/${processing.processing_id}`" >+ :to="{ >+ name: 'SettingsProcessingsFormEdit', >+ params: { processing_id: processing.processing_id }, >+ }" > :title="$__('Edit')" > ><i class="fa fa-pencil"></i > ></router-link> >@@ -55,7 +58,7 @@ > </fieldset> > <fieldset class="action"> > <router-link >- to="/cgi-bin/koha/preservation/settings" >+ :to="{ name: 'Settings' }" > role="button" > class="cancel" > >{{ $__("Close") }}</router-link >@@ -129,9 +132,7 @@ export default { > ), > true > ) >- this.$router.push( >- "/cgi-bin/koha/preservation/settings" >- ) >+ this.$router.push({ name: "Settings" }) > }, > error => {} > ) >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAdd.vue >index 2e1195426f1..c1ac05aa3e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAdd.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAdd.vue >@@ -79,7 +79,7 @@ > <fieldset class="action"> > <input type="submit" value="Submit" /> > <router-link >- to="/cgi-bin/koha/preservation/trains" >+ :to="{ name: 'TrainsList' }" > role="button" > class="cancel" > >{{ $__("Cancel") }}</router-link >@@ -176,7 +176,7 @@ export default { > client.trains.update(train, train_id).then( > success => { > this.setMessage(this.$__("Train updated")) >- this.$router.push("/cgi-bin/koha/preservation/trains") >+ this.$router.push({ name: "TrainsList" }) > }, > error => {} > ) >@@ -184,7 +184,7 @@ export default { > client.trains.create(train).then( > success => { > this.setMessage(this.$__("Train created")) >- this.$router.push("/cgi-bin/koha/preservation/trains") >+ this.$router.push({ name: "TrainsList" }) > }, > error => {} > ) >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItem.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItem.vue >index e59e531a4da..01108bb46f7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItem.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItem.vue >@@ -96,7 +96,7 @@ > <fieldset class="action"> > <input type="submit" value="Submit" /> > <router-link >- to="/cgi-bin/koha/preservation/trains" >+ :to="{ name: 'TrainsList' }" > role="button" > class="cancel" > >{{ $__("Cancel") }}</router-link >@@ -125,7 +125,10 @@ > <fieldset class="action"> > <input type="submit" value="Submit" /> > <router-link >- :to="`/cgi-bin/koha/preservation/trains/${train.train_id}`" >+ :to="{ >+ name: 'TrainsShow', >+ params: { train_id: train.train_id }, >+ }" > role="button" > class="cancel" > >{{ $__("Cancel") }}</router-link >@@ -351,10 +354,10 @@ export default { > .then( > success => { > this.setMessage(this.$__("Item updated")) >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/" + >- this.train.train_id >- ) >+ this.$router.push({ >+ name: "TrainsShow", >+ params: { train_id: this.train.train_id }, >+ }) > }, > error => {} > ) >@@ -362,10 +365,10 @@ export default { > client.train_items.create(train_item, this.train.train_id).then( > success => { > this.setMessage(this.$__("Item added to train")) >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/" + >- this.train.train_id >- ) >+ this.$router.push({ >+ name: "TrainsShow", >+ params: { train_id: this.train.train_id }, >+ }) > }, > error => {} > ) >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue >index 814ab7eb9b5..a95840bd994 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsFormAddItems.vue >@@ -90,7 +90,7 @@ > <fieldset class="action"> > <input type="submit" value="Submit" /> > <router-link >- to="/cgi-bin/koha/preservation/trains" >+ :to="{ name: 'TrainsList' }" > role="button" > class="cancel" > >{{ $__("Cancel") }}</router-link >@@ -264,11 +264,10 @@ export default { > "%s items have been added to train %s." > ).format(result.length, this.train.train_id) > ) >- >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/" + >- this.train.train_id >- ) >+ this.$router.push({ >+ name: "TrainsShow", >+ params: { train_id: this.train.train_id }, >+ }) > } else { > this.setMessage( > this.$__("No items have been added to the train.") >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsList.vue >index 77a84c50103..84e4d774245 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsList.vue >@@ -3,7 +3,7 @@ > <div v-else id="trains_list"> > <Toolbar> > <ToolbarButton >- to="/cgi-bin/koha/preservation/trains/add" >+ :to="{ name: 'TrainsFormAdd' }" > icon="plus" > :title="$__('New train')" > /> >@@ -138,14 +138,16 @@ export default { > }, > doShow: function (train, dt, event) { > event.preventDefault() >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/" + train.train_id >- ) >+ this.$router.push({ >+ name: "TrainsShow", >+ params: { train_id: train.train_id }, >+ }) > }, > doEdit: function (train, dt, event) { >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/edit/" + train.train_id >- ) >+ this.$router.push({ >+ name: "TrainsFormEdit", >+ params: { train_id: train.train_id }, >+ }) > }, > doDelete: function (train, dt, event) { > this.setConfirmationDialog( >@@ -176,11 +178,10 @@ export default { > if (train.closed_on != null) { > this.setWarning(this.$__("Cannot add items to a closed train")) > } else { >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/" + >- train.train_id + >- "/items/add" >- ) >+ this.$router.push({ >+ name: "TrainsFormAddItem", >+ params: { train_id: train.train_id }, >+ }) > } > }, > table_url() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue >index 60ee1462a7c..16d600ed497 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue >@@ -50,7 +50,10 @@ > <Toolbar> > <ToolbarButton > v-if="train.closed_on == null" >- :to="`/cgi-bin/koha/preservation/trains/${train.train_id}/items/add`" >+ :to="{ >+ name: 'TrainsFormAddItem', >+ params: { train_id: train.train_id }, >+ }" > class="btn btn-default" > icon="plus" > :title="$__('Add items')" >@@ -64,7 +67,10 @@ > <font-awesome-icon icon="plus" /> {{ $__("Add items") }} > </span> > <ToolbarButton >- :to="`/cgi-bin/koha/preservation/trains/edit/${train.train_id}`" >+ :to="{ >+ name: 'TrainsFormEdit', >+ params: { train_id: train.train_id }, >+ }" > class="btn btn-default" > icon="pencil" > :title="$__('Edit')" >@@ -199,7 +205,7 @@ > </fieldset> > <fieldset class="action"> > <router-link >- to="/cgi-bin/koha/preservation/trains" >+ :to="{ name: 'TrainsList' }" > role="button" > class="cancel" > >{{ $__("Close") }}</router-link >@@ -354,9 +360,7 @@ export default { > this.$__("Train %s deleted").format(train.name), > true > ) >- this.$router.push( >- "/cgi-bin/koha/preservation/trains" >- ) >+ this.$router.push({ name: "TrainsList" }) > }, > error => {} > ) >@@ -400,9 +404,10 @@ export default { > ) > }, > editItem(train_item_id) { >- this.$router.push( >- `/cgi-bin/koha/preservation/trains/${this.train.train_id}/items/edit/${train_item_id}` >- ) >+ this.$router.push({ >+ name: "TrainsFormEditItem", >+ params: { train_id: this.train.train_id, train_item_id }, >+ }) > }, > removeItem(train_item_id) { > this.setConfirmationDialog( >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingList.vue >index c62b0a1751e..cb7340d3b38 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingList.vue >@@ -191,12 +191,13 @@ export default { > addItemsToTrain: function (e) { > e.preventDefault() > let item_ids = this.last_items.map(i => i.item_id) >- this.$router.push( >- "/cgi-bin/koha/preservation/trains/" + >- this.train_id_selected_for_add + >- "/items/add/" + >- item_ids.join(",") >- ) >+ this.$router.push({ >+ name: "TrainsFormAddItems", >+ params: { >+ train_id: this.train_id_selected_for_add, >+ item_ids: item_ids.join(","), >+ }, >+ }) > }, > addItemsToWaitingList: function (e) { > e.preventDefault() >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js >index f95d3705e11..8c220a4b10a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/preservation.js >@@ -75,6 +75,7 @@ export const routes = [ > }, > { > path: "/cgi-bin/koha/preservation/home.pl", >+ name: "Home", > component: Home, > meta: { > breadcrumb: () => [breadcrumbs.home, breadcrumbs.preservation_home], >@@ -85,6 +86,7 @@ export const routes = [ > children: [ > { > path: "", >+ name: "TrainsList", > component: TrainsList, > meta: { > breadcrumb: () => breadcrumb_paths.trains, >@@ -95,6 +97,7 @@ export const routes = [ > children: [ > { > path: "", >+ name: "TrainsShow", > component: TrainsShow, > meta: { > breadcrumb: () => >@@ -109,6 +112,7 @@ export const routes = [ > children: [ > { > path: "add", >+ name: "TrainsFormAddItem", > component: TrainsFormAddItem, > meta: { > breadcrumb: () => >@@ -120,6 +124,7 @@ export const routes = [ > }, > { > path: "add/:item_ids", >+ name: "TrainsFormAddItems", > component: TrainsFormAddItems, > meta: { > breadcrumb: () => >@@ -131,6 +136,7 @@ export const routes = [ > }, > { > path: "edit/:train_item_id", >+ name: "TrainsFormEditItem", > component: TrainsFormAddItem, > meta: { > breadcrumb: () => >@@ -146,6 +152,7 @@ export const routes = [ > }, > { > path: "add", >+ name: "TrainsFormAdd", > component: TrainsFormAdd, > meta: { > breadcrumb: () => >@@ -157,6 +164,7 @@ export const routes = [ > }, > { > path: "edit/:train_id", >+ name: "TrainsFormEdit", > component: TrainsFormAdd, > meta: { > breadcrumb: () => >@@ -170,6 +178,7 @@ export const routes = [ > }, > { > path: "/cgi-bin/koha/preservation/waiting-list", >+ name: "WaitingList", > component: WaitingList, > meta: { > breadcrumb: () => [ >@@ -184,6 +193,7 @@ export const routes = [ > children: [ > { > path: "", >+ name: "Settings", > component: Settings, > meta: { > breadcrumb: () => breadcrumb_paths.settings, >@@ -194,6 +204,7 @@ export const routes = [ > children: [ > { > path: ":processing_id", >+ name: "SettingsProcessingsShow", > component: SettingsProcessingsShow, > meta: { > breadcrumb: () => >@@ -205,6 +216,7 @@ export const routes = [ > }, > { > path: "add", >+ name: "SettingsProcessingsFormAdd", > component: SettingsProcessingsFormAdd, > meta: { > breadcrumb: () => >@@ -216,6 +228,7 @@ export const routes = [ > }, > { > path: "edit/:processing_id", >+ name: "SettingsProcessingsFormEdit", > component: SettingsProcessingsFormAdd, > meta: { > breadcrumb: () => >-- >2.25.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 30708
:
134715
|
134716
|
134732
|
134733
|
134734
|
134736
|
134737
|
134738
|
134782
|
134783
|
134784
|
134785
|
152939
|
152940
|
152941
|
152942
|
152943
|
152944
|
152945
|
152946
|
152947
|
152948
|
152949
|
152950
|
152951
|
152952
|
152953
|
152954
|
152955
|
152956
|
152957
|
152958
|
152959
|
152960
|
152961
|
152962
|
152963
|
152964
|
152965
|
152966
|
152967
|
152968
|
152969
|
152970
|
153102
|
153576
|
154167
|
154168
|
154169
|
154170
|
154171
|
154172
|
154173
|
154174
|
154175
|
154176
|
154177
|
154178
|
154179
|
154180
|
154181
|
154182
|
154183
|
154184
|
154185
|
154186
|
154187
|
154188
|
154189
|
154190
|
154191
|
154192
|
154193
|
154194
|
154195
|
154196
|
154197
|
154198
|
154199
|
154200
|
154201
|
154202
|
154203
|
156592
|
156596
|
156597
|
156636
|
156637
|
156638
|
156639
|
156640
|
156641
|
156642
|
156643
|
156644
|
156645
|
156646
|
156647
|
156648
|
156649
|
156650
|
156651
|
156652
|
156653
|
156654
|
156655
|
156656
|
156657
|
156658
|
156659
|
156660
|
156661
|
156662
|
156663
|
156664
|
156665
|
156666
|
156667
|
156668
|
156669
|
156670
|
156671
|
156672
|
156673
|
156674
|
156675
|
157502
|
157503
|
157506
|
157508
|
157512
|
157514
|
157557