Skip to content
Commits on Oct 7, 2014
  1. Refactor autocomplete search

    * Change `<span>` for clearing search to a `<button>`. Add
      `.link-button` CSS class to style buttons as links.
    * Add Backbone view for reset button.
    * Always add child views to `children` collection via `renderChild` to
      ensuring that `render` on the child is called.
    * Specify `urlRoot` on `User` Backbone model. This removes coupling
      between `DeliveryForm` and `AutocompleteSearch` where `DeliveryForm`
      resets the collection of `AutocompleteSearch` after persisting the
      recipient so that the Backbone model knows what URL to `POST` to to
      create the record. Now `AutocompleteSearch` can reset the Backbone
      collection before triggering the `select` event.
    * Add `onSelect` and `onReset` callbacks to customize what state the
      autocomplete input is in after selecting a result or resetting the
      search after the reset button is clicked. The default select state is
      to leave the input in a disabled state with the `value` property of
      the model backing the result.
    * Add `reset` event triggered when reset button is clicked.
    * Render markup for the autocomplete `<ul>`, hint button and loading
      animation in JavaScript instead of on the server.
    * Wrap input and client-side-rendered elements in a div, styled with
      `position: absolute`. Makes the placements for absolutely positioned
      elements remain the same independent of how the input and its sibling
      elements are placed on the page.
    * Extract base styles for autocomplete inputs, deferring to specific
      contexts (new delivery page) to override styles based on any style
      changes applied in that context.
    committed Sep 13, 2014
Commits on Sep 18, 2014
  1. Add seed task for data in development and staging

    Remove `lib` directory from autoload paths. Nothing in `lib` is required
    for running in production. Removing it is necessary to prevent
    `DemoData` and the `faker` gem from being loading when the application
    starts in production mode and loads all application code on startup.
    committed Sep 18, 2014
  2. Remove unneeded helper methods in `DeliveriesController`

    Leverage `paraphrase` to filter and specify defaults for query params if
    none are specified removing the need for `delivery_search_params` in
    favor of using `@query` in the view to read param values.
    
    Remove call to `Delivery` constant in `deliveries/new.html.haml`. Build
    a delivery with receipts for each recipient in the query params in the
    controller removing the need for `receipts_for_new_delivery`.
    committed Sep 17, 2014
  3. Remove preserving delivery sort in a cookie

    This was meant to preserve the user's preference when viewing deliveries by
    date. The most meaningful way to view deliveries by default is newest
    deliveries first so there isn't as much of a presedence to sort by
    oldest first when visiting `/deliveries` with no specified filter.
    committed Sep 17, 2014
Commits on Sep 15, 2014
  1. Enforce single quotes in hound

    After trying out double quotes, single quotes are easier to type and can
    be changed to double quotes with `cs'"` using the `surround.vim` plugin.
    committed Sep 15, 2014
  2. Add minor instructions for logging deliveries [ci skip]

    Use placeholders and input hints instead of heavy copy that will
    distract the user.
    committed Sep 15, 2014
  3. Update delivery search

    committed Sep 14, 2014
Commits on Sep 14, 2014
  1. Only re-render delivery search results, not entire page

    Previously, the header content displaying the selected date and the
    next/previous day links would need to be re-rendered when switching
    days. Using a form, this isn't the case.
    committed Sep 14, 2014
  2. Add filtering by deliverer

    Use `paraphrase` gem to simplify query logic.
    
    Add constants in `DeliveryQuery` to map keywords to query param values.
    This avoids hard-coding query param values throughout the codebase and
    allows changing the values with minimal code churn or breaking
    functionality.
    
    Switch sorting feature test to use desk worker names to assert order
    since the `appear_before` matcher finds 'UPS' and 'LaserShip' in the
    `<select>` first. It isn't possible to limit the assertion to a part of
    the page with `within` since the orderly gem uses `page.body` to make
    the assertion[1].
    
    [1] https://github.com/jmondo/orderly/blob/master/lib/orderly.rb#L8
    committed Sep 12, 2014
  3. Add option to show all deliveries on index page

    Use a `<select>` input for sorting and filtering params. Sets up a base
    for filtering deliveries by deliverer, desk worker and recipient.
    committed Sep 12, 2014
  4. Switch delivery search to show all deliveries withing for pickup

    Remove searching deliveries by date of delivery as it is no longer the
    expected user interaction. Desk workers need, by default, a list of all
    deliveries waiting to be picked up.
    committed Sep 11, 2014
  5. Display a delivery's receipts on index page

    Enables a consistent display of information for different methods of
    reviewing deliveries.
    committed Sep 11, 2014
Commits on Sep 13, 2014
  1. Remove `autocomplete_steps`

    Use `data-resource` convention and capybara-provided `fill_in`.
    committed Sep 13, 2014
  2. Refactor autocomplete input

    * Change how results are focused / blurred when hovered over.
    * Decouple template for results from user attributes
    committed Sep 13, 2014
  3. Decouple autocomplete result template from user properties

    Add custom attributes to internal `attributes` property so they can be
    accessed via `Model#escape()`.
    committed Sep 13, 2014
