Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Expand quick-fork-deletion to empty repos - #3795

Merged
fregante merged 6 commits into
refined-github:masterfrom
cheap-glitch:expand-quick-fork-deletion
Dec 16, 2020
Merged

Expand quick-fork-deletion to empty repos#3795
fregante merged 6 commits into
refined-github:masterfrom
cheap-glitch:expand-quick-fork-deletion

Conversation

@cheap-glitch

@cheap-glitch cheap-glitch commented Dec 7, 2020

Copy link
Copy Markdown
Contributor

Thanks for contributing! 🍄

  1. LINKED ISSUES: Closes Enable quick-fork-deletion on regular but empty repos #3779

  2. TEST URLS: see Add quick-fork-deletion feature #3734 (comment)

  3. SCREENSHOT: TODO

  • Renamed the feature to quick-repo-deletion
  • Fixed an incorrect selector that broke the feature
  • Enabled the feature on every repo and added an additional confirmation step for non-forks

Comment thread source/features/quick-repo-deletion.tsx Outdated
// Close the <details> element again
event.delegateTarget.open = false;
} else {
if (!pageDetect.isForkedRepo() && !confirm('⚠️ ⚠️ ARE YOU TOTALLY SURE YOU WANT TO DELETE THIS REPOSITORY? ⚠️ ⚠️')) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be a plain else if, it can’t be nested or else start will still be called

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed the alert logic, tell me if that's what you intended for this feature.

if (
// Only if the user can delete the repository
!await elementReady('[data-tab-item="settings-tab"]') ||
!await elementReady('nav [data-content="Settings"]') ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this attribute is no longer available, other features also broke. It’s worth checking them out (in a separate PR)

Comment thread source/features/quick-repo-deletion.tsx Outdated
@fregante
fregante merged commit 0d186f7 into refined-github:master Dec 16, 2020
@yakov116

Copy link
Copy Markdown
Member

@fregante don't do a release yet

@cheap-glitch
cheap-glitch deleted the expand-quick-fork-deletion branch December 16, 2020 20:54
@fregante

Copy link
Copy Markdown
Member

Reason?

@yakov116

Copy link
Copy Markdown
Member

clean-pinned-issues is missing awaitDomReady:false and we need to fix that before the next release.

@yakov116

Copy link
Copy Markdown
Member

I plan to finish #3826 a drop later today if you want to wait for that

return;
}

if (!pageDetect.isForkedRepo() && !confirm('⚠️ This action cannot be undone. This will permanently delete the repository, wiki, issues, comments, packages, secrets, workflow runs, and remove all collaborator associations.')) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you interested in adding a note that one can actually restore the repository (which can't be a fork) if it's deleted by mistake? https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/restoring-a-deleted-repository

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That’s pretty cool, we can add a “You can restore it” link on the confirmation text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Enable quick-fork-deletion on regular but empty repos

4 participants