How to use the phoenix/forms/form.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 / forms / advisor-payment-form.js View on Github external
import Form from 'phoenix/forms/form';

export default Form.extend({
  genericErrorMessage: 'There has been an error with the advisor payment.',

  setPersistedValues: function() {
    var model = this.get('model');

    model.setProperties({
      paymentRequired: model.get('paymentRequired')
    });
  }
});
github alphasights / ember-scrollable / app / forms / schedule-interaction-form.js View on Github external
import Ember from 'ember';
import jstz from 'jstz';
import Form from 'phoenix/forms/form';
import phoneCountryCodes from 'phoenix/models/phone-country-codes';
import localMoment from 'phoenix/helpers/local-moment';
import SelectableInteractionTypesMixin from 'phoenix/mixins/selectable-interaction-types-form';

export default Form.extend(SelectableInteractionTypesMixin, {
  genericErrorMessage: 'There has been an error scheduling the interaction.',
  interactionTypes: null,
  interactionClassifications: null,
  speakDialInCountries: null,
  timeZone: jstz.determine().name(),
  phoneCountryCodes: phoneCountryCodes,
  dateFormat: 'D MMM, h:mm A',

  validations: {
    interactionType: {
      presence: true
    },

    advisorPhoneNumber: {
      presence: true
    },
github alphasights / ember-scrollable / app / forms / interaction-completion-form.js View on Github external
const qualityOptions = qualityOptionsMapping.keys;

const speakQualityOptionsMapping = {
  'no_known_issues': 'No known issues',
  'disconnected_10': 'Call disconnected: ≤10 mins',
  'disconnected_30': 'Call disconnected: 11 - 30 mins',
  'disconnected_60': 'Call disconnected: 31 - 60 mins',
  'poor_line_quality': 'Poor line quality identified by client or advisor',
  'breaking_up': 'Call broke up (jitter)',
  'lag': 'Voice lag or delay',
  'email_notification': 'Issues with email notifications',
  'advisor_not_dialed': 'Advisor not dialed',
  'other': 'Other issue'
};

export default Form.extend(SelectableInteractionTypesMixin, {
  genericErrorMessage: 'There has been an error completing the interaction.',
  interactionTypes: null,
  interactionClassifications: null,
  speakExplanationNeeded: Ember.computed.equal('speakQuality', 'other'),
  editingDisabled: false,

  setDefaultValues: function() {
    if (this.get('model.id') != null) {
      this.set('editingDisabled', true);
    }
    if (Ember.isPresent(this.get('model.quality'))) {
      this.set('quality', this.get('model.quality'));
    } else {
      this.set('quality', 'good');
    }
    this.set('duration', this.get('model.duration'));
github alphasights / ember-scrollable / app / forms / feature-form.js View on Github external
import Ember from 'ember';
import Form from 'phoenix/forms/form';

export default Form.extend({
  genericErrorMessage: 'There has been an error with the lab.',

  setDefaultValues: function(){
    this.set('name', this.get('model.name'));
    this.set('badgeName', this.get('model.badgeName'));
    this.set('briefDescription', this.get('model.briefDescription'));
    this.set('limit', this.get('model.limit'));
    if (this.get('limit') != null) {
      this.set('showLimit', true);
    } else {
      this.set('showLimit', false);
    }
  },

  setPersistedValues: function() {
    var model = this.get('model');