action #166310
closed
Added by tinita 4 months ago.
Updated 3 months ago.
Category:
Feature requests
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
- Parent task set to #154771
- 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
- Target version changed from Tools - Next to Ready
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.)
- Description updated (diff)
- Subject changed from Replace jquery ajax calls with fetch API to Replace jquery ajax calls with fetch API size:M
- Description updated (diff)
- Status changed from New to Workable
- Status changed from Workable to In Progress
- Assignee set to dheidler
- Due date set to 2024-09-27
Setting due date based on mean cycle time of SUSE QE Tools
- Due date deleted (
2024-09-27)
- Due date set to 2024-09-28
Setting due date based on mean cycle time of SUSE QE Tools
@dheidler is currently looking into serving JSON instead of jQuery-specific code used for "admin" tables such as machines.
livdywan wrote in #note-11:
@dheidler is currently looking into serving JSON instead of jQuery-specific code used for "admin" tables such as machines.
Regarding that: #64412
Would be good to get rid of that.
- Related to action #64412: Get rid of eval in OpenQA::WebAPI::Plugin::HashedParams added
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.
- Status changed from In Progress to Feedback
- Due date changed from 2024-09-28 to 2024-10-04
- Status changed from Feedback to Resolved
Got merged. Seems to work find on o3.
- Due date deleted (
2024-10-04)
Also available in: Atom
PDF