-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e5e4b8
commit 77d631b
Showing
9 changed files
with
163,769 additions
and
145 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 11 additions & 19 deletions
30
src/javascripts/ng-admin/Crud/fieldView/FloatFieldView.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
define(function(require) { | ||
"use strict"; | ||
|
||
function getReadWidget() { | ||
return '<ma-number-column field="::field" value="::entry.values[field.name()]"></ma-float-column>'; | ||
} | ||
function getLinkWidget() { | ||
return '<a ng-click="gotoDetail()">' + getReadWidget() + '</a>'; | ||
} | ||
function getFilterWidget() { | ||
module.exports = { | ||
getReadWidget: function() { | ||
return '<ma-number-column field="::field" value="::entry.values[field.name()]"></ma-number-column>'; | ||
}, | ||
getLinkWidget: function() { | ||
return '<a ng-click="gotoDetail()">' + this.getReadWidget() + '</a>'; | ||
}, | ||
getFilterWidget: function() { | ||
return '<ma-input-field type="number" step="any" field="::field" value="values[field.name()]"></ma-input-field>'; | ||
} | ||
function getWriteWidget() { | ||
}, | ||
getWriteWidget: function() { | ||
return '<ma-input-field type="number" step="any" field="::field" value="entry.values[field.name()]"></ma-input-field>'; | ||
} | ||
return { | ||
getReadWidget: getReadWidget, | ||
getLinkWidget: getLinkWidget, | ||
getFilterWidget: getFilterWidget, | ||
getWriteWidget: getWriteWidget | ||
} | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
src/javascripts/test/unit/Crud/fieldView/FloatFieldView.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var assert = require('chai').assert; | ||
var FloatFieldView = require('../../../../ng-admin/Crud/fieldView/FloatFieldView'); | ||
|
||
describe('FloatFieldView', function() { | ||
describe('getReadWidget', function() { | ||
it('should return number column directive', function() { | ||
var widget = FloatFieldView.getReadWidget(); | ||
assert.include(widget, '<ma-number-column'); | ||
}); | ||
}); | ||
|
||
describe('getLinkWidget', function() { | ||
it('should return number column directive', function() { | ||
var widget = FloatFieldView.getLinkWidget(); | ||
assert.include(widget, '<ma-number-column'); | ||
}); | ||
}); | ||
|
||
describe('getFilterWidget', function() { | ||
it('should set step attribute to "any"', function() { | ||
var widget = FloatFieldView.getFilterWidget(); | ||
assert.include(widget, 'step="any"'); | ||
}); | ||
}); | ||
|
||
describe('getWriteWidget', function() { | ||
it('should set step attribute to "any"', function() { | ||
var widget = FloatFieldView.getFilterWidget(); | ||
assert.include(widget, 'step="any"'); | ||
}); | ||
}); | ||
}); |