Commit graph

951 commits

Author SHA1 Message Date
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
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
Harry Wood
d8e51614cb Display how long until a note will disappear
Modify the message displayed at the bottom of the notes sidepanel. For already resolved notes we don't want to say "please resolve it". Fixes https://github.com/openstreetmap/openstreetmap-website/issues/3663

Instead explain that it will disappear from the map (so reporting is probably not necessary) and display how long to go until that happens. Tackling https://github.com/openstreetmap/openstreetmap-website/issues/3071
2022-09-14 23:59:25 +01:00
Adam Hoyle
7e5cbe87ed Merge branch 'master' into feature/add-communities-page
# Conflicts:
#	Gemfile.lock
#	package.json
#	yarn.lock
2022-09-10 16:13:17 +01:00
Andy Allan
bb7f5ac2c8 Switch to using FrozenRecord for loading communities
This allows us to query the records to get the local chapters, which
is more flexible and allows us to use other resources too.
2022-07-27 16:19:08 +01:00
Anton Khorev
b54c03389b Strip leading/trailing whitespace from comma-separated trace tags 2022-07-19 13:47:28 +03:00
Tom Hughes
a3a228862c Add validation for relation member roles
Fixes #3563
2022-06-09 19:21:08 +01:00
Harry Wood
3ca8b63643 Put issue comments through kramdown formatter
On issue comments (which only admins can create or see), put the `body` text through kramdown formatting.
2022-05-06 13:36:59 +01:00
Harry Wood
9401e451d1 Format report text with kramdown
Pass the text of reports ('details' field) through the RichText formatter to give us kramdown formatting support.
2022-04-29 01:31:39 +01:00
Andy Allan
561ee71129 Rubocop autofix: ambiguous operator precedence
This simply adds braces to clarify which mathematical operator comes
first.
2022-04-06 14:55:29 +01:00
Andy Allan
d6f8302eae
Merge pull request #3491 from tomhughes/legacy-trace
Remove support for legacy trace files
2022-03-09 17:10:40 +00:00
Tom Hughes
cbcc7dc49f Fix some rubocop Naming/PredicateName warnings 2022-03-03 22:47:55 +00:00
Tom Hughes
92b122759f Remove support for legacy trace files 2022-03-03 19:47:40 +00:00
Andy Allan
45487e1ff8 Merge branch 'pull/3472' 2022-03-02 15:00:25 +00:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Andy Allan
8938ab7997 Remove redundant presence validation on belongs_to
There's no need for us to have it when rails does this for us.
2022-03-01 10:01:16 +00:00
Andy Allan
619ac4c5b2 Enable active_record.belongs_to_required_by_default
This switches the logic so that belongs_to parent objects must exist
by default, and marks the optional ones explicitly. This is reflected
in the null/not_null status on the relevant db columns.
2022-02-23 20:33:28 +00:00
Tom Hughes
03fdc6d67f Add inverse_of to relationships that can't detect it automatically 2022-02-23 19:23:51 +00:00
Andy Allan
3cf3b3ce4e Specify inverse_of for trace tags and points
Rails can't automatically detect bi-directional relationships when
`:foreign_key` is present. Adding the `inverse_of` helps when validating
traces and tags that haven't yet been saved.
2022-02-23 15:15:07 +00:00
Andy Allan
2fabc46421
Merge pull request #3440 from mmd-osm/relationmemberlimit
Introduce relation member limit
2022-02-16 14:58:30 +00:00
Tom Hughes
53aa7259bb Merge remote-tracking branch 'upstream/pull/3345' 2022-02-13 18:39:21 +00:00
Andy Allan
2d47d6b4f8 Ensure that deactivate isn't available in production
It's only used as a workaround for factories not being able to create
pending users while keeping active as the default
2022-02-02 17:48:17 +00:00
Andy Allan
2731e7244a Add extra user transitions needed by the administrators 2022-02-02 16:37:50 +00:00
mmd-osm
2efd73c672 Introduce relation member limit
Adds a new parameter `max_number_of_relation_members` in settings.yml
2022-02-02 13:15:40 +01:00
Andy Allan
1a11c4dc19 Use a state machine for user status
The user status is a bit complex, since there are various states and
not all transitions between them make sense.

