Ejemplo n.º 1
0
import appState from "common/state";

const loginForm = appState.select( 'loginForm' );

class LoginActions {

    constructor( $http, $location, $q ) {
        this.$http = $http;
        this.$location = $location;
        this.$q = $q;
        console.info('Login Actions Service constructed');
    }

    get form() { return loginForm.get(); }

    set form( data ) { loginForm.set( data ); }

    error( message ) {
        message && loginForm.set( 'error', message );
    }
}

export default LoginActions;
Ejemplo n.º 2
0
import appState from "common/state";

const form = appState.select([ 'forms', 'searchSMS', 'exclude' ]);

class ExcludeIDPActions {

  loadFromBrowser() {
    const fromStorage = localStorage.getItem( 'excludeList' );
    fromStorage && form.set( JSON.parse( fromStorage ) );
  }

  saveToBrowser() {
    localStorage.removeItem( 'excludeList' );
    localStorage.setItem( 'excludeList', JSON.stringify( form.get() ) );
  }

  addIDP({ id, title }) {
    form.push( 'IDPs', id );
    form.push( 'titles', title );
    this.saveToBrowser();
  }

  removeIDP( index ) {
    form.splice( 'IDPs', [ index, 1 ] );
    form.splice( 'titles', [ index, 1 ] );
    this.saveToBrowser();
  }

  get items() {
    return form.get().titles;
  }
Ejemplo n.º 3
0
 get headerState() {
   return appState.select( 'header' ).get();
 }