Commit Graph

46 Commits

Author SHA1 Message Date
Guo Xiang Tan b299f5f491 DEV: Use Ember.Service over manually registering a factory.
Follow up to 9e827eb420
2020-05-06 09:24:49 +08:00
tshenry 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
Guo Xiang Tan 9e827eb420
DEV: Refactor presence manager to deal with multiple composer states.
This change amends it so we use a static service to keep track of
the typing presence.

It correct various edge cases the initial implementation had

- Faster close messages
- When composing on topic 1 and viewing topic 2 we had incorrect
  presence
- Changing a running composer to reply as new topic or reply to a
  differet topic would not correctly shift presence

Authored by tgxworld, with contributions by sam
2020-05-01 11:37:03 +10:00
Guo Xiang Tan ae54a33719
FIX: discourse-presence breaks composer for users. 2020-04-29 15:29:29 +08:00
Guo Xiang Tan 197d0332e6
DEV: Missing import. 2020-04-29 13:48:31 +08:00
Guo Xiang Tan 8b3b5d1474
DEV: Disable `discourse-presence` in Ember test env. 2020-04-29 13:39:19 +08:00
Sam Saffron 2045f51312
FIX: correctly account for direct replies with presence
followup to 301a0fa5, we were not checking the action so we
were publishing some messages from composers we did not intend to
2020-04-29 15:23:17 +10:00
Alan Guo Xiang Tan 301a0fa54e
FEATURE: Redesign discourse-presence to track state on the client side. (#9487)
Before this commit, the presence state of users were stored on the
server side and any updates to the state meant we had to publish the
entire state to the clients. Also, the way the state of users were
stored on the server side meant we didn't have a way to differentiate
between replying users and whispering users.

In this redesign, we decided to move the tracking of users state to the client
side and have the server publish client events instead. As a result of
this change, we're able to remove the number of opened connections
needed to track presence and also reduce the payload that is sent for
each event.

At the same time, we've also improved on the restrictions when publishing message_bus messages. Users that
do not have permission to see certain events will not receive messages
for those events.
2020-04-29 14:48:55 +10:00
Jarek Radosz 5037b80c9c
Merge imports from the same module (#9144) 2020-03-09 17:38:37 +01:00
Jarek Radosz 48ba65f406
DEV: Clean up Ember imports (#8979)
Includes:
* Import `computed` helpers
* Import `@ember/application`
* Import `isBlank` from `@ember/utils`
* Import `A` from `@ember/array`
* Import `EmberArray` from `@ember/array`
* Import `ArrayProxy` from `@ember/array/proxy`
* Import `warn` from `@ember/debug`
* Import `EmberObject` from `@ember/object`
* Import `Application` from `@ember/application`
* Import `EmberRouter` from `@ember/routing/router`
* Import `isPresent` from `@ember/utils`
* Import `computed` from `@ember/object`
* Import `guidFor` from `@ember/object`
* Import `isArray` from `@ember/array`
* Import `TextField` from `@ember/component`
* Import `TextArea` from `@ember/component`
* Import `Promise` from `rsvp`
* Import `Evented` from `@ember/object/evented`
* Replace deprecated `ember-addons/ember-computed-decorators` imports
2020-03-06 23:49:28 +01:00
Penar Musaraj 6be685ac67 DEV: Find/replace deprecated decorators 2020-02-19 11:49:56 -05:00
Jarek Radosz fe588cc7f8
DEV: Fix function prototype deprecations (#8681)
* DEV: Fix the function prototype observers deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.observes('foo') to observer('foo', function() {}). [deprecation id: function-prototype-extensions.observes] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-observes for more details.

* DEV: Fix the function prototype event listeners deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.on('foo') to on('foo', function() {}). [deprecation id: function-prototype-extensions.on] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-on for more details.

* DEV: Simplify `default as` imports

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-01-16 18:56:53 +01:00
Robin Ward 8d34f4bbd9 Revert "Revert Ember.run refactors"
This reverts commit fcb1ca52f9.
2019-10-30 09:48:24 -04:00
Robin Ward fcb1ca52f9 Revert Ember.run refactors
This reverts commit 5ca60fcb6b.
2019-10-29 17:10:47 -04:00
Robin Ward 5ca60fcb6b REFACTOR: Use imports for `Ember.run` 2019-10-29 15:31:56 -04:00
Robin Ward a8a76198b1 REFACTOR: Remove `Ember.Component` global variable
Use imports instead.
2019-10-23 12:30:52 -04:00
Joe 27f7bd4273
UX: adjusts RTL composer presence avatar alignment
context: https://meta.discourse.org/t/user-is-typing-misaligned-and-mixed-with-reply-choices-with-rtl/127963

This commit adds a temporary fix for presence avatar overlap in the composer for RTL.

More context on TMP here: https://meta.discourse.org/t/moving-the-voting-box-to-the-right-side-of-the-screen/126752
2019-09-09 20:47:29 +08:00
Joffrey JAFFEUX b98b994fe7
apply prettier on plugins (#7605) 2019-05-27 11:06:11 +02:00
Joffrey JAFFEUX bfea922167
DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592) 2019-05-27 10:15:39 +02:00
Penar Musaraj e50e4b6cc6 Make Prettier happy 2019-04-08 12:03:41 -04:00
Tarek Khalil 5957991340 FIX: Remove quoted post text and block realtime replies from ignored users (#7336) 2019-04-08 17:44:42 +02:00
Kris 5f75da6f61 FIX: Prensence was overlapping with full-screen icon 2019-01-10 21:02:02 -05:00
Joffrey JAFFEUX f9648de897
DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
2019-01-10 11:06:01 +01:00
Kris c09a407f65 composer alignment fixes 2018-11-13 11:12:58 -05:00
Joe a552a39f53
UX: presence-users overlaps with composer toggles 2018-10-15 16:25:28 +08:00
Robin Ward a566ed42ae FEATURE: Option to disable user presence and profile
This allows users who are privacy conscious to disable the presence
features of the forum as well as their public profile.
2018-10-10 17:34:33 -04:00
Joffrey JAFFEUX 60ff0e9b8c
missing prettified files 2018-06-15 18:42:20 +02:00
Joffrey JAFFEUX 174d392e5a
DEV: adds prettier (#5956)
Run `prettier --write "app/assets/stylesheets/**/*.scss" "plugins/**/*.scss"` after making sure you installed it with `yarn`

It's recommended to configure your editor to run prettier on file save.
2018-06-08 11:49:31 +02:00
Sam 8b62b59b2e FIX: in some cases we subscribed to an invalid channel
in some very rare cases we would publish and empty payload causing
messagebus corruption

this broke all navigation
2018-04-30 12:13:55 +10:00
Joffrey JAFFEUX ea812ea05d
FIX: regression preventing the display of `replying...` in the composer 2018-03-05 18:51:57 +01:00
Joffrey JAFFEUX 190d208631
FEATURE: improves composer-actions toggle menu
* only toggles
* fix a bug with presence
* more tests
* do not duplicate `continuing discussion...` text
* persist state to allow switching between toggles
2018-02-08 11:46:55 +01:00
Kris b040e11c6b FIX: Preventing presence users from overflowing window 2018-01-19 19:15:08 -05:00
Régis Hanol 779efd9235 FIX: don't set properties on destroyed components 2017-12-22 20:33:33 +01:00
Kris 744bb72cf9 UX: Better centering in presence plugin 2017-12-20 16:45:07 -05:00
Régis Hanol a7844de7ee UX: only publish presence when typing a message 2017-12-18 22:00:55 +01:00
Sam de20e36629 cancel timer when removing composer 2017-12-18 22:26:00 +11:00
Sam fd67508497 FIX: don't count users as replying long after they are done typing
Also, don't leak a large amount of redis usage for presence stuff
2017-12-18 15:41:32 +11:00
Régis Hanol 023fcb04b5 make eslint happy 2017-12-06 22:23:38 +01:00
Régis Hanol ae0acfb1df FEATURE: live reply indicators at the bottom of topic 2017-12-06 21:58:59 +01:00
Kris ada1d6b987
Composer restyle
* composer restyle, some input normalization

* style adjustments: spacing, preview background, colors

* small spacing adjustments, removing default iOS input appearance, fixing merge

* small width adjustment

* fixing mobile link modal for small devices

* FIX: more resilient allowInitiatlValueMutation implementation

* Build scrollMap only on scroll.

* FIX: pick date and time was not reseting state

* FIX: removes auto sizing and touchstart support for now

* Revert "FIX: reflects discourse icons naming scheme s/d-icon-*/d-*"

This reverts commit b5ed980235.

* tweak icon-library generation

* FIX: regression preventing to set number of hours before closing

This commit also adds a full test suite for editing topic timer.

* FIX: makes allowInitialValueMutation more restrictive

* FIX: invite-list expects initial value mutation

* fixing tag input spacing

* minor input cleanup

* bump onebox version

* FIX: avoids test failing at some times of the day

* FIX: various issues when editing category permissions

This commit also adds multiple tests
2017-11-27 15:23:18 -05:00
David Taylor 8825581d98 Discourse-presence improvements
- Added guardian checks to endpoint
- Added security to messagebus publishing
- Added specs for security measures
- Moved all logic into component
- Stop sending ‘keepAlive’ messages if the user stops editing for more then 2 minutes

- Enable plugin by default
2017-09-08 14:32:13 -07:00
Robin Ward a9ed0023dc FIX: Presence was broken with a null array 2017-09-08 10:20:35 -04:00
Robin Ward 846e573766 Use a connector class to determine wheteher to render presence 2017-09-08 10:20:35 -04:00
Guo Xiang Tan 84031c5cb9 Make eslint happy. 2017-09-08 14:08:19 +08:00
David Taylor feef5491a2 Simplify copy & add transifex config 2017-09-08 00:47:35 +01:00
David Taylor c9912fcc37 Add discourse-presence as a core plugin (#5137)
* Add discourse-presence as a core plugin

* Default enabled
2017-09-07 09:40:18 +02:00