Commit Graph
100 Commits
Author SHA1 Message Date
Joffrey JAFFEUX c78f32a9a1 FIX: removes legacy Ember.keys usage causing a crash (#13085)
The crash:

```
Uncaught TypeError: Ember.keys is not a function
```

Repro:

- visit home page
- click new topic
- navigate to your messages by clicking your avatar (top right), then enveloppe icon, and finally the bottom chevron
- click New Message
- click cancel in the composer, it should crash
2021-05-18 12:23:41 +02:00
Joffrey JAFFEUX 81bf581aa9 DEV: rescues site setting missing exception (#13022)
This will allow to correctly catch it client side and display a correct error.
2021-05-11 10:36:57 +02:00
Joffrey JAFFEUX a6300a9863 DEV: remove unused Helpers::StubbedJob (#12960) 2021-05-06 13:04:41 +02:00
Joffrey JAFFEUX f3a4c12564 DEV: removes unused set_env (#12961) 2021-05-06 13:04:18 +02:00
Joffrey JAFFEUX b0e9c6e127 FIX: limit visible revisions history to last 100 (#12946)
This is done to prevent spike memory usage when the number of revisions is very large (thousands) and the post has a significant length.
2021-05-05 12:18:25 +02:00
Joffrey JAFFEUX d14a7f1965 DEV: removes comment about disable_jump_reply (#12939)
This has been removed in https://github.com/discourse/discourse/commit/40fa96777ddad4698df20d6b8a61afcf87743ed7
2021-05-04 11:44:09 +02:00
Joffrey JAFFEUX 3ef1cde6e8 DOC: adds a link to teams.discourse.com (#12928) 2021-05-04 12:52:15 +10:00
Joffrey JAFFEUX 374ff4c54c FIX: topic might be night at this stage (#12929) 2021-05-03 10:37:43 +02:00
Joffrey JAFFEUX 286b6916af UX: refactor security modals (#12870)
- better form
- uses d-footer
- ensure buttons have the same height

Note that to achieve same height for btn without text, I made the choice to go for a minimum height which should work in most cases.
2021-05-03 09:22:33 +02:00
Joffrey JAFFEUX d16a39dc53 FIX: prevents exception when text input is nil (#12922)
nil was converted to "" and the matching regex would return [] and then be converted to nil with max usage.

Example exception:

```
NoMethodError (undefined method `<=' for nil:NilClass)

lib/text_sentinel.rb:71:in `seems_unpretentious?'
lib/validators/quality_title_validator.rb:13:in `validate_each'
lib/topic_creator.rb:25:in `valid?'
```
2021-05-03 09:21:35 +02:00
Joffrey JAFFEUX 64dda7112d FIX: correctly use timeouts in FileHelper and FinalDestination (#12921)
Previous refactors have lost usage of read_timeout in `FileHelper.download` and `FinalDestination` was incorrectly using `Net::HTTP.start` by setting `open_timeout` in the block instead of directly during the invocation.

Couldn't figure how to write a good test for this without slowing the spec.
2021-05-03 09:21:11 +02:00
Joffrey JAFFEUX ed818a4a19 FIX: prevents malformed href to crash TopicEmbed (#12910)
If the associated page of a remote url passed to `TopicEmber.new(remote_url)` contained a malformed link like: `<a href="(http://foo.bar)">Baz</a>` it would raise an uncaught exception:

```
Job exception: Invalid scheme format: (http
```
2021-04-30 11:10:19 +02:00
Joffrey JAFFEUX 2f0205e5c8 FIX: excludes .svg-as-img from JS sizing (#12906) 2021-04-30 11:00:16 +02:00
Joffrey JAFFEUX 54472e4150 DEV: raises a GrantError instead of a log and a variable exception (#12875)
The message in logs will now look like:

```
BadgeGranter::GrantError: Failed to backfill 'Some Badge' badge: {:post_ids=>[]}. Reason: ERROR:  column "email" does not exist
LINE 6: ...t id as user_id, current_timestamp as granted_at, email from...
```
2021-04-28 20:05:45 +02:00
Joffrey JAFFEUX 8be0191ffc UI: minor tweaks to insert-hyplink modal (#12871)
- ensures footer buttons are aligned
- prevents focus on close button to be much larger than it should be, note that this fix could impact other modals but the current solution is not working, so better fix it differently if needed
2021-04-28 17:21:23 +02:00
Joffrey JAFFEUX aa9a8d1041 UI: ensures toolbar gear button has identic color and height (#12872) 2021-04-28 16:22:30 +02:00
Joffrey JAFFEUX 71fd01c8ec FIX: ensures successive topic hydrates doesn't override category (#12865)
This bug has first been seen when loading similar topics, minimum repro:

- Have a topic named "Something Foo Bar" with a category.

- Call this in console:
```
Discourse.currentUser.store.find("similar-topic", { title: "Something foo bar", raw: "" })
```

- Navigate to latest (no full refresh)

- The category from the topic should have disappeared
2021-04-28 16:12:11 +02:00
Joffrey JAFFEUX d53307b141 UX: correctly shows outline around focused input time (#12833) 2021-04-26 11:05:46 +02:00
Joffrey JAFFEUX 6b10ada752 FIX: ensures successive tags can be renamed (#12818)
Original bug report: https://meta.discourse.org/t/rename-tag-not-working-as-expected/184950

This bug was caused by the use of `oneWay` which can be very dangerous in this case, from the documentation:

> computed.oneWay only provides an aliased get. The set will not mutate the upstream property, rather causes the current property to become the value set. **This causes the downstream property to permanently diverge from the upstream property.**
2021-04-23 16:18:23 +02:00
Joffrey JAFFEUX e2e936715e UX: uses native date picker when possible (eg: not safari) (#12668)
Note that this is only applied on date-input and not the old date-picker for now.

This commit is also slightly modifying admin report dates form to ensure the native picker is correctly used, as a result: it doesn’t auto refresh on date change and fixes a border bug.
2021-04-22 10:34:23 +02:00
Joffrey JAFFEUX 0eeedf307a DEV: replaces huge generated emoji list by a simpler regex (#11053)
Note that this commit is also fixing various mistakes in emojis.

Some of them have been fixed manually in db.json/data.js/groups.json and will need to be fixed in emoji-db gem.
2021-04-22 08:43:06 +02:00
Joffrey JAFFEUX 69f8c3b305 UX: displays a descriptive error when theme is not allowed (#12763) 2021-04-20 13:28:59 +02:00
Joffrey JAFFEUX 191fac5c7c DEV: makes transformComplete async (#12752)
This is used to apply multiple transformations following user input.
2021-04-19 11:40:23 +02:00
Joffrey JAFFEUX 99aae959a6 DEV: adds an experimental preserveKey bool option to autocomplete (#12751)
Usage:

```
$(input).autocomplete({
  preserveKey: false
});
```

Defaults to true.
2021-04-19 11:40:05 +02:00
Joffrey JAFFEUX 3157d5ee1b DEV: ensures stylesheet watcher isn't crashing with gems plugins (#12733)
* DEV: ensures stylesheet watcher isn't crashing with gems plugins

This bug has been exhibited since discourse_dev is now including an auth plugin which was loaded as a relative path instead of an absolute path, eg:

`Users/bob/.gem/ruby/2.6.6/gems/discourse_dev-0.1.0/auth/plugin.rb`

Instead of

`/Users/bob/.gem/ruby/2.6.6/gems/discourse_dev-0.1.0/auth/plugin.rb`
2021-04-16 15:25:20 +02:00
Joffrey JAFFEUX 81498bd131 DEV: updates to onebox 2.2.14 (#12713)
This commit also updates github’s body onebox styles in Discourse core:
- full width
- prevents show-more btn to trigger vertical scrolling
- makes text standout less and slightly bigger
2021-04-15 10:58:39 +02:00
Joffrey JAFFEUX ae27717b61 UX: moves from summary/details to a button to expand github body (#12698) 2021-04-15 08:52:04 +02:00
Joffrey JAFFEUX 18777d9108 DEV: implements some of ember-truth-helpers (#12667)
The implemented helpers, are helper which might be in Ember core in the future:

- and
- or
- not
- eq
- not-eq
- lt
- lte
- gt
- gte

They follow the implementation of ember-truth-helpers: https://github.com/jmurphyau/ember-truth-helpers

Note 1: Ember rfcs are still debating going with {{not-eq}} or {{neq}}, should be easy to support in the future whatever is finally chosen.

Note 2: this commit also moves it to its own addon, and removes the {{not}} test, to simplify further updates.
2021-04-12 11:40:00 +02:00
Joffrey JAFFEUX 094c9e5ea3 DEV: uses onebox 2.2.12 (#12671) 2021-04-12 11:34:05 +02:00
Joffrey JAFFEUX 2dc8bfd1ba UI: adds styling for new github PR body details/summary (#12669)
https://github.com/discourse/onebox/pull/466
2021-04-12 10:45:16 +02:00
Joffrey JAFFEUX b6337b72f1 FEATURE: adds last day to about page stats (#12663)
* FEATURE: adds last day to about page stats

* make it clear it's last 24 hours

* applies same copy fix to days
2021-04-12 12:50:33 +10:00
Joffrey JAFFEUX 081ada090c UX: shows a hint when there are more tags than displayed (#12649) 2021-04-08 15:51:31 +02:00
Joffrey JAFFEUX 6081f8e5e9 UX: always display remove emoji btn from emoji-value-list (#12652)
Although if emoji is not editable it should be disabled.
2021-04-08 13:34:26 +02:00
Joffrey JAFFEUX e463f5ce08 DEV: introduces {{not}} helper (#12651)
Code is coming from https://github.com/jmurphyau/ember-truth-helpers, for now I only ported {{not}} which would have tons of use cases in our code base.

We might want to use more helpers in the future, also Ember should have this kind of helpers natively in the future:

- https://github.com/cibernox/rfcs/blob/add-logical-operators-to-templates/text/0000-add-logical-operators.md
- https://github.com/cibernox/rfcs/blob/add-equality-operators-to-templates/text/0000-add-equality-operators.md
- https://github.com/cibernox/rfcs/blob/add-numeric-comparison-operators-to-templates/text/0561-add-numeric-comparison-operators.md
2021-04-08 13:25:16 +02:00
Joffrey JAFFEUX 68a032a734 DEV: prevents test timeout (#12631)
Clock manipulation seems not reliable in component tests. This blog post does a great job of explaining it: https://dockyard.com/blog/2018/04/18/bending-time-in-ember-tests

Sadly, we don't have all the "recent" ember test helpers and can't use things like `getSettledState()`.

For now this pattern seems the most reliable and easy to apply, albeit not great.

Note if you wish to reproduce the current timeout, the following command should do it: `QUNIT_SEED=215263717493121190480103670124734840282 rake qunit:test`
2021-04-07 15:50:06 +02:00
Joffrey JAFFEUX f14e898f6f A11Y: makes replies count a button and not a link (#12570) 2021-04-06 08:27:43 +02:00
Joffrey JAFFEUX 89f1bb7d2a FIX: with vanilla js .href and getAttribute("href") are not equal (#12609)
With a link having an empty href: `<a href>foo</a>` doing
`element.href` will give you the URL of the document, to get the same behavior than `$(element).attr("href")` and get "" you need to do `element.getAttribute("href")`
2021-04-06 00:36:28 +02:00
Joffrey JAFFEUX 8a36b91c2c DEV: removes jquery usage from intercept-click (#12600) 2021-04-05 11:59:58 +02:00
Joffrey JAFFEUX 4fb2d397a4 FIX: ensures popper's autocomplete instance is destroyed (#12476) 2021-03-22 16:19:36 +01:00
Joffrey JAFFEUX 15a9a85f0a FIX: ensures invisible link is not interfering with UI/tab order (#12472) 2021-03-22 12:51:18 +01:00
Joffrey JAFFEUX 2b5046af19 FIX: a never created listener was removed (#12469) 2021-03-22 09:58:59 +01:00
Joffrey JAFFEUX c3e76da90a DOC: document addShortcut click option (#12467) 2021-03-22 09:51:45 +01:00
Joffrey JAFFEUX 4857891ecf DEV: correctly defines focusComposer shortcut as shift+c (#12468) 2021-03-22 09:46:38 +01:00
Joffrey JAFFEUX 67e1ae3f7d A11Y: makes search results count readable by screen reader (#12437) 2021-03-18 18:44:26 +01:00
Joffrey JAFFEUX cf703ccf66 A11Y: improves avatar menu focus/active states (#12422) 2021-03-18 13:29:27 +01:00
Joffrey JAFFEUX 482bcc8726 A11Y: associates lists with labels on interface page (#12426) 2021-03-17 16:03:09 +01:00
Joffrey JAFFEUX cb0427ffdf A11Y: links change username input to its label (#12424) 2021-03-17 15:47:27 +01:00
Joffrey JAFFEUX de32fa299d DEV: adds DiscourseEvent - topic_first_visited_by_user (#12195)
This event would mostly allow plugins to create workflows once users have visited a specific topic.
2021-02-24 10:50:02 +01:00
Joffrey JAFFEUX d0d54bbead A11Y: deselect focused choice when using enter in multi-select (#12165) 2021-02-22 14:34:31 +01:00
Joffrey JAFFEUX 74d83abcc7 A11Y: gives autocomplete in search a more accessible name (#12164)
s/discourse/discourse-search
2021-02-22 12:11:06 +01:00
Joffrey JAFFEUX b7dbdec6fb A11Y: makes other and color, fieldset/legend elements (#12163) 2021-02-22 12:10:51 +01:00
Joffrey JAFFEUX 0b14eb6ab1 A11Y: makes edit username and avatar accessible (#12162)
This commit also adds name as a bindable attribute of link-to
2021-02-22 12:10:44 +01:00
Joffrey JAFFEUX 72258c663b A11Y: ensures avatar image in site header has alt attribute (#12161) 2021-02-22 11:09:18 +01:00
Joffrey JAFFEUX 47835ade9a UX: implements a new tags-intersection-chooser (#12139) 2021-02-19 13:46:02 +01:00
Joffrey JAFFEUX e175e17ebb UX: publishes page, on public change, only when page is published (#12123) 2021-02-18 17:34:50 +01:00
Joffrey JAFFEUX 8f5233a7bf DEV: adds within_one_minute time matcher (#12109) 2021-02-17 10:52:49 +01:00
Joffrey JAFFEUX 7cad5dfa83 DEV: prevents time difference causing flaky spec (#12108) 2021-02-17 10:04:25 +01:00
Joffrey JAFFEUX 237d172fd9 DEV: flexify post-controls and stop relying on clearfix (#12098) 2021-02-17 09:58:17 +01:00
Joffrey JAFFEUX f80e6a2357 FIX: adds google tracking to page publishing (#12090) 2021-02-15 19:00:35 +01:00
Joffrey JAFFEUX 323a5f22e7 A11Y: makes select-kit header a listbox (#12078)
Note that for now pressing enter doesn’t make anything, this is awaiting another change.
2021-02-15 18:22:10 +01:00
Joffrey JAFFEUX c5d0a33cc5 A11Y: adds support for aria-current through d-navigation-item (#12079) 2021-02-15 15:34:25 +01:00
Joffrey JAFFEUX 467b075ef7 A11Y: makes aria-owns an ID and not a data attribute (#12075) 2021-02-15 12:32:09 +01:00
Joffrey JAFFEUX 71e9c2e50b A11Y: sets has-popup as menu for select-kit components (#12074) 2021-02-15 12:31:51 +01:00
Joffrey JAFFEUX 79d7c4a3c2 A11Y: makes quote controls accessible (#12073) 2021-02-15 12:31:35 +01:00
Joffrey JAFFEUX 3b874f1b2d DEV: prevents heisentest in processor spec (#12066)
This test failure was caused by rails calling `.debug` on our FakeLogger which was not supporting it, resulting in more errors than what the test was expecting.
2021-02-12 14:53:36 +01:00
Joffrey JAFFEUX ad7ca46231 A11Y: sets the html lang to user's locale when possible (#12007) 2021-02-10 16:12:09 +01:00
Joffrey JAFFEUX 6d31ead050 A11Y: correctly sets a name on combo-boxes for single selects (#12009) 2021-02-08 11:24:42 +01:00
Joffrey JAFFEUX 898772787c DEV: makes aria-expanded boolean check strict (#12008)
{{d-button ariaExpanded=xxx}} only accepts Boolean now.
2021-02-08 11:18:39 +01:00
Joffrey JAFFEUX 205db66864 A11Y: Adds support for aria-expanded and aria-controls to btn (#11846)
This commit also uses this new feature for the expand/collapse control of the user activity page.
2021-02-08 08:45:37 +01:00
Joffrey JAFFEUX 8957e4d9d0 A11Y: makes user notifications list more accessible (#11992)
Previous markup used to be

```
<div>
  <div>
    <li>
```

Instead we will now have:

```
<ul>
  <li>
    <div>
```

Note this commit also adds two things:
- ability to override tagName of a widget when attaching it
- ability to pass opts and otherOpts to {{attach}}, it could be useful in templates but is mostly useful to test `tagName` for now
2021-02-08 08:45:14 +01:00
Joffrey JAFFEUX 12a4fefef6 FIX: ensures rects is present before using it (#11930)
I don't have a clear reproduction ATM, but I imagine that in fast tests element can get destroyed before we get to use it.
2021-02-02 14:43:13 +01:00
Joffrey JAFFEUX 60f10e9067 DEV: experiments parallel prettier (#11854)
For now only attempts to use it in pre-commit hook
2021-01-27 17:25:48 +01:00
Joffrey JAFFEUX c6a1042950 DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
Joffrey JAFFEUX 8417c9829e A11Y: hamburger menu aria-{expanded,haspopup} and user title (#11852)
User title in the current-user header-dropdown was sometimes `title="null"` if user doesn’t have a name. This is fixed as part of this commit to improve accessibility of this part of the UI.
2021-01-26 16:33:15 +01:00
Joffrey JAFFEUX 1989a326c9 A11Y: correctly sets role=dialog and aria-labelledby for d-modals (#11850) 2021-01-26 15:26:30 +01:00
Joffrey JAFFEUX 21d6603245 DEV: followup to 8edd2b38cb to use existing spec (#11830)
This commit also better explains in spec why max_values might be off by one.
2021-01-25 12:04:27 +01:00
Joffrey JAFFEUX bed011feef A11Y: uses role=button and supports ariaPressed for tapTile (#11827) 2021-01-25 11:31:52 +01:00
Joffrey JAFFEUX 8edd2b38cb FIX: ensures timeline_lookup includes last tuple (#11829)
A simplified version of the logic used in the function before my fix is as follow:

```ruby
result = []
things = [0,1,2,3]
max_values = 2
every = (things.size.to_f / max_values).ceil

things.each_with_index do |t, index|
  next unless (t % every) === 0
  result << t
end

p result # [0, 2]
# 3 doesn’t get included
```

The problem is that if you get unlucky two times you won't get last tuple(s) and might get a very erroneous date.

Double unlucky:
- last tuple index % computed every !== 0 and you don't get the last tuple
- the last tuple is related to a post with a very different date than the previous tuples (on year difference in our case)
2021-01-25 11:30:59 +01:00
Joffrey JAFFEUX 6f13d2b039 A11Y: makes post-edits-indicator a button instead of a link (#11811) 2021-01-22 17:09:39 +01:00
Joffrey JAFFEUX 436c8e9bcd DEV: eslint rules should be defined in eslint-config-discourse (#11812) 2021-01-22 15:48:23 +01:00
Joffrey JAFFEUX 314e7be2b1 A11Y: improves search-in-options filter accessibility (#11809) 2021-01-22 14:39:16 +01:00
Joffrey JAFFEUX 7521cb51c4 A11y: makes advanced search and html heading (#11808) 2021-01-22 14:35:17 +01:00
Joffrey JAFFEUX 54a01701d7 DEV: makes user-stream an unordered list (#11770)
Note, ideally we would drop tagName usage, but I think it's safer to do it in a separate PR in few weeks.
2021-01-20 15:57:38 +01:00
Joffrey JAFFEUX a8169e93c2 DEV: implements combobox roles for select-kit (#11769)
https://www.w3.org/TR/wai-aria-practices-1.1/#wai-aria-roles-states-and-properties-6
2021-01-20 15:50:53 +01:00
Joffrey JAFFEUX ce01f9db46 DEV: adds support for lang attribute in select-kit (#11741) 2021-01-18 15:34:18 +01:00
Joffrey JAFFEUX 8ee3d2d954 FIX: prevents debouncing and query to override each other (#11704)
Before this change we were setting the input after the query has been done, resulting in us overwriting the input if the user types during the query.
We don't need to update it after the query, we just need to ensure it's set when we load the page and then it should stay in sync.
2021-01-14 10:19:08 +01:00
Joffrey JAFFEUX 49f4c75080 FIX: recurring was not working for some cases (eg: hours and unit > 1) (#11657) 2021-01-07 12:21:51 +01:00
Joffrey JAFFEUX 53f9a0883e UX: allows to copy/paste a list of | separated values in sk (#11642)
* UX: allows to copy/paste a list of | separated values in sk

* fixes tests
2021-01-06 12:57:13 +01:00
Joffrey JAFFEUX 7cf46b290d FIX: prevents autocompoete of username to appear on right (#11623) 2021-01-04 10:36:54 +01:00
Joffrey JAFFEUX 258888b7c4 FIX: ensures defined expired_in is passed from write to write_entry (#11622)
This commit also makes `Cache#namespace` readable to help writing tests easier and make them more robust.
2021-01-04 10:34:44 +01:00
Joffrey JAFFEUX 1405b6859d DEV: uses popper for autocomplete (#11201) 2021-01-04 09:55:47 +01:00
Joffrey JAFFEUX e4dcf93238 UX: text overflow user-{primary,secondary}-navigation (#11604) 2020-12-30 21:34:27 +01:00
Joffrey JAFFEUX 8af6e72675 FIX: ensures recurring works when setting a start date in future (#11587) 2020-12-29 20:11:18 +01:00
Joffrey JAFFEUX b824af02d4 FIX: removes extra slashes from URL (#11433)
This is similar to a fix used in ember core: https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/routing/lib/location/history_location.ts#L140

It will prevent a URL with a double slash to hang and end up in a 404.
2020-12-08 17:47:43 +01:00
Joffrey JAFFEUX daefa3d25a UX: makes sk components full width on users admin page (#11413) 2020-12-08 11:18:02 +11:00
Joffrey JAFFEUX 54519a2976 FIX: do not replace smiling_face by slight_smile (#11412) 2020-12-06 18:28:39 +01:00
Joffrey JAFFEUX abb89475a3 FIX: issues with frowning/grinning (#11235)
- frowning was using slighty_frowning
- slightly_frowning was using frowning
- grinning_face_with_smiling_eyes was not defined
- fronwing_face_with_open_mouth was not defined
2020-11-25 09:09:35 +01:00
Joffrey JAFFEUX ad1a10e6e9 FIX: hides votes from regular users when poll is staff only (#11342) 2020-11-24 22:19:06 +01:00
Joffrey JAFFEUX 8aa912c885 FIX: iconList is an array in production (#11308)
This should be investigated further, but hopefully the comment will prevent anyone else to fall in this trap.
2020-11-20 20:00:51 +01:00
Joffrey JAFFEUX 8a90a5610f DEV: allows to check if an icon is in the set (#11303) 2020-11-20 17:34:55 +01:00