- Notifications
You must be signed in to change notification settings - Fork928
fix: make default support links respect --docs-url#14176
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from5 commits
c1758fa
e95fb05
af9af96
f9dfb4e
466004d
c92370b
a756f3a
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,36 +10,51 @@ type Fetcher interface { | ||
Fetch(ctx context.Context) (codersdk.AppearanceConfig, error) | ||
} | ||
func DefaultSupportLinks(docsURL string) []codersdk.LinkConfig { | ||
if docsURL == "" { | ||
docsURL = "https://coder.com/docs/{CODER_VERSION}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. You could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yeah I was taking a "do as the Romans do" approach and doing it the way the build info was done, but I agree with your comment below that we have this info on the backend so we might as well do it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Looks like we can just have the backend do this :) | ||
} | ||
docsLink := codersdk.LinkConfig{ | ||
Name: "Documentation", | ||
Target:docsURL, | ||
Icon: "docs", | ||
} | ||
defaultSupportLinks := []codersdk.LinkConfig{ | ||
{ | ||
Name: "Report a bug", | ||
Target: "https://github.com/coder/coder/issues/new?labels=needs+grooming&body={CODER_BUILD_INFO}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I know you didn't introduce this, but I think we should be doing this replacement on the backend, not the frontend. We already should have this info anyways. | ||
Icon: "bug", | ||
}, | ||
{ | ||
Name: "Join the Coder Discord", | ||
Target: "https://coder.com/chat?utm_source=coder&utm_medium=coder&utm_campaign=server-footer", | ||
Icon: "chat", | ||
}, | ||
{ | ||
Name: "Star the Repo", | ||
Target: "https://github.com/coder/coder", | ||
Icon: "star", | ||
}, | ||
} | ||
return append([]codersdk.LinkConfig{docsLink}, defaultSupportLinks...) | ||
} | ||
type AGPLFetcher struct { | ||
docsURL string | ||
} | ||
func (fAGPLFetcher) Fetch(context.Context) (codersdk.AppearanceConfig, error) { | ||
return codersdk.AppearanceConfig{ | ||
AnnouncementBanners: []codersdk.BannerConfig{}, | ||
SupportLinks: DefaultSupportLinks(f.docsURL), | ||
}, nil | ||
} | ||
func NewDefaultFetcher(docsURL string) Fetcher { | ||
return &AGPLFetcher{ | ||
docsURL: docsURL, | ||
} | ||
} |
Uh oh!
There was an error while loading.Please reload this page.