Commit graph

6005 commits

Author SHA1 Message Date
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
Harry Bond
fd33b6e17f Fix opensearch icon & update attribution
Fixes #3478
Closes #3479
2022-02-28 18:38:36 +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
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
Tom Hughes
fe79965869 Merge remote-tracking branch 'upstream/pull/3462' 2022-02-22 19:06:43 +00:00
Tom Hughes
398a39dd0a Make sure the object layer is kept in front of the data layer 2022-02-22 18:55:34 +00:00
Tom Hughes
97bb135957 Don't highlight selected items in the data layer
Routing to the feature page is going to cause them to be overlaid
in orange anyway so there's no need for the blue highlight.
2022-02-22 18:54:40 +00:00
Tom Hughes
29d2f48214 Deep copy the original style when highlighting an object
Fixes #3465
2022-02-21 22:48:22 +00:00
Tom Hughes
b86390d303 Use a button element for button_to 2022-02-21 19:11:58 +00:00
Tom Hughes
cb8419456b Apply bootstrap styling to "make public" button 2022-02-21 19:11:58 +00:00
Tobias Speicher
be878df097
Replace deprecated String.prototype.substr()
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-02-20 22:11:11 +01:00
Tom Hughes
1f8df781be Merge remote-tracking branch 'upstream/pull/3398' 2022-02-16 18:13:16 +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
6c1d73a509 Allow users to delete their own accounts
This PR allows users to delete their own accounts. The logic implemented matches
that currently used by the admins when they manually close accounts, although
there is room to be more complex in future e.g. completely removing accounts
with no content.

The error handling has been slightly adapted for namespaced controllers, by
anchoring the controller name with a leading forward slash.
2022-02-09 16:15:24 +00:00
Tom Hughes
446837c351 Merge remote-tracking branch 'upstream/pull/3419' 2022-02-03 18:37:12 +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
Tom Hughes
81c58571c5 Fix route for "go public" button on the account edit page 2022-01-28 12:39:39 +00:00
Tom Hughes
c59471842f Merge remote-tracking branch 'upstream/pull/3420' 2022-01-18 19:03:32 +00:00
Tom Hughes
988d7cd90d Remove form_action restrictions for sessions#login
Login may redirect to ouath2_authorizations#create which may then
redirect to arbitrary schemes if the application is already authorized
so we need to allow login to redirect to any scheme.

Fixes #3424
2022-01-17 11:01:07 +00:00
Tom Hughes
ff995e7ea3 Restore form_action restrictions for ouath2_authorizations#create 2022-01-17 11:00:41 +00:00
Tom Hughes
707ebddbb5 Remove form_action restrictions for ouath2_authorizations#create
Fixes #3424
2022-01-17 09:33:28 +00:00
Nick Doiron
a4f601b114
rm spaces 2022-01-12 19:16:09 -05:00
Nick Doiron
e9522b0205
add dir="auto" to search fields
Improves right-to-left text input support
2022-01-12 19:06:18 -05: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
d6da1499fc Avoid putting ActionController::Parameters objects in the session 2022-01-11 19:43:43 +00:00
Tom Hughes
6403515897 Replace to_s on TimeWithZone objects with to_formatted_s 2022-01-10 18:59:22 +00:00
Tom Hughes
dcaf21602c Merge remote-tracking branch 'upstream/pull/3409' 2022-01-05 18:40:13 +00:00
Tom Hughes
8e8f6ef990 Attempt to avoid polynomial time matches on user supplied data 2022-01-05 18:38:15 +00:00
Andy Allan
4bed9c12a0 Fix display of suspension message when a user is suspended mid-session
Without the ability defined, the user is still logged out, but then
the deny_access check redirects to the login page. The re-login attempt
would then fail anyway, with an error message, but let's fix the abilities
and use the intended page.
2022-01-05 18:21:42 +00:00
Tom Hughes
d2337810a3 Remove redundant OpenID URL expansion code
It was only used for Google who have long since dropped OpenID support.
2022-01-04 12:02:02 +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
Andy Allan
a8e8ba1a64 Refactor the account edit/update pages out into a separate accounts controller 2021-12-08 15:17:50 +00:00
Tom Hughes
1a65c279aa Merge remote-tracking branch 'upstream/pull/3382' 2021-11-25 17:19:26 +00:00
Tom Hughes
4eecd59a5d Merge remote-tracking branch 'upstream/pull/3380' 2021-11-25 17:15:54 +00:00
Tom Hughes
5dfbf00776 Merge remote-tracking branch 'upstream/pull/3378' 2021-11-25 17:15:10 +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
c343f3ed3e Prevent flash messages from expanding offscreen
Because we are using an edge-to-edge layout for the flash messages,
the negative margins on the row were expanding the element offscreen.

Bootstrap provides a "no-gutter" class for removing these margins,
but that also drops the spacing between columns which we want to preserve.
So instead we use a margin override on the row only.

Additionally, drop some padding css in favour of a utility class

Fixes #3351

Bug was introduced in 3dd639c8d0
2021-11-24 14:32:36 +00:00
Andy Allan
675f72fe35 Use flex grid to position changeset discussion subscribe button
This avoids needing any floats. Also remove buttons class from two
locations, since there is a min-width on that class and it affects
the button styling negatively for standalone buttons
2021-11-24 12:24:16 +00:00
Andy Allan
8249b41a83 Remove some unused thumbnail rules
These are all done with flex grids now, so no need to float the image anywhere
2021-11-24 12:24:16 +00:00