MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)
* Generate and use an interface instead of *App
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
66fc096768
Коммит
17523fa5d9
@@ -44,7 +44,7 @@ type SystemBrowser struct {
|
||||
MakeDefaultString string
|
||||
}
|
||||
|
||||
func renderUnsupportedBrowser(app *app.App, w http.ResponseWriter, r *http.Request) {
|
||||
func renderUnsupportedBrowser(app app.AppIface, w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
page := utils.NewHTMLTemplate(app.HTMLTemplates(), "unsupported_browser")
|
||||
|
||||
@@ -88,7 +88,7 @@ func renderUnsupportedBrowser(app *app.App, w http.ResponseWriter, r *http.Reque
|
||||
page.RenderToWriter(w)
|
||||
}
|
||||
|
||||
func renderMattermostAppMac(app *app.App) MattermostApp {
|
||||
func renderMattermostAppMac(app app.AppIface) MattermostApp {
|
||||
return MattermostApp{
|
||||
"/static/images/browser-icons/mac.png",
|
||||
app.T("web.error.unsupported_browser.download_the_app"),
|
||||
@@ -100,7 +100,7 @@ func renderMattermostAppMac(app *app.App) MattermostApp {
|
||||
}
|
||||
}
|
||||
|
||||
func renderMattermostAppWindows(app *app.App) MattermostApp {
|
||||
func renderMattermostAppWindows(app app.AppIface) MattermostApp {
|
||||
return MattermostApp{
|
||||
"/static/images/browser-icons/windows.svg",
|
||||
app.T("web.error.unsupported_browser.download_the_app"),
|
||||
@@ -112,7 +112,7 @@ func renderMattermostAppWindows(app *app.App) MattermostApp {
|
||||
}
|
||||
}
|
||||
|
||||
func renderBrowserChrome(app *app.App) Browser {
|
||||
func renderBrowserChrome(app app.AppIface) Browser {
|
||||
return Browser{
|
||||
"/static/images/browser-icons/chrome.svg",
|
||||
app.T("web.error.unsupported_browser.browser_title.chrome"),
|
||||
@@ -122,7 +122,7 @@ func renderBrowserChrome(app *app.App) Browser {
|
||||
}
|
||||
}
|
||||
|
||||
func renderBrowserFirefox(app *app.App) Browser {
|
||||
func renderBrowserFirefox(app app.AppIface) Browser {
|
||||
return Browser{
|
||||
"/static/images/browser-icons/firefox.svg",
|
||||
app.T("web.error.unsupported_browser.browser_title.firefox"),
|
||||
@@ -132,7 +132,7 @@ func renderBrowserFirefox(app *app.App) Browser {
|
||||
}
|
||||
}
|
||||
|
||||
func renderBrowserSafari(app *app.App) Browser {
|
||||
func renderBrowserSafari(app app.AppIface) Browser {
|
||||
return Browser{
|
||||
"/static/images/browser-icons/safari.svg",
|
||||
app.T("web.error.unsupported_browser.browser_title.safari"),
|
||||
@@ -142,7 +142,7 @@ func renderBrowserSafari(app *app.App) Browser {
|
||||
}
|
||||
}
|
||||
|
||||
func renderSystemBrowserEdge(app *app.App, r *http.Request) SystemBrowser {
|
||||
func renderSystemBrowserEdge(app app.AppIface, r *http.Request) SystemBrowser {
|
||||
return SystemBrowser{
|
||||
"/static/images/browser-icons/edge.svg",
|
||||
app.T("web.error.unsupported_browser.browser_title.edge"),
|
||||
|
||||
Ссылка в новой задаче
Block a user