From patchwork Wed Jul 28 15:24:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Raxel Gutierrez X-Patchwork-Id: 1510900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=VaeF6OaK; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GZcsZ3Dsrz9sT6 for ; Thu, 29 Jul 2021 01:24:50 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GZcsZ2LJQz30Hq for ; Thu, 29 Jul 2021 01:24:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=VaeF6OaK; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--raxel.bounces.google.com (client-ip=2607:f8b0:4864:20::84a; helo=mail-qt1-x84a.google.com; envelope-from=3qnybyqukcasclipwrzzrwp.nzxalenshzcvwtded.zkwlmd.zcr@flex--raxel.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=VaeF6OaK; dkim-atps=neutral Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GZcsH5HX3z304S for ; Thu, 29 Jul 2021 01:24:34 +1000 (AEST) Received: by mail-qt1-x84a.google.com with SMTP id s14-20020ac8528e0000b029025f76cabdfcso1186253qtn.15 for ; Wed, 28 Jul 2021 08:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=/ieJYFoYx0BhLpblNTYBJYmo3ucNc6Udl3g6nBM0JIU=; b=VaeF6OaKIgEu1uhrQcJNGefqeCuex1I4X72WdMt1Yx0pS2WGa1mVQwHTrnHYofCwnN +vFr6ZBvPq6wkXUHVQYIBE8wDMqwrtn8q2EjFAJ3ckSY9qlfAyw8Caf3hEdd3RCjCX+E KKB1UOHEKz373VAOxNrjQPDahLBD33J1twM38RGXq2Ot7AkTy9AtuoJ42UYXGx7N2ldK 06TpIkYWd5r7GdwpP4ysP4fSPHKJE8Dfhg2LvELq15PCLxzyrbxatUObJWYSjrb2gUOZ J259tO7CBvLzxAp71X7H/VCStsflf3m2vgVP8yf6UmB661lCMvNki9mwaKfs8bG6FhRG O1MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=/ieJYFoYx0BhLpblNTYBJYmo3ucNc6Udl3g6nBM0JIU=; b=Ud2p5rIZu1i4A+bZUCyzYzGY6SnzXujrm0cP9qTCshxn7O4l3Ri2hDk6LXx8AdU7Wn hPRA70v8OCA+rKQScrxD0Ou4jFDrEVs8J9QKN2gONMPaZygeUztKu9F09ZLyV/nUljUp B/JLxjlH/z018qMkxU8hbgKXfSMmYUwO3zxPy1TzkI1cZkQ8BwmsZS/bTM0wSHDqzZv3 nvYoHl/JPfIPHSQ45wiTaas1ZF/+k2hgVaghkhq7jQI1IMZaBwO9env2U/uAJbTs4+BH LrzMWgTH8FJxeuu44ug6PUedvyPRtoEdZYDYXyxyD5+oeDs3wlJVnkcfYb1rvwJteebC iwSw== X-Gm-Message-State: AOAM531rPS5PSpr6vCnm2j9suTmR8EOUnbTpetV1PUnb4VEaiLANi8az um1wcG0vNyE9psWXYO2tMUjQ23pzGOI3qE2qUVTugwQNCfRCFTXOoOZvWovjC7dmxQsCnXPJXJW 8w7MeRyRRQ7/KizxjMkyj3yxfGMzIhygg4bUdsIKVy8FwQOKY0hraFufg7BAu+xze X-Google-Smtp-Source: ABdhPJyIDmquwRhkAfZMTfCeaVL/oMXEu7xv3yuEdhlkfKIUuTKlCwGwf1C5c3Yw5QclUu2gyqsxN/JGYA== X-Received: from raxel-pw.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2fda]) (user=raxel job=sendgmr) by 2002:ad4:58cb:: with SMTP id dh11mr463877qvb.29.1627485866219; Wed, 28 Jul 2021 08:24:26 -0700 (PDT) Date: Wed, 28 Jul 2021 15:24:14 +0000 Message-Id: <20210728152419.3588812-1-raxel@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [PATCH v3 0/5] patch-list: improve usability of list action bar From: Raxel Gutierrez To: patchwork@lists.ozlabs.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This series is a revision to the previous version of the patch series. The series mainly addresses the review comments from the v2 series [1]. For the first patch, the recently released v3.0.0 of the JS cookie library replaces the previous version. For the second patch, following jrnieder’s comments [2], the commit message is updated to better explain the benefits of the change and its details. Also, an unclear comment in forms.py for BundleForm is cleaned up to better explain what the changes do. The id for table cells in patch-list.html are correctly differentiated by patch id. I noticed a bug where property changes in the patch detail page weren’t working because the respective “update” action was not accounted for. For the third patch, the “jump to form” arrow is removed [3]. For the fourth patch, the `updateProperty` function now returns whether the update request was successful or not with `response.ok` so that callers can use that information and respond accordingly. The next patch adds a use case for the return value. For the fifth patch, the inline dropdowns are changed so that they are only visible to logged in users. Also, upon any unsuccessful update requests, the dropdown selection reverts to its previous selection. Since update requests to a patch’s state and delegate fields fail for unauthorized users, this behavior covers the case where unauthorized users don't see the current state of the db after they change the dropdown selection. This behavior is a useful example of patch four’s change of returning whether an update request is successful. [1] https://lists.ozlabs.org/pipermail/patchwork/2021-July/006968.html [2] https://lists.ozlabs.org/pipermail/patchwork/2021-July/006988.html [3] https://lists.ozlabs.org/pipermail/patchwork/2021-July/006991.html Raxel Gutierrez (5): static: add JS Cookie Library to get csrftoken for fetch requests patch-list: clean up patch-list page and refactor patch forms patch-list: style modification forms as an action bar static: add rest.js to handle requests & respective messages patch-list: add inline dropdown for delegate and state one-off changes htdocs/README.rst | 23 +++ htdocs/css/style.css | 85 +++++++-- htdocs/js/js.cookie.min.js | 2 + htdocs/js/patch-list.js | 60 ++++++ htdocs/js/rest.js | 72 ++++++++ patchwork/forms.py | 66 +++++-- patchwork/templates/patchwork/list.html | 11 +- .../templates/patchwork/partials/errors.html | 9 + .../patchwork/partials/patch-forms.html | 45 +++++ .../patchwork/partials/patch-list.html | 171 ++++++------------ patchwork/templates/patchwork/submission.html | 91 +--------- patchwork/tests/views/test_bundles.py | 44 ++--- patchwork/tests/views/test_patch.py | 4 +- patchwork/views/__init__.py | 76 ++++---- patchwork/views/patch.py | 35 +--- templates/base.html | 3 +- 16 files changed, 472 insertions(+), 325 deletions(-) create mode 100644 htdocs/js/js.cookie.min.js create mode 100644 htdocs/js/patch-list.js create mode 100644 htdocs/js/rest.js create mode 100644 patchwork/templates/patchwork/partials/errors.html create mode 100644 patchwork/templates/patchwork/partials/patch-forms.html Range-diff: 1: 2a34394 ! 1: 859789e static: add JS Cookie Library to get csrftoken for fetch requests @@ htdocs/README.rst: js + This is used to get the ``csrftoken`` cookie for AJAX requests in JavaScript. + + :GitHub: https://github.com/js-cookie/js-cookie/ -+ :Version: 2.2.1 ++ :Version: 3.0.0 + ``selectize.min.js`` @@ htdocs/README.rst: js ## htdocs/js/js.cookie.min.js (new) ## @@ -+/*! js-cookie v2.2.1 | MIT */ -+ -+!function(a){var b;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a @@ - - {% if page.paginator.long_page and user.is_authenticated %} - + {% endif %} +-{% if page.paginator.long_page and user.is_authenticated %} +- +-{% endif %} +- -