How to use the phoenix/components/as-widget/list.extend function in phoenix

To help you get started, we’ve selected a few phoenix 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 alphasights / ember-scrollable / app / components / as-widget / team-unused-advisors.js View on Github external
import Ember from 'ember';
import ListWidgetComponent from 'phoenix/components/as-widget/list';

export default ListWidgetComponent.extend({
  classNameBindings: [':team-unused-advisors'],

  name: 'Unused Advisors',
  emptyMessage: 'no unused advisors to contact.',
  listItemTemplateName: 'components/as-widget/team-unused-advisors/list-item',
  hasTeamMemberFilter: false,
  teamMembers: null,

  model: Ember.computed('teamMembers', function() {
    return this.get('teamMembers').sortBy('deliveryPerformance.unusedAdvisorsCount').reverse();
  })
});
github alphasights / ember-scrollable / app / components / as-widget / unused-advisors.js View on Github external
import ListWidgetComponent from 'phoenix/components/as-widget/list';
import notify from 'phoenix/helpers/notify';

export default ListWidgetComponent.extend({
  classNameBindings: [':unused-advisors'],

  name: 'Unused Advisors',
  emptyMessage: 'no unused advisors to contact.',
  hasTeamMemberFilter: false,
  listItemTemplateName: 'components/as-widget/unused-advisors/list-item',
  store: null,

  actions: {
    removeUnusedAdvisor: function(unusedAdvisorId) {
      if (window.confirm('Are you sure you want to remove the advisor from the list?')) {
        this.get('store').findRecord('unusedAdvisor', unusedAdvisorId).then(function(unusedAdvisor) {
          unusedAdvisor.destroyRecord().then(function() {
            notify(`The advisor ${unusedAdvisor.get('advisor.name')} was removed from the list.`);
          });
        });
github alphasights / ember-scrollable / app / components / as-widget / scheduled-interactions.js View on Github external
import Ember from 'ember';
import ListWidgetComponent from 'phoenix/components/as-widget/list';

export default ListWidgetComponent.extend({
  classNameBindings: [':interactions', ':scheduled-interactions'],

  name: 'Scheduled Interactions',

  hasTeamMemberFilter: Ember.computed.oneWay('isTeamView'),
  listItemTemplateName: 'components/as-widget/scheduled-interactions/list-item',
  emptyMessage: 'no scheduled interactions.'
});
github alphasights / ember-scrollable / app / components / as-widget / interactions.js View on Github external
import Ember from 'ember';
import ListWidgetComponent from 'phoenix/components/as-widget/list';

export default ListWidgetComponent.extend({
  classNameBindings: [':interactions'],

  interactionsWithIncompleteChecklistItems: Ember.computed.filterBy('arrangedContent', 'hasIncompleteChecklistItems', true),

  alert: Ember.computed('interactionsWithIncompleteChecklistItems.length', function() {
    let count = this.get('interactionsWithIncompleteChecklistItems.length');

    return `${count} ${count > 1 ? 'interactions have' : 'interaction has'} incomplete checklist items.`;
  }),

  displayAlert: Ember.computed('interactionsWithIncompleteChecklistItems.length', 'hasMoreItems', function() {
    return this.get('interactionsWithIncompleteChecklistItems.length') > 0 && this.get('hasMoreItems');
  })
});