Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: Remove now obsolete config env var from webpack serve (#1801)

Rich Turner8d44dec463be
diff --git a/ui/app/insights/src/index.ts b/ui/app/insights/src/index.ts
index 22ffa611b..13418c262 100644
--- a/ui/app/insights/src/index.ts
+++ b/ui/app/insights/src/index.ts
@@ -4,7 +4,6 @@ import {pageViewProvider} from "./pages/page-view";
import {ManagerAppConfig} from "@openremote/model";
declare const MANAGER_URL: string | undefined;
-declare const CONFIG_URL_PREFIX: string | undefined;
const rootReducer = combineReducers({
app: appReducer
@@ -60,12 +59,6 @@ fetch(configURL).then(async (result) => {
}
}
- // Add config prefix if defined (used in dev)
- if (CONFIG_URL_PREFIX) {
- if (appConfig.manager.translationsLoadPath) {
- appConfig.manager.translationsLoadPath = CONFIG_URL_PREFIX + appConfig.manager.translationsLoadPath;
- }
- }
// Override specific for Insights app, since it doesn't require login.
// Login and logout buttons can be found in the sidebar menu of the app.
appConfig.manager.autoLogin = false;
diff --git a/ui/app/manager/src/index.ts b/ui/app/manager/src/index.ts
index abf5b5e0c..63940721c 100644
--- a/ui/app/manager/src/index.ts
+++ b/ui/app/manager/src/index.ts
@@ -47,7 +47,6 @@ import {pageAlarmsProvider} from "./pages/page-alarms";
import { ManagerAppConfig } from "@openremote/model";
import {pageGatewayTunnelProvider} from "./pages/page-gateway-tunnel";
-declare var CONFIG_URL_PREFIX: string | undefined;
declare var MANAGER_URL: string | undefined;
const rootReducer = combineReducers({
@@ -140,13 +139,6 @@ fetch(configURL).then<ManagerAppConfig>(async (result) => {
}
}
- // Add config prefix if defined (used in dev)
- if (CONFIG_URL_PREFIX) {
- if (appConfig.manager.translationsLoadPath) {
- appConfig.manager.translationsLoadPath = CONFIG_URL_PREFIX + appConfig.manager.translationsLoadPath;
- }
- }
-
orApp.managerConfig = appConfig.manager;
orApp.appConfigProvider = (manager) => {
diff --git a/ui/app/manager/src/pages/page-configuration.ts b/ui/app/manager/src/pages/page-configuration.ts
index 6809bab23..37884dedd 100644
--- a/ui/app/manager/src/pages/page-configuration.ts
+++ b/ui/app/manager/src/pages/page-configuration.ts
@@ -37,7 +37,6 @@ import {OrConfPanel} from "../components/configuration/or-conf-panel";
import { InputType } from "@openremote/or-mwc-components/or-mwc-input";
import {DefaultHeaderMainMenu, DefaultHeaderSecondaryMenu, DefaultRealmConfig} from "../index";
-declare const CONFIG_URL_PREFIX: string;
declare const MANAGER_URL: string | undefined;
declare const APP_VERSION: string;
@@ -172,8 +171,6 @@ export class PageConfiguration extends Page<AppStateKeyed> {
@query("#managerConfig-panel")
protected realmConfigPanel?: OrConfPanel;
- private readonly urlPrefix: string = (CONFIG_URL_PREFIX || "")
-
/* ------------------------------------------ */
diff --git a/ui/app/manager/webpack.config.js b/ui/app/manager/webpack.config.js
index 78b88eb27..42b66dd10 100644
--- a/ui/app/manager/webpack.config.js
+++ b/ui/app/manager/webpack.config.js
@@ -5,39 +5,12 @@ const packageJson = require('./package.json');
module.exports = (env, argv) => {
- const customConfigDir = env.config;
const managerUrl = env.managerUrl;
const keycloakUrl = env.keycloakUrl;
const port = env.port;
const IS_DEV_SERVER = !!process.argv.find(arg => arg.includes("serve"));
-
- if (IS_DEV_SERVER) {
- console.log("");
- console.log("To set a path to a custom manager_config.json use the config environment argument with a path");
- console.log("relative to this app e.g: ");
- console.log("");
- console.log("npm run serve -- --env config=../../../manager_config.json");
- console.log("");
- }
-
const config = util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname, managerUrl, keycloakUrl, port);
- if (IS_DEV_SERVER) {
- console.log("CUSTOM_CONFIG_DIR: " + customConfigDir || "");
- console.log("");
- }
-
- if (IS_DEV_SERVER && customConfigDir) {
- // Try and include the static files in the specified config dir if we're in dev server mode
- config.plugins.push(new CopyWebpackPlugin({
- patterns: [
- {
- from: customConfigDir
- }
- ]
- }));
- }
-
if (IS_DEV_SERVER) {
config.performance = {
hints: false
@@ -47,7 +20,6 @@ module.exports = (env, argv) => {
// Add a custom base URL to resolve the config dir to the path of the dev server not root
config.plugins.push(
new webpack.DefinePlugin({
- CONFIG_URL_PREFIX: JSON.stringify(IS_DEV_SERVER && customConfigDir ? "/manager" : ""),
APP_VERSION: JSON.stringify(packageJson.version)
})
);