Vue improvements/refactorings
Hi, Pedro and I have been working on improving the way we request the Koha REST API from Vue components. We ended up with the implementation that is available on the following remote branch: https://gitlab.com/joubu/Koha/-/commits/bug_32925 It contains the patches from the following bug reports: *Bug 32898* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> - Cypress tests are failing *Bug 32923* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> - x-koha-embed must a header of collectionFormat csv *Bug 32806* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> - Some Vue files need to be moved for better reusability *Bug 32939* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> - Have generic fetch functions in vue modules *Bug 32925* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> - Display loading info when a form is submitted First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923. We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806). Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code! All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it. Cheers, Jonathan
Thanks for involving me in this work Jonathan. To be clear, my contribution was very light compared to the work Jonathan did and is doing. I'm very excited to have all of this in master and see what's next for Vue in Koha. Pedro Amorim Software Engineer E: pedro.amorim@ptfs-europe.com www.ptfs-europe.com On Wed, 15 Feb 2023 at 12:09, Jonathan Druart < jonathan.druart@bugs.koha-community.org> wrote:
Hi,
Pedro and I have been working on improving the way we request the Koha REST API from Vue components. We ended up with the implementation that is available on the following remote branch: https://gitlab.com/joubu/Koha/-/commits/bug_32925
It contains the patches from the following bug reports: *Bug 32898* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> - Cypress tests are failing *Bug 32923* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> - x-koha-embed must a header of collectionFormat csv *Bug 32806* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> - Some Vue files need to be moved for better reusability *Bug 32939* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> - Have generic fetch functions in vue modules *Bug 32925* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> - Display loading info when a form is submitted
First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923. We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806). Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code!
All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it.
Cheers, Jonathan _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
I’ve started playing more with Vue for some other projects, so I wouldn’t mind taking a look. Is there anything particular you want us to look at with these patches? David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Thursday, 16 February 2023 12:10 AM To: koha-devel <koha-devel@lists.koha-community.org> Subject: [Koha-devel] Vue improvements/refactorings Hi, Pedro and I have been working on improving the way we request the Koha REST API from Vue components. We ended up with the implementation that is available on the following remote branch: https://gitlab.com/joubu/Koha/-/commits/bug_32925 It contains the patches from the following bug reports: <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> Bug 32898 - Cypress tests are failing <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> Bug 32923 - x-koha-embed must a header of collectionFormat csv <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> Bug 32806 - Some Vue files need to be moved for better reusability <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> Bug 32939 - Have generic fetch functions in vue modules <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> Bug 32925 - Display loading info when a form is submitted First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923. We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806). Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code! All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it. Cheers, Jonathan
Bug 32806 modifies the directory structure and how Vue files are organised. Bug 32939 is centralising the way we request the Koha REST API by having a single place where the fetch is made. I want people to be aware of these changes, and see them agree (or disagree and provide follow-ups) quickly. There are many changes to build on top of that, and we don't want to provide them before getting the suggestion approved. Le mer. 15 févr. 2023 à 23:18, David Cook <dcook@prosentient.com.au> a écrit :
I’ve started playing more with Vue for some other projects, so I wouldn’t mind taking a look.
Is there anything particular you want us to look at with these patches?
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:* Koha-devel <koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Jonathan Druart *Sent:* Thursday, 16 February 2023 12:10 AM *To:* koha-devel <koha-devel@lists.koha-community.org> *Subject:* [Koha-devel] Vue improvements/refactorings
Hi,
Pedro and I have been working on improving the way we request the Koha REST API from Vue components.
We ended up with the implementation that is available on the following remote branch:
https://gitlab.com/joubu/Koha/-/commits/bug_32925
It contains the patches from the following bug reports:
*Bug 32898* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> - Cypress tests are failing
*Bug 32923* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> - x-koha-embed must a header of collectionFormat csv
*Bug 32806* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> - Some Vue files need to be moved for better reusability
*Bug 32939* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> - Have generic fetch functions in vue modules
*Bug 32925* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> - Display loading info when a form is submitted
First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923.
We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806).
Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code!
All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it.
Cheers,
Jonathan
I’ve spent the past few days working with Vue.js on a different app, so it’s certainly on my mind, but I’ve also had a build up of tasks. I took a look at “routes.js” for https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html <https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=32806&attachment=146664> &bug=32806&attachment=146664 and all the import statements looked a bit cumbersome. I quizzed ChatGPT earlier about my design for the different app, and was impressed with what it had to say. My prompt: “With Vue.js 3, is there an easy way to import multiple components without having to specify each one separately?” ChatGPT: It gave some explanatory text and the following code: import { defineAsyncComponent } from 'vue'; const components = [ 'MyComponent1', 'MyComponent2', 'MyComponent3', ]; const asyncComponents = components.map(name => defineAsyncComponent(() => import(`@/components/${name}.vue`))); export default { components: { ...asyncComponents.reduce((obj, component, index) => { obj[components[index]] = component; return obj; }, {}), }, }; I haven’t looked enough at Koha’s Vue.js code for ERM, but doing something along those lines could reduce the copy/paste text from routes.js. Anyway, I have to run, but I thought you might find that interesting. David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Thursday, 16 February 2023 6:41 PM To: koha-devel <koha-devel@lists.koha-community.org> Subject: Re: [Koha-devel] Vue improvements/refactorings Bug 32806 modifies the directory structure and how Vue files are organised. Bug 32939 is centralising the way we request the Koha REST API by having a single place where the fetch is made. I want people to be aware of these changes, and see them agree (or disagree and provide follow-ups) quickly. There are many changes to build on top of that, and we don't want to provide them before getting the suggestion approved. Le mer. 15 févr. 2023 à 23:18, David Cook <dcook@prosentient.com.au <mailto:dcook@prosentient.com.au> > a écrit : I’ve started playing more with Vue for some other projects, so I wouldn’t mind taking a look. Is there anything particular you want us to look at with these patches? David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 From: Koha-devel <koha-devel-bounces@lists.koha-community.org <mailto:koha-devel-bounces@lists.koha-community.org> > On Behalf Of Jonathan Druart Sent: Thursday, 16 February 2023 12:10 AM To: koha-devel <koha-devel@lists.koha-community.org <mailto:koha-devel@lists.koha-community.org> > Subject: [Koha-devel] Vue improvements/refactorings Hi, Pedro and I have been working on improving the way we request the Koha REST API from Vue components. We ended up with the implementation that is available on the following remote branch: https://gitlab.com/joubu/Koha/-/commits/bug_32925 It contains the patches from the following bug reports: <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> Bug 32898 - Cypress tests are failing <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> Bug 32923 - x-koha-embed must a header of collectionFormat csv <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> Bug 32806 - Some Vue files need to be moved for better reusability <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> Bug 32939 - Have generic fetch functions in vue modules <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> Bug 32925 - Display loading info when a form is submitted First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923. We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806). Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code! All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it. Cheers, Jonathan
Yes, David, we can lazy load the components. I have not considered it a high priority for now. I've opened a bug to keep track of the need bug 33024 (Lazy load the components in the routes definition) Le mar. 21 févr. 2023 à 07:08, David Cook <dcook@prosentient.com.au> a écrit :
I’ve spent the past few days working with Vue.js on a different app, so it’s certainly on my mind, but I’ve also had a build up of tasks.
I took a look at “routes.js” for https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=32806&attachment=146664 and all the import statements looked a bit cumbersome.
I quizzed ChatGPT earlier about my design for the different app, and was impressed with what it had to say.
My prompt: “With Vue.js 3, is there an easy way to import multiple components without having to specify each one separately?”
ChatGPT: It gave some explanatory text and the following code:
import { defineAsyncComponent } from 'vue';
const components = [
'MyComponent1',
'MyComponent2',
'MyComponent3',
];
const asyncComponents = components.map(name => defineAsyncComponent(() => import(`@/components/${name}.vue`)));
export default {
components: {
...asyncComponents.reduce((obj, component, index) => {
obj[components[index]] = component;
return obj;
}, {}),
},
};
I haven’t looked enough at Koha’s Vue.js code for ERM, but doing something along those lines could reduce the copy/paste text from routes.js.
Anyway, I have to run, but I thought you might find that interesting.
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:* Koha-devel <koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Jonathan Druart *Sent:* Thursday, 16 February 2023 6:41 PM *To:* koha-devel <koha-devel@lists.koha-community.org> *Subject:* Re: [Koha-devel] Vue improvements/refactorings
Bug 32806 modifies the directory structure and how Vue files are organised.
Bug 32939 is centralising the way we request the Koha REST API by having a single place where the fetch is made.
I want people to be aware of these changes, and see them agree (or disagree and provide follow-ups) quickly. There are many changes to build on top of that, and we don't want to provide them before getting the suggestion approved.
Le mer. 15 févr. 2023 à 23:18, David Cook <dcook@prosentient.com.au> a écrit :
I’ve started playing more with Vue for some other projects, so I wouldn’t mind taking a look.
Is there anything particular you want us to look at with these patches?
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:* Koha-devel <koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Jonathan Druart *Sent:* Thursday, 16 February 2023 12:10 AM *To:* koha-devel <koha-devel@lists.koha-community.org> *Subject:* [Koha-devel] Vue improvements/refactorings
Hi,
Pedro and I have been working on improving the way we request the Koha REST API from Vue components.
We ended up with the implementation that is available on the following remote branch:
https://gitlab.com/joubu/Koha/-/commits/bug_32925
It contains the patches from the following bug reports:
*Bug 32898* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> - Cypress tests are failing
*Bug 32923* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> - x-koha-embed must a header of collectionFormat csv
*Bug 32806* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> - Some Vue files need to be moved for better reusability
*Bug 32939* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> - Have generic fetch functions in vue modules
*Bug 32925* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> - Display loading info when a form is submitted
First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923.
We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806).
Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code!
All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it.
Cheers,
Jonathan
A quick update. There are several bug reports, and the tree is at https://gitlab.com/joubu/Koha/-/commits/bug_32991 It's ~40 commits on top of master, a lot of architecture changes in the erm/vue files. It would be great to have them pushed ASAP, they are blocking other works. Most important is that people will read, learn and copy the code that is in master, which will be obsolete (and generate conflicts) one this tree will be pushed. How can we coordinate to make it move forward? Who is willing to help here? Cheers, Jonathan Le mer. 15 févr. 2023 à 14:09, Jonathan Druart < jonathan.druart@bugs.koha-community.org> a écrit :
Hi,
Pedro and I have been working on improving the way we request the Koha REST API from Vue components. We ended up with the implementation that is available on the following remote branch: https://gitlab.com/joubu/Koha/-/commits/bug_32925
It contains the patches from the following bug reports: *Bug 32898* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> - Cypress tests are failing *Bug 32923* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> - x-koha-embed must a header of collectionFormat csv *Bug 32806* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> - Some Vue files need to be moved for better reusability *Bug 32939* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> - Have generic fetch functions in vue modules *Bug 32925* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> - Display loading info when a form is submitted
First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923. We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806). Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code!
All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it.
Cheers, Jonathan
I think that the number of bug reports and commits is a bit intimidating. Unless there is a compelling reason to the contrary, I think squashing a lot of these commits would be a good idea. Also, I’m doing a diff on https://gitlab.com/joubu/Koha/-/commits/bug_32991 and the stats are: 76 files changed, 929 insertions(+), 1823 deletions(-). That’s a lot of changes to review. Looking through the changed files… I’d say targeting changes that affect non-ERM functionality should take highest priority – like Bug 32981 and Bug 32923 – since more people have the skills to work on them. Then maybe all the ERM changes can be tested at 1 time all together, although that’s a bit messy in terms of attaching signed off patches… Looking at the Vue components… I’m not sure what to be looking for from a QA perspective, since we don’t have any rules around Vue.js specifically. For Javascript related things, things look OK in the couple of *.vue files I’ve reviewed, but I’d need to double-check them to know for sure. Looking through Breadcrumb.vue and Main.vue, I’d probably do things a bit differently for readability and generalizability/reusability. I don’t know if that should be a blocker or not at this stage though… Personally, I don’t have any investment in the ERM work, but I’m very interested in the Vue.js work. I’d love to make sure we’re creating a design that maximizes reusability and eases maintenance. My koha-testing-docker is broken at the moment, so I’ll look at fixing that up, and then I’ll try to look at this more. I am willing to help, although my schedule is fairly full too. I’m trying to do more Vue.js on other projects, so hopefully I can bring that experience back to Koha and help more… David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Wednesday, 22 February 2023 1:57 AM To: koha-devel <koha-devel@lists.koha-community.org> Subject: Re: [Koha-devel] Vue improvements/refactorings A quick update. There are several bug reports, and the tree is at https://gitlab.com/joubu/Koha/-/commits/bug_32991 It's ~40 commits on top of master, a lot of architecture changes in the erm/vue files. It would be great to have them pushed ASAP, they are blocking other works. Most important is that people will read, learn and copy the code that is in master, which will be obsolete (and generate conflicts) one this tree will be pushed. How can we coordinate to make it move forward? Who is willing to help here? Cheers, Jonathan Le mer. 15 févr. 2023 à 14:09, Jonathan Druart <jonathan.druart@bugs.koha-community.org <mailto:jonathan.druart@bugs.koha-community.org> > a écrit : Hi, Pedro and I have been working on improving the way we request the Koha REST API from Vue components. We ended up with the implementation that is available on the following remote branch: https://gitlab.com/joubu/Koha/-/commits/bug_32925 It contains the patches from the following bug reports: <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> Bug 32898 - Cypress tests are failing <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> Bug 32923 - x-koha-embed must a header of collectionFormat csv <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> Bug 32806 - Some Vue files need to be moved for better reusability <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> Bug 32939 - Have generic fetch functions in vue modules <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> Bug 32925 - Display loading info when a form is submitted First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923. We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806). Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code! All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it. Cheers, Jonathan
It's a lot of changes, that's why they are split into several bug reports and patches. Is it always either too big or too small?
I’m not sure what to be looking for from a QA perspective Does it look better after the patches than before? Is it still working? If so they should get in.
I’d probably do things a bit differently There are always different ways. Here it's mine, feel free to propose alternatives.
creating a design that maximizes reusability and eases maintenance That's *exactly* the goal of these patches. And more work is in the pipe so it cannot wait too long.
Le mer. 22 févr. 2023 à 06:14, David Cook <dcook@prosentient.com.au> a écrit :
I think that the number of bug reports and commits is a bit intimidating. Unless there is a compelling reason to the contrary, I think squashing a lot of these commits would be a good idea.
Also, I’m doing a diff on https://gitlab.com/joubu/Koha/-/commits/bug_32991 and the stats are: 76 files changed, 929 insertions(+), 1823 deletions(-). That’s a lot of changes to review.
Looking through the changed files… I’d say targeting changes that affect non-ERM functionality should take highest priority – like Bug 32981 and Bug 32923 – since more people have the skills to work on them. Then maybe all the ERM changes can be tested at 1 time all together, although that’s a bit messy in terms of attaching signed off patches…
Looking at the Vue components… I’m not sure what to be looking for from a QA perspective, since we don’t have any rules around Vue.js specifically. For Javascript related things, things look OK in the couple of *.vue files I’ve reviewed, but I’d need to double-check them to know for sure.
Looking through Breadcrumb.vue and Main.vue, I’d probably do things a bit differently for readability and generalizability/reusability. I don’t know if that should be a blocker or not at this stage though…
Personally, I don’t have any investment in the ERM work, but I’m very interested in the Vue.js work. I’d love to make sure we’re creating a design that maximizes reusability and eases maintenance.
My koha-testing-docker is broken at the moment, so I’ll look at fixing that up, and then I’ll try to look at this more.
I am willing to help, although my schedule is fairly full too. I’m trying to do more Vue.js on other projects, so hopefully I can bring that experience back to Koha and help more…
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:* Koha-devel <koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Jonathan Druart *Sent:* Wednesday, 22 February 2023 1:57 AM *To:* koha-devel <koha-devel@lists.koha-community.org> *Subject:* Re: [Koha-devel] Vue improvements/refactorings
A quick update.
There are several bug reports, and the tree is at https://gitlab.com/joubu/Koha/-/commits/bug_32991
It's ~40 commits on top of master, a lot of architecture changes in the erm/vue files.
It would be great to have them pushed ASAP, they are blocking other works.
Most important is that people will read, learn and copy the code that is in master, which will be obsolete (and generate conflicts) one this tree will be pushed.
How can we coordinate to make it move forward? Who is willing to help here?
Cheers,
Jonathan
Le mer. 15 févr. 2023 à 14:09, Jonathan Druart < jonathan.druart@bugs.koha-community.org> a écrit :
Hi,
Pedro and I have been working on improving the way we request the Koha REST API from Vue components.
We ended up with the implementation that is available on the following remote branch:
https://gitlab.com/joubu/Koha/-/commits/bug_32925
It contains the patches from the following bug reports:
*Bug 32898* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898> - Cypress tests are failing
*Bug 32923* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923> - x-koha-embed must a header of collectionFormat csv
*Bug 32806* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32806> - Some Vue files need to be moved for better reusability
*Bug 32939* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32939> - Have generic fetch functions in vue modules
*Bug 32925* <https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32925> - Display loading info when a form is submitted
First, make the tests pass (32898)! We forgot to include the cypress test in the jenkins pipeline and we missed regressions! There have been regressions on the REST API specs, that are fixed on 32923.
We noticed that the code we provided for the ERM module was not flexible enough and too ERM oriented. Some directories have been moved and code split a bit to make it more reusable for other modules (32806).
Finally there are 32939 that introduce generic fetch functions, to have all the error handling (catch exceptions and display the error on the UI) in a single place. On top of that we added a "loading" message when a form (POST/PUT/DELETE) is submitted and, thanks to the previous moves, it's only a couple of lines of code!
All this must be considered a base for future Vue enhancements, and I would like people interested in the Vue work to have a look at it.
Cheers,
Jonathan
participants (3)
-
Amorim, Pedro -
David Cook -
Jonathan Druart