Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/0.12.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-scherzinger committed May 5, 2017
2 parents da49de5 + d80b778 commit 794c114
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ec.datamanager.js",
"main": "build/datamanager.min.js",
"version": "0.12.4",
"version": "0.12.5",
"authors": [
"Ruben Deyhle <deyhle@entrecode.de>"
],
Expand Down
2 changes: 1 addition & 1 deletion build/datamanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ Entry.prototype.getTitle = function(property) {
if (!links) {
return undefined;
}
if (links.length === 1) {
if (!Array.isArray(this.value[property])) {
return links[0].title;
}
var out = [];
Expand Down
2 changes: 1 addition & 1 deletion build/datamanager.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## 0.12.5
- fix: always return array in getTitle on lineked types

## 0.12.4
- best file functions in Entry

Expand Down
2 changes: 1 addition & 1 deletion lib/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Entry.prototype.getTitle = function(property) {
if (!links) {
return undefined;
}
if (links.length === 1) {
if (!Array.isArray(this.value[property])) {
return links[0].title;
}
var out = [];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ec.datamanager",
"version": "0.12.4",
"version": "0.12.5",
"description": "JavaScript SDK for ec.datamanager. By entrecode.",
"main": "index.js",
"typings": "typings.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"modified": "2015-12-08T09:55:15.171Z",
"private": false,
"title": "Single Item List",
"list-items": [
"N1GJuenPEl"
],
"list-item": "N1GJuenPEl",
"description": "",
"_modelTitleField": "title",
"_links": {
Expand All @@ -25,7 +23,7 @@
"self": {
"href": "https://datamanager.entrecode.de/api/58b9a1f5/to-do-list?_id=V1EXdcJHl"
},
"58b9a1f5:to-do-list/list-items": {
"58b9a1f5:to-do-list/list-item": {
"href": "https://datamanager.entrecode.de/api/58b9a1f5/to-do-item?_id=N1GJuenPEl",
"name": "to-do-item",
"title": "NewItem"
Expand Down
4 changes: 2 additions & 2 deletions test/sdk.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ describe('entry/entries', function() { // this is basically modelList
});
it('get link title single link', function() {
return dm.model('to-do-list').entry('V1EXdcJHl').then(function(entry) {
var title = entry.getTitle('list-items');
var title = entry.getTitle('list-item');
expect(title).to.be.equal('NewItem');
});
});
Expand All @@ -1760,7 +1760,7 @@ describe('entry/entries', function() { // this is basically modelList
});
it('get model title single link', function() {
return dm.model('to-do-list').entry('V1EXdcJHl').then(function(entry) {
var title = entry.getModelTitle('list-items');
var title = entry.getModelTitle('list-item');
expect(title).to.be.equal('to-do-item');
});
});
Expand Down

0 comments on commit 794c114

Please sign in to comment.