mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-21 13:25:17 +02:00
-Added clear button directive.
-Added filter button directive. -Moved the UI stuff to stf/common-ui. -Added optional filtering to Details. -Sync active tabs to local forage. -Device List status filters by usability. -Removed 750ms delay from filtering.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
module.exports = function clearButtonDirective() {
|
||||
return {
|
||||
restrict: 'EA',
|
||||
replace: true,
|
||||
scope: {},
|
||||
template: require('./clear-button.jade')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
describe('clearButton', function () {
|
||||
|
||||
beforeEach(module('stf.clear-button'));
|
||||
|
||||
var scope, compile;
|
||||
|
||||
beforeEach(inject(function ($rootScope, $compile) {
|
||||
scope = $rootScope.$new();
|
||||
compile = $compile;
|
||||
}));
|
||||
|
||||
it('should ...', function () {
|
||||
|
||||
/*
|
||||
To test your directive, you need to create some html that would use your directive,
|
||||
send that through compile() then compare the results.
|
||||
|
||||
var element = compile('<div clear-button name="name">hi</div>')(scope);
|
||||
expect(element.text()).toBe('hello, world');
|
||||
*/
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
button.btn.btn-sm.btn-danger-outline.pull-right
|
||||
i.fa.fa-trash-o
|
||||
span(translate) Clear
|
||||
2
res/app/components/stf/common-ui/clear-button/index.js
Normal file
2
res/app/components/stf/common-ui/clear-button/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
module.exports = angular.module('stf.clear-button', [])
|
||||
.directive('clearButton', require('./clear-button-directive'))
|
||||
@@ -0,0 +1,9 @@
|
||||
module.exports = function filterButtonDirective() {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
restrict: 'EA',
|
||||
replace: true,
|
||||
scope: {},
|
||||
template: require('./filter-button.jade')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
describe('filterButton', function () {
|
||||
|
||||
beforeEach(module('stf.filter-button'));
|
||||
|
||||
var scope, compile;
|
||||
|
||||
beforeEach(inject(function ($rootScope, $compile) {
|
||||
scope = $rootScope.$new();
|
||||
compile = $compile;
|
||||
}));
|
||||
|
||||
it('should ...', function () {
|
||||
|
||||
/*
|
||||
To test your directive, you need to create some html that would use your directive,
|
||||
send that through compile() then compare the results.
|
||||
|
||||
var element = compile('<div clear-button name="name">hi</div>')(scope);
|
||||
expect(element.text()).toBe('hello, world');
|
||||
*/
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
button(btn-checkbox, title='{{"Filter"|translate}}').btn.btn-sm.btn-primary-outline.pull-right
|
||||
i.fa.fa-filter
|
||||
span {{"Filter"|translate}}
|
||||
2
res/app/components/stf/common-ui/filter-button/index.js
Normal file
2
res/app/components/stf/common-ui/filter-button/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
module.exports = angular.module('stf.filter-button', [])
|
||||
.directive('filterButton', require('./filter-button-directive'))
|
||||
5
res/app/components/stf/common-ui/index.js
Normal file
5
res/app/components/stf/common-ui/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = angular.module('stf/common-ui', [
|
||||
require('./clear-button').name,
|
||||
require('./filter-button').name,
|
||||
require('./nothing-to-show').name
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
require('./nothing-to-show.css')
|
||||
|
||||
module.exports = angular.module('stf/common/nothing-to-show', [])
|
||||
module.exports = angular.module('stf/common-ui/nothing-to-show', [])
|
||||
.directive('nothingToShow', require('./nothing-to-show-directive'))
|
||||
Reference in New Issue
Block a user