Exemplo n.º 1
0
  datePickerClear = name => {
    let fieldName = name + "Radio";
    this.props.dispatch(change("filterForm", fieldName, "timeRange"));

    fieldName = name + ".from";
    this.props.dispatch(change("filterForm", fieldName, ""));
    fieldName = name + ".to";
    this.props.dispatch(change("filterForm", fieldName, ""));
  };
 selectIdHandler: (bid,lbl,close) => {
     if(!bid){
         return
     }
     dispatch(change('addSection','lbl',lbl))
     Promise.resolve(dispatch(change('addSection','bid',bid)))
     .then(()=>{
         close()
     })
 },
Exemplo n.º 3
0
function* saveLocation(action) {
  const { marker } = action;
  if (!isEmpty(marker)) {
    yield put(change('help', 'latitude', marker.lat));
    yield put(change('help', 'longitude', marker.lng));
    yield put(helpActions.centerChanged({
      lat: marker.lat,
      lng: marker.lng,
    }));
    yield put(helpActions.hideLocationModal());
  }
}
Exemplo n.º 4
0
 .catch(response => {
   // console.error('login POST error: ', response);
   dispatch(toastrActions.clean());
   toastr.error('Invalid Login', 'Your email/password was invalid. Please try again.', toastrOptions);
   dispatch(change('Login', 'password', ''));
   reject();
 });
Exemplo n.º 5
0
 componentWillReceiveProps (nextProps) {
   this.setState({
     submitting: false
   })
   if (nextProps.error) {
     this.setState({
       error: nextProps.error
     })
   }
   this.props.dispatch(change('form', 'password', ''))
 }
Exemplo n.º 6
0
  return (dispatch) => {
    const { [startAtField]: oldStartAt, [endAtField]: oldEndAt } = oldValues;
    if (!oldStartAt || !oldEndAt) { return; }
    const oldStartTime = oldStartAt.getTime();
    const oldEndTime = oldEndAt.getTime();

    // if start time is before end time, allow user to clear the error
    if (oldStartTime <= oldEndTime) {
      const newStartTime = newStartAt.getTime();
      const newEndAt = new Date(oldEndTime + (newStartTime - oldStartTime));
      dispatch(change(formName, endAtField, newEndAt));
    }
  };
Exemplo n.º 7
0
 .then(response => {
   if (response.status !== 200) {
     localStorage.removeItem('jwtToken');
     dispatch(loginFailure(response.data));
     dispatch(toastrActions.clean());
     toastr.error('Invalid Login', 'Your email/password was invalid. Please try again.', toastrOptions);
     dispatch(change('Login', 'password', ''));
     reject(response.data);
   } else {
     localStorage.setItem('jwtToken', response.data.token);
     dispatch(setCurrentUser(response.data.user));
     dispatch(loginSuccess(response.data));
     dispatch(toastrActions.clean());
     dispatch(push('/u'));
     resolve();
   }
 })
Exemplo n.º 8
0
 const onAddInviteesButtonClick = event => {
   const {dispatch, inviteesRaw} = props;
   const parsedAddresses = emailAddresses.parseAddressList(inviteesRaw);
   event.preventDefault();
   // clear the inviteesRaw form component:
   dispatch(change('welcomeWizard', 'inviteesRaw', ''));
   if (!parsedAddresses) {
     return;
   }
   parsedAddresses.forEach(email => {
     dispatch(arrayPush('welcomeWizard', 'invitees', {
       email: email.address,
       fullName: email.name,
       label: email.name ? `"${email.name}" <${email.address}>` : email.address
     }));
   });
 };
Exemplo n.º 9
0
 onValueUpdate: (name) => {
   switch(name) {
     case 'module':
       dispatch(change('condition', 'attribute', ''))
       dispatch(change('condition', 'operator', ''))
       dispatch(change('condition', 'value', ''))
     case 'attribute':
       dispatch(change('condition', 'operator', ''))
       dispatch(change('condition', 'value', ''))
     case 'operator':
       dispatch(change('condition', 'value', ''))
   }
 }
Exemplo n.º 10
0
function* cancelDescriptionModal() {
  yield put(change('help', 'description', ''));
  yield put(helpActions.hideDescriptionModal());
}
Exemplo n.º 11
0
 changeRowVisibility = e => {
   let checked = !!e.target.checked;
   let name = e.target.name;
   this.props.dispatch(change("filterForm", name, checked));
 };
Exemplo n.º 12
0
 componentDidMount() {
     const storageId = this.props.record.id || 'new'
     const initialMarkdown = localStorage.getItem(storageId) || this.props.record.markdown
     this.props.dispatch(change('record-form', 'markdown', initialMarkdown))
 }
Exemplo n.º 13
0
			setFormValue: (field, name) =>
				dispatch(change('conversation', field, name)),
Exemplo n.º 14
0
 .forEach(testKey =>
   dispatch(change(formName, `config.${testKey}[${idx}].${variableKey}`, variableValues[variableKey]))
Exemplo n.º 15
0
 .map(field => {
   const value = transformations[field] ? transformations[field](test.id, template[field]) : template[field];
   return value !== undefined
     ? dispatch(change(formName, ['config', testKey, field].join('.'), value))
     : undefined;
 })
Exemplo n.º 16
0
function* discardLocation() {
  yield put(change('help', 'latitude', ''));
  yield put(change('help', 'longitude', ''));
  yield put(helpActions.hideLocationModal());
}
Exemplo n.º 17
0
 toggleDialog: (name,q,w) => {
   dispatch(createAction(USERNAME_EDIT_FORM_TOGGLE)())
   dispatch(change('username', 'name', name))
 }