Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Add Fider version to Powered by Fider

Albert Nimtz8522a17c46e5
diff --git a/app/pkg/web/renderer.go b/app/pkg/web/renderer.go
index 0880701cb..a5a6e5c58 100644
--- a/app/pkg/web/renderer.go
+++ b/app/pkg/web/renderer.go
@@ -207,6 +207,7 @@ func (r *Renderer) Render(w io.Writer, statusCode int, props Props, ctx *Context
"mode": env.Config.HostMode,
"locale": locale,
"localeDirection": localeDirection,
+ "version": env.Version(),
"environment": env.Config.Environment,
"googleAnalytics": env.Config.GoogleAnalytics,
"domain": env.MultiTenantDomain(),
diff --git a/e2e/features/server/ssr.feature b/e2e/features/server/ssr.feature
index 497392ee3..c6890ecec 100644
--- a/e2e/features/server/ssr.feature
+++ b/e2e/features/server/ssr.feature
@@ -5,7 +5,7 @@ Feature: SSR
And I set the "User-Agent" header to "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
When I send the request
Then I should see http status 200
- And I should not see ">Powered by Fider ⚡</a>" on the response body
+ And I should not see ">Powered by Fider" on the response body
And I should see "This website requires JavaScript, please enable and reload the page." on the response body
And I should see "/assets/js/vendor" on the response body
@@ -14,6 +14,6 @@ Feature: SSR
And I set the "User-Agent" header to "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
When I send the request
Then I should see http status 200
- And I should see ">Powered by Fider ⚡</a>" on the response body
+ And I should see ">Powered by Fider" on the response body
And I should not see "This website requires JavaScript, please enable and reload the page." on the response body
And I should not see "/assets/js/vendor" on the response body
diff --git a/public/components/common/PoweredByFider.tsx b/public/components/common/PoweredByFider.tsx
index 791b93598..74849b7ad 100644
--- a/public/components/common/PoweredByFider.tsx
+++ b/public/components/common/PoweredByFider.tsx
@@ -1,5 +1,5 @@
import React from "react"
-import { classSet } from "@fider/services"
+import { classSet, FiderContext } from "@fider/services"
import "./PoweredByFider.scss"
@@ -9,9 +9,12 @@ interface PoweredByFiderProps {
}
export const PoweredByFider = (props: PoweredByFiderProps) => {
+ const fider = React.useContext(FiderContext)
const source = encodeURIComponent(window?.location?.host || "")
const medium = "powered-by"
const campaign = props.slot
+ const version = fider.settings?.version
+ const versionString = version && version !== "dev" ? ` v${version}` : ""
const className = classSet({
"c-powered": true,
@@ -21,7 +24,7 @@ export const PoweredByFider = (props: PoweredByFiderProps) => {
return (
<div className={className}>
<a rel="noopener" href={`https://fider.io?utm_source=${source}&utm_medium=${medium}&utm_campaign=${campaign}`} target="_blank">
- Powered by Fider ⚡
+ {`Powered by Fider${versionString} ⚡`}
</a>
</div>
)