aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
AgeCommit message (Collapse)Author
2017-08-23Refs #4258: adding overhead feature to table_builder, with static samples on ↵jpl
imports#show
2017-08-23API - WorkbenchImport #create actionXinhui
Refs #4280
2017-08-22Refs: 4273@5h; Still debugging zip file upload inside post to Rails api; ↵Robert
Retry removed (but not the deadcode yet) [amend me]
2017-08-22API - workbench imports controllerXinhui
2017-08-22API - Refactoring iboo controller basic auth username should be an ↵Xinhui
organisation code
2017-08-22API - new end point for workbenchesXinhui
2017-08-22API - Iboo controller for basic auth end pointsXinhui
2017-08-22Refs: #4273@3h;Robert
Debugging Java Integration (ZipService -> HTTPService -> Object Creation) - Created an ErrorFormat concern to see what went wrong in the HTTP call as so many things can go wrong due to: * Timeout Issues * Illegal database setup or cleaning before tests
2017-08-21Refs #4246 Fix combinaitions to only consider effective days for the two ttcedricnjanga
2017-08-18Refactoring api_keys views with table_builderXinhui
2017-08-16Import validate presence of creatorXinhui
Refs #4270
2017-08-16Refs #4256: adding pagination and so for imports#indexjpl
2017-08-11RoutesController: Add separate method for POST /duplicateTeddy Wing
Send POST requests for duplication to a new controller method so we can more easily handle them and separate setup and creation code. Note that the test doesn't work. The `to change` part succeeds even though it shouldn't. Still need to figure out what's going on there, but committing this to hand off the feature to Robert. Refs #4189
2017-08-11Routes#duplicate: Add breadcrumb to pageTeddy Wing
Build a breadcrumb. In order to do so, we need to set the `@line` instance variable (how would I know that? I wouldn't, damn implicit dependencies). Refs #4189
2017-08-11Routes#duplicate: Add page headerTeddy Wing
Set header text in the locale files and display it on the page given the route ID in the URL. Remove the third argument from `pageheader` because after looking at the helper method's signature, I see that it's not necessary. Refs #4189
2017-08-11RoutesController: Get rid of old commented codeTeddy Wing
This method was commented out in 2012. Safe to say we can remove it.
2017-08-11Add routes to Routes#duplicateTeddy Wing
A couple of new routes for a form that will allow us to duplicate an itinéraire/route inside a line. Refs #4189
2017-08-11initialRobert
2017-08-04Refs #4227 Add timetable_combination policiescedricnjanga
2017-08-03Merge branch '1726-WorkbenchImport-for-multi-Netex-import'Robert
2017-08-02Fix date filters for Timetable and workbenchescedricnjanga
2017-08-02Refs: #4176@3h; NetexImportController refactored with help of ControlFlowRobert
2017-08-01Refs: #4176@2h; Request Spec for NetexImport adapted and implementedRobert
- Specing that, in case of a correct request Referential & NetexImport instances are created and a 201 is returned - Specing that, in case of an incorrect request, no instance is created and a 406 with a correct error message is returned - Implemented MISSING: Refactor controller implmentation
2017-08-01Merge pull request #48 from af83/1726-WorkbenchImport-for-multi-Netex-importteddywing
1726 workbench import for multi netex import
2017-08-01Merge pull request #46 from af83/3507_1726_impl_workbench_importteddywing
3507 1726 impl workbench import
2017-07-31Refs #4005 Period filters for time_table and referentialscedricnjanga
2017-07-31Fix routing constraint zones scope for index use line and not referential ↵Luc Donnet
Refs #4185 @1
2017-07-27Merge branch 'master' into 1726-WorkbenchImport-for-multi-Netex-importRobert
2017-07-26RoutingConstraintZones#index: Fix sort in tableTeddy Wing
Sorting by stop point count and route name wasn't working. Only sorting by name worked. This was because these HTML table columns get their data from methods on the `RoutingConstraintZone` model (`#stop_points_count` and `#route_name`). Those methods can't be sorted on in the database. Furthermore, when setting up the order ActiveRecord call, only database column names on `routing_constraint_zones` were taken into account. When a `sort` parameter specified an identifier that wasn't a column name, the `name` column would be used to sort the list. In this change, we enable sorting by stop point count and by route name. The SQL work for ordering comes from a couple of new scope methods defined on the model. Xin explained that he had previously used scope methods to enable exotic sorting of Referentials on the Workbenches#show page. I couldn't think of a better way to deal with these, and it seems like a reasonable thing to do here, so I went with the same setup. In `#sort_column`, tack on our custom sorting keys to the list of accepted keys. This borrows the pattern used in other `#sort_column` methods in other controllers. Ended up using "route" as the route name sorting key because that's what gets passed from the frontend. Eliminated the `if` condition in `#collection` that defaults to `name` sorting because it was redundant. The `#sort_column` method already defaults to sorting by name if no `params[:sort]` is passed in. This makes the method a lot cleaner, nice. Add a new private method `#sort_collection` that determines what method to call to sort the query. When using real table column names, it calls `#order` like before. But now, if the user asked to sort by stop point count or route name, we delegate instead to our scope methods, `#order_by_stop_points_count` and `#order_by_route_name`. Refs #4130
2017-07-25Hot fix Timetable#create - from Calendarcedricnjanga
2017-07-24Update Tietable#merge! to manage more edge casescedricnjanga
2017-07-24Check tt_params[:calendar_id] in Timetable#createcedricnjanga
2017-07-21Refs #4134: fix autocomplete on TT edit tagsjpl
2017-07-21Fix cloned ref should belong to current user organisationXinhui
Refs #4132
2017-07-21Fix referentials count in homepage Refs #4136 @1Luc Donnet
2017-07-20Refs: #3507@1hRobert
Introduction of Presence Validation in Import model, for: - workbench - referential
2017-07-20Merge remote-tracking branch 'origin/master' into ↵Teddy Wing
1726-WorkbenchImport-for-multi-Netex-import
2017-07-19Fix errors from JS-formatted templates using the table_builderTeddy Wing
We were getting errors like these: Started GET "/referentials/4/networks?_=1500482065840" for 127.0.0.1 at 2017-07-19 18:34:27 +0200 Processing by ReferentialNetworksController#index as JS Parameters: {"_"=>"1500482065840", "referential_id"=>"4"} User Load (3.6ms) SELECT "public"."users".* FROM "public"."users" WHERE "public"."users"."id" = $1 ORDER BY "public"."users"."id" ASC LIMIT 1 [["id", 1]] locale set to :fr Organisation Load (5.6ms) SELECT "public"."organisations".* FROM "public"."organisations" WHERE "public"."organisations"."id" = $1 LIMIT 1 [["id", 1]] Referential Load (1.0ms) SELECT "public"."referentials".* FROM "public"."referentials" WHERE "public"."referentials"."organisation_id" = $1 AND "public"."referentials"."id" = $2 LIMIT 1 [["organisation_id", 1], ["id", 4]] Workbench Load (0.7ms) SELECT "public"."workbenches".* FROM "public"."workbenches" WHERE "public"."workbenches"."id" = $1 LIMIT 1 [["id", 1]] (1.3ms) SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 [["id", 1]] CACHE (0.0ms) SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 [["id", 1]] Chouette::Network Load (2.3ms) SELECT DISTINCT "public"."networks".* FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 ORDER BY name asc LIMIT 12 OFFSET 0 [["id", 1]] CACHE (0.0ms) SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 [["id", 1]] Chouette::Network Exists (1.2ms) SELECT 1 AS one FROM "public"."networks" WHERE "public"."networks"."id" = $1 LIMIT 1 [["id", 118]] Rendered referential_networks/index.html.slim (48.9ms) Completed 500 Internal Server Error in 184ms (ActiveRecord: 17.4ms) ActionView::Template::Error (undefined method `action_links' for #<Chouette::Network:0x007ffea2148b08>): 22: - if @networks.any? 23: .row 24: .col-lg-12 25: = table_builder_2 @networks, 26: [ \ 27: TableBuilderHelper::Column.new( \ 28: name: 'ID Codifligne', \ app/helpers/table_builder_helper.rb:161:in `block in build_links' app/helpers/table_builder_helper.rb:158:in `build_links' app/helpers/table_builder_helper.rb:138:in `block (3 levels) in tbody' app/helpers/table_builder_helper.rb:110:in `block (2 levels) in tbody' app/helpers/table_builder_helper.rb:108:in `block in tbody' app/helpers/table_builder_helper.rb:107:in `tbody' app/helpers/table_builder_helper.rb:72:in `table_builder_2' app/views/referential_networks/index.html.slim:25:in `_app_views_referential_networks_index_html_slim___1557411244315414919_70366016986820' app/controllers/referential_networks_controller.rb:27:in `index' Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.8ms) Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (2.5ms) Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb (76.0ms) on the following pages: - http://stif-boiv.dev:3000/referentials/4/time_tables - http://stif-boiv.dev:3000/line_referentials/1/companies - http://stif-boiv.dev:3000/line_referentials/1/networks - http://stif-boiv.dev:3000/referentials/4/companies - http://stif-boiv.dev:3000/referentials/4/networks This was caused by the request of a JS-formatted view that rendered the HTML template, since the collection decoration only happened in the HTML format section. Do the decoration in both the HTML format and JS format for the relevant controllers in order to eliminate this error. Maybe there's a cleaner way to do this than just duplicating the decoration in both `format.X` blocks, but I don't know of it. Wanted to make sure not to decorate when it wasn't necessary, like when rendering other formats (XML, etc.). Refs #4105
2017-07-19Refs 4131 Change Timetable#create to fetch all Calendars (new_from)cedricnjanga
2017-07-19dead code eliminatedRobert
2017-07-19Refs: #3506@16h Request Spec for NetexImport API and implementationRobert
- Carrier Wave Upload with `fixture_file_upload` - Request specs to .json - Implementation - API token setup - Refuted experiments with controller specs
2017-07-17Refs #4108: adding workbenches#indexjpl
2017-07-17Refs: #3506@1.5h sketching out specs [amend me]Robert
2017-07-17Fixes: #3555@1hRobert
- Import#parent_id & #parent_type migration generated - Import#belongs_to :parent, class_name: to_s specified - Import#belongs_to :parent, class_name: to_s implemented
2017-07-13Update policies to make a custom behaviour on footnotes Refs #4094 @1Luc Donnet
2017-07-13Fix footnotes policy Refs #4094 @2Luc Donnet
2017-07-12Remove wild option in timetable tag filtercedricnjanga
2017-07-12Merge pull request #30 from ↵soykje
af83/3479-migrate-all-remaining-table-builder-helper-calls-to-new-version 3479 migrate all remaining table builder helper calls to new version
2017-07-12Routes#show: Use new table builder helperTeddy Wing
Update the table builder helper for the table of `Chouette::StopPoints` on this page. Created a new `StopPointDecorator` which unfortunately has the same code as `StopAreaDecorator`, the only difference being that instead of using `object`, it uses `object.stop_area`. Need to work out how to eliminate that code duplication. Refs #3479
2017-07-12ReferentialStopAreas#show: Render header buttons from decoratorTeddy Wing
Since we already have the decorator available, get the links from there for better code reuse. Refs #3479