-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite code to work with ember 2.10.x
- Loading branch information
1 parent
c911086
commit 48cf073
Showing
15 changed files
with
240 additions
and
207 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,96 +26,96 @@ export default Ember.Mixin.create({ | |
'==': 'Equal', | ||
'like': 'Contains' | ||
}, | ||
createFiltergroup(filters, link) { | ||
let that = this; | ||
return Ember.ArrayProxy.extend({ | ||
Link: null, | ||
LinkLocale: Ember.computed('Link', function() { | ||
return that.links[this.Link]; | ||
}), | ||
isvalid: Ember.computed('[email protected]', function() { | ||
let a = this.content.filterBy('Ready', false); | ||
return this.content.filterBy('Ready', false).length === 0; | ||
}) | ||
}).create({ | ||
Link: link || "or", | ||
content: filters || [] //Ember.ArrayProxy.create() | ||
}); | ||
}, | ||
create(base) { | ||
let that = this; | ||
return Ember.Object.extend({ | ||
Display: null, | ||
Key: null, | ||
|
||
Condition: null, | ||
ConditionMask: Ember.computed('Condition', function() { | ||
return (this.Options || {})[this.Condition] || ""; | ||
}), | ||
|
||
Value: null, | ||
ValueMask: null, | ||
|
||
display:Ember.computed.alias('Display'), | ||
key:Ember.computed.alias('Key'), | ||
condition:Ember.computed.alias('Condition'), | ||
value:Ember.computed.alias('Value'), | ||
valuemask:Ember.computed.alias('ValueMask'), | ||
link:Ember.computed.alias('Link'), | ||
|
||
|
||
//Type:null, | ||
SelectObject: false, | ||
Options: null, | ||
Link: null, | ||
Readable: Ember.computed('Display', 'ConditionMask', 'ValueMask', function() { | ||
return this.Display + " " + this.get('ConditionMask') + " " + this.ValueMask; | ||
}), | ||
Ready: Ember.computed('Display', 'Condition', 'Value', function() { | ||
return !!(this.Display && this.Condition && this.Value); | ||
// return `${this.get('Key')} ${this.get('Condition')} ${this.get('Display')}`; | ||
}), | ||
LinkLocale: Ember.computed('Link', function() { | ||
return that.links[this.Link]; | ||
}) | ||
}).create(base || {}); | ||
}, | ||
init(filters) { | ||
this.set('filtergroups', Ember.ArrayProxy.extend({ | ||
areValid: Ember.computed('[email protected]', function() { | ||
return this.content.filterBy('isvalid', false).length === 0; | ||
}) | ||
}).create({ | ||
content: [] | ||
})); | ||
(filters || this.createFiltergroup().addObject(this.create())).forEach(function(filter, index, arr) { | ||
let link = index > 0 ? arr[index - 1].link : null; | ||
this.AddFilterGroup(filter.filters, link); | ||
}.bind(this)); | ||
}, | ||
change(filters){ | ||
this.init(filters); | ||
this.set('filterupdated',!this.set('filterupdated')); | ||
}, | ||
localelink(link) { | ||
return this.links[link]; | ||
}, | ||
makefilter(filter) { | ||
return filter; | ||
}, | ||
AddFilterGroup(filters, link) { | ||
let that = this; | ||
filters = filters || [this.create()]; | ||
link = link || "or"; | ||
filters = filters.map((filter) => { | ||
return that.create(filter) | ||
}); | ||
if (this.filtergroups.content.length > 0) { | ||
let filt = this.filtergroups.objectAt(this.filtergroups.content.length - 1); | ||
filt.set('Link', link); | ||
} | ||
this.filtergroups.addObject(this.createFiltergroup(filters, link)); | ||
}, | ||
// createFiltergroup(filters, link) { | ||
// let that = this; | ||
// return Ember.ArrayProxy.extend({ | ||
// Link: null, | ||
// LinkLocale: Ember.computed('Link', function() { | ||
// return that.links[this.Link]; | ||
// }), | ||
// isvalid: Ember.computed('[email protected]', function() { | ||
// let a = this.content.filterBy('Ready', false); | ||
// return this.content.filterBy('Ready', false).length === 0; | ||
// }) | ||
// }).create({ | ||
// Link: link || "or", | ||
// content: filters || [] //Ember.ArrayProxy.create() | ||
// }); | ||
// }, | ||
// create(base) { | ||
// let that = this; | ||
// return Ember.Object.extend({ | ||
// Display: null, | ||
// Key: null, | ||
// | ||
// Condition: null, | ||
// ConditionMask: Ember.computed('Condition', function() { | ||
// return (this.Options || {})[this.Condition] || ""; | ||
// }), | ||
// | ||
// Value: null, | ||
// ValueMask: null, | ||
// | ||
// display:Ember.computed.alias('Display'), | ||
// key:Ember.computed.alias('Key'), | ||
// condition:Ember.computed.alias('Condition'), | ||
// value:Ember.computed.alias('Value'), | ||
// valuemask:Ember.computed.alias('ValueMask'), | ||
// link:Ember.computed.alias('Link'), | ||
// | ||
// | ||
// //Type:null, | ||
// SelectObject: false, | ||
// Options: null, | ||
// Link: null, | ||
// Readable: Ember.computed('Display', 'ConditionMask', 'ValueMask', function() { | ||
// return this.Display + " " + this.get('ConditionMask') + " " + this.ValueMask; | ||
// }), | ||
// Ready: Ember.computed('Display', 'Condition', 'Value', function() { | ||
// return !!(this.Display && this.Condition && this.Value); | ||
// // return `${this.get('Key')} ${this.get('Condition')} ${this.get('Display')}`; | ||
// }), | ||
// LinkLocale: Ember.computed('Link', function() { | ||
// return that.links[this.Link]; | ||
// }) | ||
// }).create(base || {}); | ||
// }, | ||
// init(filters) { | ||
// this.set('filtergroups', Ember.ArrayProxy.extend({ | ||
// areValid: Ember.computed('[email protected]', function() { | ||
// return this.content.filterBy('isvalid', false).length === 0; | ||
// }) | ||
// }).create({ | ||
// content: [] | ||
// })); | ||
// (filters || this.createFiltergroup().addObject(this.create())).forEach(function(filter, index, arr) { | ||
// let link = index > 0 ? arr[index - 1].link : null; | ||
// this.AddFilterGroup(filter.filters, link); | ||
// }.bind(this)); | ||
// }, | ||
// change(filters){ | ||
// this.init(filters); | ||
// this.set('filterupdated',!this.set('filterupdated')); | ||
// }, | ||
// localelink(link) { | ||
// return this.links[link]; | ||
// }, | ||
// makefilter(filter) { | ||
// return filter; | ||
// }, | ||
// AddFilterGroup(filters, link) { | ||
// let that = this; | ||
// filters = filters || [this.create()]; | ||
// link = link || "or"; | ||
// filters = filters.map((filter) => { | ||
// return that.create(filter) | ||
// }); | ||
// if (this.filtergroups.content.length > 0) { | ||
// let filt = this.filtergroups.objectAt(this.filtergroups.content.length - 1); | ||
// filt.set('Link', link); | ||
// } | ||
// this.filtergroups.addObject(this.createFiltergroup(filters, link)); | ||
// }, | ||
getBody(query) { | ||
query.filterset = (this.filtergroups||[]).map((filter) => { | ||
return { | ||
|
@@ -131,9 +131,9 @@ export default Ember.Mixin.create({ | |
}; | ||
}); | ||
}, | ||
Query:Ember.computed('[email protected]',function(){ | ||
let query = {filterset:{}}; | ||
this.getBody(query); | ||
return query.filterset; | ||
}) | ||
// Query:Ember.computed('[email protected]',function(){ | ||
// let query = {filterset:{}}; | ||
// this.getBody(query); | ||
// return query.filterset; | ||
// }) | ||
}); |
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
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
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
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
Oops, something went wrong.