Commit graph

5995 commits

Author SHA1 Message Date
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
Andy Allan
cb68450ac7 Simplify margins when showing diary entries 2021-11-24 12:24:16 +00:00
Andy Allan
514ec41c58 Remove unused browse-field style rules 2021-11-24 12:24:16 +00:00
Andy Allan
3bc20b6f21 Pass classes to override the default thumbnail_tiny style, rather than having another selector overriding 2021-11-24 12:24:16 +00:00
Andy Allan
52cd62bf13 Replace CSS-driven borders with bootstrap borders
This makes future refactoring easier, since the elements will
retain their borders even if the hierarchy changes.

Also round some maps and the legale section since I think those now
look nicer.
2021-11-24 12:24:16 +00:00
Andy Allan
f433fb3d4e Remove border-radius parameter
This overrides the same variable from bootstrap. Since bootstrap
also comes with -sm and -lg variants defined by rem, our px-based
override doesn't sit nicely with those.
2021-11-24 12:24:08 +00:00
Andy Allan
300cd884ec Use flex grid instead of floating to position changeset element paging nav
This works much better when either the heading or the paging is long.

The heading was moved into the partial to avoid repetitive grid definitions
2021-11-24 12:07:49 +00:00
Andy Allan
846bacd665 Remove the custom flash styling for sidebar flashes
The flash partial is now based on flexbox, so these positioning classes
are no longer required
2021-11-24 12:07:31 +00:00
Andy Allan
b43aaa1d58 Remove the floating from the sidebar close buttons
These are mostly positioned with flexbox, and those that aren't
are covered by the similar close-wrap selector elsewhere in this file
2021-11-24 12:07:07 +00:00
Andy Allan
18c70fa2de Add a user link to the heading of the diary comments page
Fixes #3369

This makes the heading match the layout of the user's Notes page,
which also has a short heading and a subheading with a link.

Additionally, add a page title, again for consistency
2021-11-24 10:55:09 +00:00
Tom Hughes
abbd5a30d4 Validate any origin passed the auth failure callback
Fixes #3375
2021-11-23 17:33:19 +00:00