Skip to content

Commit

Permalink
Merge pull request #8 from empress/data-layout
Browse files Browse the repository at this point in the history
Add stages and teams models and data processing
  • Loading branch information
locks authored Apr 28, 2022
2 parents 0011beb + 4fb8ecb commit d5f4433
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 1 deletion.
10 changes: 10 additions & 0 deletions addon/models/rfc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ const { Model } = DS;
export default Model.extend({
content: DS.attr(),
html: DS.attr(),

startDate: DS.attr('date'),
releaseDate: DS.attr('date'),
releaseVersions: DS.attr(),
proposalPr: DS.attr(),
trackingLink: DS.attr(),


teams: DS.hasMany('team'),
stage: DS.belongsTo('stage'),
});
8 changes: 8 additions & 0 deletions addon/models/stage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import DS from 'ember-data';
const { Model } = DS;

export default Model.extend({
content: DS.attr(),
html: DS.attr(),
name: DS.attr(),
});
8 changes: 8 additions & 0 deletions addon/models/team.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import DS from 'ember-data';
const { Model } = DS;

export default Model.extend({
content: DS.attr(),
html: DS.attr(),
name: DS.attr(),
});
5 changes: 5 additions & 0 deletions addon/serializers/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DS from 'ember-data';

export default DS.JSONAPISerializer.extend({
keyForAttribute(key) { return key; }
});
1 change: 1 addition & 0 deletions app/models/stage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'rfc-process/models/stage';
1 change: 1 addition & 0 deletions app/models/team.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'rfc-process/models/team';
1 change: 1 addition & 0 deletions app/serializers/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'rfc-process/serializers/application';
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ module.exports = {
references: ['teams', 'stage']
});

const teamsJSON = new StaticSiteJson(join(dataDirectory, 'teams'), {
contentFolder: 'teams',
type: 'teams',
attributes: ['name'],
});

const stagesJSON = new StaticSiteJson(join(dataDirectory, 'stages'), {
contentFolder: 'stages',
type: 'stages',
attributes: ['name'],
});

const readmeFile = funnel(dataDirectory, {
files: ['README.md']
});
Expand All @@ -77,7 +89,7 @@ module.exports = {

const tocFile = writeFile('/tocs/rfc.json', JSON.stringify(TocSerializer.serialize({ id: 'rfc', links: rfcs })));

const trees = [rfcsJSON, tocFile, pagesJSON]
const trees = [rfcsJSON, teamsJSON, stagesJSON, tocFile, pagesJSON]

if(existsSync(join(dataDirectory, 'images'))) {
const images = funnel(join(dataDirectory, 'images'), {
Expand Down
3 changes: 3 additions & 0 deletions tests/dummy/stages/ready-for-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
name: Ready For Release
---
3 changes: 3 additions & 0 deletions tests/dummy/teams/framework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
name: Framework
---
3 changes: 3 additions & 0 deletions tests/dummy/teams/learning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
name: Learning
---

0 comments on commit d5f4433

Please sign in to comment.