Skip to content

Commit 6993acc

Browse files
committed
Adds a RFC overview
1 parent 1f07b00 commit 6993acc

File tree

6 files changed

+91
-1
lines changed

6 files changed

+91
-1
lines changed

app/app-styles/app.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,50 @@
121121
position: absolute;
122122
right: var(--spacing-5);
123123
}
124+
125+
[class^="label-"] {
126+
width: 160px;
127+
height: 20px;
128+
border-radius: 24px;
129+
display: block;
130+
font-size: 12px;
131+
font-weight: 700;
132+
text-align: center;
133+
}
134+
135+
.label-proposed {
136+
color: var(--color-black);
137+
background-color: rgb(191 218 220);
138+
}
139+
140+
.label-exploring {
141+
color: var(--color-white);
142+
background-color: rgb(28 135 137);
143+
}
144+
145+
.label-accepted {
146+
color: var(--color-white);
147+
background-color: var(--color-brand-hc-dark);
148+
}
149+
150+
.label-ready-for-release {
151+
color: var(--color-white);
152+
background-color: rgb(133 13 67);
153+
}
154+
155+
.label-released {
156+
color: var(--color-white);
157+
background-color: rgb(29 62 124);
158+
}
159+
160+
.label-recommended {
161+
color: var(--color-black);
162+
background-color: rgb(80 233 187);
163+
}
164+
165+
.label-discontinued, .label-closed {
166+
color: var(--color-black);
167+
background-color: rgb(239 216 9);
168+
}
169+
170+

app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Router.map(function () {
1717
this.route('discontinued');
1818
this.route('closed');
1919
this.route('ready-for-release');
20+
this.route('library');
2021
});
2122
this.route('create-rfc');
2223
this.route('role-core-team');

app/routes/stages/library.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Route from '@ember/routing/route';
2+
3+
export default class StagesLibraryRoute extends Route {
4+
async model() {
5+
return (await import('rfcs-app-toc-builder:index.json'))
6+
.default;
7+
}
8+
}

app/templates/application.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { NavigationNarrator } from 'ember-a11y-refocus';
3030
</li>
3131
</ul>
3232
</li>
33-
<li class="toc-heading">RFC library</li>
33+
<li class="toc-heading"><LinkTo @route="stages.library">RFC library</LinkTo></li>
3434
<li class="toc-item">
3535
<ul class="table-of-contents sub-table-of-contents">
3636
<li class="toc-item">

app/templates/stages/library.gjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { pageTitle } from 'ember-page-title';
2+
import { LinkTo } from '@ember/routing';
3+
4+
<template>
5+
{{pageTitle "RFC library"}}
6+
<div>
7+
<h1>RFC library</h1>
8+
<p>The table below shows all the RFCs in chronological order. If you are interested in more information you can click on the RFC or check out the specific stages.</p>
9+
{{#each @model as |rfc|}}
10+
<div class="rfc-card"><span>#{{rfc.number}}</span><div><LinkTo
11+
@route="rfc"
12+
@model={{rfc.link}}
13+
>{{rfc.title}}</LinkTo></div><span class="label-{{rfc.stage}}">{{rfc.stage}}</span></div>
14+
{{/each}}
15+
</div>
16+
</template>

lib/toc-builder.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ function loadFcpData(contentFolder, dataFolder) {
131131
result.push(fileContents);
132132
}
133133
}
134+
// the source code for "virtual-module"
135+
return `${JSON.stringify(result, null, 2)}`;
136+
}
137+
138+
function loadIndexData(contentFolder, dataFolder) {
139+
const data = loadRFCData(contentFolder, dataFolder);
140+
141+
const result = [];
142+
143+
for (let fileContents of data) {
144+
result.push({number: fileContents.number, link: fileContents.rfcFile, title: fileContents.title,stage: fileContents.currentStage});
145+
}
134146

135147
// the source code for "virtual-module"
136148
return `${JSON.stringify(result, null, 2)}`;
@@ -168,6 +180,12 @@ export default function tocBuilder(contentFolder, dataFolder) {
168180
return loadFcpData(contentFolder, dataFolder);
169181
}
170182

183+
if (id.startsWith('rfcs-app-toc-builder:index.json')) {
184+
this.addWatchFile(contentFolder);
185+
this.addWatchFile(dataFolder);
186+
return loadIndexData(contentFolder, dataFolder);
187+
}
188+
171189
return null;
172190
},
173191
};

0 commit comments

Comments
 (0)