-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data Table Bot Accounts: Remove PAT panel on destroy (#860)
* some cleanup, fix some tests * fix translations * refactor PAT tables into component * finish refactoring translations * rework logic to handle closing PAT panel upon destroy bot or revoke PAT * cleanup, add tests * cleanup translations * remove whitespace for some styling classes * cleanup tests * further cleanup tests * fix selector * attempt to fix flakes * run normalize * remove commented out code * cleanup tests, add unauthorized test cases * change new_destroy and new_revoke to destroy_confirmation and revoke_confirmation * run normalize
- Loading branch information
1 parent
5ff9e2d
commit 4df6bb0
Showing
21 changed files
with
580 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/views/groups/bots/_destroy_confirmation_modal.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%= viral_dialog(open: open) do |dialog| %> | ||
<%= dialog.with_header(title: t("bots.destroy_confirmation.title")) %> | ||
<%= dialog.with_section do %> | ||
|
||
<%= turbo_frame_tag("deletion-alert") %> | ||
|
||
<div | ||
class=" | ||
mb-4 font-normal text-slate-500 dark:text-slate-400 overflow-x-visible | ||
" | ||
> | ||
<p class="mb-4"> | ||
<%= t("bots.destroy_confirmation.description", bot_name: bot_account.user.email) %> | ||
</p> | ||
<%= form_for(:deletion, url: group_bot_path(id: bot_account.id), method: :delete, | ||
data: { | ||
turbo_frame: "_top", | ||
controller: "token", | ||
action:"turbo:submit-end->viral--dialog#close" | ||
} | ||
) do |form| %> | ||
<%= form.submit t("bots.destroy_confirmation.submit_button"), | ||
class: | ||
"button text-sm px-5 py-2.5 text-white bg-red-700 border-red-800 focus:outline-none hover:bg-red-800 focus:ring-red-300 dark:focus:ring-red-700 dark:bg-red-600 dark:text-white dark:border-red-600 dark:hover:bg-red-700", | ||
data: { | ||
action: "click->token#removeTokenPanel", | ||
} %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/views/groups/bots/personal_access_tokens/_revoke_confirmation_modal.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<%= viral_dialog(open: open) do |dialog| %> | ||
<%= dialog.with_header(title: t("personal_access_tokens.revoke_confirmation.title")) %> | ||
<%= dialog.with_section do %> | ||
|
||
<%= turbo_frame_tag("deletion-alert") %> | ||
|
||
<div | ||
class=" | ||
mb-4 font-normal text-slate-500 dark:text-slate-400 overflow-x-visible | ||
" | ||
> | ||
<p class="mb-4"> | ||
<%= t( | ||
"personal_access_tokens.revoke_confirmation.description", | ||
token_name: personal_access_token.name, | ||
bot_name: bot_account.user.email, | ||
) %> | ||
</p> | ||
<%= form_for(:deletion, url: revoke_group_bot_personal_access_token_path( | ||
bot_id: @bot_account.id, | ||
id: personal_access_token.id | ||
), method: :delete, | ||
data: { | ||
turbo_frame: "_top", | ||
controller: "token", | ||
action:"turbo:submit-end->viral--dialog#close" | ||
} | ||
) do |form| %> | ||
<%= form.submit t("personal_access_tokens.revoke_confirmation.submit_button"), | ||
class: | ||
"button text-sm px-5 py-2.5 text-white bg-red-700 border-red-800 focus:outline-none hover:bg-red-800 focus:ring-red-300 dark:focus:ring-red-700 dark:bg-red-600 dark:text-white dark:border-red-600 dark:hover:bg-red-700", | ||
data: { | ||
action: "click->token#removeTokenPanel", | ||
} %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> |
31 changes: 31 additions & 0 deletions
31
app/views/projects/bots/_destroy_confirmation_modal.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%= viral_dialog(open: open) do |dialog| %> | ||
<%= dialog.with_header(title: t("bots.destroy_confirmation.title")) %> | ||
<%= dialog.with_section do %> | ||
|
||
<%= turbo_frame_tag("deletion-alert") %> | ||
|
||
<div | ||
class=" | ||
mb-4 font-normal text-slate-500 dark:text-slate-400 overflow-x-visible | ||
" | ||
> | ||
<p class="mb-4"> | ||
<%= t("bots.destroy_confirmation.description", bot_name: bot_account.user.email) %> | ||
</p> | ||
<%= form_for(:deletion, url: namespace_project_bot_path(id: bot_account.id), method: :delete, | ||
data: { | ||
turbo_frame: "_top", | ||
controller: "token", | ||
action:"turbo:submit-end->viral--dialog#close" | ||
} | ||
) do |form| %> | ||
<%= form.submit t("bots.destroy_confirmation.submit_button"), | ||
class: | ||
"button text-sm px-5 py-2.5 text-white bg-red-700 border-red-800 focus:outline-none hover:bg-red-800 focus:ring-red-300 dark:focus:ring-red-700 dark:bg-red-600 dark:text-white dark:border-red-600 dark:hover:bg-red-700", | ||
data: { | ||
action: "click->token#removeTokenPanel", | ||
} %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/views/projects/bots/personal_access_tokens/_revoke_confirmation_modal.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<%= viral_dialog(open: open) do |dialog| %> | ||
<%= dialog.with_header(title: t("personal_access_tokens.revoke_confirmation.title")) %> | ||
<%= dialog.with_section do %> | ||
|
||
<%= turbo_frame_tag("deletion-alert") %> | ||
|
||
<div | ||
class=" | ||
mb-4 font-normal text-slate-500 dark:text-slate-400 overflow-x-visible | ||
" | ||
> | ||
<p class="mb-4"> | ||
<%= t( | ||
"personal_access_tokens.revoke_confirmation.description", | ||
token_name: personal_access_token.name, | ||
bot_name: bot_account.user.email, | ||
) %> | ||
</p> | ||
<%= form_for(:deletion, url: revoke_namespace_project_bot_personal_access_token_path( | ||
bot_id: bot_account.id, | ||
id: personal_access_token.id | ||
), method: :delete, | ||
data: { | ||
turbo_frame: "_top", | ||
controller: "token", | ||
action:"turbo:submit-end->viral--dialog#close" | ||
} | ||
) do |form| %> | ||
<%= form.submit t("personal_access_tokens.revoke_confirmation.submit_button"), | ||
class: | ||
"button text-sm px-5 py-2.5 text-white bg-red-700 border-red-800 focus:outline-none hover:bg-red-800 focus:ring-red-300 dark:focus:ring-red-700 dark:bg-red-600 dark:text-white dark:border-red-600 dark:hover:bg-red-700", | ||
data: { | ||
action: "click->token#removeTokenPanel", | ||
} %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.