Commit Graph
100 Commits
Author SHA1 Message Date
Joffrey JAFFEUX 50647366ed FIX: NotificationLevels import was incorrect (#10709)
This was causing NotificationLevels.muted to be undefined.
2020-09-19 11:27:20 +02:00
Joffrey JAFFEUX f785b04dc0 FIX: missing / after basePath was causing the URL to be relative (#10708) 2020-09-19 11:27:03 +02:00
Joffrey JAFFEUX cc2a306936 FIX: hidden was defined as static instead of relying on attribute (#10701)
This commit also:
- deprecate an old way of using actions for future removal
- removes all the hidden/block/... logic, as we just rely on parent being displayed or not
2020-09-18 15:11:34 +02:00
Joffrey JAFFEUX 28cd1aaf8e FIX: uses get() on properties of groups/badges which could be POJOs (#10682) 2020-09-16 16:45:11 +02:00
Joffrey JAFFEUX 02dec8c209 UI: minor size/spacing inconsistencies in search advanced options (#10681) 2020-09-16 15:05:19 +02:00
Joffrey JAFFEUX 4af48f7998 FIX: attempts to make autofocus more resilient in modals (#10680)
The current situation could cause a transition on the button to end after/during modal has shown and causing the button to get focus again. Browsers would then refuse to switch focus.

This is a kinda convulted solution, but it's a general purpose solution which doesn't involve changing anything in plugins/themes or core templates.
2020-09-16 11:05:02 +02:00
Joffrey JAFFEUX 15b3477145 FIX: img width and height should be in quotes (#10675) 2020-09-15 11:39:12 +02:00
Joffrey JAFFEUX 53e281a3fd FIX: simplifies updating searchedTerms from connectors (#10674) 2020-09-15 11:21:38 +02:00
Joffrey JAFFEUX 324aa3eb61 REFACTOR: reworks all the search-advanced-options panel (#10661)
* REFACTOR: reworks all the search-advanced-options panel

This commit includes the following changes:
- prevents any mutation of external (to the component) values
- get rid of observers
- uses @action
- minor UI tweaks
- dropped the unecessary debounce
- drops all the legacy code for badges/groups which is not being used
- replaces user-selector by user-chooser and improves multi-select to not show `search` if maximum has been reached

Most importantly this refactor should fix multiple bugs due to _update() being called multiple times if searchTerm was empty and other various bugs where some changes in searchTerm was not applied to the sidebar.
2020-09-15 09:39:12 +02:00
Joffrey JAFFEUX bbddce4d3a DEV: updates js transpiler to use babel 7 (#10627)
Updates our js transpiler code to use Babel 7.11.6

List of changes in this commit:

- Updates plugins, babel plugins all have a new version which doesn't contain -es2015- anymore
- Drops [transform-es2015-classes](https://babeljs.io/docs/en/babel-plugin-transform-classes) this plugin shouldn't be needed now that we don't support IE
- Drops check-es2015-constants, checking constants is now part of babel and the check-constants plugin is deprecated. As a result the behavior slightly changed, and is now wrapping every const call in a readOnlyError function which would throw if assigned a new value. This explains the modified spec.
- Adds [proposal-optional-chaining](https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining)

```javascript
const obj = {
  foo: {
    bar: {
      baz: 42,
    },
  },
};

const baz = obj?.foo?.bar?.baz; // 42
```

- Adds [proposal-json-strings](https://babeljs.io/docs/en/babel-plugin-proposal-json-strings)

```javascript
// IN
const ex = "before
after";
//                ^ There's a U+2028 char between 'before' and 'after'


// OUT
const ex = "before\u2028after";
//                ^ There's a U+2028 char between 'before' and 'after'
```

- Adds [proposal-nullish-coalescing-operator](https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator)

```javascript
var object = {};
var foo = object.foo ?? "default"; // default
```

- Adds [proposal-logical-assignment-operators](https://babeljs.io/docs/en/babel-plugin-proposal-logical-assignment-operators)

```javascript
let a;
let b = 2;
a ||= b; // 2
```

- Adds [proposal-numeric-separator](https://babeljs.io/docs/en/babel-plugin-proposal-numeric-separator)

```javascript
let budget = 1_000_000_000_000;
console.log(budget === 10 ** 12); // true
```

- Adds proposal-object-rest-spread https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread

```javascript
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
console.log(x); // 1
console.log(y); // 2
console.log(z); // { a: 3, b: 4 }
```

- Adds proposal-optional-catch-binding https://babeljs.io/docs/en/babel-plugin-proposal-optional-catch-binding

```javascript
try {

} catch {

} finally {
  // ensures finally is available in every browsers
}
```

- Adds improved regex support for firefox through (transform-dotall-regex](https://babeljs.io/docs/en/next/babel-plugin-transform-dotall-regex.html) and (proposal-unicode-property-regex](https://babeljs.io/docs/en/babel-plugin-proposal-unicode-property-regex)

- Drops async/generator stuff, the browser we target should allow to use this (excepts iterable async)
2020-09-15 09:26:33 +02:00
Joffrey JAFFEUX 9238a9e427 FIX: adds shims for popper in wizard (#10658) 2020-09-14 12:33:14 -04:00
Joffrey JAFFEUX e02da64091 FIX: Make form use /u/admin-login instead of /users/admin-login (#10663) 2020-09-14 12:27:06 +10:00
Joffrey JAFFEUX 0a4a273ccc FEATURE: adds support for mobile view on page publishing (#10662) 2020-09-13 13:50:23 +02:00
Joffrey JAFFEUX e8053d17f6 FIX: selected diversity was off by one (#10659) 2020-09-12 09:44:45 +02:00
Joffrey JAFFEUX 539eb63904 DEV: heisentest cause by a post not created yet (#10656) 2020-09-12 08:47:06 +02:00
Joffrey JAFFEUX 07d7adb8b4 UX: makes emoji picker case insensitive (#10655) 2020-09-11 19:54:19 +02:00
Joffrey JAFFEUX 10bdf36a24 FIX: ensures focus is dropped before focus hyperlink input (#10653) 2020-09-11 16:45:51 +02:00
Joffrey JAFFEUX d9aa105c8e FIX: wrap modal onShow inside next (#10651)
Before this commit, onShow code could be impacted by code happening after the onShow call. This should ensure this code works for example:

```
onShow() {
  afterRender(() => {
    someInput.focus();
  })
}
```
2020-09-11 16:00:31 +02:00
Joffrey JAFFEUX a60ba75ac2 FIX: prevents eslint failure on unmatched patterns in plugins (#10648)
The recent upgrade of eslint fails if no files is found for the defined patterns.
2020-09-10 20:17:40 +02:00
Joffrey JAFFEUX e4fbe404b4 linting (#10644) 2020-09-10 11:34:48 +02:00
Joffrey JAFFEUX 38c934e1e1 UX: prevents auto capitalize/correct in the emoji picker (#10636) 2020-09-09 15:43:18 +02:00
Joffrey JAFFEUX 8413d27cf2 FIX: handles different cases of canInvite/canRemove states in PM (#10607) 2020-09-08 16:35:59 +02:00
Joffrey JAFFEUX 02495510e8 FIX: workaround constructor name not available after transpilation (#10623)
This is only reproducible en production build. In this case, constructor.name could be any value like "i" for example.
2020-09-08 10:14:41 +02:00
Joffrey JAFFEUX 0b8e7d88fe FIX: wraps popper call in afterRender and uses createPopper (#10621)
Before this fix, popper was sometimes not applied.
2020-09-07 13:33:52 +02:00
Joffrey JAFFEUX 110f6ec6dd DEV: fixes eslint/prettier on github actions (#10601) 2020-09-04 20:01:14 +02:00
Joffrey JAFFEUX c5b8a47901 FIX: ensures we don't attempt to concat an empty list (#10600) 2020-09-04 19:08:07 +02:00
Joffrey JAFFEUX 34c2dfccb7 DEV: specific ext and remove I18n global 2020-09-04 18:59:53 +02:00
Joffrey JAFFEUX ed05839dfc FIX: prevents error when opening a composer from a tag page (#10596) 2020-09-04 15:47:22 +02:00
Joffrey JAFFEUX 647cdca99b DEV: ignore coding standards applied to plugins (#10595) 2020-09-04 13:53:26 +02:00
Joffrey JAFFEUX bf88410126 DEV: apply coding standards to plugins (#10594) 2020-09-04 13:51:53 +02:00
Joffrey JAFFEUX 034a59a69d DEV: ignore coding standards commit (#10593) 2020-09-04 13:44:58 +02:00
Joffrey JAFFEUX 52672b9eab DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
Joffrey JAFFEUX 80dfaeb0d2 DEV: upgrades dev config (#10588) 2020-09-04 13:33:03 +02:00
Joffrey JAFFEUX de038c0eab FIX: highlightjs 10 requires some languages to be loaded before others (#10584)
cs is also not present in 10 and relies only on csharp file, but for cs alias to work csharp has to be loaded.
2020-09-02 21:32:57 +02:00
Joffrey JAFFEUX c6e336b519 REFACTOR: simplifies connectors code (#10579)
- directly uses factoryFor to avoid having to set owner later
- drops jquery usage
- renames view into component as I find it more explicit
2020-09-02 15:53:42 +02:00
Joffrey JAFFEUX 02f0637892 FIX: updates highlightjs to latest version to avoid a freeze (#10578)
Example repro of the freeze:

```
```css
[
```
2020-09-02 15:14:48 +02:00
Joffrey JAFFEUX f8062300da DEV: removes jquery usage from highlight-syntax (#10564) 2020-09-01 09:50:49 +02:00
Joffrey JAFFEUX 1cc5e8ea63 DEV: gives didRender and willRerender hooks to widgets (#10496)
didRender will be called each time the widget is rendered
willRerender will be called the second time a widget is rendered to give an opportunity to clean some state before the tree is replaced
2020-08-27 16:07:14 +02:00
Joffrey JAFFEUX f5eccdd0b8 FIX: ensures period-chooser is not losing query params (#10534)
eg repro before:
- visit http://pr-discourse.test/top/weekly?f=foo
- select another period in the period chooser
- f=foo was gone

After this commit it should still be present
2020-08-26 19:01:08 +02:00
Joffrey JAFFEUX c792f36966 UX: clarify timezone formatting (#10526) 2020-08-26 10:18:55 +02:00
Joffrey JAFFEUX b6dd3eca9a FIX: ensures diversity code is not applied multiple times (#10517) 2020-08-24 16:10:47 +02:00
Joffrey JAFFEUX 265d8bc1d7 FIX: close picker on emoji selection when on mobile device (#10516) 2020-08-24 15:04:44 +02:00
Joffrey JAFFEUX c3364b3a6b UX: improves picker on automatic dark themes (#10515) 2020-08-24 15:04:11 +02:00
Joffrey JAFFEUX 226be994da REFACTOR: rewrite the emoji-picker (#10464)
The emoji-picker is a specific piece of code as it has very strong performance requirements which are almost not found anywhere else in the app, as a result it was using various hacks to make it work decently even on old browsers.

Following our drop of Internet Explorer, and various new features in Ember and recent browsers we can now take advantage of this to reduce the amount of code needed, this rewrite most importantly does the following:
- use loading="lazy" preventing the full list of emojis to be loaded on opening
- uses InterserctionObserver to find the active section
- limits the use of native event listentes only for hover/click emojis (for performance reason we track click on the whole emoji area and delegate events), everything else is using ember events
- uses popper to position the emoji picker
- no jquery code
2020-08-24 14:20:51 +02:00
Joffrey JAFFEUX 23b823dd3a FIX: removes us_pacific-new from the list of available timezones (#10514) 2020-08-24 11:04:46 +02:00
Joffrey JAFFEUX 4f7a9802e7 FIX: prefer timezones over timezone for previews (#10506)
eg:

timezone="America/Detroit"
timezones="US/Eastern"

Before this commit we would show America/Detroit in previews and not US/Eastern, given US/Eastern and America/Detroit are equivalent.

After this commit, we will display the date with America/Detroit but show US/Eastern in the previews.
2020-08-21 16:31:50 +02:00
Joffrey JAFFEUX 2fac77cc48 DEV: upgrades sassc to 2.4.0 (#10447)
We were stuck on 2.0.1 but multiple reports on the original issue shows that the issue has been fixed since 2.3 and 2.4:

https://github.com/sass/sassc-ruby/issues/146#issuecomment-654522157
https://github.com/sass/sassc-ruby/issues/146#issuecomment-654522157

There's one report show it was not fixed in 2.3.0, but that's the only one, it's probably worth trying: https://github.com/sass/sassc-ruby/issues/146#issuecomment-639073736
2020-08-21 13:46:46 +02:00
Joffrey JAFFEUX dde3d63b33 DEV: adds event_reminder (27) and event_invitation (28) (#10473)
Note that these events are also added to the list of events sent to push notifications.
2020-08-19 12:07:51 +02:00
Joffrey JAFFEUX 3e49c5b4d8 FIX: do not cancel search early in tests (#10445)
This is done to avoid cases where search would be cancelled before debounce.
2020-08-19 09:57:40 +02:00
Joffrey JAFFEUX b98cf565d1 FIX: makes group_show_serializer#is_group_owner follow standards (#10466)
It should only return if is_group_owner, otherwise the field won't be present in json.
2020-08-18 18:30:08 +02:00
Joffrey JAFFEUX 93a370863f FIX: more efficient and resilient widget-dropdown body (#10458) 2020-08-18 13:39:08 +02:00
Joffrey JAFFEUX 6d0eb7178d FIX: prevents errors on /tags when a tag constructor exists (#10449)
This is due to js objects having a constructor property:

```
const obj = {};
obj['constructor'] // return [native code] and not undefined
```
2020-08-17 17:40:34 +02:00
Joffrey JAFFEUX 510eaf9881 DEV: re-enable tests following the timeout fix (#10410)
The 3 skipped tests are failing but not related to timeout
2020-08-11 09:09:21 +02:00
Joffrey JAFFEUX b86198198f FIX: removes persistedQueryParams as it should work out of the box (#10394)
This hack is only attempting to hide something which should have been working in core and for which we should provide a fix soon. Also it's not working as it should.
2020-08-07 09:51:37 +02:00
Joffrey JAFFEUX b6e475a8f3 FIX: ensures shadow has last_posted_at before comparing to site setting (#10374) 2020-08-05 13:20:51 +02:00
Joffrey JAFFEUX 4593bb60c5 FIX: allows to change a user group notification level (#10369)
The current code has an ambiguous name of "user" which is actually not a user model, the real user model is accessible on the model key of user.
2020-08-04 21:23:55 +02:00
Joffrey JAFFEUX 8a0478b97d DEV: adds plugin api to add custom recipients of a post revision (#10367)
* DEV: adds plugin api to add custom recipients of a post revision

Usage:

```
add_post_revision_notifier_recipients do |post_revision|
  [78]
end
```
2020-08-04 11:57:33 +02:00
Joffrey JAFFEUX eb61916e23 UX: allows to navigate widget dropdown with tab and enter (#10356) 2020-08-03 10:37:30 +02:00
Joffrey JAFFEUX 8a9e4504fe DEV: allows to decouple csv-uploader texts from bulk invite (#10344) 2020-08-01 10:29:09 +02:00
Joffrey JAFFEUX cfd3dcee4a FIX: reduces charts height (#10327) 2020-07-28 18:42:14 +02:00
Joffrey JAFFEUX 11faec71ae FIX: prevents group show serializer to override basic group serializer (#10326) 2020-07-28 18:11:15 +02:00
Joffrey JAFFEUX 0c7eaa57b2 FEATURE: allows to display charts by day/week/month (#10325) 2020-07-28 16:14:41 +02:00
Joffrey JAFFEUX f32cc04ddc FIX: uses topic title for published page head title (#10312) 2020-07-27 15:09:12 +02:00
Joffrey JAFFEUX de5245631b FIX: gives emojis a width/height to prevent lazy loading warning (#10277) 2020-07-21 08:50:56 +02:00
Joffrey JAFFEUX 936a40adcf linting (#10276) 2020-07-21 08:39:14 +02:00
jjaffeux f92116d695 Revert "DEV: flexify post actions (#9926)"
This reverts commit 6ef0e98f4e.
2020-07-07 12:42:49 +02:00
Joffrey JAFFEUX 56475f57c5 UX: simplifies editing email templates by always having a default (#10179) 2020-07-07 11:44:13 +02:00
Joffrey JAFFEUX 9b7000dbf1 FIX: ensures category order keeps consistent (#10165)
Before this change:
- first full page load would get category defaults defined un cateory settings
- a navigation to a topic and then back to categories list would reset defaut to the ones defined in discovery/topics
2020-07-07 09:56:38 +02:00
Joffrey JAFFEUX 6ef0e98f4e DEV: flexify post actions (#9926)
* DEV: flexify post actions

* more tweaks
2020-07-07 10:18:01 +10:00
Joffrey JAFFEUX 789a15a897 DEV: allows autocomplete to be debounced (#10166)
Usage:

```
$(".foo").autocomplete({debounced: true});
```
2020-07-06 09:28:57 +02:00
Joffrey JAFFEUX b2a2e4f1e5 FIX: ensures seconds are displayed when used with dates (#10170) 2020-07-06 09:26:31 +02:00
Joffrey JAFFEUX df1f804400 FIX: ensures moderation history is accessible from topic/post admin menu (#10118) 2020-06-24 10:49:47 +02:00
Joffrey JAFFEUX 3e161e372a FEATURE: allows to have header/footer in publshed pages (#10067)
Usage: fill Header/Footer sections of your theme.
2020-06-19 09:51:03 +02:00
Joffrey JAFFEUX b8c676e727 FEATURE: allows to ignore a user forever (#10074) 2020-06-18 11:24:07 -04:00
Joffrey JAFFEUX 75991a249e fix spec (#10069) 2020-06-18 09:02:08 +02:00
Joffrey JAFFEUX 9518d6b587 fix spec (#10061) 2020-06-17 15:10:07 +02:00
Joffrey JAFFEUX 9da3a7f436 FEATURE: allows published pages to be public (#10053) 2020-06-17 12:42:20 +02:00
Joffrey JAFFEUX 4b793a1072 FIX: allows PM owner to remove any user if >= TL2 (#10036) 2020-06-12 12:54:28 +02:00
Joffrey JAFFEUX 6fa990f05d FIX: prevents emoji in links to appear as large emojis (#10027) 2020-06-11 12:27:48 +02:00
Joffrey JAFFEUX 8fe074430b REVERT: partly revert change to ensure context is the same (#10012) 2020-06-10 11:10:39 +02:00
Joffrey JAFFEUX 43e17f92e0 DEV: allows to call a widget function without re-rendering the widget (#10004) 2020-06-09 19:58:17 +02:00
Joffrey JAFFEUX 84d767716f linting (#10008) 2020-06-09 19:54:06 +02:00
Joffrey JAFFEUXandRégis Hanol a3cf1cf6ff DEV: allows to prepend widgets to post nav controls (#10005)
Co-authored-by: Régis Hanol <regis@hanol.fr>
2020-06-09 19:37:06 +02:00
Joffrey JAFFEUX 23ed16339f DEV: adds mouse{Over,Out} and touch{Start,End} to widgets (#10003) 2020-06-09 19:36:28 +02:00
Joffrey JAFFEUX cb13152a43 FIX: ensures edit-category-setting is correctly casting boolean (#9999) 2020-06-08 15:16:42 +02:00
Joffrey JAFFEUX d4caf69ed7 DEV: makes SKIP_INSTALL_PLUGINS called last and global (#9990) 2020-06-05 17:59:23 +02:00
Joffrey JAFFEUX a23d31e4d6 DEV: removes unecessary casting (#9982) 2020-06-04 19:07:34 +02:00
Joffrey JAFFEUX ae52f5eaf5 DEV: removes brittle test (#9977) 2020-06-04 09:21:21 +02:00
Joffrey JAFFEUX d27b877a40 FIX: prevents false boolean param to be filtered as non existant (#9968)
* FIX: prevents false boolean param to be filtered as non existant

This was preventing to filter top category route to be filtered by replies.

* if order is different ascending should be true on first click

* test

* fix

* just pass params

* more fixxes
2020-06-03 10:19:53 -06:00
Joffrey JAFFEUX f9e715672b DEV: makes autocomplete debounced (#9941)
* DEV: makes autocomplete debounced

* better wording
2020-06-02 15:20:14 +10:00
Joffrey JAFFEUX 57e587f39f DEV: removes dead code of dropdown-menu (#9942) 2020-06-01 11:22:35 +02:00
Joffrey JAFFEUX 40c4a8e3fc DEV: skips/tweaks brittle tests (#9952) 2020-06-01 11:09:34 +02:00
Joffrey JAFFEUX 93bd1ff228 FIX: topic-admin-popup-menu was overflowing on small screens (#9944) 2020-05-30 10:53:08 +02:00
Joffrey JAFFEUX 8f59f155fb UI: makes topic count less visible in category drop (#9938) 2020-05-30 00:32:20 +02:00
Joffrey JAFFEUX c5ccf5f93c UI: removes font-weight: bold from category-drop names (#9937) 2020-05-30 00:06:35 +02:00
Joffrey JAFFEUX 03c3448b15 UX: better alignment of icons in notifications menu (#9934) 2020-05-29 22:48:47 +02:00
Joffrey JAFFEUX 931bfca454 DEV: allows categories-admin-dropdown to have custom items (#9931)
Usage:

```
modifySelectKit("categories-admin-dropdown").appendContent(function() {
  return {
    id: "foo",
    name: I18n.t("foo"),
    description: I18n.t("foo_description"),
    icon: "gear",
    onChange: () => alert("Foo.")
  };
});
```
2020-05-29 21:01:19 +02:00
Joffrey JAFFEUX 7635c18a14 DEV: ensures highlightjs is correctly tested (#9923) 2020-05-29 13:05:44 +02:00
Joffrey JAFFEUX 5d792483f0 UI: various select-kit dropdown tweaks/cleaning (#9922) 2020-05-29 11:11:28 +02:00
Joffrey JAFFEUX f3dee5863f FIX: pins down highlight.js to the last commit of the v9 tree (#9921)
The 10+ version has actually a bug with bash. We will wait a little bit before upgrading to 10, we should also make sure any of the breaking changes listed here https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_BREAKING_CHANGES.md are not impacting us.
2020-05-29 10:21:21 +02:00