aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-07-09Refs: #3478@1h; fixes a view error in references#show(format: js)Robert
2017-07-07Fix routing_constraint_zone validation for create refs #3962 @3Luc Donnet
2017-07-07Merge branch 'regression_tests_user_permissions_in_controllers'Robert
2017-07-07User Permissions Computation tested in controllers vehicle_journeys and ↵Robert
journey_patterns
2017-07-07Refactoring calendar mailer move users query into observerXinhui
2017-07-07Observer for model CalendarXinhui
2017-07-07Add mailer jobXinhui
2017-07-07Hotfix user_permission computation in journey_patterns and vehicle_journey ↵Robert
controllers
2017-07-07Merge pull request #28 from ↵Robert Dober
af83/3479-migrate-priority-table-builder-helper-calls-to-new-version 3479 migrate priority table builder helper calls to new version
2017-07-07referential_lines/show.html.slim: Fix syntax errorTeddy Wing
I had converted the double quotes that used to be here into single quotes without thinking, and that doesn't work because there's an apostrophe in the string. Thankfully the failing tests told me about the error. Refs #3479
2017-07-07TableBuilderHelper::URL: Fix polymorphic URL for TimeTableTeddy Wing
Had a problem on the TimeTables#index page where the #show and #edit links in the gear menu would link to `/referentials/:id` instead of `/referentials/:id/time_tables/:id`. This turned out to be caused by a syntax bug in the condition that adds the `Chouette::TimeTable` object to the polymorphic URL array. Now the proper URL is rendered. Refs #3479
2017-07-07TimeTables#index: Use new table builder helperTeddy Wing
Additionally convert the `#human_attribute_name` calls to call it on the class because this is more correct and because that method doesn't exist on the decorated collection of `@time_tables`. TODO: There's a bug here where the #show and #edit links don't link correctly, they go to `/referentials/:id` instead of `/referentials/:id/time_tables/:id`. Refs #3479
2017-07-07CalendarsController: Fix breadcrumb on #index & #showTeddy Wing
Apparently I messed up the breadcrumb in these views because I was overriding the `#index` and `#show` methods defined in `BreadcrumbController`, which make these calls to `#build_breadcrumb`. Add them in to restore the breadcrumb links to these pages. Refs #3479
2017-07-07Calendars#index: Use new table builder helperTeddy Wing
Refs #3479
2017-07-07RoutingConstraintZones#show: Use new table builder helperTeddy Wing
Refs #3479
2017-07-07ReferentialLines#show: Use new table builder helperTeddy Wing
Convert the table of `Route`s on this page to use the new table builder helper. This gives us the links from the `RouteDecorator` in the gear menu next to each row in the table. Ended up removing the `route_sp` field from the `RouteDecorator` context because it seems like we can just grab that collection directly from the `Route` object. At first I thought about renaming it because after coming back to this code I thought, 'what does sp mean?'. Then after some investigation, it appears that we don't need to pass it in explicitly. Now, no need to bother with that from the ReferentialLines controller. The RoutesController does create a separate `@route_sp` variable, but this only changes the sort order of the stop points, not the contents of the collection. Thus it seems safe to get them directly from the Route in the decorator. Refs #3479
2017-07-07Add CalendarMailerXinhui
2017-07-07Set default action_mailer default_options fromXinhui
2017-07-07Add gem email_specXinhui
2017-07-07Refs #3987: updating menu left (fix tests)jpl
2017-07-07Refs #3987: updating menu leftjpl
2017-07-07Fix auth switch mode (again)jpl
2017-07-06Merge branch 'master' of github.com:af83/stif-boivcedricnjanga
2017-07-06Fix test according changes in model : boundaries are exclusive for between ↵cedricnjanga
clean up
2017-07-06Merge branch 'master' of github.com:af83/stif-boivRobert
2017-07-06Merge branch 'master' of github.com:af83/stif-boivcedricnjanga
2017-07-06Comment clean test, need to fix it latercedricnjanga
2017-07-06Merge branch 'master' of github.com:af83/stif-boivRobert
2017-07-06improve packagingFlorent Peyraud
2017-07-06Merge branch 'master' of github.com:AF83/stif-boivFlorent Peyraud
2017-07-06Merge branch 'master' of github.com:af83/stif-boivRobert
2017-07-06Change format of error message format + some typoscedricnjanga
2017-07-06Conflict resolvedRobert
2017-07-06Merge branch 'master' of github.com:af83/stif-boivaf83
2017-07-06Change wording for RCZ wording on validations errorsaf83
2017-07-06Merge branch 'master' of github.com:AF83/stif-boivFlorent Peyraud
2017-07-06Update install scripts to cope with the two roles front and workerFlorent Peyraud
2017-07-06TableBuilderHelper: Fix specs which mock `current_referential`Teddy Wing
These two specs were failing because of the line: current_referential ||= nil which would set `current_referential` to `nil` even after updating the object being stubbed to `helper`. Change the specs to stub the method on the correct object now that `TableBuilderHelper::URL` doesn't depend on `current_referential`. Update the faulty line in question to not clobber `current_referential`, but still give us the `nil` value we were looking for when the helper method isn't defined. Refs #3479
2017-07-06TableBuilderHelper: Fix NoMethodError when `current_referential` undefTeddy Wing
Certain controllers (`Calendar` and `Referential`) don't define a `#current_referential` method. In those cases, we'd get a `NoMethodError` in this function when calling `#current_referential`. To avoid the error, give `current_referential` a default value. Using a default of `nil` works here because the current referential is needed in other places in order to build links. Since the links in the special models don't need a referential in order to be built, we don't care that the value is `nil`. Refs #3479
2017-07-06Lines#index: Use new `table_builder_2`Teddy Wing
Convert the table of Lines to use the new version of the table builder. Update the view with the new calling format of the helper. The controller needs to decorate the `@lines` collection in order to make `#action_links` available to the table builder. Needed to update the "_filters.html.slim" template to call `#human_attribute_name` on the class instead of the collection, because we can't do that on a decorated collection. Refs #3479
2017-07-06TableBuilderHelper::URL: Inject `current_referential` dependencyTeddy Wing
Turns out the only reason why this code worked before was because the only place I was using `table_builder_2` was for a list of `Referential`s, and there's an explicit check for `item.is_a?(Referential)` that avoids calling `current_referential`. Otherwise, when that `unless` condition passes, we get a failure because `current_referential` can't be found. It can't be found because helper methods are not accessible in this scope (duh). In order to make the referential accessible to the method, require one as an argument. Now we explicitly pass the `current_referential` from places where `#polymorphic_url_parts` is called. Refs #3479
2017-07-06Merge branch 'master' of github.com:af83/stif-boivaf83
2017-07-06Change wording for clean up + add exclusive dates for between clean upaf83
2017-07-06Fixes: #3478@1.5hRobert
- Fixes remaining issues with LinePolicy, CalenderPolicy & RoutePolicy - Dead Code elimination
2017-07-06Refs:#3478@10h;Robert
Policy Refactoring and Policy Test Completion - All policies (and all permissions) under test. - Common patterns and potential problems identified... - ... and documented in DEVNOTES.md - some simply refactorings
2017-07-05Refs#3972: Adding proper link to Calendar on side menujpl
2017-07-05Refs: #3478@1h;Robert
- All permissions tied to `!archived?` - Tests adapted - Policies refactored ? Is `create?` permission bound to `organisation_match?`
2017-07-05Refs: #3478@1.5h;Robert
- PolicyChecker authorizes(*) all now - Untied ApplicationPolicy#index? from show? - mv access_point_policy.rb to access_point_policy.rb fixing an invisible name curruption (local problem?) * to authorize: to allow (not here), to undergo the process of authorization (here)
2017-07-04Refs: #3478@3h; Policy Cleanup and Providing Policy and permissions for all ↵Robert
models and actions - ApplicationPolicy nondestructive permission depend on model existance - ApplicationPolicy destructive permission default to `false` - Tied Policy permissions at ApplicationPolicy Level: edit? → update?, new? → create?, index? → show? - ApplicationPolicy convenience methods `delete?` & `authorizes_action?(action)` - Refactoring of `spec/helpers/table_builder_helper_spec.rb` accordingly - Stubbing scope in specs (cannot switch to referential with a `build_stubbed` instance)
2017-07-04Refs: #3478@1h removed boiv-read-offer and BoivPolicyRobert