Commit graph

107 commits

Author SHA1 Message Date
Anton Khorev
e286ce515c Add limit parameter to api changesets query 2023-02-14 20:56:29 +03:00
Andy Allan
067b0de439
Merge pull request #3676 from harry-wood/notes-disappear-time
Display how long until a note will disappear
2022-11-23 15:44:26 +00:00
Andy Allan
22946d703a Enable the ActionOrder cop for remaining controllers
Where actions were reordered, the rails standard actions were
also moved to the top of each controller.
2022-11-02 11:06:00 +00:00
Tom Hughes
3d0b94abda Merge remote-tracking branch 'upstream/pull/3768' 2022-10-25 19:28:10 +01:00
Tom Hughes
460ed0c844 Fix new rubocop warnings 2022-10-25 19:19:57 +01:00
Anton Khorev
225b260640 Pass min/max lat/lon to notes index rss builder 2022-10-25 13:52:28 +03:00
Anton Khorev
0c8b9eabf3 Pass min/max lat/lon to notes rss feed builder 2022-10-25 13:35:18 +03:00
Robbendebiene
ed1112bcef Allow setting HTTP ACCEPT header for notes API
Previously the notes API return type could only be specified by appending the file extension like .json or .rss
2022-09-23 11:40:19 +02:00
Harry Wood
e057e1c479 Define a DEFAULT_FRESHLY_CLOSED_LIMIT constant
Define DEFAULT_FRESHLY_CLOSED_LIMIT in the Note model to allow the 7 day limit to be referenced in the API controller and in the new `freshy_closed_until` logic. The default value is `7.days`. API users can still override this, but the website uses that default for the duration of the green "freshly closed" notes markers.
2022-09-14 23:59:41 +01:00
Tom Hughes
1a4faa4507 There is no need to do setup_user_auth and authorize for the same action 2022-07-08 16:38:51 +01:00
Tom Hughes
7f619c6484 Check API status before authorizing access
Fixes #3530
2022-04-11 20:47:52 +01:00
mmd-osm
4ec85171fd JSON output added to changeset(s) endpoints 2022-03-14 15:52:49 +01:00
mmd-osm
c9e836a6cb JSON output added to permissions endpoint 2022-03-08 20:21:35 +01:00
Tom Hughes
cbcc7dc49f Fix some rubocop Naming/PredicateName warnings 2022-03-03 22:47:55 +00:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Tom Hughes
0410596908 Switch traces to use ActiveStorage 2021-12-16 18:45:31 +00:00
Andy Allan
3aa8292d6d Drop the trace_use_job_queue option
This has been set as true by default, and in production, for many
years. I don't think there's much use in keeping the setting around
any longer.
2021-11-24 15:23:27 +00:00
Andy Allan
95e5178bfb Refactor tracepoint index to use an xml builder view
This avoids constructing xml by hand in both the controller and
the model, and opens the way for other rendering in future.

