Commit Graph

7951 Commits (3da2cd21fd43b571a2b35b82c8f33ee29025caac)

Author SHA1 Message Date
ThibG 3da2cd21fd [Glitch] Fix page incorrectly scrolling when bringing up dropdown menus
Port e88a05f707 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-05-03 21:47:11 +02:00
ThibG 2ac3e3dc07 [Glitch] Fix end-user-facing uses of inline CSS
Port 3b7373ed4c to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-05-03 21:44:43 +02:00
ThibG f261370e7c [Glitch] Refactor/cleanup TIMELINE_DELETE-related code
Port df5867f072 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-05-03 21:42:13 +02:00
ThibG e869a257d8 [Glitch] Fix messed up z-index when NoScript blocks media/previews
Port f53bd1bef6 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-05-03 21:41:15 +02:00
Thibaut Girka dfa13deaa1 Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/statuses_controller.rb`:
  Upstream disabled the embed controller for reblogs.
  Not a real conflict, but glitch-soc has an extra line to deal
  with its theming system.
  Ported upstream changes.
- `app/javascript/packs/public.js`:
  Upstream made changes to get rid of most inline CSS, this changes
  javascript for public pages, which in glitch are split between
  different files. Ported those changes.
- `app/models/status.rb`:
  Upstream changed the block check in `Status#permitted_for` to
  include domain-block checks. Not a real conflict with glitch-soc,
  but our scope is slightly different, as our scope for
  unauthenticated access do not include instance-local toots.
  Ported upstream changes.
- `app/serializers/rest/instance_serializer.rb`:
  Not a real conflict, upstream added a new field to the instance
  serializer, the conflict is one line above since we added more of
  that.
  Ported upstream changes.
- `app/views/settings/profiles/show.html.haml`:
  Upstream got rid of most inline CSS and moved hidden elements
  to data attributes in the process, in fields were we have
  different values.
  Ported upstream changes while keeping our glitch-specific
  values.
- `app/views/statuses/_simple_status.html.haml`:
  Upstream got rid of inline CSS on an HAML line we treat
  differently, stripping empty text nodes.
  Ported upstream changes to the style attribute, keeping
  the empty text node stripping behavior.
