feat(PageHelp): make PageHelp messages configurable

This commit is contained in:
Danny Koppenhagen
2021-10-26 20:12:45 +02:00
committed by Bastian
parent 265a8318b0
commit 1e3433274b
4 changed files with 17 additions and 7 deletions

View File

@@ -42,6 +42,7 @@
] ]
} }
], ],
"quadrantsPreDescription": "The quadrants are:",
"quadrants": [ "quadrants": [
{ {
"name": "Languages and Frameworks", "name": "Languages and Frameworks",
@@ -60,6 +61,7 @@
"description": "(including AOE internal Services): Here we include infrastructure platforms and services. We also use this category to communicate news about AOE services that we want all AOE teams to be aware of." "description": "(including AOE internal Services): Here we include infrastructure platforms and services. We also use this category to communicate news about AOE services that we want all AOE teams to be aware of."
} }
], ],
"ringsPreDescription": "Each of the items is classified in one of these rings:",
"rings": [ "rings": [
{ {
"name": "Adopt", "name": "Adopt",
@@ -82,7 +84,8 @@
"href": "https://github.com/AOEpeople/aoe_technology_radar", "href": "https://github.com/AOEpeople/aoe_technology_radar",
"name": "AOE Tech Radar on Github", "name": "AOE Tech Radar on Github",
"description": "Contributions and source code of the AOE Tech Radar are on github:" "description": "Contributions and source code of the AOE Tech Radar are on github:"
} },
"headlinePrefix": "How to use the"
}, },
"pageOverview": { "pageOverview": {
"title": "Technologies Overview" "title": "Technologies Overview"

View File

@@ -42,6 +42,7 @@
] ]
} }
], ],
"quadrantsPreDescription": "The quadrants are:",
"quadrants": [ "quadrants": [
{ {
"name": "Languages and Frameworks", "name": "Languages and Frameworks",
@@ -60,6 +61,7 @@
"description": "(including AOE internal Services): Here we include infrastructure platforms and services. We also use this category to communicate news about AOE services that we want all AOE teams to be aware of." "description": "(including AOE internal Services): Here we include infrastructure platforms and services. We also use this category to communicate news about AOE services that we want all AOE teams to be aware of."
} }
], ],
"ringsPreDescription": "Each of the items is classified in one of these rings:",
"rings": [ "rings": [
{ {
"name": "Adopt", "name": "Adopt",
@@ -82,7 +84,8 @@
"href": "https://github.com/AOEpeople/aoe_technology_radar", "href": "https://github.com/AOEpeople/aoe_technology_radar",
"name": "AOE Tech Radar on Github", "name": "AOE Tech Radar on Github",
"description": "Contributions and source code of the AOE Tech Radar are on github:" "description": "Contributions and source code of the AOE Tech Radar are on github:"
} },
"headlinePrefix": "How to use the"
}, },
"pageOverview": { "pageOverview": {
"title": "Technologies Overview" "title": "Technologies Overview"

View File

@@ -14,11 +14,12 @@ const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
const { pageHelp } = useMessages(); const { pageHelp } = useMessages();
if (pageHelp) { if (pageHelp) {
const { paragraphs, quadrants, rings, sourcecodeLink } = pageHelp; const { paragraphs, quadrants, rings, sourcecodeLink, headlinePrefix, quadrantsPreDescription, ringsPreDescription } = pageHelp;
const title = `${headlinePrefix || 'How to use the'} ${radarName}`;
return ( return (
<Fadeable leaving={leaving} onLeave={onLeave}> <Fadeable leaving={leaving} onLeave={onLeave}>
<SetTitle title={"How to use the " + radarName} /> <SetTitle title={title}/>
<HeroHeadline>How to use the {radarName}</HeroHeadline> <HeroHeadline>{title}</HeroHeadline>
<div className="fullpage-content"> <div className="fullpage-content">
{paragraphs.map(({ headline, values }) => ( {paragraphs.map(({ headline, values }) => (
<React.Fragment key={headline}> <React.Fragment key={headline}>
@@ -29,7 +30,7 @@ const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
</React.Fragment> </React.Fragment>
))} ))}
<p>The quadrants are:</p> <p>{quadrantsPreDescription ?? "The quadrants are:"}</p>
<ul> <ul>
{quadrants.map(({ name, description }) => ( {quadrants.map(({ name, description }) => (
<li key={name}> <li key={name}>
@@ -38,7 +39,7 @@ const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
))} ))}
</ul> </ul>
<p>Each of the items is classified in one of these rings:</p> <p>{ringsPreDescription ?? "Each of the items is classified in one of these rings:"}</p>
<ul> <ul>
{rings.map(({ name, description }) => ( {rings.map(({ name, description }) => (
<li key={name}> <li key={name}>

View File

@@ -18,13 +18,16 @@ interface Paragraph {
interface PageHelp { interface PageHelp {
paragraphs: Paragraph[]; paragraphs: Paragraph[];
quadrantsPreDescription?: string;
quadrants: Quadrant[]; quadrants: Quadrant[];
rings: Ring[]; rings: Ring[];
ringsPreDescription?: string;
sourcecodeLink?: { sourcecodeLink?: {
href: string; href: string;
name: string; name: string;
description: string; description: string;
}; };
headlinePrefix?: string
} }
interface PageOverview { interface PageOverview {