Files
stf/res/app/app.js
Matan Baruch 4e26101a95 feat: Display STF version in Web UI (#858)
* feat: Display STF version in Web UI

Adds the STF application version to the main menu in the Web UI.

Changes:
- Modified `lib/units/app/index.js` to read the version from `package.json` and make it available to the frontend via the `GLOBAL_APPSTATE.config.stfVersion` variable.
- Updated `res/app/menu/menu.pug` to display this version in the top navigation bar, near the help icon. The format is "vX.Y.Z".
- Added an E2E test (`res/test/e2e/menu/menu-spec.js`) to verify the presence and correct format of the version string in the UI.

Signed-off-by: matanbaruch <matan.baruch@unity3d.com>

* Update menu-spec.js

Signed-off-by: matanbaruch <matan.baruch@unity3d.com>

* fix: lint

Signed-off-by: matanbaruch <matan.baruch@unity3d.com>

* feat: Add application state to root scope and style version text in menu

- Introduced a new run block in `app.js` to attach the application state to the `$rootScope`.
- Added CSS styles for the version text in the menu to enhance its visibility and layout.

Signed-off-by: matanbaruch <matan.baruch@unity3d.com>

* fix: Correct path to package.json in index.js

Updated the import statement for package.json in lib/units/app/index.js to use the correct relative path, ensuring proper access to the application version information.

Signed-off-by: matanbaruch <matan.baruch@unity3d.com>

---------

Signed-off-by: matanbaruch <matan.baruch@unity3d.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-05-23 12:31:20 +02:00

43 lines
1.1 KiB
JavaScript

/**
* Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
**/
require.ensure([], function(require) {
require('angular')
require('angular-route')
require('angular-touch')
angular.module('app', [
'ngRoute',
'ngTouch',
require('gettext').name,
require('angular-hotkeys').name,
require('./layout').name,
require('./device-list').name,
require('./group-list').name,
require('./control-panes').name,
require('./menu').name,
require('./settings').name,
require('./docs').name,
require('./user').name,
require('./../common/lang').name,
require('stf/standalone').name,
require('./group-list').name
])
.config(function($routeProvider, $locationProvider) {
$locationProvider.hashPrefix('!')
$routeProvider
.otherwise({
redirectTo: '/devices'
})
})
.config(function(hotkeysProvider) {
hotkeysProvider.templateTitle = 'Keyboard Shortcuts:'
})
.run(['$rootScope', 'AppState', function($rootScope, AppState) {
$rootScope.state = AppState
}])
})