2020-05-03 21:23:49 +02:00
Yamagishi Kazutoshi cf55546c41 Revert "improve status title (#8596)" (#13591)
This reverts commit dff05cd398.
2020-05-03 18:48:13 +02:00
Eugen Rochko 0ca06d0ba9 Add more tests for ActivityPub controllers (#13585) 2020-05-03 16:30:36 +02:00
kaiyou 7a65e2f0db Only check locally when deduplicating usernames (#13581)
When deduplicating account usernames for OAuthable users, the routine did check if any account was known with that username, including remote accounts. This caused some unnecessary deduplication, and usernames ending with unexpected trailing _1.
This fixes #13580
2020-04-30 14:39:05 +02:00
ThibG a30829deee Fix admin-facing uses of inline CSS (#13575)
* Move .back-button inline styles to CSS file

All occurrences of the back-button CSS class used the same inline
CSS rules, so moved them over to the CSS file

* Fix “Add new domain block” button using inline CSS

* Replace common pattern of inline-styled button boxes by a CSS class

In particular, switching from `float: left/right` to a flexbox with
`justify-content: space-between`. This implied changing the order of
a few HTML tags and adding an empty `div` in one case.

Also removed a `margin-bottom` rule that wasn't needed due to the
margins of surrounding elements.

* Move account admin view inline CSS to CSS file
2020-04-28 19:39:16 +02:00
ThibG e88a05f707 Fix page incorrectly scrolling when bringing up dropdown menus (#13574)
Fixes #13573

For some reason (I suspect this may be related to focusing the item before it
got drown by the browser), Firefox scrolls to top when bringing up dropdown
menus with pre-selected items.

This commit uses the “preventScroll” option as, due to the placement behavior,
the menu should be visible anyway and not trigger scrolling.
2020-04-28 13:19:39 +02:00
ThibG 3b7373ed4c Fix end-user-facing uses of inline CSS (#13438)
* Move some inline styles to CSS files

* Move default_account_display_name span to fix useless tags with duplicate id

* Change handling of public pages spoiler text from inline CSS to dataset attribute

* Use the `dir` HTML attribute instead of inline CSS

* Move status action bar inline CSS to CSS file

* Hide logo resources from CSS file, not inline CSS

Fixes #11601

* Move translation prompt styling from inline CSS to CSS file

* Move “invited by” styling on registration form from inline to CSS file

* Use the progress tag to display poll results in JS fallback

* Fix poll results JS-less fallback when the user has voted for an option

* Change account public page “moved” notice to use img tags instead of inline CSS

* Move OTP hint inline CSS to SCSS file

* Hide JS-less fallback vote progressbars from accessibility tools

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
2020-04-28 10:16:55 +02:00
ThibG df5867f072 Refactor/cleanup TIMELINE_DELETE-related code (#13175) 2020-04-28 09:53:42 +02:00
ThibG f53bd1bef6 Fix messed up z-index when NoScript blocks media/previews (#13449)
Fixes #13444
2020-04-28 09:44:17 +02:00
ThibG 207c5ab2a3 Fix /public showing public instead of community timeline for logged-in users (#13499) 2020-04-28 09:43:45 +02:00
ThibG 09162ceb7c Add `invites_enabled` to API (#13501) 2020-04-28 09:43:34 +02:00
Eugen Rochko adfb22a9dd Add separate cache directory for non-local uploads (#12821) 2020-04-26 23:29:08 +02:00
Eugen Rochko 96920a7b8e Fix not being able to resolve public resources in development environment (#13505) 2020-04-25 22:01:08 +02:00
ThibG 2e92d55b64 [Glitch] Fix uninformative error message when uploading unsupported image files
Port cd3a0a17bc to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-25 15:29:01 +02:00
ThibG ed2267b78e [Glitch] Fix expanded video player issues
Port 3526163340 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-25 15:28:16 +02:00
Irie Aoi 1e1b72ff72 [Glitch] Set max-width and max-height to gif video
Port cf1bf9dda9 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-25 15:26:42 +02:00
ThibG 7195bca890 [Glitch] Fix and refactor keyboard navigation in dropdown menus
Port 69696c62b1 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-25 15:24:02 +02:00
Thibaut Girka 2ac1f38bd8 Merge branch 'master' into glitch-soc/merge-upstream 2020-04-25 15:19:32 +02:00
ThibG cd3a0a17bc Fix uninformative error message when uploading unsupported image files (#13540)
Attempting to upload image files that the browser is unable to load results
in “Oops! An unexpected error occurred.”

This commit changes the error handling so that an unprocessable image results
in the file being sent anyway, which might cover a few corner cases, and
provide a slightly better error message.
2020-04-25 12:27:29 +02:00
ThibG 3526163340 Fix expanded video player issues (#13541)
Fixes #13536

- Expanding a paused video doesn't autoplay anymore
- Default volume level for the expanded video inherited from the original video

Position/playing state/volume are carried over from the original video player
to the modal, but they're not reported back to the modal as it would require
deeper changes.
2020-04-25 12:16:05 +02:00
Takeshi Umeda f365b9d6cd Fix enable/disable relay failures (#13535) 2020-04-23 22:04:18 +02:00
Irie Aoi cf1bf9dda9 Set max-width and max-height to gif video (#13533) 2020-04-23 15:49:33 +02:00
ThibG 69696c62b1 Fix and refactor keyboard navigation in dropdown menus (#13528)
Fixes #13527

- Fixes caught keyboard events being needlessly propagated
- Let up/down arrows wrap around like the tab key does
- Refactor common code
2020-04-21 15:13:26 +02:00
D Anzorge 0b8c354379 [Glitch] Update Twemoji to 12.1.5
Port emoji_map.json changes from 945c8e207e to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-20 16:54:01 +02:00
Takeshi Umeda 6556bd1f67 [Glitch] Add local only to hashtag timeline
Port front-end changes from f5606cdab4 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-20 16:52:56 +02:00
Thibaut Girka 4c125214de Merge branch 'master' into glitch-soc/merge-upstream 2020-04-20 16:45:40 +02:00
sternenseemann 674005c08e Allow users to delete their header and avatar (#13234)
This is achieved by sending a DELETE request to
/settings/profile/pictures/{avatar,header} via a link that is part of
the upload form's hint of the respective picture.
2020-04-20 14:03:03 +02:00
D Anzorge 945c8e207e Update Twemoji to 12.1.5 (#13021)
* Update Twemoji to 12.1.5

SVGs from Twemoji repo https://github.com/twitter/twemoji

* Update emoji_map.json to Unicode 12
2020-04-19 23:38:31 +02:00
Takeshi Umeda f5606cdab4 Add local only to hashtag timeline (#13502) 2020-04-18 21:52:39 +02:00
ThibG f41a61965a [Glitch] Fix uploaded image orientation in some browsers
Port 2444658e4b to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-18 15:48:15 +02:00
Thibaut Girka ecc53d10e1 Merge branch 'master' into glitch-soc/merge-upstream 2020-04-18 15:47:32 +02:00
ThibG 2444658e4b Fix uploaded image orientation in some browsers (#13493)
Some browsers (at least recent Chrome versions) automatically take
image metadata into account when drawing images into a canvas.
There seem to be no way to prevent that behavior, and the only
way to detect it seems to compare with a known image.

See: https://github.com/w3c/csswg-drafts/issues/4666
Solution adapted from: 1e4df70782
2020-04-18 15:37:03 +02:00
ThibG 2c92697ec8 [Glitch] Fix not being able to vote
Port 0f3317fbe2 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-17 22:04:10 +02:00
Thibaut Girka 28bdecf004 Merge branch 'master' into glitch-soc/merge-upstream 2020-04-17 22:02:55 +02:00
ThibG 0f3317fbe2 Fix not being able to vote (#13490)
Fix regression introduced by 53f9f8a4ce
2020-04-17 21:54:25 +02:00
Gurgen Hayrapetyan f451095c04 [Glitch] Fix Poll fetchPoll action not being debounced.
Port 53f9f8a4ce to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-17 20:20:06 +02:00
Thibaut Girka 43a9ed3de8 Merge branch 'master' into glitch-soc/merge-upstream 2020-04-17 20:16:24 +02:00
ThibG a93fc74d31 Fix admin actions log crash when displaying updates of deleted announcements (#13489)
Fixes #13487
2020-04-17 19:54:58 +02:00
Gurgen Hayrapetyan 53f9f8a4ce Fix Poll fetchPoll action not being debounced. (#13485)
* Fix Poll fetchPoll action not being debounced.

* Fix unused import in the Poll component
2020-04-16 20:16:20 +02:00
Takeshi Umeda 8eca96eb77 Fix DeliveryWorker not to call failure_tracker when inbox_url is unavailable (#13482) 2020-04-16 08:04:10 +02:00
ThibG c162748a14 Fix confusing error when failing to add an alias to an unknown account (#13480)
Follow-up to #13452, fixing broken `uri.nil?` test.

Also remove the separate check for `uri` presence, as that would result
in a “Please review 2 errors below” while only one would be listed.
2020-04-15 20:33:53 +02:00
Eugen Rochko 2d3219549b Change delivery failure tracking to work with hostnames instead of URLs (#13437) 2020-04-15 20:33:24 +02:00
Thibaut Girka f9d5864e04 Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `package.json`:
  No real conflict, upstream updated a dependency which is
  textually adjacent to a glitch-soc-specific dependency.
  Updated it.
- `yarn.lock`:
  No real conflict, upstream updated a dependency which is
  textually adjacent to a glitch-soc-specific dependency.
  Updated it.
2020-04-15 17:07:49 +02:00
ThibG add34dd132 Fix “Email changed” notification sometimes having wrong e-mail (#13475)
* Fix “Email changed” notification sometimes having wrong e-mail

Fixes #6778

The root of the issue is that `send_devise_notification` was called before
the changes were properly commited to the database, causing the mailer to
pick previous values if running too early.

Devise's documentation provides guidance on how to handle that[1][2], however,
I have found it to not be working, as the following happens, in that order:
- `send_devise_notification` is called for the `email_changed` notification.
  In that case, `changed?` is false and `saved_changes?` is true, so
  if we use the former, we have the same issue.
- the `after_commit` hook is called
- `send_devise_notification` is called for the `confirmation_instructions`
  notification.
  In that case, `changed?` is still false, and `saved_changes?` still true,
  so if we use the latter, that second notification email is simply not
  going to be sent (as we would be queuing the notification *after*
  executing the after_commit hook).

This is because it may be called from either an `after_update` or
`after_commit` hook, the difference not being a call to `save` but the
transaction actually being committed to the database. This may arguably
be a bug in Devise, or Devise's notification.

The proposed workaround is inspired by Devise's documentation but checks
whether a transaction is open to make the call whether to immediately
send the notification or defer it to the `after_commit` hook.

[1]: https://www.rubydoc.info/github/plataformatec/devise/Devise%2FModels%2FAuthenticatable:send_devise_notification
[2]: 406915cb78/lib/devise/models/authenticatable.rb (L133-L194)

* Fix cases when sending notifications without changing the model

* Defer sending if and only if in transaction including current record
2020-04-15 16:13:44 +02:00
ThibG dedac235bc Fix account aliases page (#13452)
* Fix error not being displayed when adding an account alias, add error for self-references

Co-Authored-By: Mélanie Chauvel (ariasuni) <perso@hack-libre.org>

* Add “You have no aliases.” note in confusing empty aliases table

Co-Authored-By: Mélanie Chauvel (ariasuni) <perso@hack-libre.org>

Co-authored-by: Mélanie Chauvel (ariasuni) <perso@hack-libre.org>
2020-04-13 06:41:43 +02:00
ThibG 9e12c3f3a7 [Glitch] Fix WebUI pagination of following, followers, follow requests, blocks and mutes lists
Port 9d57af78d2 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2020-04-12 17:01:41 +02:00