Giter Club home page Giter Club logo

empower's People

Contributors

leosoaivan avatar

Watchers

 avatar  avatar

empower's Issues

Find an alternative to decorating respondents via helper

A Client/Respondent's demographic information is in a partial that is shown on two pages: Episode#show and Client#show.

Because Episode#show displays a single episode, decorating a respondent's demographic information via @respondent = ClientDecorator.new(@episode.respondent) and passing it to the view is not an issue.

Because Client#show displays many episodes in which a client is involved in as petitioner (not respondent), decorating a respondent's demographic information while rendering through the collection of episodes is more challenging. This is made harder since, in some episodes, there is no respondent (aka, nil).

Presently, a helper is employed in the view, as follows:

  def decorated_respondent(respondent, attr)
    ClientDecorator.new(respondent).send(attr) unless respondent.nil?
  end

Right-align "view" buttons on clients#search cards

Expected Behavior

When viewing the client cards displayed after searching for a client, the "View" button's alignment should be towards the right

Current Behavior

The "View" button's alignment is affect by another field to its left, currently holding a client's phone number. The "View" button's alignment is affected by the length of this field, which varies. As such, the button is not always align all the way to the right.

Possible Solution

Use a grid within the card?

Steps to Reproduce

  1. Log in
  2. Click on "Find client"
  3. Observe alignments of "View" buttons on the resulting cards being displayed.

Rails' wrapper class `field_with_errors` removes Materialize checkboxes

Context

Materialize pushes Rails' checkboxes off-screen, sets them to invisible, and provides its own (label::before).
When validations fail on a form, Rails' wrapper class field_with_errors removes the checkboxes provided by Materialize.

In order to maintain Materialize's checkboxes, a (temporary) solution is to add the following to Rails, which removes the field_with_errors wrapper:

#config/initializers/environment.rb

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
  html_tag
end

A more long-term solution would be to edit the above code such that the wrapper class does NOT apply to checkboxes. A Capybara test to #check for the presence of the Materialize checkbox before and after failing would be helpful. Currently, however, when field_with_errors is active, the following passes when it shouldn't:

#after failing validation

  it "keeps the checkboxes active" do
    expect(page).to have_unchecked_field(id, visible: true)
  end

screenshot-2018-1-7 empower

Duplicate flash

Describe the bug
A second flash with text "true" appears when a user is timed-out and is returned to the login page.

To Reproduce
Steps to reproduce the behavior:

  1. Log in
  2. Allow self to time-out and to be redirected to login page
  3. See error

Expected behavior
Only a single flash should appear.

Screenshots
https://screenshots.firefox.com/7i4Ti07tNOUphU84/localhost

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser: FireFox 60.0.1

Redirect after attempting to delete a client with episodes doesn't display the client's episodes

Expected Behavior

When attempting to delete a client with episodes, a user is redirected to the client's page. The client's page displays a flash stating that the client could not be deleted due to the presence of episodes. The episodes are displayed.

Actual Behavior

The client's page after the redirect is the right page, but none of the episodes are there. The flash warning appears. A message stating that there are currently no episodes is displayed.

Possible solution

render vs. redirect?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.