metanoia's People
metanoia's Issues
Write a more helpful README
Give instructions on how to run through the demo, and only link to the production version (don't give staging link).
Section reset feature could be really slow...
Since it sends one request per climb, this could take a long time and annoy the users.
Add a color_name instance method to `Climb` model
There a lot of places where I'm doing this:
Climb.color_name_for(climb.color)
"Add new employee" is broken in production
You can only see this in production. When you try to add a new employee (or give an existing one a new role), it doesn't work, saying that the role isn't in the list.
I think what is happening is that the code is eager loaded in production, and EmploymentForm
is loaded before the role story classes, so when this validation is defined:
validates :role_name, inclusion: { in: Employment.roles.map(&:to_s) }
Employment.roles
hasn't be set up properly yet.
Create a layout for JS responses
It should render the flash and put it before main
.
This would be a good time to move the flash partial to the shared folder (it is currently in the layouts folder).
White buttons are too tall
See climb log links, for a white climb
Review admin role & policies
Admins should be allowed to get a gym set up, but after it is "published", they should no longer be able to edit the gym or it's employees. It should be required that before a gym is published there is at least one manager assigned.
Create object within EmployeeTable for #has_employee? and related
Better color scheme for application
Choose a more vibrant color scheme. Also, I'd like to pick one main color for each role, and have the color switch when the role switches so that it is more obvious to the user what their current role is.
Refactor EmploymentForm#errors
Don't merge the employment errors directly into the form errors. Keep them separate, and instead create an instance variable to hold the merged errors. To perform the merging, use ActiveModel::Errors#copy!
(which is available in Rails version 5.0.0.1) to copy the form errors, and then merge in the employment errors as I was doing.
Re-do the Guardfile
Review the README at guard-rspec. For example,
- definitely want to have a special command for when all specs are running (to make sure that test coverage is turned on)
- consider setting
failed_mode
tofocus
, and having all unit tests listed first - maybe set
all_after_pass
totrue
Also, maybe define different groups (could separate out unit and integration tests).
Also, install guard-spring
Add documentation comments to code
This would also be a good opportunity to do a general code review while the application is still fairly small.
Have semaphore build automatically run migrations
`current_user` returns `nil` after user switches roles?
After a user switches from admin to athlete, the current_user
method seems to be returning nil
. Try logging in as admin1, switching to athlete role, then clicking on Gyms.
Fix appearance of select boxes when they're in focus
Look at "adding a new employee" when you're really just giving an existing employee an additional role
- make form more intuitive
- should find row with employee, and add the new role name (current it just adds a new row, so the employee is listed twice, once for existing roles, once for new role)
Scope policies to the gym that the user's role corresponds to
E.g. a setter at one gym shouldn't be able to modify stuff at another gym.
The page looks really bad on mobile devices
Refactor feature specs
In The Four Phases of Testing, they describe why it is important to only have one set of the four phases in each test.
Review the feature specs and try to apply this as much as possible.
Review specs and use factories more
Factories can be for non-active record objects too.
If a complex set up is needed in more than one place, consider if a (rather complicated) factory is appropriate.
When creating lots of climbs in a row, the flash messages just build up
Since there aren't any redirects, the flashes don't cleared out. We'll have to do it manually.
Make charts responsive
The climb histograms aren't resizing when I resize the browser window. They are responsive in that the size adjusts to the size of the window at the time that the page is loading, so it's not a huge issue, but I'd still like to fix it. Maybe use a Bourbon Neat grid instead of flexbox.
Clean up EmployeeListPolicy#index?
Better to use User#employed_at?
, but we'll need to adjust that method so it can be called without a specific role in order to see if a user is employed at a given gym with any role.
Use `button_to` rather than `link_to` for the links to log climbs
Search bots can click on link_to
'sThese links won't work if there is no logged in, but it still good to change them.
Refactor Employee#roles
Make a separate #roles_in_words
method, and have #roles
just returns the array of strings / symbols. We don't always need to turn it into a sentence, e.g.
# app/policies/employment_policy
def index?
Employee.new(email: user.email, gym_id: employment.gym_id).roles.present?
end
Create a RoleStory class or module
- hold information about the role story models and tables (basically all of the role story and role name related stuff that is currently in the
Employment
model) - have a method
for_user
that behaves like an ActiveRecord scope, returning all role stories for a particular user (something likeSetterStory.where(user: user).or(ManagerStory.where(user: user)
only with metaprogramming so that all types of role stories are handled; maybe define afor_user
method for each role story model in theEmployable
concern
Might be tempting to call it RoleStories
because it contains information about all of the role story models, however if we call it RoleStory
, then calls to the method above will look kind of like regular ActiveRecord stuff.
Validations and db constraints
Check to see that each validation has a matching db constraint and vice versa.
Review all of the role story models and stuff
Things would probably be cleaner if some inheritance or mixin modules were used. Also, maybe make the association one polymorphic has many instead of multiple 1:1's (but still, each user should only have one of each type of story).
SeedMigration table is dropped when db:drop runs
Any task that depends on db:drop
(e.g. db:reset
and db:populate
) will drop the seed_migrations
table. When a new seed migration is run after this, it then thinks that no seed migrations have been run yet, so it runs them all and data is duplicated.
Two possible solutions:
(a) Add pre-requisite rake task to db:drop
that will write the seed_migrations
table to a YAML file. Have another task that will load the seed_migrations
table back into memory and is a post-requisite for db:schema:load
.
(b) Add a way to record the current version somewhere, and record it after each migration is run. We obviously wouldn't want to record the current version in the database, because we'd run into the same problem... so maybe in a file somewhere? Once we have this recorded somewhere, we could either use it to regenerate the seed_migrations
table, or we could use the seed_migrations
table in combination with the recorded current version when determining which migrations to run.
GradeSystem should have dependent destroy on buckets
In the gym form object, the gym and the sections should be created in one transaction
Don't include modules directly into ActiveRecord::Base
For example, we include ActiveRecordSupplement
directly into ActiveRecord::Base
. With Rails 5.0, we can include this in ApplicationRecord
instead.
Users should only be able to log a climb when their current role is athlete
Fix new climb
It looks really ugly now... I think this started after I added min_width: 0
in order to allow the flex box to decrease in size
Only show "active" climbs in the section view partial
Rails 5.0 allows nested params in `button_to`
In sections/_show.html.haml
, we can switch params: { 'climb_log[climb_id]': climb.id }
back to a proper nested hash once we upgrade to Rails 5.0.
Extra section field is added when creating a new section fails
Does this happen for updating as well?
Add a mixin for radio button groups
Do this once we have another place (aside from climb type) where we want a radio button group.
Add waiting icon when AJAX is loading
So far, this is just for when the new section fields are loading (which probably shouldn't be through AJAX...). It will also be on the gym show page when a new section is selected.
"My Log" link should only be shown for athletes, action should have authorization
Upgrade to Rails 5.0
Add functionality to remove sections (via ajax) on the gym form
Require that emails be unique
Figure out why it takes files so long to load for RSpec
Maybe see if there is a way to profile it?
Add uniqueness constraint and validation for user emails
Close box on flashes doesn't work when they're added via ajax response
For example, try logging climbs and then closing the flash message.
Review feature specs
Some could probably be cleaned up with page objects. Also, look at other people's feature specs for ideas.
Manager tries to add new employee who doesn't have a certain role yet
What happens? It should just assign the role to the user.
Revert change to devise.en.yml once issue is fixed in Devise
Change invalid: "Invalid email or password."
back to "Invalid %{authentication_keys} or password."
once heartcombo/devise#4095 is addressed
Seed records for the roles table
Then we can add validation that ensures that when users are given a new role, that it is a role that exists. Then we don't need to validation like this:
# spec/factories/users.rb
# ...
valid_roles = roles.pluck(:name).keep_if do |role_name|
Employment.roles.include? role_name.to_sym
end
# ...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.