How to use the @smile-io/ember-polaris/components/polaris-resource-list/filter-control/filter-value-selector.FilterType.Select function in @smile-io/ember-polaris

To help you get started, we’ve selected a few @smile-io/ember-polaris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smile-io / ember-polaris / addon / components / polaris-resource-list / filter-control.js View on Github external
findFilterLabelByType(filter, appliedFilter) {
    let appliedFilterValue = get(appliedFilter, 'value');

    if (get(filter, 'type') === FilterType.Select) {
      let foundFilterOption = get(filter, 'options').find((option) =>
        typeof option === 'string'
          ? option === appliedFilterValue
          : get(option, 'value') === appliedFilterValue
      );

      if (foundFilterOption) {
        return typeof foundFilterOption === 'string'
          ? foundFilterOption
          : get(foundFilterOption, 'label');
      }
    }

    if (get(filter, 'type') === FilterType.DateSelector) {
      if (get(filter, 'key') === get(appliedFilter, 'key')) {
        return getFilterLabelForValue(get(appliedFilter, 'value'));