fix RADAR_NAME env variable

This commit is contained in:
dennis.ludwig
2021-06-15 13:03:31 +02:00
parent 897bd5a084
commit 61d7fa38f2
9 changed files with 20 additions and 58 deletions

2
.env
View File

@@ -1,2 +1,2 @@
RADAR_NAME=AOE Technology Radar REACT_APP_RADAR_NAME=AOE Technology Radar
PUBLIC_URL=/techradar PUBLIC_URL=/techradar

View File

@@ -56,7 +56,7 @@ cp -r build techradar
You can customize the following parts of the tech radar. You can customize the following parts of the tech radar.
### Change title, description and headline ### Change title, description and headline
Set the environment variable `RADAR_NAME`. The default is "AOE Technology Radar". Set the environment variable `REACT_APP_RADAR_NAME`. The default is "AOE Technology Radar".
### Host the application under a sub path ### Host the application under a sub path
To host the application under a sub path, set the environment variable `PUBLIC_URL`, e.g. "/techradar". To host the application under a sub path, set the environment variable `PUBLIC_URL`, e.g. "/techradar".

View File

@@ -1,7 +1,7 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.assetUrl = exports.isMobileViewport = exports.translate = exports.showEmptyRings = exports.getItemPageNames = exports.rings = exports.quadrants = exports.radarNameShort = exports.radarName = void 0; exports.assetUrl = exports.isMobileViewport = exports.translate = exports.showEmptyRings = exports.getItemPageNames = exports.rings = exports.quadrants = exports.radarNameShort = exports.radarName = void 0;
exports.radarName = process.env.RADAR_NAME || "AOE Technology Radar"; exports.radarName = process.env.REACT_APP_RADAR_NAME || "AOE Technology Radar";
exports.radarNameShort = exports.radarName; exports.radarNameShort = exports.radarName;
exports.quadrants = [ exports.quadrants = [
"languages-and-frameworks", "languages-and-frameworks",

View File

@@ -16,9 +16,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
return to; return to;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getFirstLetter = exports.groupByFirstLetter = exports.groupByQuadrants = exports.featuredOnly = void 0; exports.getFirstLetter = exports.groupByFirstLetter = exports.groupByQuadrants = exports.unfeaturedOnly = exports.featuredOnly = void 0;
var featuredOnly = function (items) { return items.filter(function (item) { return item.featured; }); }; var featuredOnly = function (items) {
return items.filter(function (item) { return item.featured; });
};
exports.featuredOnly = featuredOnly; exports.featuredOnly = featuredOnly;
var unfeaturedOnly = function (items) {
return items.filter(function (item) { return !item.featured; });
};
exports.unfeaturedOnly = unfeaturedOnly;
var groupByQuadrants = function (items) { var groupByQuadrants = function (items) {
return items.reduce(function (quadrants, item) { return items.reduce(function (quadrants, item) {
var _a; var _a;
@@ -52,5 +58,7 @@ var addItemToRing = function (ring, item) {
if (ring === void 0) { ring = []; } if (ring === void 0) { ring = []; }
return __spreadArray(__spreadArray([], ring), [item]); return __spreadArray(__spreadArray([], ring), [item]);
}; };
var getFirstLetter = function (item) { return item.title.substr(0, 1).toUpperCase(); }; var getFirstLetter = function (item) {
return item.title.substr(0, 1).toUpperCase();
};
exports.getFirstLetter = getFirstLetter; exports.getFirstLetter = getFirstLetter;

View File

@@ -16,6 +16,7 @@
}, },
"scripts": { "scripts": {
"prepare": "husky install && yarn build:scripts", "prepare": "husky install && yarn build:scripts",
"start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"build:scripts": "tsc --project tsconfig.scripts.json", "build:scripts": "tsc --project tsconfig.scripts.json",
"test": "react-scripts test", "test": "react-scripts test",

View File

@@ -4,15 +4,15 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="%RADAR_NAME%" /> <meta name="description" content="%REACT_APP_RADAR_NAME%" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.svg" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.svg" />
<meta property="og:title" content="%RADAR_NAME%" /> <meta property="og:title" content="%REACT_APP_RADAR_NAME%" />
<meta property="og:image" content="%PUBLIC_URL%/logo.svg" /> <meta property="og:image" content="%PUBLIC_URL%/logo.svg" />
<meta name="format-detection" content="telephone=no" /> <meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=0" /> <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=0" />
<title>%RADAR_NAME%</title> <title>%REACT_APP_RADAR_NAME%</title>
</head> </head>
<body> <body>

View File

@@ -1,35 +0,0 @@
export var radarName = process.env.RADAR_NAME || 'AOE Technology Radar';
export var radarNameShort = radarName;
export var quadrants = [
'languages-and-frameworks',
'methods-and-patterns',
'platforms-and-aoe-services',
'tools',
];
export var rings = [
'all',
'adopt',
'trial',
'assess',
'hold'
];
export var getItemPageNames = function (items) { return items.map(function (item) { return item.quadrant + "/" + item.name; }); };
export var showEmptyRings = false;
var messages = {
'languages-and-frameworks': 'Languages & Frameworks',
'methods-and-patterns': 'Methods & Patterns',
'platforms-and-aoe-services': 'Platforms and Operations',
'tools': 'Tools',
};
export var translate = function (key) { return (messages[key] || '-'); };
export function isMobileViewport() {
// return false for server side rendering
if (typeof window == 'undefined')
return false;
var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
return width < 1200;
}
export function assetUrl(file) {
return process.env.PUBLIC_URL + '/' + file;
// return `/techradar/assets/${file}`
}

View File

@@ -1,6 +1,7 @@
import { Item } from "./model"; import { Item } from "./model";
export const radarName = process.env.RADAR_NAME || "AOE Technology Radar"; export const radarName =
process.env.REACT_APP_RADAR_NAME || "AOE Technology Radar";
export const radarNameShort = radarName; export const radarNameShort = radarName;
export const quadrants = [ export const quadrants = [

View File

@@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}