action #166310
closedcoordination #154768: [saga][epic][ux] State-of-art user experience for openQA
coordination #154771: [epic] Improved test developer user experience
Replace jquery ajax calls with fetch API size:M
Description
Motivation¶
We want to get rid of jquery, and as part of this we could get rid of is our ajax calls.
We are currently using jquery for that, e.g. $.ajax({ ... })
.
Instead we could use the fetch API:
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
Acceptance Criteria¶
- AC1: We don't use jquery any more for ajax calls
- AC2: Ajax calls still work in all browsers we support
Suggestions¶
- Confirm that fetch API is available in all current browsers (including the latest versions of Chromium and Firefox available under the oldest still supported Leap version, e.g. some Firefox ESR version provided by Leap)
- Consider checking that we document what browsers are supported by/required by openQA
- Grep for
$.ajax
,$.ajaxSetup
and similar calls to find relevant usages to be replaced (and post/ajaxSetup or similar calls) - For the
X-CSRF-TOKEN
header see https://github.com/os-autoinst/openQA/blob/master/assets/javascripts/openqa.js#L22
Out of scope¶
- Whatever datatables does internally
Updated by livdywan 4 months ago
- Related to action #156340: Evaluate the use of state-of-the-art web development frameworks to simplify our stack, e.g. alpine.js, vanilla CSS nesting size:S added
Updated by mkittler 4 months ago
That makes sense.
I'm not sure what DataTables uses internally for its AJAX calls but it is probably jQuery. I suggest we shouldn't care about this as part of the ticket. (Probably DataTables is the one dependency that makes removing jQuery completely very hard for us.)
Updated by openqa_review 3 months ago
- Due date set to 2024-09-27
Setting due date based on mean cycle time of SUSE QE Tools
Updated by openqa_review 3 months ago
- Due date set to 2024-09-28
Setting due date based on mean cycle time of SUSE QE Tools
Updated by tinita 3 months ago
- Related to action #64412: Get rid of eval in OpenQA::WebAPI::Plugin::HashedParams added
Updated by livdywan 3 months ago ยท Edited
dheidler wrote in #note-14:
In
assets/javascripts/job_templates.js
I would only update the non-deprecated YAML related ajax calls - not the legacy job group editor that - according to the a message in the template - is getting removed in the future.
You're probably referring to templates/webapi/admin/job_template/index.html.ep? This was 5 years ago. Maybe it is time to announce it in Slack and see if we can go through with it.