Commits on Sep 7, 2014
  1. Don't stub the system unders test in command classes

    Use a double to represent instances of `Cocaine::CommandLine` instead of
    stubbing `#command_output` on instances of the class being tested.
    committed Sep 7, 2014
  2. Fix argument name in `PtsMembershipCommand`

    Tests still passed because `command_output` is stubbed.
    committed Sep 6, 2014
  3. Add worker to sync users that have the desk worker role

    Runs every 5 minutes. Notifies `Honeybadger` if:
    * `ENV['DESK_WORKERS_GROUP']` is missing
    * The command failed.
    * A user in the group is not found in the application database or the
      LDAP server
    committed Aug 28, 2014
  4. Add `PtsMembership` command

    Shells out to `pts` command line utility for checking members of
    specified AFS group. Handles when command has a 0 exit status but
    returns an error message.
    committed Aug 28, 2014
  5. Correct index for `user_roles` table

    Had lingering indices from when the table was the join table between
    `users` and `roles`.
    committed Sep 6, 2014
Commits on Sep 6, 2014
  1. Correctly handle Shibboleth sessions

    Closes #17.
    Closes #18.
    committed Sep 6, 2014
  2. Remove local Shibboleth session after

    After sign out via devise, redirect to the Shibboleth logout handler
    with the `return` query parameter to redirect back to the home page
    after Shibboleth removes the user's local session.
    committed Sep 6, 2014
  3. Only sign in user via Shibboleth when visiting login page

    Pass login page as `target` query parameter to the Shibboleth login
    handler that instructs Shibboleth to redirect to the specified URL after
    a session is created.
    committed Sep 6, 2014
  4. Improve dev/prod parity around Shibboleth sign-in

    Handle redirect inside a Rails controller instead of having it be
    handled by Apache.
    
    Only enable signing in via Shibboleth if the `SHIBBOLETH_LOGIN_HANDLER`
    variable is set. Don't render the form to the user if the variable is
    not set.
    
    To simplify conditional styling, swap placement of Touchstone/Shibboleth
    form and form to sign in via `devise`.
    committed Sep 6, 2014
Commits on Sep 4, 2014
  1. Enable deploying a specific branch

    $ BRANCH=topic-branch bundle exec cap <stage> deploy
    committed Sep 4, 2014
  2. Merge pull request #20 from ecbypi/capistrano-env

    Setup ENV variable management and loading
    committed Sep 4, 2014
  3. Load .env file in `config/boot.rb` [ci skip]

    Part of the ideal 12 Factor[1] setup is loading the environment
    variables prior to starting the application a la the `foreman` gem.
    While the 12 Factor manifesto doesn't say this methodology is required,
    it avoids mutating the `ENV` in the running process making it easy to
    avoid potentially subtle bugs where code fails due to the `ENV` not
    being loaded early enough or having to setup complicated /
    unconventional load orders to ensure the `ENV` is loaded before all
    other code that depends on it is loaded.
    
    Using MIT Touchstone requires use of shibboleth[2], which requires using
    the Apache webserver. In order for the Rails application to use
    shibboleth to sign in users, it needs access to Apache environment
    variables[3]. The only Rack web server that provides this functionality
    is Phusion Passenger[4]. While it is possible to use HTTP headers to
    communicate information provided by Shibboleth, it is strongly
    discouraged due to security concerns.
    
    Passenger's solution for loading the `ENV` before starting the
    application is through Apache's `SetEnv` and `PassEnv` directives[4].
    This requires editing Apache XML conf files and restarting/reloading
    Apache anytime `ENV` variables need to be changed. This requires root
    access and is difficult to do programatically without a well-managed
    Chef or Puppet deployment[6].  It also does not help with loading `ENV`
    variables for other processes such as `sidekiq`.
    
    Given the set of requirements and limitations, `config/boot.rb` is the
    ideal place to load the `ENV` since it:
    
    1. Ensures both web, background and console processes have the same
       `ENV` loaded.
    2. Occurs just after `bundler` is setup, but before any gems listed in
       the `Gemfile` are loaded.  This solves modifying the `ENV` before any
       application code needs it.  If any code that needs to be configured
       by the `ENV` occurs in `config.ru` or `config/environment.rb`[7], the
       location `Dotenv.load!` is called needs to be changed or `config.ru`
       / `config/environment.rb` need to be modified.
    
    `Dotenv.load` is used over `Dotenv.load!`, deferring to where the `ENV`
    is read from to ensure the value is present (i.e. via `Hash#fetch`
    without a fallback).
    
    This strategy also maintains dev/prod parity by ensuring we load the
    .env file in a consistent manner in development and in production. To
    maintian parity with the Apache config strategy, the development
    environment need to have apache running.
    
    Dev/prod parity still needs to be resolved around signing in with
    shibboleth, either via enabling with a feature toggle or reproducing the
    functionality in development via a service such as testshib.org.
    
    [1] http://12factor.net
    [2] https://wiki.shibboleth.net/confluence/display/SHIB2/Home
    [3] https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPEnableApplication#NativeSPEnableApplication-Environment/HeaderVariables
    [4] https://www.phusionpassenger.com/
    [5] http://httpd.apache.org/docs/2.4/mod/mod_env.html
    [6] The current goal is to manage deploys and deployment configuration
        via capistrano
    [7] `BUNDLE_GEMFILE` cannot be changed by the .env file using this
        method. There isn't a need for this so it can safely be ignored.
    committed Sep 4, 2014
Something went wrong with that request. Please try again.