Project

General

Profile

Actions

action #166310

closed

coordination #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

Added by tinita about 1 month ago. Updated 7 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2024-09-04
Due date:
% Done:

0%

Estimated time:

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

Related issues 2 (2 open0 closed)

Related to openQA Project - 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:SWorkable2024-02-29

Actions
Related to openQA Project - action #64412: Get rid of eval in OpenQA::WebAPI::Plugin::HashedParamsBlockeddheidler2020-03-112024-11-01

Actions
Actions #1

Updated by tinita about 1 month ago

  • Parent task set to #154771
Actions #2

Updated by livdywan about 1 month 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
Actions #3

Updated by tinita about 1 month ago

  • Target version changed from Tools - Next to Ready
Actions #4

Updated by mkittler about 1 month 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.)

Actions #5

Updated by tinita about 1 month ago

  • Description updated (diff)
Actions #6

Updated by livdywan about 1 month ago

  • 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
Actions #7

Updated by dheidler 27 days ago

  • Status changed from Workable to In Progress
  • Assignee set to dheidler
Actions #8

Updated by openqa_review 26 days ago

  • Due date set to 2024-09-27

Setting due date based on mean cycle time of SUSE QE Tools

Actions #9

Updated by dheidler 26 days ago

  • Due date deleted (2024-09-27)
Actions #10

Updated by openqa_review 25 days ago

  • Due date set to 2024-09-28

Setting due date based on mean cycle time of SUSE QE Tools

Actions #11

Updated by livdywan 16 days ago

@dheidler is currently looking into serving JSON instead of jQuery-specific code used for "admin" tables such as machines.

Actions #12

Updated by tinita 16 days ago

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.

Actions #13

Updated by tinita 16 days ago

  • Related to action #64412: Get rid of eval in OpenQA::WebAPI::Plugin::HashedParams added
Actions #14

Updated by dheidler 16 days ago

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.

Actions #15

Updated by livdywan 16 days 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.

Actions #16

Updated by dheidler 14 days ago

  • Status changed from In Progress to Feedback
Actions #17

Updated by livdywan 9 days ago

  • Due date changed from 2024-09-28 to 2024-10-04

dheidler wrote in #note-9:

https://github.com/os-autoinst/openQA/pull/5925

Please merge when you can monitor

Maybe we can merge it this week

Actions #18

Updated by dheidler 7 days ago

  • Status changed from Feedback to Resolved

Got merged. Seems to work find on o3.

Actions #19

Updated by okurz 7 days ago

  • Due date deleted (2024-10-04)
Actions

Also available in: Atom PDF