Remove envConstants.js file
Removing because current implementations are not using this file but
directly referencing process.env.VUE_APP_* value instead.
Also removing reference to this file in the env documentation along with
the conditional template rendering section. The conditional template pattern
is something that should be avoided and currently researching ways to
dynamically generate navigation items so we can avoid this pattern.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Icbb92c423dac2b9b353c3701c330c3b9bfb00d7a
diff --git a/src/env/env.md b/src/env/env.md
index 573809d..f07375a 100644
--- a/src/env/env.md
+++ b/src/env/env.md
@@ -6,7 +6,6 @@
- [Store](#store)
- [Router](#router)
- [Theming](#theming)
-- [Conditional template rendering](#conditional-template-rendering)
- [Local development](#local-development)
- [Production build](#production-build)
@@ -100,63 +99,6 @@
);
```
-## Conditional template rendering
-
-For features that show or hide chunks of code in the template/markup, use the src/`envConstants.js` file, to determine which features are enabled/disabled depending on the `VUE_APP_ENV_NAME` value.
-
->Avoid complex v-if/v-else logic in the templates. If a template is being **heavily** modified, consider creating a separate View and [updating the router definition](#router).
-
-1. Add the environment specific feature name and value in the `envConstants.js` file
-2. Import the ENV_CONSTANTS object in the component needing conditional rendering
-3. Use v-if/else as needed in the component template
-
-Example for adding conditional navigation item to AppNavigation.vue component:
-
-`src/envConstants.js`
-
-```
-const envName = process.env.VUE_APP_ENV_NAME;
-
-export const ENV_CONSTANTS = {
- name: envName || 'openbmc',
- hmcEnabled: envName === 'openpower' ? true : false
-};
-
-```
-
-`src/components/AppNavigation/AppNavigation.vue`
-
-
-```
-<template>
-
-...
-
- <b-nav-item
- to="/access-control/hmc"
- v-if="hmcEnabled">
- HMC
- </b-nav-item>
-
-...
-
-</template>
-
-<script>
-import { ENV_CONSTANTS } from '@/envConstants.js';
-
-export default {
- data() {
- return {
- hmcEnabled: ENV_CONSTANTS.hmcEnabled
- }
- }
-}
-
-</script>
-
-```
-
## Local development
1. Add the same `VUE_APP_ENV_NAME` key value pair to your `env.development.local` file.
diff --git a/src/envConstants.js b/src/envConstants.js
deleted file mode 100644
index f9a4c3c..0000000
--- a/src/envConstants.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const envName = process.env.VUE_APP_ENV_NAME;
-
-export const ENV_CONSTANTS = {
- name: envName || 'openbmc'
-};