Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions app/app-styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,50 @@
position: absolute;
right: var(--spacing-5);
}

[class^="label-"] {
width: 160px;
height: 20px;
border-radius: 24px;
display: block;
font-size: 12px;
font-weight: 700;
text-align: center;
}

.label-proposed {
color: var(--color-black);
background-color: rgb(191 218 220);
}

.label-exploring {
color: var(--color-white);
background-color: rgb(28 135 137);
}

.label-accepted {
color: var(--color-white);
background-color: var(--color-brand-hc-dark);
}

.label-ready-for-release {
color: var(--color-white);
background-color: rgb(133 13 67);
}

.label-released {
color: var(--color-white);
background-color: rgb(29 62 124);
}

.label-recommended {
color: var(--color-black);
background-color: rgb(80 233 187);
}

.label-discontinued, .label-closed {
color: var(--color-black);
background-color: rgb(239 216 9);
}


1 change: 1 addition & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Router.map(function () {
this.route('discontinued');
this.route('closed');
this.route('ready-for-release');
this.route('library');
});
this.route('create-rfc');
this.route('role-core-team');
Expand Down
8 changes: 8 additions & 0 deletions app/routes/stages/library.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Route from '@ember/routing/route';

export default class StagesLibraryRoute extends Route {
async model() {
return (await import('rfcs-app-toc-builder:index.json'))
.default;
}
}
2 changes: 1 addition & 1 deletion app/templates/application.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { NavigationNarrator } from 'ember-a11y-refocus';
</li>
</ul>
</li>
<li class="toc-heading">RFC library</li>
<li class="toc-heading"><LinkTo @route="stages.library">RFC library</LinkTo></li>
<li class="toc-item">
<ul class="table-of-contents sub-table-of-contents">
<li class="toc-item">
Expand Down
16 changes: 16 additions & 0 deletions app/templates/stages/library.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { pageTitle } from 'ember-page-title';
import { LinkTo } from '@ember/routing';

<template>
{{pageTitle "RFC library"}}
<div>
<h1>RFC library</h1>
<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>
{{#each @model as |rfc|}}
<div class="rfc-card"><span>#{{rfc.number}}</span><div><LinkTo
@route="rfc"
@model={{rfc.link}}
>{{rfc.title}}</LinkTo></div><span class="label-{{rfc.stage}}">{{rfc.stage}}</span></div>
{{/each}}
</div>
</template>
18 changes: 18 additions & 0 deletions lib/toc-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ function loadFcpData(contentFolder, dataFolder) {
result.push(fileContents);
}
}
// the source code for "virtual-module"
return `${JSON.stringify(result, null, 2)}`;
}

function loadIndexData(contentFolder, dataFolder) {
const data = loadRFCData(contentFolder, dataFolder);

const result = [];

for (let fileContents of data) {
result.push({number: fileContents.number, link: fileContents.rfcFile, title: fileContents.title,stage: fileContents.currentStage});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we're showing proposed things we won't always have a link to the rfcFile 🤔 should we also be exposing github links? what is the UX around this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I think we might want to add the GitHub links as a seperate thing (with the open external link icon) so that it's clearer what a link means.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea I agree, but I think it's probably fine to default to linking to the actual RFC when it's available 👍

}

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

if (id.startsWith('rfcs-app-toc-builder:index.json')) {
this.addWatchFile(contentFolder);
this.addWatchFile(dataFolder);
return loadIndexData(contentFolder, dataFolder);
}

return null;
},
};
Expand Down
Loading