-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Make issue suggestion work for all editors #33340
Conversation
52a9662
to
8444011
Compare
8444011
to
a310c88
Compare
web_src/js/utils.ts
Outdated
export function parseRepoOwnerPathInfo(pathname: string): RepoOwnerPathInfo { | ||
const appSubUrl = window.config.appSubUrl; | ||
if (appSubUrl && pathname.startsWith(appSubUrl)) pathname = pathname.substring(appSubUrl.length); | ||
const path = (pathname || '').replace(/[#?].*$/, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two small problem to point out
- may we should trust types and not null check pathname. to use empty string can hide callers issue
- when it is not a repo path, we returns empty object and check if ownerName is exists even though it's type does not say it can be nullable. may we can return null instead null ownerName?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do that (use null
) for 2 reasons:
- There was a long argument about returning null or not: Downscale pasted PNG images based on metadata #29123 (review)
- The
parseIssueHref
was already written that way: Fix context popup error #17398 (comment)
To avoid unnecessary arguments and changes, I didn't use null
here.
The pathname
usage has been improved in e4c8791
I was unable to create a backport for 1.23. @wxiaoguang, please send one manually. 🍵
|
And do not handle special keys when the text-expander popup exists # Conflicts: # web_src/js/utils.test.ts
* giteaofficial/main: [skip ci] Updated translations via Crowdin Support disable passkey auth (go-gitea#33348) Update JS dependencies (go-gitea#33359) Enable Typescript `noImplicitAny` (go-gitea#33322) Remove duplicate "ResponseWriter.Status" method (go-gitea#33346) Fix code button alignment (go-gitea#33345) [skip ci] Updated translations via Crowdin Support performance trace (go-gitea#32973) Make issue suggestion work for all editors (go-gitea#33340) Fix issue count (go-gitea#33338)
And do not handle special keys when the text-expander popup exists