balanced/balanced-dashboard

View on GitHub
app/views/results/disputes-status-results-dropdown-filter.js

Summary

Maintainability
A
1 hr
Test Coverage
import ResultsDropdownFilterView from "./results-dropdown-filter";
import { defineFilter } from "./results-dropdown-filter";

var DisputesStatusResultsDropdownFilterView = ResultsDropdownFilterView.extend({
    toggleText: "Status",
    filters: function() {
        return [
            defineFilter("All", null, true),
            defineFilter("Needs attention & Under review", ["pending"]),
            defineFilter("Won", ["won"]),
            defineFilter("Lost", ["lost"])
        ];
    }.property(),

    actions: {
        setFilter: function(filterLink) {
            var controller = this.get('controller');
            controller.send('changeDisputeStatusFilter', filterLink.value);
            this.toggleSelected(filterLink);
        }
    }
});

export default DisputesStatusResultsDropdownFilterView;