--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/components/discourses-component.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,110 @@
+import Ember from 'ember';
+import d3 from 'd3';
+import env from 'app-client/config/environment';
+
+
+
+export default Ember.Component.extend({
+
+ constants: Ember.inject.service(),
+
+ init: function() {
+ this._super(...arguments);
+ },
+
+ didRender: function() {
+ var self = this;
+ var baseURL = env.baseURL.replace(/\/$/,"")+'/api/v1';
+
+ d3.json(baseURL + "/discourses", function(discourses) {
+ console.log(discourses);
+
+ var width = self.$().parent().width();
+ var height = self.$().parent().height();
+
+ var bubble = d3.layout.pack()
+ .sort(null)
+ .size([width, height])
+ .padding(33);
+
+ var element = d3.select('#' + self.get('elementId'));
+
+ var svg = element.append("svg")
+ .attr("width", width)
+ .attr("height", height)
+ .attr("class", "bubble");
+
+ var nodes = svg.selectAll(".node")
+ .data(bubble.nodes(self.createNodes(discourses)))
+ .enter().append("g")
+ .attr("width", function(d) { return 2.5 * d.r + 'px'; })
+ .attr("class", function(d) { return "node" + (!d.children ? " leaf" : ""); })
+ .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })
+ .style("font-size", function(d) { return Math.max(13, d.r / 2) + 'px'; });
+
+
+ var leaf = svg.selectAll(".leaf")
+ .on('click', function(d) { document.location = self.setQueryString('discours', d.name); });
+
+ leaf.append("circle")
+ .attr("r", function(d) { return d.r; })
+ .attr("fill", function(d) { return d.fill; })
+ .attr("stroke", function(d) { return "#000"; });
+
+ leaf.append("text")
+ .attr("dy", ".3em")
+ .style("text-anchor", "middle")
+ .text(function(d) { return d.name; });
+
+ element.style("height", height + "px");
+ });
+
+ this._super(...arguments);
+ },
+
+ createNodes: function(json) {
+ var self = this;
+ var nodes = {};
+ var children = {};
+
+ Object.keys(json).forEach(function(key) {
+ var discourse = json[key];
+ var index = self.get('constants').DISCOURSES[key];
+ var category = self.get('constants').DISCOURSE_CATEGORIES[index];
+
+ children[index] = children[index] || {};
+ children[index]['name'] = index;
+ children[index]['children'] = children[index]['children'] || [];
+ children[index]['children'].push({ "name": discourse.label, "value": discourse.count, "fill": category.fill });
+ });
+
+ nodes.children = [];
+ Object.keys(children).forEach(function(key) {
+ nodes.children.push(children[key]);
+ });
+
+ return nodes;
+ },
+
+ setQueryString: function(field, value) {
+ var hash = document.location.href.split('?');
+ var query_parameters = hash.pop();
+
+ // Unserialize
+ var parameters = [];
+ query_parameters.split('&').forEach(function(parameter){
+ var object = parameter.split('=');
+ object[1] && (parameters[object[0]] = object[1]);
+ });
+
+ // Serialize
+ var string = [];
+ parameters[field] = encodeURI(value);
+ Object.keys(parameters).forEach(function(key) {
+ string.push(key + '=' + parameters[key]);
+ });
+
+ return hash + '?' + string.join('&');
+ }
+
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/components/filtering-component.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,25 @@
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+
+ filter: '',
+
+ filteredThemes: Ember.computed.filter('themes', function(item) {
+ return this.get('filter') && (item.get('label') || '').match(this.get('filter'));
+ }).property('filter'),
+
+ actions: {
+
+ setQueryParameters: function(id) {
+ this.get('setQueryParameters')(id);
+ },
+
+ filterBy: function(input) {
+ this.set('filter', input && new RegExp('^' + input));
+ this.get('filteredThemes');
+ }
+
+ }
+
+
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/components/sorting-component.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,26 @@
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+
+ sorting: [],
+ sortedThemes: Ember.computed.sort('themes', 'sorting'),
+
+ minimum: Ember.computed('themes', function() { return Math.min(...this.themes.mapBy('count')); }),
+
+ maximum: Ember.computed('themes', function() { return Math.max(...this.themes.mapBy('count')); }),
+
+ actions: {
+
+
+ setQueryParameters: function(id) {
+ this.get('setQueryParameters')(id);
+ },
+
+ sortBy: function (type) {
+ this.set('sorting', type === 'popularity' ? ['count:desc'] : ['label']);
+ this.get('sortedThemes');
+ }
+
+ }
+
+});
--- a/cms/app-client/app/controllers/tabs/discours.js Tue Jun 07 01:16:31 2016 +0200
+++ b/cms/app-client/app/controllers/tabs/discours.js Tue Jun 07 12:00:40 2016 +0200
@@ -1,9 +1,5 @@
import Ember from 'ember';
export default Ember.Controller.extend({
- actions: {
- updateUrl: function(selection){
- this.transitionToRoute({queryParams: {discours: selection}});
- }
- }
+
});
--- a/cms/app-client/app/controllers/tabs/thematiques.js Tue Jun 07 01:16:31 2016 +0200
+++ b/cms/app-client/app/controllers/tabs/thematiques.js Tue Jun 07 12:00:40 2016 +0200
@@ -1,9 +1,12 @@
import Ember from 'ember';
export default Ember.Controller.extend({
- actions: {
- updateUrl: function(selection){
- this.transitionToRoute({queryParams: {thematique: selection}});
+
+ actions: {
+
+ transitionTo: function(id){
+ this.transitionToRoute({queryParams: {thematique: id}});
+ }
+
}
- }
});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/helpers/popularity.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,15 @@
+import Ember from 'ember';
+
+export function popularity([target, minimum, maximum]) {
+ var classname = ['not-popular', 'popular', 'very-popular'];
+ var interval = ( maximum - minimum ) / classname.length;
+
+ var i = 0;
+ while( target > minimum + ( interval * ( i + 1 ) ) ) {
+ i ++;
+ }
+
+ return classname[i];
+}
+
+export default Ember.Helper.helper(popularity);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/models/discourse.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,5 @@
+import Model from 'ember-data/model';
+
+export default Model.extend({
+
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/models/theme.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,9 @@
+import Model from 'ember-data/model';
+import attr from 'ember-data/attr';
+
+export default Model.extend({
+
+ label: attr('string'),
+ count: attr('number')
+
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/routes/tabs/discours.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,5 @@
+import Ember from 'ember';
+
+export default Ember.Route.extend({
+
+})
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/routes/tabs/thematiques.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,9 @@
+import Ember from 'ember';
+
+export default Ember.Route.extend({
+
+ model: function() {
+ return this.store.findAll('theme');
+ }
+
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/serializers/theme.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,22 @@
+import DS from 'ember-data';
+
+export default DS.JSONSerializer.extend({
+
+ normalizeResponse: function(store, primaryModelClass, payload, id, requestType) {
+ var data = [];
+ Object.keys(payload).forEach(function(key) {
+ data.push({
+ 'id': key,
+ 'type': 'theme',
+ 'attributes': {
+ 'label': payload[key].label,
+ 'count': payload[key].count
+ }
+ });
+ });
+ return {
+ 'data': data
+ };
+ }
+
+});
\ No newline at end of file
--- a/cms/app-client/app/services/constants.js Tue Jun 07 01:16:31 2016 +0200
+++ b/cms/app-client/app/services/constants.js Tue Jun 07 12:00:40 2016 +0200
@@ -27,6 +27,45 @@
'http://www.language-archives.org/OLAC/1.1/translator': 'bo.olac_role_translator',
};
+
+const DISCOURSES = {
+ "http://ark.bnf.fr/ark:/12148/cb12083158d": "cat1",
+ "http://ark.bnf.fr/ark:/12148/cb119783362": "cat1",
+ "http://ark.bnf.fr/ark:/12148/cb119317924": "cat1",
+ "http://ark.bnf.fr/ark:/12148/cb12481481z": "cat1",
+ "http://ark.bnf.fr/ark:/12148/cb119341539": "cat1",
+ "http://ark.bnf.fr/ark:/12148/cb11946100d": "cat1",
+ "http://ark.bnf.fr/ark:/12148/cb11931724n": "cat2",
+ "http://ark.bnf.fr/ark:/12148/cb11949715t": "cat2",
+ "http://ark.bnf.fr/ark:/12148/cb13319048g": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11936159v": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11948542x": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11953414d": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11955657q": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11957378b": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11937212q": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb119834877": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb11976851v": "cat3",
+ "http://ark.bnf.fr/ark:/12148/cb120502737": "cat4",
+ "http://ark.bnf.fr/ark:/12148/cb11932135w": "cat4",
+ "http://ark.bnf.fr/ark:/12148/cb119829234": "cat4"
+};
+
+const DISCOURSE_CATEGORIES = {
+ "cat1": {
+ "fill": "#b6d7a8"
+ },
+ "cat2": {
+ "fill": "#ea9999"
+ },
+ "cat3": {
+ "fill": "#a2c4c9"
+ },
+ "cat4":{
+ "fill": "#ffe599"
+ }
+};
+
const KEY_CODES = {
BACKSPACE : 8,
DELETE : 46,
@@ -255,6 +294,8 @@
export default Ember.Service.extend({
OLAC_ROLES: OLAC_ROLES,
+ DISCOURSES: DISCOURSES,
+ DISCOURSE_CATEGORIES: DISCOURSE_CATEGORIES,
KEY_CODES: KEY_CODES,
VIAF_BASE_URL: "http://viaf.org/viaf/",
LEXVO_BASE_URL: "http://lexvo.org/id/iso639-3/",
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/templates/components/discourses-component.hbs Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,1 @@
+{{yield}}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/templates/components/filtering-component.hbs Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,11 @@
+{{yield}}
+
+{{ input type='text' key-up='filterBy' placeholder='Entrez une thématique'}}
+
+<ul id="filtering">
+
+ {{#each filteredThemes as |theme|}}
+ <li {{ action 'setQueryParameters' theme.id }}>{{ theme.label }} ({{ theme.count }})</li>
+ {{/each}}
+
+</ul>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/templates/components/sorting-component.hbs Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,24 @@
+{{yield}}
+
+<div>
+
+ <header>Trier par :</header>
+
+ <ul>
+ <li {{ action 'sortBy' 'alphabetical' }}>Ordre alphabétique</li>
+ <li {{ action 'sortBy' 'popularity' }}>Popularité</li>
+ </ul>
+
+</div>
+
+<ul class="sorting">
+
+ {{#each sortedThemes as |theme| }}
+
+ {{#if theme.label}}
+ <span {{ action 'setQueryParameters' theme.id }} class="{{ popularity theme.count minimum maximum }}">{{ theme.label }} ({{ theme.count }})</span>
+ {{/if}}
+
+ {{/each }}
+
+</ul>
\ No newline at end of file
--- a/cms/app-client/app/templates/tabs/discours.hbs Tue Jun 07 01:16:31 2016 +0200
+++ b/cms/app-client/app/templates/tabs/discours.hbs Tue Jun 07 12:00:40 2016 +0200
@@ -1,30 +1,1 @@
-<div class="visu-discours">
- <div class='left'>
- <p {{action 'updateUrl' 'Dialogue'}}>Dialogue</p>
- <p {{action 'updateUrl' 'Conversation'}}>Conversation</p>
- <p {{action 'updateUrl' 'Entretien'}}>Entretien</p>
- <p {{action 'updateUrl' 'Discussion'}}>Discussion</p>
- <p {{action 'updateUrl' 'Bavardage'}}>Bavardage</p>
- <p {{action 'updateUrl' 'Argumentation'}}>Argumentation</p>
- <p {{action 'updateUrl' 'Negociation'}}>Negociation</p>
- <p {{action 'updateUrl' 'Reunion'}}>Reunion</p>
- <p {{action 'updateUrl' 'Discours'}}>Discours</p>
- <p {{action 'updateUrl' 'Lecture a haute voix'}}>Lecture a haute voix</p>
- <p {{action 'updateUrl' 'Recitation'}}>Recitation</p>
- <p {{action 'updateUrl' 'Recit personnel'}}>Recit personnel</p>
- <p {{action 'updateUrl' 'Seminaire'}}>Seminaire</p>
- </div>
- <div class='right'>
- <p {{action 'updateUrl' 'Colloque'}}>Colloque</p>
- <p {{action 'updateUrl' 'Conte'}}>Conte</p>
- <p {{action 'updateUrl' 'Fable'}}>Fable</p>
- <p {{action 'updateUrl' 'Narration'}}>Narration</p>
- <p {{action 'updateUrl' 'Chanson'}}>Chanson</p>
- <p {{action 'updateUrl' 'Enquete par telephone'}}>Enquete par telephone</p>
- <p {{action 'updateUrl' 'Questionnaire'}}>Questionnaire</p>
- <p {{action 'updateUrl' 'Enquete'}}>Enquete</p>
- <p {{action 'updateUrl' 'Enquetes linguistiques'}}>Enquetes linguistiques</p>
- <p {{action 'updateUrl' 'Enquetes de terrain'}}>Enquetes de terrain</p>
- <p {{action 'updateUrl' 'Musique instrumentale'}}>Musique instrumentale</p>
- </div>
-</div>
+{{discourses-component}}
\ No newline at end of file
--- a/cms/app-client/app/templates/tabs/thematiques.hbs Tue Jun 07 01:16:31 2016 +0200
+++ b/cms/app-client/app/templates/tabs/thematiques.hbs Tue Jun 07 12:00:40 2016 +0200
@@ -1,60 +1,5 @@
-<div class="search-box">
- {{input type="text" placeholder="Entrez une thématique" enter="updateUrl"}}
-</div>
+{{outlet}}
-<div class="tag-cloud">
- <span {{action 'updateUrl' 'ipsum'}} class="popular">ipsum</span>
- <span {{action 'Url' 'dolor'}} class="not-popular">dolor</span>
- <span {{action 'updateUrl' 'sit'}} class="not-popular">sit</span>
- <span {{action 'updateUrl' 'amet'}} class="popular">amet</span>
- <span {{action 'updateUrl' 'consectetur'}} class="popular">consectetur</span>
- <span {{action 'updateUrl' 'adipiscing'}} class="not-popular">adipiscing</span>
- <span {{action 'updateUrl' 'elit'}} class="very-popular">elit</span>
- <span {{action 'updateUrl' 'Curabitur'}} class="not-popular">Curabitur</span>
- <span {{action 'updateUrl' 'non'}} class="popular">non</span>
- <span {{action 'updateUrl' 'ipsum'}} class="not-popular">ipsum</span>
- <span {{action 'updateUrl' 'dolor'}} class="very-popular">dolor</span>
- <span {{action 'updateUrl' 'sit'}} class="not-popular">sit</span>
- <span {{action 'updateUrl' 'amet'}} class="popular">amet</span>
- <span {{action 'updateUrl' 'consectetur'}} class="popular">consectetur</span>
- <span {{action 'updateUrl' 'adipiscing'}} class="not-popular">adipiscing</span>
- <span {{action 'updateUrl' 'elit'}} class="not-popular">elit</span>
- <span {{action 'updateUrl' 'Curabitur'}} class="popular">Curabitur</span>
- <span {{action 'updateUrl' 'non'}} class="not-popular">non</span>
- <span {{action 'updateUrl' 'ipsum'}} class="popular">ipsum</span>
- <span {{action 'updateUrl' 'dolor'}} class="popular">dolor</span>
- <span {{action 'updateUrl' 'sit'}} class="not-popular">sit</span>
- <span {{action 'updateUrl' 'amet'}} class="not-popular">amet</span>
- <span {{action 'updateUrl' 'consectetur'}} class="not-popular">consectetur</span>
- <span {{action 'updateUrl' 'adipiscing'}} class="not-popular">adipiscing</span>
- <span {{action 'updateUrl' 'elit'}} class="very-popular">elit</span>
- <span {{action 'updateUrl' 'Curabitur'}} class="popular">Curabitur</span>
- <span {{action 'updateUrl' 'non'}} class="very-popular">non</span>
- <span {{action 'updateUrl' 'ipsum'}} class="popular">ipsum</span>
- <span {{action 'updateUrl' 'dolor'}} class="not-popular">dolor</span>
- <span {{action 'updateUrl' 'sit'}} class="not-popular">sit</span>
- <span {{action 'updateUrl' 'amet'}} class="popular">amet</span>
- <span {{action 'updateUrl' 'consectetur'}} class="popular">consectetur</span>
- <span {{action 'updateUrl' 'adipiscing'}} class="not-popular">adipiscing</span>
- <span {{action 'updateUrl' 'elit'}} class="very-popular">elit</span>
- <span {{action 'updateUrl' 'Curabitur'}} class="not-popular">Curabitur</span>
- <span {{action 'updateUrl' 'non'}} class="popular">non</span>
- <span {{action 'updateUrl' 'ipsum'}} class="not-popular">ipsum</span>
- <span {{action 'updateUrl' 'dolor'}} class="very-popular">dolor</span>
- <span {{action 'updateUrl' 'sit'}} class="not-popular">sit</span>
- <span {{action 'updateUrl' 'amet'}} class="popular">amet</span>
- <span {{action 'updateUrl' 'consectetur'}} class="popular">consectetur</span>
- <span {{action 'updateUrl' 'adipiscing'}} class="not-popular">adipiscing</span>
- <span {{action 'updateUrl' 'elit'}} class="not-popular">elit</span>
- <span {{action 'updateUrl' 'Curabitur'}} class="popular">Curabitur</span>
- <span {{action 'updateUrl' 'non'}} class="not-popular">non</span>
- <span {{action 'updateUrl' 'ipsum'}} class="popular">ipsum</span>
- <span {{action 'updateUrl' 'dolor'}} class="popular">dolor</span>
- <span {{action 'updateUrl' 'sit'}} class="not-popular">sit</span>
- <span {{action 'updateUrl' 'amet'}} class="not-popular">amet</span>
- <span {{action 'updateUrl' 'consectetur'}} class="not-popular">consectetur</span>
- <span {{action 'updateUrl' 'adipiscing'}} class="not-popular">adipiscing</span>
- <span {{action 'updateUrl' 'elit'}} class="very-popular">elit</span>
- <span {{action 'updateUrl' 'Curabitur'}} class="popular">Curabitur</span>
- <span {{action 'updateUrl' 'non'}} class="very-popular">non</span>
-</div>
+{{ filtering-component themes=model setQueryParameters=( action 'transitionTo' ) }}
+
+{{ sorting-component themes=model setQueryParameters=( action 'transitionTo' ) }}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/integration/components/discourses-component-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,24 @@
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+
+moduleForComponent('discourses-component', 'Integration | Component | discourses component', {
+ integration: true
+});
+
+test('it renders', function(assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`{{discourses-component}}`);
+
+ assert.equal(this.$().text().trim(), '');
+
+ // Template block usage:
+ this.render(hbs`
+ {{#discourses-component}}
+ template block text
+ {{/discourses-component}}
+ `);
+
+ assert.equal(this.$().text().trim(), 'template block text');
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/integration/components/filtering-component-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,24 @@
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+
+moduleForComponent('filtering-component', 'Integration | Component | filtering component', {
+ integration: true
+});
+
+test('it renders', function(assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`{{filtering-component}}`);
+
+ assert.equal(this.$().text().trim(), '');
+
+ // Template block usage:
+ this.render(hbs`
+ {{#filtering-component}}
+ template block text
+ {{/filtering-component}}
+ `);
+
+ assert.equal(this.$().text().trim(), 'template block text');
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/integration/components/sorting-component-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,24 @@
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+
+moduleForComponent('sorting-component', 'Integration | Component | sorting component', {
+ integration: true
+});
+
+test('it renders', function(assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`{{sorting-component}}`);
+
+ assert.equal(this.$().text().trim(), '');
+
+ // Template block usage:
+ this.render(hbs`
+ {{#sorting-component}}
+ template block text
+ {{/sorting-component}}
+ `);
+
+ assert.equal(this.$().text().trim(), 'template block text');
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/controllers/tabs/thematiques-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,12 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:tabs/thematiques', 'Unit | Controller | tabs/thematiques', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/helpers/popularity-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,10 @@
+import { popularity } from 'app-client/helpers/popularity';
+import { module, test } from 'qunit';
+
+module('Unit | Helper | popularity');
+
+// Replace this with your real tests.
+test('it works', function(assert) {
+ let result = popularity([42]);
+ assert.ok(result);
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/models/discourse-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,12 @@
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('discourse', 'Unit | Model | discourse', {
+ // Specify the other units that are required for this test.
+ needs: []
+});
+
+test('it exists', function(assert) {
+ let model = this.subject();
+ // let store = this.store();
+ assert.ok(!!model);
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/models/theme-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,12 @@
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('theme', 'Unit | Model | theme', {
+ // Specify the other units that are required for this test.
+ needs: []
+});
+
+test('it exists', function(assert) {
+ let model = this.subject();
+ // let store = this.store();
+ assert.ok(!!model);
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/routes/discours-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,11 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('route:discours', 'Unit | Route | discours', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+test('it exists', function(assert) {
+ let route = this.subject();
+ assert.ok(route);
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/routes/tabs/thematiques-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,11 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('route:tabs/thematiques', 'Unit | Route | tabs/thematiques', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+test('it exists', function(assert) {
+ let route = this.subject();
+ assert.ok(route);
+});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/serializers/theme-test.js Tue Jun 07 12:00:40 2016 +0200
@@ -0,0 +1,15 @@
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('theme', 'Unit | Serializer | theme', {
+ // Specify the other units that are required for this test.
+ needs: ['serializer:theme']
+});
+
+// Replace this with your real tests.
+test('it serializes records', function(assert) {
+ let record = this.subject();
+
+ let serializedRecord = record.serialize();
+
+ assert.ok(serializedRecord);
+});