Commit Graph

8 Commits

Author SHA1 Message Date
Javi Martín
5c7d87f763 Open admin links in the same window
In the admin section, when clicking on a link that leads to a page in
the public area, sometimes the page was opened in the same window and
sometimes it would open in a new window, with no clear criteria
regarding when either scenario would take place.

This was really confusing, so now we're more consistent and open
(almost) every link in the same window. The main reason behind it is
simple: if we add `target: _blank`, people who want to open those links
in the same window can no longer do so, so we're taking control away
from them. However, if we don't add this attribute, people can choose
whether to open the link on the same tab or to open it on a new one,
since all browsers implement a method to do so.

More reasons behind this decision can be found in "Opening Links in New
Browser Windows and Tabs" [1].

We're keeping some exceptions, though:

* Opening the link to edit an investment on the same tab would result in
  losing all the investment filters already applied when searching for
  investments, so until we implement a way to keep these filters, we're
  also opening the link to edit an investment in a new tab
* For now, we're also opening links to download files in a new window;
  we'll deal with this case in the future

[1] https://www.nngroup.com/articles/new-browser-windows-and-tabs/
2023-10-24 16:31:39 +02:00
Iraline
2dc32c6bc1 Add new column to show activation status 2023-05-29 16:06:51 +02:00
Javi Martín
469b39ffa3 Add and apply Style/RedundantInterpolation rule
Somehow I thought we already had this rule; must have forgotten to
actually add it.
2021-08-09 21:37:04 +02:00
Javi Martín
6f5180e512 Reduce number of requests in user search specs
We were adding a `visit` in a `before` block but then we started the
search tests with another `visit`.

We also created records in the database in between, which increased the
risk of database inconsistency since the process running the browser had
already been started.
2021-04-13 21:54:26 +02:00
Javi Martín
92ddcb7aef Use JavaScript in system tests by default
JavaScript is used by about 98% of web users, so by testing without it
enabled, we're only testing that the application works for a very
reduced number of users.

We proceeded this way in the past because CONSUL started using Rails 4.2
and truncating the database between JavaScript tests with database
cleaner, which made these tests terribly slow.

When we upgraded to Rails 5.1 and introduced system tests, we started
using database transactions in JavaScript tests, making these tests much
faster. So now we can use JavaScript tests everywhere without critically
slowing down our test suite.
2021-04-07 14:41:06 +02:00
Javi Martín
1bd9992890 Use JavaScripts in tests opening new windows
IMHO opening new windows is a usability issue which has been known for
twenty years since it takes control away from the user and breaks the
"back button", but for now we're keeping the same behavior as we already
had, while slightly increasing the complexity of the tests (which is a
good indicator of a usability issue).
2021-04-07 14:41:06 +02:00
decabeza
f72f255d15 Filter erased users and show erase reason in admin 2020-07-17 22:21:52 +02:00
Javi Martín
9427f01442 Use system specs instead of feature specs
We get rid of database cleaner, and JavaScript tests are faster because
between tests we now rollback transactions instead of truncating the
database.
2020-04-24 15:43:54 +02:00