The complexity of deciding which point goes where, along with revisiting
previous tracks and tracksegs means that I've broken it down into
two parts - sorting the points into the right trksegs is done first,
before rendering them all as xml. I couldn't find a way to allow
revisiting using the builder.
2021-09-29 15:14:53 +01:00
Andy Allan
76f1d7bc78 Use a builder to render changeset downloads 2021-09-15 16:33:04 +01:00
Tom Hughes
cc461b126d Correct policing of access to private user details 2021-08-24 17:49:08 +01:00
Andy Allan
37b03e47c6 Fix various code comments
These were found as part of #3233
2021-07-21 11:24:23 +01:00
Tom Hughes
608aafbf14 Make /api/0.6/permissions work for OAuth 2 clients 2021-06-27 00:38:16 +01:00
Andy Allan
6bb18436a3 Add tests for routing and to ensure output format
This avoids the tests passing if the json output is an array of kv pairs,
instead of the desired hash of attributes.
2021-04-14 16:11:57 +01:00
Michal Migurski
a67ff9c038 Added JSON support to user preferences 2021-04-06 21:27:54 -07:00
Tom Hughes
ff3a30d245 Fix new rubocop warnings 2021-03-02 08:24:15 +00:00
mmd-osm
4e6d729529 Remove /api/0.6/changes endpoint
Also removes sql functions which are only used by this endpoint
2021-02-03 14:06:34 +00:00
Tom Hughes
0654be27f9 Fix new rubocop warnings 2021-01-11 19:17:31 +00:00
Tom Hughes
0ff89c31e4 Remove both Potlatch versions
Fixes #2622
2021-01-05 21:18:45 +00:00
Andy Allan
4f304e2301 Remove SystemTimer and use stdlib Timeout directly
SystemTimer was only needed on ruby 1.8, and we dropped support for
that a long time ago.
2020-12-23 14:25:58 +00:00
Tom Hughes
88ba316abe Merge remote-tracking branch 'upstream/pull/2999' 2020-12-09 14:51:04 +00:00
Tom Hughes
582402ba8f Prefer keyword arguments when method has optional boolean arguments 2020-11-13 10:22:55 +00:00
Andy Allan
78b9d92207 Prefer keyword arguments when method has optional boolean arguments 2020-11-12 11:24:44 +00:00
Andy Allan
e6d7da3a62 Preload traces for the selected points
It doesn't make a huge difference, since rails caches all the results
of the queries generated by point.trace lookups, but at least it cuts
down on the logs.
2020-11-11 17:52:33 +00:00
Andy Allan
a15a3744da Use point.trace instead of an additional gpx_file variable
Every point knows which trace it's associated with, so there's no
need to search for it separately
2020-11-11 17:51:52 +00:00
Andy Allan
2c1033f62d Rename Notifier to UserMailer
It's a convention in rails to name your mailers with a Mailer suffix, and is also common to name the class after the recipient (e.g. User, Admin). So UserMailer seems a reasonable choice.
2020-10-14 15:04:58 +02:00
Tom Hughes
ddac660f3b Merge remote-tracking branch 'upstream/pull/2839' 2020-09-30 11:54:30 +01:00
Tom Hughes
18b9b9f14c Fix new rubocop warnings 2020-09-07 07:11:22 +01:00
mmd-osm
0fb725ea61 API User details JSON format 2020-09-06 22:11:23 +02:00
Tom Hughes
b7432e9432 Handle new rubocop warnings 2020-09-02 07:18:21 +01:00
Tom Hughes
75e135869e Fix Style/ExplicitBlockArgument warnings 2020-08-09 19:06:04 +01:00
Tom Hughes
77f9aec772 Fix some rubocop todos 2020-07-31 22:45:53 +01:00
Andy Allan
8c326a6c1f Remove unnecessary layout calls from api controllers
These were left over from the refactoring of the controllers into api and non-api versions.
2020-07-08 18:51:27 +02:00
Tom Hughes
96ee7ef95c Only report traces as offline when they are offline 2020-07-07 10:37:56 +01:00
Tom Hughes
2def62ee19 Fix errors with GPX offline mode 2020-07-05 14:49:12 +01:00
Tom Hughes
c9f9ade96f Fix new rubocop warnings 2020-06-03 17:47:35 +01:00
Tom Hughes
b5c778b662 Fix new rubocop warnings 2020-03-31 19:08:10 +01:00
Tom Hughes
aaf9d15d56 Rework set_default_request_format ast set_request_formats
Instead of trying to work out the exact format, just figure
out the list of allowed formats and let rails do the rest.
2020-02-29 15:28:23 +00:00
Andy Allan
73c95847a6
Merge pull request #2485 from mmd-osm/patch/json2
JSON output nodes, ways, relations, map
2020-02-26 15:55:48 +01:00
Tom Hughes
ff7ddb6b86 Merge remote-tracking branch 'upstream/pull/2381' 2020-02-19 19:11:32 +00:00
ENT8R
b84799f481 Keep the behaviour backwards-compatible 2020-02-19 12:58:47 +01:00