Using AASM means that we can name and restrict the transitions, which
hopefully makes them easier to reason about.
2022-01-12 18:16:14 +00:00
Tom Hughes
fea1b5b88d Fix new rubocop warnings 2021-12-28 19:47:51 +00:00
Tom Hughes
0ca2e10b1d Merge remote-tracking branch 'upstream/pull/3404' 2021-12-22 15:36:25 +00:00
Tom Hughes
5a70476d38 Merge remote-tracking branch 'upstream/pull/3403' 2021-12-22 15:26:23 +00:00
Andy Allan
99a64ba8c1 Remove unused require statement
The corresponding code was removed in a65cb84288
2021-12-22 15:08:06 +00:00
Andy Allan
40e8482825 Alias the user creation_time column
This allows rails to set the created_at automatically, and so avoids
us from having to do so in a callback. It also hides the unusual
db column name from the rest of the app.
2021-12-22 14:48:07 +00:00
Andy Allan
a863be8831 Rename User#delete to User#destroy
"delete" is generally used for immediate SQL deletion without running
any callbacks or other ruby code, whereas "destroy" will trigger callbacks.

Although we don't currently use any callbacks, let's rename this method to
align better with the convention.
2021-12-22 11:32:33 +00:00
Tom Hughes
b244905cd2 Add a rake task to migrate trace data to ActiveStorage 2021-12-16 18:45:31 +00:00
Tom Hughes
0410596908 Switch traces to use ActiveStorage 2021-12-16 18:45:31 +00:00
Tom Hughes
ef85e8c7b3 Make the storage service to use for avatars configurable 2021-12-16 18:45:31 +00:00
Tom Hughes
5966acc207 Merge remote-tracking branch 'upstream/pull/3300' 2021-10-07 17:45:07 +01:00
Tom Hughes
cb10c10ea3 Merge remote-tracking branch 'upstream/pull/3332' 2021-09-29 19:10:22 +01:00
Tom Hughes
22377cbdd4 Fix new rubocop warning 2021-09-29 18:54:56 +01:00
Andy Allan
9ab15f38ea Move the tracepoint coordinate format test to the controller test
This allows us to remove the model method
2021-09-29 15:25:28 +01:00
Andy Allan
dfcecb0118 Remove the ObjectMetadata concern, since it's only used in tests now 2021-09-15 17:05:50 +01:00
Andy Allan
baea8dc10e Remove unused to_xml and to_xml_node methods from models 2021-09-15 17:05:50 +01:00
Tom Hughes
6c6e8883f7 Introduce privileged scopes that only an administrator can enable 2021-08-26 17:22:24 +01:00
Tom Hughes
f1935b1c57 Merge remote-tracking branch 'upstream/pull/3257' 2021-07-21 19:24:31 +01:00
Tom Hughes
cd9a72e669 Merge remote-tracking branch 'upstream/pull/3263' 2021-07-21 12:16:08 +01:00
Tom Hughes
377f394a7c Treat association between users and OAuth 2 applications as polymorphic 2021-07-21 11:52:10 +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
4d47cff5e1 Merge remote-tracking branch 'upstream/pull/3237' 2021-07-21 11:24:17 +01:00
Andy Allan
9b8f2bbcbe Remove code complexity around resetting language preferences
This was originally introduced since we saved the user and showed
the result on the same action. Now that the preferences controller
saves and redirects, the user model and associated language preferences
are reloaded between requests, and this code is no longer required.
2021-07-14 17:40:20 +01:00
Tom Hughes
da546af22e Allow acls to match on parent domains 2021-07-06 10:13:33 +01:00
Tom Hughes
b4a1e41968 Switch web site to use OAuth 2 2021-06-27 19:00:36 +01:00
Tom Hughes
e222329d04 Add support for OAuth2 using doorkeeper 2021-05-18 12:05:32 +01:00