Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Table Bot Accounts: Remove PAT panel on destroy #860

Merged
merged 17 commits into from
Dec 31, 2024

Conversation

ChrisHuynh333
Copy link
Collaborator

@ChrisHuynh333 ChrisHuynh333 commented Dec 3, 2024

What does this PR do and why?

This PR is a followup to #849, and adds logic to remove the new PAT frame upon bot deletion or revoked PAT. This is because we wouldn't want the new PAT panel to persist upon the potential removal of the PAT itself or its associated bot. Due to the changes in response logic in #849, the PAT frame now uses data-turbo-permanent attribute to persist through response refreshes, and requires explicit logic to remove/hide it.

Screenshots or screen recordings

Before:
Screencast from 2024-12-19 01:17:14 PM.webm

Now:
Screencast from 2024-12-19 01:17:53 PM.webm

How to set up and validate locally

Repeat for both project and group bots:

  1. Navigate to the bot accounts page
  2. Create a new bot or generate a new token for an existing bot. Afterwards, the new PAT frame should render.
  3. Delete a bot. The new PAT frame should no longer appear.
  4. Repeat step 2, and afterwards, revoke a PAT from a bot. Once again, the new PAT frame should no longer appear.

PR acceptance checklist

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

@ChrisHuynh333 ChrisHuynh333 force-pushed the remove-pat-panel-on-destroy branch from 0be4b79 to 1231c5a Compare December 19, 2024 18:55
@ChrisHuynh333 ChrisHuynh333 marked this pull request as ready for review December 19, 2024 19:19
@ChrisHuynh333 ChrisHuynh333 self-assigned this Dec 19, 2024
@ChrisHuynh333 ChrisHuynh333 added ready for review Pull request is ready for review and removed on hold labels Dec 19, 2024

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

@joshsadam joshsadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this and your code looks great. Just a couple comments.

test/controllers/concerns/bot_actions_concern_test.rb Outdated Show resolved Hide resolved
test/system/groups/bots_test.rb Outdated Show resolved Hide resolved
test/system/groups/bots_test.rb Show resolved Hide resolved
@ChrisHuynh333 ChrisHuynh333 force-pushed the remove-pat-panel-on-destroy branch from 53c0f6f to 802eb62 Compare December 20, 2024 15:38

This comment has been minimized.

Copy link
Contributor

@deepsidhu85 deepsidhu85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working great. Just left a few comments about possibly changing the route/method names

app/controllers/concerns/bot_actions.rb Outdated Show resolved Hide resolved
config/routes/group.rb Outdated Show resolved Hide resolved
config/routes/project.rb Outdated Show resolved Hide resolved

This comment has been minimized.

Copy link
Contributor

@joshsadam joshsadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@joshsadam joshsadam merged commit 4df6bb0 into main Dec 31, 2024
4 checks passed
@joshsadam joshsadam deleted the remove-pat-panel-on-destroy branch December 31, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants