Commit Graph

2211 Commits

Author SHA1 Message Date
286b4e535e DEV: allows buttons to define aria-label (#9747) 2020-05-11 22:09:44 +02:00
0deb05740f Revert "DEV: allows to define an ariaLabel on d-button (#9716)"
This reverts commit 7a95dd48415c2152f1c791b2dfcd04f6910c1ca7.
2020-05-11 19:19:13 +02:00
7a95dd4841 DEV: allows to define an ariaLabel on d-button (#9716)
* DEV: allows to define an ariaLabel on d-button

This topic also adds this function to topic-footer-buttons, simplifies the whole logic of titile/label/arialabel in d-button and adds tests for these properties.

* typo
2020-05-11 18:42:51 +02:00
fe2d5da623 DEV: Remove obsolete commented out tests
Commented out in 2016 in ff74bd7e28a13014dd09228445bf0a9938066518
2020-05-11 18:19:21 +02:00
7d3c4a5f13 FIX: Show category name in badge preview on edit (#9726) 2020-05-11 17:05:40 +02:00
12d4d51d81 FIX: CurrentUser now must be passed to resolveTimezone and user card local time issues (#9734)
* This is to prevent user's timezones being changed accidentally
e.g. by admin looking at a user
* This problem only occurred via the user card, however the user card
was still calling userTimezone even if the setting to display user
time in card was disabled
2020-05-11 11:01:47 +10:00
8f5a651e51 DEV: No need for double await 2020-05-10 19:54:07 +02:00
8149bfbaf1 FEATURE: Filter settings by plugin (#9692) 2020-05-10 14:07:45 +03:00
9bf11a8c68 DEV: allows select-kit to prevent autofocus of header after onChange (#9718) 2020-05-09 10:26:23 +02:00
a40649409e DEV: calling preload-store is deprecated (#9703) 2020-05-08 17:04:28 +02:00
f9608c0af5 DEV: Remove INLINE_ONEBOX_* constants
There were two constants here, `INLINE_ONEBOX_LOADING_CSS_CLASS` and
`INLINE_ONEBOX_CSS_CLASS` that were both longer than the strings they
were DRYing up: `inline-onebox-loading` and `inline-onebox`

I normally appreciate constants, but in this case it meant that we had
a lot of JS imports resulting in many more lines of code (and CPU cycles
spent figuring them out.)

It also meant we had an `.erb` file and had to invoke Ruby to create the
JS file, which meant the app was harder to port to Ember CLI.

I removed the constants. It's less DRY but faster and simpler, and
arguably the loss of DRYness is not significant as you can still search
for the `inline-onebox-loading` and `inline-onebox` strings easily if
you are refactoring.
2020-05-07 16:14:38 -04:00
6fb0f36ce1 FEATURE: Optionally delete bookmark when reminder sent (#9637)
We now show an options gear icon next to the bookmark name.

When expanded we show the "delete bookmark when reminder sent" option. The value of this checkbox is saved in local storage for the user.

If this is ticked, when a reminder is sent for the bookmark the bookmark itself is deleted. This is so people can use the reminder functionality by itself.

Also remove the blue alert reminder section from the "Edit Bookmark" modal as it just added clutter, because the user can already see they had a reminder set:

Adds a default false boolean column `delete_when_reminder_sent` to bookmarks.
2020-05-07 13:37:39 +10:00
7e303f9320 DEV: Upgrade sinon and fix time based bookmark tests (#9647)
Update sinon.js to 9.0.2 to access async fake timers https://sinonjs.org/releases/v9.0.2/fake-timers/ which can then be used with acceptance tests (previously useFakeTimers didn't work with await, e.g. for visit).

Fix the bookmark acceptance test that was time based to use these new fake timers.

Add a fakeTime function that uses moment and the provided date string + timezone to freeze time using useFakeTimers and return a clock.

Add a timeStep function that accepts a clock from fakeTime and a function to run. Once the function is run we call clock.tickAsync(1000) to progress the fake clock forward 1s to progress promises/callbacks.
2020-05-07 09:10:32 +10:00
7acb25db12 FIX: preload-store was moved 2020-05-06 15:55:52 -04:00
01929e3505 DEV: Move preload-store to discourse/lib/preload-store
It's only used inside Discourse so it needn't be its own module
2020-05-06 15:28:06 -04:00
c99ecba68f DEV: improves sk api (#9653)
- reduces the API to 3 actions for now: appendContent/prependContent/onChange
- well tested
- removes all previous APIS which were only half supported or too dangerous as they could collide with other plugins or core behaviors
- this plugins also puts every sk test helpers in one file
2020-05-06 17:16:20 +02:00
2edee74718 FIX: Flaky tests. Due to CSS transitions opacity might not be 0 yet. 2020-05-05 13:45:14 -04:00
612284cef3 DEV: Remove Discourse.RAW_TEMPLATES (#9630)
We were sharing `Discourse` both as an application object and a
namespace which complicated things for Ember CLI. This patch
moves raw templates into `__DISCOURSE_RAW_TEMPLATES` and adds
a couple helper methods to create/remove them.
2020-05-05 12:15:03 -04:00
8010e1ab2e DEV: Add remove button function to PluginAPI (#9627) 2020-05-05 09:18:02 -04:00
04e4932307 DEV: Skip time-dependent bookmark test 2020-05-05 09:50:50 +01:00
5cf6984a1a FIX: Pre-select Later Today on bookmark edit if the time is the same (#9636)
If the user chooses "Later Today" as the reminder for a bookmark, then edits that bookmark, we should pre-select "Later Today" if that time has not changed (e.g. later is still 6pm). We do this to avoid confusion instead of opening the custom date + time section.
2020-05-05 16:28:31 +10:00
6aa9014509 UX: Bookmark removal tweaks (#9635)
* Do not show confirmation modal if deleting bookmark from list unless the bookmark has a reminder
* Remove the deleted bookmark from the in-memory array for the user list so a full reload of the list is not needed and scrolling is maintained
2020-05-05 14:56:04 +10:00
b8b1cbbfb9 UX: Improve second factor UI (#9526)
This will make a few minor improvements to the second factor user interface. Highlights include:

- Using the site's title to prefix the backup code filename. If non-ascii characters are detected, then prefix "discourse" instead.
- Add icons and change the text on some of the buttons for better clarity and consistency
- Add an education link to the security key modal
2020-05-05 11:05:25 +10:00
a2c85f0845 DEV: use the existing parsePostData function (#9629) 2020-05-04 18:35:04 +02:00
0e4db91870 FIX: save bookmark reminder on tap unless custom (#9611) 2020-05-02 10:31:44 +02:00
f182e61def DEV: Remove global Handlebars 2020-05-01 14:12:09 -04:00
2cb9e85d14 FEATURE: add category banner for why a user cannot post (#9576)
* FEATURE: add category banner for why a user cannot post

Adds a category banner for why a user is unable to post in a category.

Also adds an extra alert for the user when a user is unable to create a topic in a
category and they still try and click on the disabled-looking new topic
button.
2020-04-30 10:39:11 -07:00
1b2db44678 FEATURE: allows to limit visible reports and tabs in dashboard (#9598) 2020-04-30 17:31:04 +02:00
10f9f295dc DEV: Add acceptance tests for bookmarks with reminders (#9592) 2020-04-30 14:58:26 +10:00
d6df92b074 DEV: correct bad test
Test was unlisting a topic and then checking for the unlist info
in the whisper field
2020-04-30 14:27:24 +10:00
ca539fdccf FIX: Rename all instances of bookmarkWithReminder to just bookmark (#9579)
* Rename all instances of bookmarkWithReminder and bookmark_with_reminder to just bookmark
* Delete old bookmark code at the same time
* Add migration to remove the bookmarkWithReminder post menu item if people have it set in site settings
2020-04-30 10:09:22 +10:00
a1b9150512 DEV: adds a caret option to widget dropdown (#9588) 2020-04-29 19:37:21 +02:00
6cf31f16f7 FIX: Change bookmarks-with-reminders URL back to bookmarks for user activity (#9566)
* Bookmarks with reminders is a core feature now, no need to have a separate URL
* Keep around the old /u/:username/activity/bookmarks-with-reminders route for backwards compat in Ember but just redirect to user activity bookmarks.
2020-04-29 10:53:37 +10:00
17ca47af1a FIX: Remove timezone in brackets from user card (#9567)
For clarity and to save space remove the timezone in brackets e.g. (EDT) from the user card. Also add a title to the user time span to say it is Local Time.
2020-04-29 08:45:38 +10:00
67f3fe14aa FEATURE: support SSO website and location overrides
Add location and website + the ability to override using SSO using the `sso_overrides_location` and `sso_overrides_website` site settings.
2020-04-28 16:06:35 +10:00
66b5b8cf29 FIX: Local time not updating between user cards (#9564)
The local time was not updating between user cards because the computed property was not used correctly.

There's an old saying in Tennessee — I know it's in Texas, probably in Tennessee — that says, fool me once computed properties, shame on — shame on you. Fool me — you can't get fooled again.
2020-04-28 13:23:43 +10:00
ad978b93ab FIX: Correctly shows no bookmark message (#9548) 2020-04-28 11:19:35 +10:00
bb4e965a66 FEATURE: Optionally show local time for user in card (#9527)
This adds a site setting (default off) to optionally show a user's local time and timezone in their user card. For example, I live in Brisbane, and if at 3:30PM my time I were to open a user who lives in California's card I would see 22:30 (PST).
2020-04-28 10:13:59 +10:00
fb20b57057 DEV: Re-enable "remove featured link" test (#9550)
It was disabled in ac4b4e30dcb6334812fb6c8100776f5abf00b210
2020-04-27 17:54:07 +02:00
3de901e38d DEV: correct missing file from revert
Test did not revert cleanly. Corrected.
2020-04-25 13:29:45 +10:00
1f6eaf26a1 Revert "UX: replace closed topic icon with discourse-no-entry"
This reverts commit 040b8c00a4450cfb0ee306f96d18aa34ab15f931.

We decided to keep status quo for now
2020-04-25 13:12:56 +10:00
040b8c00a4 UX: replace closed topic icon with discourse-no-entry 2020-04-24 17:31:34 -04:00
9f52997be1 UX: Let's try X for the closed topic icon instead of a \ 2020-04-23 17:23:25 -04:00
52c1d7337e FEATURE: don't display new/unread notification for muted topics (#9482)
* FEATURE: don't display new/unread notification for muted topics

Currently, even if user mute topic, when a new reply to that topic arrives, the user will get "See 1 new or updated topic" message. After clicking on that link, nothing is visible (because the topic is muted)

To solve that problem, we will send background message to all users who recently muted that topic that update is coming and they can ignore the next message about that topic.
2020-04-23 14:57:35 +10:00
3bbd8b1258 UX: rework date time input range (#9524) 2020-04-22 22:17:53 +02:00
df0c386f8a UX: drop the automatic_membership_retroactive column from groups model. (#9430) 2020-04-22 22:07:39 +05:30
e733701887 FEATURE: Make report filters reusable (#9444)
This commit also adds 'include subcategories' report filter
2020-04-22 11:52:50 +03:00
628ba9d1e2 FEATURE: Promote bookmarks with reminders to core functionality (#9369)
The main thrust of this PR is to take all the conditional checks based on the `enable_bookmarks_with_reminders` away and only keep the code from the `true` path, making bookmarks with reminders the core bookmarks feature. There is also a migration to create `Bookmark` records out of `PostAction` bookmarks for a site.

### Summary

* Remove logic based on whether enable_bookmarks_with_reminders is true. This site setting is now obsolete, the old bookmark functionality is being removed. Retain the setting and set the value to `true` in a migration.
* Use the code from the rake task to create a database migration that creates bookmarks from post actions.
* Change the bookmark report to read from the new table.
* Get rid of old endpoints for bookmarks
* Link to the new bookmarks list from the user summary page
2020-04-22 13:44:19 +10:00
d1bee13fda test fix 2020-04-21 17:57:25 -04:00
fe579c918f DEV: fix failing test relating to sk click propagation
* followup to 62459c84
2020-04-21 12:01:16 -04:00