Skip to content

isProject - Add support for organization projects #208

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

kovsu
Copy link
Member

@kovsu kovsu commented May 9, 2025

Fix this and then update no-modals feature.

@fregante fregante changed the title Fix isProject isProject - Add support for organization projects (#208) May 9, 2025
@@ -202,9 +202,10 @@ export const isOwnUserProfile = (): boolean => getCleanPathname() === getLoggedI
// If there's a Report Abuse link, we're not part of the org
export const isOwnOrganizationProfile = (): boolean => isOrganizationProfile() && !exists('[href*="contact/report-abuse?report="]');

export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path);
export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path ?? getOrg(url)?.path);
TEST: addTests('isProject', [
'https://github.com/sindresorhus/refined-github/projects/3',
Copy link
Member

@fregante fregante May 9, 2025

Choose a reason for hiding this comment

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

We should update the URL to one that exists

Suggested change
'https://github.com/sindresorhus/refined-github/projects/3',
'https://github.com/orgs/eslint/projects/4',

Copy link
Member

Choose a reason for hiding this comment

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

If you apply this change, most likely you'll have to update the URL to other parts as well

@fregante fregante changed the title isProject - Add support for organization projects (#208) isProject - Add support for organization projects May 9, 2025
@fregante fregante merged commit f94b6ff into refined-github:main May 9, 2025
15 checks passed
@fregante fregante added the enhancement New feature or request label May 9, 2025
@kovsu kovsu deleted the fix-isProject branch May 9, 2025 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants