Skip to content

Commit 52d93ff

Browse files
committed
use different approach for setting version
1 parent ab13272 commit 52d93ff

File tree

8 files changed

+18
-11
lines changed

8 files changed

+18
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
env:
2828
CI: false
2929
run: |
30-
cd hub/gads-ui && npm install && npm run build --verbose
31-
echo "{\"version\": \"${{ github.ref_name }}\"}" > hub/gads-ui/build/version.json
30+
cd hub/gads-ui && npm install && REACT_APP_VERSION=${{ github.ref_name }} npm run build --verbose
3231
3332
- name: Build binaries
3433
run: |

common/models/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ type HubConfig struct {
3737
SeleniumGridInstance string `json:"selenium_grid_instance"`
3838
OSTempDir string `json:"-"`
3939
UIFilesTempDir string `json:"-"`
40-
CurrentVersion string `json:"-"`
4140
}

hub/gads-ui/.env

Whitespace-only changes.

hub/gads-ui/.env.production

Lines changed: 0 additions & 1 deletion
This file was deleted.

hub/gads-ui/src/components/Login/Login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function Login() {
5050
})
5151
}
5252

53-
let gadsVersion = localStorage.getItem('gadsVersion')
53+
let gadsVersion = localStorage.getItem('gadsVersion') || 'unknown'
5454

5555
return (
5656
<div className="top-wrapper">

hub/gads-ui/src/components/TopNavigationBar/TopNavigationBar.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { NavLink } from 'react-router-dom'
44
import { Auth } from '../../contexts/Auth'
55
import Button from '@mui/material/Button'
66
import { api } from '../../services/api.js'
7-
import versionData from "../../version.json";
87

98
export default function NavBar() {
109
const {userName} = useContext(Auth)
@@ -19,7 +18,7 @@ export default function NavBar() {
1918
}
2019
}
2120

22-
let appVersion = localStorage.getItem('gadsVersion')
21+
let appVersion = localStorage.getItem('gadsVersion') || 'unknown'
2322

2423
return (
2524
<div
@@ -47,11 +46,23 @@ export default function NavBar() {
4746
/>
4847
)}
4948
</nav>
50-
<div>V: {appVersion}</div>
49+
<div
50+
style={{
51+
backgroundColor: '#2f3b26'
52+
}}
53+
>
54+
<div
55+
style={{
56+
fontWeight: 'bold',
57+
color: '#829476',
58+
padding: '5px',
59+
}}
60+
>{appVersion.startsWith('v') ? appVersion : "DEV"}</div>
61+
</div>
5162
<div
5263
className="social-buttons-wrapper"
5364
>
54-
<p style={{ fontWeight: "bold"}}>Welcome, {userName}</p>
65+
<p style={{fontWeight: "bold"}}>Welcome, {userName}</p>
5566
<KoFiButton></KoFiButton>
5667
<GithubButton></GithubButton>
5768
<DiscordButton></DiscordButton>

hub/hub.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ func StartHub(flags *pflag.FlagSet, appVersion string) {
5757
MongoDB: mongoDB,
5858
OSTempDir: osTempDir,
5959
UIFilesTempDir: uiFilesTempDir,
60-
CurrentVersion: appVersion,
6160
}
6261

6362
devices.ConfigData = &config

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func main() {
2121
Use: "hub",
2222
Short: "Run a hub component",
2323
Run: func(cmd *cobra.Command, args []string) {
24-
hub.StartHub(cmd.Flags(), AppVersion)
24+
hub.StartHub(cmd.Flags())
2525
},
2626
}
2727
hubCmd.Flags().String("ui-files-dir", "", "Directory where the UI static files will be unpacked and served from."+

0 commit comments

Comments
 (0)