Commit graph

1782 commits

Author SHA1 Message Date
Tom Hughes
81c58571c5 Fix route for "go public" button on the account edit page 2022-01-28 12:39:39 +00: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
Andy Allan
4436099e31 Remove params from user deletion test
They have no effect, and are likely a copy-paste error from when
the test was first written in 39a54f8c14
2022-01-12 16:45:58 +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
24d605f567 Merge remote-tracking branch 'upstream/pull/3411' 2022-01-06 15:34:30 +00:00
Andy Allan
2f6a87e443 Use assert_link instead of assert page.has_link?
This leads to better error messages if the test fails
2022-01-06 15:04:03 +00:00
Tom Hughes
2927c6b6be Merge remote-tracking branch 'upstream/pull/3410' 2022-01-06 13:25:42 +00:00
Andy Allan
d257c21740 Use assert_content instead of assert page.has_content?
The assert_content comes from capybara, and gives a much more helpful
error message if the test fails.
2022-01-06 13:16:47 +00:00
Andy Allan
0100cfe304 Use factory_bot to build new model objects 2022-01-06 10:46:38 +00:00
Andy Allan
88cf03ff00 Use factorybot to build user objects
This allows us to only specify attributes of interest in the test.
2022-01-05 20:29:12 +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
4549de5f32 Test redirect from settings page to OmniAuth 2021-12-29 18:29:38 +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
0410596908 Switch traces to use ActiveStorage 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
Andy Allan
cb68450ac7 Simplify margins when showing diary entries 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
Tom Hughes
abbd5a30d4 Validate any origin passed the auth failure callback
Fixes #3375
2021-11-23 17:33:19 +00:00
Tom Hughes
e342314d8b Merge remote-tracking branch 'upstream/pull/3353' 2021-11-16 08:21:17 +00:00
Tom Hughes
e21b9b2bf1 Merge remote-tracking branch 'upstream/pull/3365' 2021-11-11 15:33:08 +00:00
Andy Allan
75749cc540 Convert remaining heading titles to use h1
This makes them consistent with all the other pages that use h1
in the `content_for :heading` sections
2021-11-11 15:12:23 +00:00
Andy Allan
3719e8defb Remove the userinformation ids from headings
The style rule was removed in 3f8cf32272
and they were otherwise only used in the tests.
2021-11-11 14:53:36 +00:00
Tom Hughes
aad81eb74c Switch to Argon2 for password hashing 2021-11-03 20:39:31 +00:00
Andy Allan
826a864e6c Remove the contact-activity class
The margin-top is better replaced with a bottom margin on the
preceding element, and the width is unnecessary in the grid layout.
2021-11-03 18:35:42 +00:00
Andy Allan
2b84452222 Remove custom margins on sidebar headings
Margin-top in particular is best avoided. The removal of some top
margins required a few corresponding changes to add bottom margins
to other features, mostly done by converting bare text strings to
live within paragraphs.
2021-11-03 18:16:38 +00:00
Tom Hughes
94b327ddfc Test third party logins to pending/suspended/blocked accounts 2021-10-24 10:36:30 +01:00
Andy Allan
9f61d6c1cf Specify avatar dimensions in html tags
This prevents reflow when the images are loaded by the browser.

ActiveStorage variants are resized lazily when the image is requested,
so we only know the dimensions if the image was already loaded. This
means that there will be one reflow just after a new avatar is first
viewed.
2021-10-13 14:05:02 +01:00
Tom Hughes
5966acc207 Merge remote-tracking branch 'upstream/pull/3300' 2021-10-07 17:45:07 +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
710bf75411 Rename file so that it's included in test runs 2021-09-16 18:04:37 +01:00
Tom Hughes
e91c02f2ce Merge remote-tracking branch 'upstream/pull/3297' 2021-09-15 18:44:23 +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
d07ce46929 Move the xml format test for old nodes to the controller test
This allows us to remove the model method
2021-09-15 17:05:34 +01:00
Andy Allan
76f1d7bc78 Use a builder to render changeset downloads 2021-09-15 16:33:04 +01:00
Andy Allan
fa7d64b788 Fix test 2021-09-15 14:36:08 +01:00
Tom Hughes
8a9dbc94c8 Update rubocop todo and fix new warnings 2021-09-14 20:40:36 +01:00
Tom Hughes
350ac303f1 Check that user email address are only returned with read_email 2021-08-26 17:22:25 +01:00
Tom Hughes
5723ba0624 Check that use of privileged scopes is restricted to administrators 2021-08-26 17:22:25 +01:00
Tom Hughes
6c6e8883f7 Introduce privileged scopes that only an administrator can enable 2021-08-26 17:22:24 +01:00
Tom Hughes
4389eff647 Improve testing of user details API responses 2021-08-24 18:41:07 +01:00
Andy Allan
6ab522b2b3 Convert account setting menu to tabs, and include on other pages
This makes it easier to navigate around these pages. Since each tab
corresponds to a given controller, this makes the selection of active
tabs straightforward.
2021-08-18 14:30:35 +01:00
Andy Allan
cb7b79a58f Split the non-public information off of the profile page
This opens up many possibilities for more interesting things to be
shown on the dashboard, as well as making it easier to find if
you have lots of content in your profile.
2021-08-18 13:32:36 +01:00
Tom Hughes
08e2a06e41 Merge remote-tracking branch 'upstream/pull/3279' 2021-07-28 20:18:07 +01:00
Andy Allan
36f6d8d85d Fix redirect to terms path when not logged in
This was missed during #3147 since it wasn't covered by a test.
2021-07-28 16:36:13 +01:00
Andy Allan
dd9eca9346 Switch to html5-compatible fragment encoding for wikipedia URLs
Fixes #3269

In the HTML4 days, fragments weren't allowed to have `%` signs, so
mediawiki generated fragments with `%` replaced with a `.`

In HTML5, fragments can have % encoded characters, and so in 2017
wikipedia switched over to this for their automatically generated
fragments, while keeping the "dot" versions available as a fallback.

However, we have been automatically converting all fragments,
including manually specified anchors that do not have "dot"-encoded
versions available. So we can now simplify everything by just using
the HTML5 percent-encoded fragments.
2021-07-28 16:01:48 +01:00
Andy Allan
95d406937e
Merge pull request #3268 from tomhughes/capitalisation
Improve capitalisation of page titles
2021-07-28 11:06:47 +01:00
Andy Allan
baee0b9a90 Enable test for showing flash message in the new language 2021-07-28 09:38:24 +01:00
Tom Hughes
abd98757b6 Improve capitalisation of page titles 2021-07-22 19:00:08 +01:00
Tom Hughes
f1935b1c57 Merge remote-tracking branch 'upstream/pull/3257' 2021-07-21 19:24:31 +01:00
Andy Allan
403c8941a6 Ensure that flash message is shown in the updated language 2021-07-21 18:58:47 +01:00