Commit Graph

315 Commits

Author SHA1 Message Date
Mark VanLandingham 223e413a6c
DEV: Render glimmer notification items for user notification list (#24802)
This removes the widget notifications list and renders the glimmer user menu notification items instead.
2023-12-11 11:04:43 -06:00
Penar Musaraj ce723caae2
DEV: Remove flaky spec (#24795) 2023-12-08 11:43:17 -05:00
Penar Musaraj 80d5acc0ce
FIX: Navigate search results using J/K keys (#24787) 2023-12-08 11:06:59 -05:00
Penar Musaraj 6dc5fe0c83
A11Y: improve setting focus to a post (#24786)
See https://github.com/discourse/discourse/pull/23367 for implementation details.
2023-12-08 11:06:21 -05:00
Keegan George 290f6a70bd
FIX: Form template form error visiblity (#24779) 2023-12-07 12:26:56 -08:00
Keegan George 9de0626356
FIX: Table builder spec (#24775) 2023-12-07 11:15:26 -08:00
Alan Guo Xiang Tan 7aab65887f
UX: Fix edit navigation tags modal height too long on desktop (#24765)
Why this change?

The tags modal loads more tags via infinite loading based on when the last tag in the
given page appears in the viewport for the user. When it comes in to
view, a request is then triggered to fetch additional tags. To ensure
that we are only loading a single page of tags each time the modal is
opened, we previously set a max height on the modal's body to ensure
that the last tag which appears in the modal will be outside of the view
port in the initial load. However, this has regressed recently due to
unknown reasons and resulted in multiple pages of tags being loaded
immediately from the server as the modal's height was not restricted.
This regression was caught by an existing test but was unfortunately
determined as flaky.

What does this change do?

This change restores the max height on the edit navigation menu tags
modal on dekstop.
2023-12-07 09:42:04 +08:00
Jarek Radosz 694b5f108b
DEV: Fix various rubocop lints (#24749)
These (21 + 3 from previous PRs) are soon to be enabled in rubocop-discourse:

Capybara/VisibilityMatcher
Lint/DeprecatedOpenSSLConstant
Lint/DisjunctiveAssignmentInConstructor
Lint/EmptyConditionalBody
Lint/EmptyEnsure
Lint/LiteralInInterpolation
Lint/NonLocalExitFromIterator
Lint/ParenthesesAsGroupedExpression
Lint/RedundantCopDisableDirective
Lint/RedundantRequireStatement
Lint/RedundantSafeNavigation
Lint/RedundantStringCoercion
Lint/RedundantWithIndex
Lint/RedundantWithObject
Lint/SafeNavigationChain
Lint/SafeNavigationConsistency
Lint/SelfAssignment
Lint/UnreachableCode
Lint/UselessMethodDefinition
Lint/Void

Previous PRs:
Lint/ShadowedArgument
Lint/DuplicateMethods
Lint/BooleanSymbol
RSpec/SpecFilePathSuffix
2023-12-06 23:25:00 +01:00
Jarek Radosz 138bf486d3
DEV: Fix Lint/DuplicateMethods (#24746) 2023-12-06 13:18:34 +01:00
Joffrey JAFFEUX c6ee647b12
DEV: skip failing spec du to refactoring modal for now (#24712) 2023-12-05 11:47:39 +01:00
Keegan George 7756c210da
FIX: Flaky table builder spec (#24700) 2023-12-04 12:14:07 -08:00
Jarek Radosz 7196613e2e
DEV: Fix various spec linting issues (#24672)
Duplicated specs, incorrect descriptions, incorrect assertions, incorrect filenames, old todo
2023-12-04 13:45:19 +01:00
Joffrey JAFFEUX 3ed1528327
FIX: failing spec in sidebar tags (#24682)
The modal is now larger and more tags will be shown by default, we need more tags to correctly test the scroll behavior.
2023-12-04 12:46:53 +01:00
Martin Brennan adb75cf3a9
DEV: Delete redundant bookmark test (#24680)
Cases were identical and also already covered on L63
2023-12-04 12:27:35 +10:00
Keegan George d2b53ccac2
DEV: Port `discourse-table-builder` theme component to core (#24441) 2023-11-30 10:54:29 -08:00
Penar Musaraj b00dbaa6c9
DEV: Remove flaky spec (#24641) 2023-11-30 11:06:27 +08:00
Jarek Radosz d38360b23f
DEV: Fix `ember/no-private-routing-service` (#24009) 2023-11-29 12:26:52 +01:00
Martin Brennan dfd9c9b8d0
DEV: Fix flagging post flaky (#24619)
Followup to 91ec3323dd,
remove DB check and check actual UI.
2023-11-29 08:16:52 +10:00
Alan Guo Xiang Tan 91ec3323dd
DEV: Temporary fix for flaky system test (#24598)
Why this change?

Asserting against records of the database in system tests can be flaky
because those assertions can run against the database before the server
has actually saved the necessary changes to the database.

What does this change do?

While the assertion is not ideal, we are working around this as a
temporary fix by using `try_until_success` which will retry the
assertion up till the default capybara timeout.
2023-11-28 21:00:56 +08:00
Krzysztof Kotlarek dc2a0854b0
UX: add gift emoji styling for new features (#24523)
When admin has unseen new feature, gift emoji is added to a link.

In addition, `/new-features` path was changed to `/whats-new`
2023-11-27 09:32:28 +11:00
Martin Brennan e395e5e002
FIX: Use plugin category name for plugin list (#24477)
Followup to e37fb3042d

Some plugins like discourse-ai and discourse-saml do not
nicely change from kebab-case to Title Case (e.g. Ai, Saml),
and anyway this method of getting the plugin name is not
translated either.

Better to use the plugin setting category if it exists,
since that is written by a human and is translated.
2023-11-23 08:40:55 +10:00
David Taylor ed1dece517
DEV: Introduce history-store service (#24486)
This commit extracts the storage part of the route-scroll-manager into a dedicated service. This provides a key/value store which will reset for each navigation, and restore previous values when the user uses the back/forward buttons in their browser.

This gives us a reliable replacement for the old `DiscourseRoute.isPoppedState` function, which would not work under all situations.

Previously reverted in e6370decfd. This version has been significantly refactored, and includes an additional system spec for the issue we identified.
2023-11-22 14:25:52 +00:00
Daniel Waterworth 38abd471b6
DEV: Remove unnecessary fab! block (#24496) 2023-11-21 17:03:17 -06:00
Blake Erickson 447d9b2105
DEV: Convert approve_unless_trust_level to groups (#24357)
This change converts the `approve_unless_trust_level` site setting to
`approve_unless_allowed_groups`.

See: https://meta.discourse.org/t/283408

- Adds the new site setting
- Adds a deprecation warning
- Updates core to use the new settings.
- Adds a migration to fill in the new setting of the old setting was
  changed
- Adds an entry to the site_setting.keywords section
- Updates many tests to account for the new change

After a couple of months we will remove the `approve_unless_trust_level`
setting entirely.

Internal ref: /t/115696
2023-11-21 11:31:42 -07:00
Martin Brennan e37fb3042d
FEATURE: Admin plugin list redesign (#24363)
* Remove checkmark for official plugins
* Add author for plugin, which is By Discourse for all discourse
  and discourse-org github plugins
* Link to meta topic instead of github repo
* Add experimental flag for plugin metadata and show this as a
  badge on the plugin list if present

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2023-11-21 09:37:11 +10:00
David Taylor 299989b85e
FIX: Sorting toggles on topic list (#24465)
- Correctly interpret string queryParams
- On first click of a new column, use "descending". Otherwise, toggle.
- Add system specs for behavior
2023-11-20 17:45:13 +00:00
Jarek Radosz 89bd2b7df0
DEV: Remove unnecessary `js: true` options from specs (#24463) 2023-11-20 17:22:14 +01:00
Jarek Radosz 8968887e24
DEV: Fix various typos (#24461)
November 2023 edition
2023-11-20 16:49:49 +01:00
David Taylor 18461e38cf
DEV: Update custom array implementations for Ember 5 compatibility (#24435)
In the long term we should aim to modernize these places, but for now this change will make them compatible with Ember 5.x (while maintaining compatibility with Ember 3.28)
2023-11-20 13:26:46 +00:00
Krzysztof Kotlarek 96c5a6c9ca
FEATURE: dedicated admin section for new features (#24292)
New tab in admin panel with list of new features. Presentation was enhanced by screenshot and markdown description.

Related PR https://github.com/discourse-org/discourse-new-features-feeds/pull/23
2023-11-20 09:59:04 +11:00
Alan Guo Xiang Tan c2295b9d5d
DEV: Unskip flaky editing sidebar nav menu categories on mobile test (#24412)
Why this change?

The test became flaky due to d208396c5c.
In that commit, we introduced `page.has_no_css?("div.menu-panel.animating")` to `PageObjects::Components::NavigationMenu::Sidebar#open_on_mobile` but
it did not work as intended because `page.has_no_css?("div.menu-panel.animating")` can return `true` immediately as the `animating` class has not been added
to the element.

What does this change do?

Switch to the `wait_for_animation` system helper to ensure that all
animations have ended on the element.
2023-11-17 06:37:20 +08:00
Daniel Waterworth e34d2cfde4
DEV: Remove unnecessary fab! blocks (#24419) 2023-11-16 13:22:08 -05:00
Penar Musaraj bcfb1a423d
FIX: Regression when enforced 2FA is enabled (#24415) 2023-11-16 11:52:12 -05:00
Penar Musaraj f08e5c897e
UX: Apply decorators to small action posts (#24397) 2023-11-16 08:52:07 -05:00
chapoi cd183edad1
UX: modal > remove obsolete wrapper class (#24381) 2023-11-15 11:33:23 +00:00
chapoi f72899401d
UX: refactor .d-modal to use BEM and improve styling (#23967)
This PR refactors the following:
* leaving all the CSS applied to the old `modal-body` classes in their respective files
* made  new clean styling for `.d-modal` and refactored the template to use the new BEM classes
  * `inner-`, `middle-`, `outer-` container classes are gone and replaced with simplified `wrapper` and `container` classes  
  * use standardised max-sizes with modifiers `-large` and `-max`
  * lighter backdrop,
  * min-width to prevent puny modals
  * other styling changes regarding padding, close button,…
* pulled out all modal overrides into a general `modal-overrides` file + cleanup of outdated CSS
* pulled out login and create account modal styling into their own file, cause it's such a big override 
* removed old general login.scss file for mobile & desktop
* only kept some remainders I don't want to touch in `app/assets/stylesheets/common/base/login.scss`
2023-11-15 10:14:47 +00:00
Penar Musaraj a814348176
DEV: Rename `experimental_passkeys` to `enable_passkeys` (#24349)
Also includes a migration.
2023-11-13 15:04:15 -05:00
Kris 797da5870b
FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
Martin Brennan 620485ada2
DEV: Skip flaky sidebar mobile spec (#24321) 2023-11-10 10:46:19 +10:00
Daniel Waterworth 6e161d3e75
DEV: Allow fab! without block (#24314)
The most common thing that we do with fab! is:

    fab!(:thing) { Fabricate(:thing) }

This commit adds a shorthand for this which is just simply:

    fab!(:thing)

i.e. If you omit the block, then, by default, you'll get a `Fabricate`d object using the fabricator of the same name.
2023-11-09 16:47:59 -06:00
Martin Brennan 986fb522be
FEATURE: Add theme-components route for admin (#24264)
This commit adds an /admin/customize/theme-components route,
that opens the theme page with the components tab pre-selected,
so people can navigate to that directly.
2023-11-08 13:42:27 +10:00
Penar Musaraj a1c1f7ce75
DEV: Standardize session confirmation prompt (#24212)
Switches to using a dialog to confirm a session (i.e. sudo mode for
account changes where we want to be extra sure the current user is who
they say they are) to match what we do with passkeys.
2023-11-07 11:26:10 -05:00
Kelv 4a21411de2
DEV: upgrade avatar-selector modal to glimmer component (#24192)
* DEV: upgrade avatar-selector modal

* DEV: add system test for avatar selection in account preferences
2023-11-07 21:02:19 +08:00
Renato Atilio 2201f8f7dc
FIX: form template upload type validation (#24148)
When submitting files through the form template upload field, we were having an issue where, although a validation error message was being presented to the user, the upload was still coming through, because `PickFilesButton`'s validation happens **after** the Uppy mixin finished the upload and hit `uploadDone`.

This PR adds a new overridable method to the Uppy mixin and overrides it with the custom validation, which now happens before the file is sent.

Additionally, we're now also using `uploadingOrProcessing` as the source of truth to show the upload/uploading label, which seems more reliable.
2023-11-03 10:11:25 -03:00
Martin Brennan b53449eac9
DEV: Automatically generate all admin links for app for new sidebar (#24175)
NOTE: Most of this is experimental and will be removed at a later
time, which is why things like translations have not been added.

The new /admin-revamp UI uses a sidebar for admin nav. This initial
step adds a script to generate a map of all the current admin nav
into a format the sidebar to read. Then, people can experiment
with different changes to this structure.

The structure can then be edited from `/admin-revamp/config/sidebar-experiment`,
and it is saved to local storage so people can visually experiment with different ways
of showing the admin sidebar links.
2023-11-02 10:34:37 +10:00
Krzysztof Kotlarek 1c395e1a01
FIX: reliably reorder link in custom sections (#24188)
Two changes were introduced:
1. Reorder links on sidebar section is removed. Clicking and holding the mouse for 250ms was unintuitive;
2. Fixed bugs when reorder is done in edit modal.
2023-11-02 08:46:45 +11:00
Penar Musaraj 18d7162481
FIX: Maintain destination_url after passkey login (#24171) 2023-10-31 11:35:36 -04:00
Jarek Radosz 231e02446b
DEV: Add a basic account creation system spec (#24179) 2023-10-31 14:53:24 +01:00
Martin Brennan 0a4b1b655d
FIX: Alter "Take Action" default behaviour to hide post (#24088)
This commit fixes an issue where clicking the default
"Take Action" option on a flag for a post doesn't always
end up with the post hidden.

This is because the "take_action" score bonus doesn’t take into account
the final score required to hide the post.

Especially with the `hide_post_sensitivity` site setting set to `low`
sensitivity, there is a likelihood the score needed to hide the post
won’t be reached.

Now, the default "Take Action" button has been changed to "Hide Post"
to reflect what is actually happening and the description has been
improved, and if "Take Action" is clicked we _always_ hide the post
regardless of score and sensitivity settings. This way the action reflects
expectations of the user.
2023-10-30 10:24:35 +10:00
Blake Erickson 1a78e8ec1b
FEATURE: Add keywords support for site_settings search (#24146)
* FEATURE: Add keywords support for site_settings search

This change allows for a new `keywords` field that can be added to site
settings in order to help with searching. Keywords are not visible in
the UI, but site settings matching one of the contained keywords will
appear when searching for that keyword.

Keywords can be added for site settings inside of the
`config/locales/server.en.yml` file under the new `keywords` key.

```
site_settings
  example_1: "fancy description"
  example_2: "another description"

  keywords:
    example_1: "capybara"
```

* Add keywords entry for a recently changed site setting and add system specs

* Use page.visit now that we have our own visit
2023-10-27 15:42:57 -06:00