-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Configurable Volume for Notifications #6087 #7517
Conversation
# Conflicts: # .meteor/packages # package.json # packages/rocketchat-ui/client/lib/notification.js
# Conflicts: # .meteor/packages # package.json # packages/rocketchat-ui/client/lib/notification.js
…tions about changing user's password. #2995
@@ -397,7 +397,6 @@ class ModelUsers extends RocketChat.models._Base { | |||
requirePasswordChangeReason | |||
} | |||
}; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do not introduce unnecessary changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. Fixed!
@@ -70,7 +70,6 @@ RocketChat.settings.addGroup('Accounts', function() { | |||
type: 'boolean', | |||
'public': true | |||
}); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do not introduce unnecessary changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. Fixed!
@@ -619,7 +619,7 @@ var jsc = { | |||
|
|||
switch (controlName) { | |||
case 'pad': | |||
// if the slider is at the bottom, move it up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change these comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I've struggled by my find-replace :-) Fixed!
@@ -872,6 +872,7 @@ | |||
"Nothing_found": "No se encontró nada", | |||
"Notification_Duration": "Duración de la notificación", | |||
"Notifications": "Notificaciones", | |||
"Notifications_Sound_Volume": "Notifications sound volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
.meteor/packages
Outdated
@@ -173,3 +174,4 @@ yasinuslu:blaze-meta | |||
deepwell:bootstrap-datepicker2 | |||
rocketchat:postcss | |||
[email protected] | |||
fourseven:scss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use only cssnext as CSS post-processor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. SCSS removed.
@@ -748,6 +748,7 @@ | |||
"Nothing": "asgjë", | |||
"Nothing_found": "Asgjë për të gjetur", | |||
"Notifications": "Njoftime", | |||
"Notifications_Sound_Volume": "Notifications sound volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
@@ -58,7 +58,10 @@ this.visitor = new class { | |||
|
|||
// notification sound | |||
if (Session.equals('sound', true) && msg.u._id !== Meteor.userId()) { | |||
$('#chatAudioNotification')[0].play(); | |||
const audioVolume = Meteor.user().settings.preferences.notificationsSoundVolume || 100; | |||
const audio = $('#chatAudioNotification')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use document.getElementById
here, it's faster if you won't use jQuery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback. Fixed!
@@ -0,0 +1,112 @@ | |||
$shade-10: #04436a !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use scss, just cssnext and less(we will remove all less styles in the future). You need to add your style on rocketchat-theme package and set your custom colors there on variables.js and colors.less files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback and explanation. I've done as you suggested. Fixed!
* Input Range Slider | ||
*/ | ||
|
||
.range-slider__range { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have classes for these colors, can you add those classes on your template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
@@ -1,5 +1,6 @@ | |||
/*globals defaultUserLanguage, KonchatNotification */ | |||
import toastr from 'toastr'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove that unnecessary change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
@@ -0,0 +1,72 @@ | |||
*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have this selector on base.css
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
content: ''; | ||
} | ||
|
||
::-moz-range-track { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make a selector that work only on the slider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
border: 0; | ||
} | ||
|
||
input::-moz-focus-inner, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make a selector that work only on the slider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
} | ||
|
||
.range-slider__range::-webkit-slider-thumb { | ||
-webkit-appearance: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already use autoprefixer on css build, so you can remove these browser prefixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
height: 20px; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
-webkit-transition: background 0.15s ease-in-out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already use autoprefixer on css build, so you can remove these browser prefixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
|
||
.range-slider__range { | ||
-webkit-appearance: none; | ||
width: calc(100% - (73px)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use calc(100% - 73px)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
} | ||
|
||
.range-slider { | ||
margin: 0 0 0 0%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use margin: 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
border: 0; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
-webkit-transition: background 0.15s ease-in-out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already use autoprefixer on css build, so you can remove these browser prefixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
let audio = $(e.currentTarget).data('play'); | ||
|
||
if (!audio || audio === 'none') { | ||
audio = Meteor.user().settings.preferences.newMessageNotification || 'chime'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meteor.user().settings
or Meteor.user().settings.preferences
can be undefined, can you check before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
return audio && audio.play && audio.play(); | ||
|
||
if (user && user.settings && user.settings.preferences) { | ||
const newMessageNotification = user.settings.preferences.newMessageNotification || 'chime'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no user.settings.preferences
then there will not have notifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
@@ -58,7 +58,10 @@ this.visitor = new class { | |||
|
|||
// notification sound | |||
if (Session.equals('sound', true) && msg.u._id !== Meteor.userId()) { | |||
$('#chatAudioNotification')[0].play(); | |||
const audioVolume = Meteor.user().settings.preferences.notificationsSoundVolume || 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check the properties here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution 👍
@RocketChat/core
Closes #6087