Skip to content
Snippets Groups Projects

Do not show revoke button if revoke_path is absent

Merged Eduardo Sanz García requested to merge eduardosanz/optional-revoke-path into master
All threads resolved!

What does this MR do and why?

AccessTokenTableApp component assumed that revoke_path in the access token is always present. However, the property revoke_path is optional.

When the revoke_path is absent or falsy, it doesn't display the revoke button action.

Screenshots or screen recordings

Before

image

After

image

How to set up and validate locally

  1. Create a personal access token:
  2. See the revoke button is present
  3. Apply patch:
diff --git a/app/assets/javascripts/access_tokens/index.js b/app/assets/javascripts/access_tokens/index.js
index f0c1b415157..c12b45bf2b1 100644
--- a/app/assets/javascripts/access_tokens/index.js
+++ b/app/assets/javascripts/access_tokens/index.js
@@ -43,7 +43,7 @@ export const initAccessTokenTableApp = () => {
     provide: {
       accessTokenType,
       accessTokenTypePlural,
-      initialActiveAccessTokens,
+      initialActiveAccessTokens: initialActiveAccessTokens.map(({ revokePath, ...rest }) => rest),
       noActiveTokensMessage,
       showRole,
     },
  1. Reload the page and observe that the button is not present.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Sanz García

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Angelo Gulina removed review request for @agulina

    removed review request for @agulina

  • added UX label

  • Please wait for Reviewer Roulette to suggest a designer for UX review, and then assign them as Reviewer. This helps evenly distribute reviews across UX.

    This message was generated automatically. You're welcome to improve it.

  • requested review from @agulina

  • Eduardo Sanz García changed the description

    changed the description

  • added 565 commits

    Compare with previous version

  • @dblessing, would you mind reviewing this MR in behave of the ~"group::authentication and authorization"? Thanks!

    It is frontend only, but we still need the approval of somebody from the group.

  • requested review from @dblessing

  • Angelo Gulina approved this merge request

    approved this merge request

  • Hey @pslaughter, :wave:

    would you have time to look at this merge request, please? Thanks!

  • Angelo Gulina requested review from @pslaughter

    requested review from @pslaughter

  • :wave: @agulina, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.

    For more info, please refer to the following links:

  • requested review from @seggenberger

  • Allure report

    allure-report-publisher generated test report!

    review-qa-blocking: :exclamation: test report for 04ad4e70

    expand test summary
    +-----------------------------------------------------------------------------------------+
    |                                     suites summary                                      |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
    |                                    | passed | failed | skipped | flaky | total | result |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
    | Create                             | 28     | 0      | 1       | 5     | 29    | ❗     |
    | Verify                             | 12     | 0      | 1       | 5     | 13    | ❗     |
    | Plan                               | 47     | 0      | 1       | 6     | 48    | ❗     |
    | Feature flag handler sanity checks | 9      | 0      | 0       | 0     | 9     | ✅     |
    | Manage                             | 46     | 0      | 3       | 14    | 49    | ❗     |
    | Configure                          | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Version sanity check               | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Package                            | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Secure                             | 2      | 0      | 0       | 2     | 2     | ❗     |
    | Protect                            | 2      | 0      | 0       | 1     | 2     | ❗     |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
    | Total                              | 146    | 0      | 9       | 33    | 155   | ❗     |
    +------------------------------------+--------+--------+---------+-------+-------+--------+

    e2e-review-qa-blocking: :exclamation: test report for 1080be8f

    expand test summary
    +-----------------------------------------------------------------------------------------+
    |                                     suites summary                                      |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
    |                                    | passed | failed | skipped | flaky | total | result |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
    | Plan                               | 47     | 0      | 1       | 47    | 48    | ❗     |
    | Version sanity check               | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Create                             | 28     | 0      | 1       | 27    | 29    | ❗     |
    | Manage                             | 57     | 0      | 3       | 54    | 60    | ❗     |
    | Verify                             | 12     | 0      | 1       | 10    | 13    | ❗     |
    | Feature flag handler sanity checks | 9      | 0      | 0       | 0     | 9     | ✅     |
    | Configure                          | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Protect                            | 2      | 0      | 0       | 2     | 2     | ❗     |
    | Package                            | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Secure                             | 2      | 0      | 0       | 2     | 2     | ❗     |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
    | Total                              | 157    | 0      | 9       | 142   | 166   | ❗     |
    +------------------------------------+--------+--------+---------+-------+-------+--------+
  • Drew Blessing approved this merge request

    approved this merge request

  • Drew Blessing removed review request for @dblessing

    removed review request for @dblessing

  • Looking at this now! :eyes:

  • Thanks for everything here @eduardosanz! I left you a very small testing suggestion for your consideration:

    Then we should be good to go :smile:

    Back to you! :soccer:

  • Paul Slaughter removed review request for @pslaughter

    removed review request for @pslaughter

  • added 1 commit

    • 6f19649f - Apply feedback from code review

    Compare with previous version

  • requested review from @pslaughter

  • Looks like pipeline failure is unrelated and possible fixed by this commit:

    40caf289

    Let me try a /rebase :eyes:

  • Paul Slaughter added 589 commits

    added 589 commits

    Compare with previous version

  • Thanks for this MR @eduardosanz! Changes LGTM! :thumbsup:

    lgtm

    Approving...


    todo: For the sake of completeness, let's get an official UX :thumbsup:, then this should be good to go :smile:

  • Paul Slaughter approved this merge request

    approved this merge request

  • Paul Slaughter removed review request for @pslaughter

    removed review request for @pslaughter

  • Sascha Eggenberger approved this merge request

    approved this merge request

  • Paul Slaughter requested review from @pslaughter

    requested review from @pslaughter

  • Starting merge...

  • Paul Slaughter mentioned in merge request !96549 (merged)

    mentioned in merge request !96549 (merged)

  • Paul Slaughter resolved all threads

    resolved all threads

  • Paul Slaughter enabled an automatic merge when the pipeline for 5f9b593f succeeds

    enabled an automatic merge when the pipeline for 5f9b593f succeeds

  • Paul Slaughter mentioned in commit e21429e7

    mentioned in commit e21429e7

  • added workflowstaging label and removed workflowcanary label

  • mentioned in merge request !99464 (merged)

  • Please register or sign in to reply
    Loading