Hide `Action` column when revokePath is absent
What does this MR do and why?
In the access token table, we hide the Action
column when revokePath
is absent from all the tokens. If the table is empty we still show
the column.
Follow up from !96276 (comment 1083611365)
Screenshots or screen recordings
Before
After
The column is still present when the table is empty:
How to set up and validate locally
- Create a personal access token:
- See the
Action
column is present - 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,
},
- Reload the page and observe that the
Action
column 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.
-
I have evaluated the MR acceptance checklist for this MR.