Merge remote-tracking branch 'origin/develop' into admin-tests-base

# Conflicts:
#	.travis.yml
#	tests/data/user.js
#	tests/steps/04-main-elements-render.js
#	tests/steps/API.js
pull/5290/head
Rodrigo Nascimento 9 years ago
commit 5291d33a81
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 5
      .travis.yml
  2. 2
      client/helpers/log.js
  3. 3
      client/helpers/not.js
  4. 2
      client/routes/roomRoute.js
  5. 8
      client/startup/startup.js
  6. 129
      docker-compose.yml
  7. 2
      packages/rocketchat-channel-settings/client/views/channelSettings.html
  8. 11
      packages/rocketchat-lib/client/MessageAction.coffee
  9. 13
      packages/rocketchat-lib/lib/roomTypesCommon.coffee
  10. 2
      packages/rocketchat-livechat/client/views/sideNav/livechat.js
  11. 2
      packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.html
  12. 2
      packages/rocketchat-message-pin/client/views/pinnedMessages.html
  13. 2
      packages/rocketchat-message-snippet/client/tabBar/views/snippetedMessages.html
  14. 2
      packages/rocketchat-message-star/client/views/starredMessages.html
  15. 5
      packages/rocketchat-oembed/client/oembedUrlWidget.coffee
  16. 2
      packages/rocketchat-slashcommands-open/client.js
  17. 9
      packages/rocketchat-theme/assets/stylesheets/base.less
  18. 42
      packages/rocketchat-theme/assets/stylesheets/utils/_colors.import.less
  19. 4
      packages/rocketchat-theme/server/variables.coffee
  20. 42
      packages/rocketchat-ui-admin/admin/admin.coffee
  21. 14
      packages/rocketchat-ui-admin/admin/admin.html
  22. 2
      packages/rocketchat-ui-flextab/flex-tab/tabs/messageSearch.html
  23. 2
      packages/rocketchat-ui-flextab/flex-tab/tabs/uploadedFilesList.html
  24. 2
      packages/rocketchat-ui-master/master/loading.html
  25. 33
      packages/rocketchat-ui-master/server/inject.js
  26. 4
      packages/rocketchat-ui/views/app/room.html
  27. 2
      packages/rocketchat-ui/views/app/spotlight/spotlight.coffee
  28. 2
      packages/rocketchat-webrtc/WebRTCClass.coffee
  29. 36
      server/startup/initialData.coffee
  30. 8
      server/startup/migrations/v075.js
  31. 10
      server/startup/migrations/v076.js
  32. 0
      tests/data/channel.js
  33. 0
      tests/data/checks.js
  34. 0
      tests/data/interactions.js
  35. 4
      tests/data/user.js
  36. 10
      tests/pageobjects/flex-tab.page.js
  37. 6
      tests/steps/03-user-creation.js
  38. 4
      tests/steps/04-main-elements-render.js
  39. 8
      tests/steps/05-channel-creation.js
  40. 8
      tests/steps/06-messaging.js
  41. 4
      tests/steps/07-emoji.js
  42. 4
      tests/steps/08-resolutions.js
  43. 8
      tests/steps/09-channel.js
  44. 6
      tests/steps/10-user-preferences.js
  45. 22
      tests/steps/API.js

@ -93,7 +93,4 @@ env:
- secure: iihMgVr2PaP9d0GXuEe3JU/eK5agWWHWDH0WFOTHQ42L1x6wT6oom3zJfwGmFL28BDVp5qQQ3V5isc0p1Vca7PCsRWUht/37EzzLbfrutLDvCpvzGqzqTkvKeW9WINYcIwEQoDE0M2I12WZN9NhGCaT5Z3WanwYX1x6AzjHX4GK/gBzX0WWOqKp7UQijLpuWpdlMUhoWKatGKi9ft+PCBgOonhoqy6Pk9QYNG+jrq86RydOP428DE2Mo5aFxPwhSoMFukOlTIPQylJ3q3q9NDHI9XhV6AJwty/CE9UXr4wAI5RAR/9q0cHkoXj7P/y7cj+SI9pZMt5EaS4DPs4MVb8vvVP+7K0VfbVc5kcoXZoUsORtxiaPk5yPeqaqpB89xp7BjQizr5fOXeTp3Xe8UiZeWvpnbvzWEUAW7XXbMLJjyKT6OLRyVmZ240aMY7zdgC/e3nNePaam1LHYJRejJGM0aFIuwDqryGN9KJMjMFOL6LHm+OBQcjfDokBLc1wjfomNXcIrWWjdNTckpDEIhAFzwgxy9OlJQBJqtpPajPrcU1bxfrnbLks0KeQj9YTSTR0D7FknhVF8OpOnDZDPWdUBJL/dGd4eIf0UIr5xW7ZdFJ0xxhGXpJuH5ITG/C8CMOFsFvUMR1EG+cY4UN8YlVcUyp/S6eJgEzJM9fyWwDgs=
- MONGO_OPLOG_URL: "mongodb://localhost:27017/local"
- MONGO_URL: "mongodb://localhost:27017/meteor"
- ADMIN_USERNAME: "admin.test"
- ADMIN_EMAIL: "admin.test@rocket.chat"
- ADMIN_PASS: "admin.test"
- DISABLE_ANIMATION: "true"
- TEST_MODE: "true"

@ -1,3 +1,3 @@
Template.registerHelper('log', function() {
Template.registerHelper('log', () => {
console.log.apply(console, arguments);
});

@ -0,0 +1,3 @@
Template.registerHelper('not', (value) => {
return !value;
});

@ -1,6 +1,6 @@
FlowRouter.goToRoomById = (roomId) => {
const subscription = ChatSubscription.findOne({rid: roomId});
if (subscription) {
FlowRouter.go(RocketChat.roomTypes.getRouteLink(subscription.t, subscription), null, FlowRouter.current().queryParams);
RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
}
};

@ -1,6 +1,14 @@
/* globals UserPresence, fireGlobalEvent, isRtl */
import moment from 'moment';
import toastr from 'toastr';
if (window.DISABLE_ANIMATION) {
toastr.options.timeOut = 1;
toastr.options.showDuration = 0;
toastr.options.hideDuration = 0;
toastr.options.extendedTimeOut = 0;
}
Meteor.startup(function() {
TimeSync.loggingEnabled = false;

@ -1,64 +1,73 @@
rocketchat:
image: rocketchat/rocket.chat:latest
volumes:
- ./uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=http://localhost:3000
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
- MAIL_URL=smtp://smtp.email
- HTTP_PROXY=http://proxy.domain.com
- HTTPS_PROXY=http://proxy.domain.com
links:
- mongo:mongo
ports:
- 3000:3000
labels:
- "traefik.backend=rocketchat"
- "traefik.frontend.rule=Host: your.domain.tld"
version: '2'
mongo:
image: mongo:3.2
volumes:
- ./data/db:/data/db
# - ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0
labels:
- "traefik.enable=false"
services:
rocketchat:
image: rocketchat/rocket.chat:latest
restart: unless-stopped
volumes:
- ./uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=http://localhost:3000
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
- MAIL_URL=smtp://smtp.email
- HTTP_PROXY=http://proxy.domain.com
- HTTPS_PROXY=http://proxy.domain.com
depends_on:
- mongo
ports:
- 3000:3000
labels:
- "traefik.backend=rocketchat"
- "traefik.frontend.rule=Host: your.domain.tld"
mongo-init-replica:
image: mongo:3.2
command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})"'
links:
- mongo:mongo
mongo:
image: mongo:3.2
restart: unless-stopped
volumes:
- ./data/db:/data/db
#- ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0
labels:
- "traefik.enable=false"
# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
image: rocketchat/hubot-rocketchat:latest
environment:
- ROCKETCHAT_URL=rocketchat:3000
- ROCKETCHAT_ROOM=GENERAL
- ROCKETCHAT_USER=bot
- ROCKETCHAT_PASSWORD=botpassword
- BOT_NAME=bot
# you can add more scripts as you'd like here, they need to be installable by npm
- EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
links:
- rocketchat:rocketchat
labels:
- "traefik.enable=false"
volumes:
- ./scripts:/home/hubot/scripts
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
ports:
- 3001:8080
# this container's job is just run the command to initialize the replica set.
# it will run the command and remove himself (it will not stay running)
mongo-init-replica:
image: mongo:3.2
command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})"'
depends_on:
- mongo
#traefik:
# image: traefik:latest
# command: traefik --docker --acme=true --acme.domains='your.domain.tld' --acme.email='your@email.tld' --acme.entrypoint=https --acme.storagefile=acme.json --defaultentrypoints=http --defaultentrypoints=https --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' --entryPoints='Name:https Address::443 TLS.Certificates:'
# ports:
# - 80:80
# - 443:443
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
image: rocketchat/hubot-rocketchat:latest
restart: unless-stopped
environment:
- ROCKETCHAT_URL=rocketchat:3000
- ROCKETCHAT_ROOM=GENERAL
- ROCKETCHAT_USER=bot
- ROCKETCHAT_PASSWORD=botpassword
- BOT_NAME=bot
# you can add more scripts as you'd like here, they need to be installable by npm
- EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
depends_on:
- rocketchat
labels:
- "traefik.enable=false"
volumes:
- ./scripts:/home/hubot/scripts
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
ports:
- 3001:8080
#traefik:
# image: traefik:latest
# restart: unless-stopped
# command: traefik --docker --acme=true --acme.domains='your.domain.tld' --acme.email='your@email.tld' --acme.entrypoint=https --acme.storagefile=acme.json --defaultentrypoints=http --defaultentrypoints=https --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' --entryPoints='Name:https Address::443 TLS.Certificates:'
# ports:
# - 80:80
# - 443:443
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock

@ -50,7 +50,7 @@
</div>
{{#if $value.canEdit room}}
{{#if $value.processing.get}}
{{> loading dark=true}}
{{> loading}}
{{/if}}
{{/if}}
{{/if}}

@ -183,8 +183,12 @@ Meteor.startup ->
]
action: (event, instance) ->
message = @_arguments[1]
permalink = RocketChat.MessageAction.getPermaLink(message._id)
RocketChat.MessageAction.hideDropDown()
$(event.currentTarget).attr('data-clipboard-text', RocketChat.MessageAction.getPermaLink(message._id));
if Meteor.isCordova
cordova.plugins.clipboard.copy(permalink);
else
$(event.currentTarget).attr('data-clipboard-text', permalink);
toastr.success(TAPi18n.__('Copied'))
validation: (message) ->
if not RocketChat.models.Subscriptions.findOne({ rid: message.rid })?
@ -205,7 +209,10 @@ Meteor.startup ->
action: (event, instance) ->
message = @_arguments[1].msg
RocketChat.MessageAction.hideDropDown()
$(event.currentTarget).attr('data-clipboard-text', message)
if Meteor.isCordova
cordova.plugins.clipboard.copy(message);
else
$(event.currentTarget).attr('data-clipboard-text', message)
toastr.success(TAPi18n.__('Copied'))
validation: (message) ->
if not RocketChat.models.Subscriptions.findOne({ rid: message.rid })?

@ -60,3 +60,16 @@ class @roomTypesCommon
return FlowRouter.path @roomTypes[roomType].route.name, routeData
openRouteLink: (roomType, subData, queryParams) ->
unless @roomTypes[roomType]?
return false
routeData = {}
if @roomTypes[roomType]?.route?.link?
routeData = @roomTypes[roomType].route.link(subData)
else if subData?.name?
routeData = { name: subData.name }
return FlowRouter.go @roomTypes[roomType].route.name, routeData, queryParams

@ -114,7 +114,7 @@ Template.livechat.events({
if (isConfirm) {
Meteor.call('livechat:takeInquiry', this._id, (error, result) => {
if (!error) {
FlowRouter.go(RocketChat.roomTypes.getRouteLink(result.t, result));
RocketChat.roomTypes.openRouteLink(result.t, result);
}
});
}

@ -17,7 +17,7 @@
</ul>
{{#if hasMore}}
<div class="load-more">
{{> loading dark=true}}
{{> loading}}
</div>
{{/if}}
</div>

@ -17,7 +17,7 @@
</ul>
{{#if hasMore}}
<div class="load-more">
{{> loading dark=true}}
{{> loading}}
</div>
{{/if}}
</div>

@ -17,7 +17,7 @@
</ul>
{{#if hasMore}}
<div class="load-more">
{{> loading dark=true}}
{{> loading}}
</div>
{{/if}}
</div>

@ -17,7 +17,7 @@
</ul>
{{#if hasMore}}
<div class="load-more">
{{> loading dark=true}}
{{> loading}}
</div>
{{/if}}
</div>

@ -36,7 +36,10 @@ Template.oembedUrlWidget.helpers
url = decodedOgImage or this.meta.twitterImage
if url?[0] is '/' and this.parsedUrl?.host?
if url.indexOf('//') is 0
url = "#{this.parsedUrl.protocol}#{url}"
else if url.indexOf('/') is 0 and this.parsedUrl?.host?
url = "#{this.parsedUrl.protocol}//#{this.parsedUrl.host}#{url}"
return url

@ -22,7 +22,7 @@ function Open(command, params/*, item*/) {
subscription = ChatSubscription.findOne(query);
if (subscription) {
FlowRouter.go(RocketChat.roomTypes.getRouteLink(subscription.t, subscription), null, FlowRouter.current().queryParams);
RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
}
}

@ -1601,6 +1601,15 @@ label.required::after {
}
}
.submit {
display: flex;
.button {
white-space: nowrap;
margin-left: 1rem;
}
}
.animated-hidden {
visibility: hidden;
display: none;

@ -20,6 +20,17 @@
@code-border-color: #cccccc;
@code-font-color: #333333;
/** ----------------------------------------------------------------------------
* Transparency variables
*/
@transparent-darkest: rgba(0, 0, 0, 0.5);
@transparent-darker: rgba(0, 0, 0, 0.15);
@transparent-dark: rgba(0, 0, 0, 0.05);
@transparent-light: rgba(255, 255, 255, 0.1);
@transparent-lighter: rgba(255, 255, 255, 0.3);
@transparent-lightest: rgba(255, 255, 255, 0.6);
/** ----------------------------------------------------------------------------
* Document components
*/
@ -872,18 +883,38 @@ i.status-offline {
&.primary {
.buttonColors(@primary-action-contrast, @primary-action-color);
&[disabled] {
background-color: lighten(desaturate(@primary-action-color, 50%), 30%);
}
}
&.secondary {
.buttonColors(@secondary-action-contrast, @secondary-action-color);
&[disabled] {
background-color: lighten(desaturate(@secondary-action-color, 50%), 30%);
}
}
&.tertiary {
.buttonColors(@primary-action-contrast, @selection-color);
&[disabled] {
background-color: lighten(desaturate(@selection-color, 50%), 30%);
}
}
&.danger {
.buttonColors(@error-contrast, @error-color);
&[disabled] {
background-color: lighten(desaturate(@error-color, 50%), 30%);
}
}
&[disabled] {
cursor: initial;
}
&.external-login {
@ -974,6 +1005,13 @@ label.required::after {
color: @error-contrast;
}
.loading-animation.dark > div {
background-color: @transparent-darkest;
/** ----------------------------------------------------------------------------
* Loading
*/
.main-content,
.flex-tab {
.loading-animation > div {
background-color: @primary-font-color;
}
}

@ -9,7 +9,7 @@
# New colors, used for shades on solid backgrounds
# Defined range of transparencies reduces random colour variances
alphaColors=
'transparent-darkest': 'rgba(0,0,0,0.5)'
'transparent-darkest': 'rgba(0,0,0,0.5)'
'transparent-darker': 'rgba(0,0,0,0.15)'
'transparent-dark': 'rgba(0,0,0,0.05)'
'transparent-light': 'rgba(255,255,255,0.10)'
@ -48,8 +48,6 @@ minorColors=
# Bulk-add settings for color scheme
for key, value of majorColors
RocketChat.theme.addPublicColor key, value, 'Colors'
for key, value of alphaColors
RocketChat.theme.addPublicColor key, value, 'Colors (alphas)'
for key, value of minorColors
RocketChat.theme.addPublicColor key, value, 'Colors (minor)', 'expression'

@ -2,11 +2,10 @@ import toastr from 'toastr'
TempSettings = new Meteor.Collection null
RocketChat.TempSettings = TempSettings
updateColorComponent = ->
$('input.minicolors').minicolors
updateColorComponent = (input = $('input.minicolors')) ->
input.minicolors
theme: 'rocketchat'
format: 'rgb'
opacity: true
letterCase: 'uppercase'
Template.admin.onCreated ->
if not RocketChat.settings.cachedCollectionPrivate?
@ -273,6 +272,41 @@ Template.admin.events
Meteor.setTimeout updateColorComponent, 100
"click .submit .discard": ->
group = FlowRouter.getParam('group')
query =
group: group
changed: true
settings = TempSettings.find(query, {fields: {_id: 1, value: 1, editor: 1}}).fetch()
settings.forEach (setting) ->
oldSetting = RocketChat.settings.cachedCollectionPrivate.collection.findOne({"_id": setting._id})
input = $('.page-settings').find('[name="' + setting._id + '"]')
switch oldSetting.type
when 'boolean'
input.not(':checked').prop('checked', true).change()
when 'code'
input.next()[0].CodeMirror.setValue(oldSetting.value)
when 'color'
oldEditorColor = oldSetting.editor is 'color'
input.parents('.horizontal').find('select[name="color-editor"]').val(oldSetting.editor).change()
if oldEditorColor && setting.editor is 'color'
input.minicolors('value', oldSetting.value)
else
input.val(oldSetting.value).change()
if oldEditorColor
Meteor.setTimeout ->
updateColorComponent(input)
, 100
else
input.val(oldSetting.value).change()
"click .submit .save": (e, t) ->
group = FlowRouter.getParam('group')

@ -5,6 +5,14 @@
<h2>
<span class="room-title">{{#with group}}{{label}}{{/with}}</span>
</h2>
{{#unless $eq group._id 'Assets'}}
<div class="submit">
{{#if hasChanges}}
<button class="button danger discard"><i class="icon-send"></i><span>{{_ "Cancel"}}</span></button>
{{/if}}
<button class="button primary save" disabled="{{not hasChanges}}"><i class="icon-send"></i><span>{{_ "Save_changes"}}</span></button>
</div>
{{/unless}}
</header>
<div class="content">
@ -196,12 +204,6 @@
</div>
{{/if}}
{{/if}}
{{#if hasChanges section}}
<div class="submit">
<button class="button primary save"><i class="icon-send"></i><span>{{_ "Save_changes"}}</span></button>
</div>
{{/if}}
</div>
</div>
{{/each}}

@ -28,7 +28,7 @@
</ul>
{{#if hasMore}}
<div class="load-more">
{{> loading dark=true}}
{{> loading}}
</div>
{{/if}}
{{/if}}

@ -22,7 +22,7 @@
</ul>
{{#if hasMore}}
<div class="load-more">
{{> loading dark=true}}
{{> loading}}
</div>
{{/if}}
{{#if Template.subscriptionsReady}}

@ -1,5 +1,5 @@
<template name="loading">
<div class="loading-animation {{#if dark}}dark{{/if}}">
<div class="loading-animation">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>

@ -1,6 +1,6 @@
/* globals Inject */
Inject.rawBody('page-loading', `
Inject.rawHead('page-loading', `
<style>
.loading-animation {
top: 0;
@ -19,7 +19,7 @@ Inject.rawBody('page-loading', `
margin: 2px;
border-radius: 100%;
display: inline-block;
background-color: rgba(255,255,255,0.8);
background-color: rgba(255,255,255,0.6);
-webkit-animation: loading-bouncedelay 1.4s infinite ease-in-out both;
animation: loading-bouncedelay 1.4s infinite ease-in-out both;
}
@ -52,7 +52,7 @@ Inject.rawBody('page-loading', `
</div>
</div>`);
if (process.env.DISABLE_ANIMATION) {
if (process.env.DISABLE_ANIMATION || process.env.TEST_MODE === 'true') {
Inject.rawHead('disable-animation', `
<style>
body, body * {
@ -60,18 +60,21 @@ if (process.env.DISABLE_ANIMATION) {
transition: none !important;
}
</style>
<script>
window.DISABLE_ANIMATION = true;
</script>
`);
}
RocketChat.settings.get('theme-color-primary-background-color', function(key, value = '#04436a') {
RocketChat.settings.get('theme-color-primary-background-color', (key, value = '#04436a') => {
Inject.rawHead(key, `<style>body { background-color: ${value};}</style>` +
`<meta name="msapplication-TileColor" content="${value}" />` +
`<meta name="theme-color" content="${value}" />`);
});
RocketChat.settings.get('Accounts_ForgetUserSessionOnWindowClose', function(key, value) {
RocketChat.settings.get('Accounts_ForgetUserSessionOnWindowClose', (key, value) => {
if (value) {
Inject.rawModHtml(key, function(html) {
Inject.rawModHtml(key, (html) => {
const script = `
<script>
if (Meteor._localStorage._data === undefined && window.sessionStorage) {
@ -82,46 +85,46 @@ RocketChat.settings.get('Accounts_ForgetUserSessionOnWindowClose', function(key,
return html.replace(/<\/body>/, script + '\n</body>');
});
} else {
Inject.rawModHtml(key, function(html) {
Inject.rawModHtml(key, (html) => {
return html;
});
}
});
RocketChat.settings.get('Site_Name', function(key, value = 'Rocket.Chat') {
RocketChat.settings.get('Site_Name', (key, value = 'Rocket.Chat') => {
Inject.rawHead(key,
`<title>${value}</title>` +
`<meta name="application-name" content="${value}">` +
`<meta name="apple-mobile-web-app-title" content="${value}">`);
});
RocketChat.settings.get('Meta_language', function(key, value = '') {
RocketChat.settings.get('Meta_language', (key, value = '') => {
Inject.rawHead(key,
`<meta http-equiv="content-language" content="${value}">` +
`<meta name="language" content="${value}">`);
});
RocketChat.settings.get('Meta_robots', function(key, value = '') {
RocketChat.settings.get('Meta_robots', (key, value = '') => {
Inject.rawHead(key, `<meta name="robots" content="${value}">`);
});
RocketChat.settings.get('Meta_msvalidate01', function(key, value = '') {
RocketChat.settings.get('Meta_msvalidate01', (key, value = '') => {
Inject.rawHead(key, `<meta name="msvalidate.01" content="${value}">`);
});
RocketChat.settings.get('Meta_google-site-verification', function(key, value = '') {
RocketChat.settings.get('Meta_google-site-verification', (key, value = '') => {
Inject.rawHead(key, `<meta name="google-site-verification" content="${value}" />`);
});
RocketChat.settings.get('Meta_fb_app_id', function(key, value = '') {
RocketChat.settings.get('Meta_fb_app_id', (key, value = '') => {
Inject.rawHead(key, `<meta property="fb:app_id" content="${value}">`);
});
RocketChat.settings.get('Meta_custom', function(key, value = '') {
RocketChat.settings.get('Meta_custom', (key, value = '') => {
Inject.rawHead(key, value);
});
Meteor.defer(function() {
Meteor.defer(() => {
let baseUrl;
if (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX && __meteor_runtime_config__.ROOT_URL_PATH_PREFIX.trim() !== '') {
baseUrl = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;

@ -83,7 +83,7 @@
{{#if canPreview}}
{{#if hasMore}}
<li class="load-more">
{{> loading dark=true}}
{{> loading}}
</li>
{{else}}
<li class="start">
@ -96,7 +96,7 @@
{{/each}}
{{#if hasMoreNext}}
<li class="load-more">
{{> loading dark=true}}
{{> loading}}
</li>
{{/if}}
</ul>

@ -57,7 +57,7 @@ Template.spotlight.helpers
getValue: (_id, collection, records, firstPartValue) ->
doc = _.findWhere(records, {_id: _id})
FlowRouter.go(RocketChat.roomTypes.getRouteLink(doc.t, doc), null, FlowRouter.current().queryParams)
RocketChat.roomTypes.openRouteLink(doc.t, doc, FlowRouter.current().queryParams)
spotlight.hide()

@ -160,7 +160,7 @@ class WebRTCClass
@screenShareAvailable = @navigator in ['chrome', 'firefox']
@media =
video: true
video: false
audio: true
@transport = new @transportClass @

@ -89,3 +89,39 @@ Meteor.startup ->
if oldestUser
RocketChat.authz.addUserRoles( oldestUser._id, 'admin')
console.log "No admins are found. Set #{oldestUser.username} as admin for being the oldest user"
RocketChat.models.Users.removeById 'rocketchat.internal.admin.test'
if process.env.TEST_MODE is 'true'
console.log 'Inserting admin test user:'.green
adminUser =
_id: 'rocketchat.internal.admin.test'
name: 'RocketChat Internal Admin Test'
username: 'rocketchat.internal.admin.test'
emails: [
address: 'rocketchat.internal.admin.test@rocket.chat'
verified: true
]
status: 'offline'
statusDefault: 'online'
utcOffset: 0
active: true
type: 'user'
console.log "Name: #{adminUser.name}".green
console.log "Email: #{adminUser.emails[0].address}".green
console.log "Username: #{adminUser.username}".green
console.log "Password: #{adminUser._id}".green
if RocketChat.models.Users.findOneByEmailAddress(adminUser.emails[0].address)
throw new Meteor.Error "Email #{adminUser.emails[0].address} already exists", 'Rocket.Chat can\'t run in test mode'
if not RocketChat.checkUsernameAvailability(adminUser.username)
throw new Meteor.Error "Username #{adminUser.username} already exists", 'Rocket.Chat can\'t run in test mode'
RocketChat.models.Users.create adminUser
Accounts.setPassword adminUser._id, adminUser._id
RocketChat.authz.addUserRoles(adminUser._id, 'admin')

@ -1,6 +1,14 @@
RocketChat.Migrations.add({
version: 71.1,
up: function() {
ServiceConfiguration.configurations.remove({});
}
});
RocketChat.Migrations.add({
version: 75,
up: function() {
ServiceConfiguration.configurations.remove({});
}
});

@ -0,0 +1,10 @@
RocketChat.Migrations.add({
version: 76,
up: function() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
RocketChat.models.Settings.find({section: 'Colors (alphas)'}).forEach((setting) => {
RocketChat.models.Settings.remove({ _id: setting._id });
});
}
}
});

@ -2,6 +2,6 @@ export const username = 'user.test.'+Date.now();
export const email = username+'@rocket.chat';
export const password = 'rocket.chat';
export const adminUsername = 'admin.test';
export const adminUsername = 'rocketchat.internal.admin.test';
export const adminEmail = adminUsername+'@rocket.chat';
export const adminPassword = 'admin.test';
export const adminPassword = adminUsername;

@ -67,6 +67,8 @@ class FlexTab extends Page {
get sweetAlertOverlay() { return browser.element('.sweet-overlay'); }
get toastAlert() { return browser.element('.toast'); }
getUserEl(username) { return browser.element(`.flex-tab button[title="${username}"] > p`); }
confirmPopup() {
this.confirmBtn.waitForVisible(5000);
this.confirmBtn.click();
@ -93,14 +95,14 @@ class FlexTab extends Page {
}
removePeopleFromChannel(user) {
const userEl = browser.element('.flex-tab button[title="'+user+'"]');
const userEl = this.getUserEl(user);
userEl.waitForVisible();
userEl.click();
this.removeUserBtn.click();
}
setUserOwner(user) {
const userEl = browser.element('.flex-tab button[title="'+user+'"]');
const userEl = this.getUserEl(user);
userEl.waitForVisible();
userEl.click();
this.setOwnerBtn.waitForVisible(5000);
@ -109,7 +111,7 @@ class FlexTab extends Page {
}
setUserModerator(user) {
const userEl = browser.element('.flex-tab button[title="'+user+'"]');
const userEl = this.getUserEl(user);
if (!userEl.isVisible() && this.showAll.isVisible()) {
this.setModeratorBtn.click();
this.viewAllBtn.click();
@ -123,7 +125,7 @@ class FlexTab extends Page {
}
muteUser(user) {
const userEl = browser.element('.flex-tab button[title="'+user+'"]');
const userEl = this.getUserEl(user);
if (this.showAll.isVisible()) {
this.muteUserBtn.waitForVisible(5000);
this.muteUserBtn.click();

@ -6,7 +6,7 @@ import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
//test data imports
import {username, email, password, adminUsername, adminEmail, adminPassword} from '../test-data/user.js';
import {username, email, password, adminUsername, adminEmail, adminPassword} from '../data/user.js';
@ -24,7 +24,7 @@ describe('User Creation', function() {
if (process.env.ADMIN_USERNAME && process.env.ADMIN_PASS) {
console.log('Admin login and password provided, skipping admin creation.');
} else {
it('create the admin user', () => {
it.skip('create the admin user', () => {
loginPage.gotToRegister();
loginPage.registerNewAdmin({adminUsername, adminEmail, adminPassword});
@ -36,7 +36,7 @@ describe('User Creation', function() {
mainContent.mainContent.waitForExist(5000);
});
it('logout', () => {
it.skip('logout', () => {
sideNav.accountBoxUserName.waitForVisible(5000);
sideNav.accountBoxUserName.click();

@ -6,8 +6,8 @@ import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
//test data imports
import {checkIfUserIsValid} from '../test-data/checks';
import {username, email, password} from '../test-data/user.js';
import {checkIfUserIsValid} from '../data/checks';
import {username, email, password} from '../data/user.js';
describe('Main Elements Render', function() {
before(()=>{

@ -2,12 +2,12 @@
/* eslint-disable func-names, prefer-arrow-callback */
import sideNav from '../pageobjects/side-nav.page';
import {publicChannelName, privateChannelName} from '../test-data/channel.js';
import {targetUser} from '../test-data/interactions.js';
import {publicChannelName, privateChannelName} from '../data/channel.js';
import {targetUser} from '../data/interactions.js';
//test data imports
import {checkIfUserIsValid, setPublicChannelCreated, setPrivateChannelCreated, setDirectMessageCreated} from '../test-data/checks';
import {username, email, password} from '../test-data/user.js';
import {checkIfUserIsValid, setPublicChannelCreated, setPrivateChannelCreated, setDirectMessageCreated} from '../data/checks';
import {username, email, password} from '../data/user.js';
//Basic usage test start
describe('Channel creation', function() {
before(()=>{

@ -5,10 +5,10 @@ import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
//test data imports
import {username, email, password} from '../test-data/user.js';
import {publicChannelName, privateChannelName} from '../test-data/channel.js';
import {targetUser, imgURL} from '../test-data/interactions.js';
import {checkIfUserIsValid, publicChannelCreated, privateChannelCreated, directMessageCreated, setPublicChannelCreated, setPrivateChannelCreated, setDirectMessageCreated} from '../test-data/checks';
import {username, email, password} from '../data/user.js';
import {publicChannelName, privateChannelName} from '../data/channel.js';
import {targetUser, imgURL} from '../data/interactions.js';
import {checkIfUserIsValid, publicChannelCreated, privateChannelCreated, directMessageCreated, setPublicChannelCreated, setPrivateChannelCreated, setDirectMessageCreated} from '../data/checks';
//Test data

@ -4,8 +4,8 @@
import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
import {username, email, password} from '../test-data/user.js';
import {checkIfUserIsValid} from '../test-data/checks';
import {username, email, password} from '../data/user.js';
import {checkIfUserIsValid} from '../data/checks';
describe('emoji', ()=> {
before(()=>{

@ -4,8 +4,8 @@
import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
import {username, email, password} from '../test-data/user.js';
import {checkIfUserIsValid} from '../test-data/checks';
import {username, email, password} from '../data/user.js';
import {checkIfUserIsValid} from '../data/checks';
describe.skip('resolutions tests', ()=> {
describe('mobile render', ()=> {

@ -5,10 +5,10 @@ import flexTab from '../pageobjects/flex-tab.page';
import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
import {username, email, password} from '../test-data/user.js';
import {checkIfUserIsValid, publicChannelCreated, setPublicChannelCreated} from '../test-data/checks';
import {publicChannelName} from '../test-data/channel.js';
import {targetUser} from '../test-data/interactions.js';
import {username, email, password} from '../data/user.js';
import {checkIfUserIsValid, publicChannelCreated, setPublicChannelCreated} from '../data/checks';
import {publicChannelName} from '../data/channel.js';
import {targetUser} from '../data/interactions.js';
describe('channel usage', ()=> {
before(() => {

@ -6,10 +6,10 @@ import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
import preferencesMainContent from '../pageobjects/preferences-main-content.page';
import {username, password, email} from '../test-data/user.js';
import {imgURL} from '../test-data/interactions.js';
import {username, password, email} from '../data/user.js';
import {imgURL} from '../data/interactions.js';
import {checkIfUserIsValid} from '../test-data/checks';
import {checkIfUserIsValid} from '../data/checks';
describe.skip('user preferences', ()=> {

@ -3,11 +3,11 @@
/* eslint no-unused-vars: 0 */
import supertest from 'supertest';
import {adminUsername, adminEmail, adminPassword} from '../test-data/user.js';
const request = supertest('http://localhost:3000');
const prefix = '/api/v1/';
import {adminUsername, adminEmail, adminPassword} from '../data/user.js';
function api(path) {
return prefix + path;
}
@ -25,20 +25,10 @@ const credentials = {
['X-User-Id']: undefined
};
var login = {
user: process.env.ADMIN_USERNAME,
password: process.env.ADMIN_PASS
const login = {
user: adminUsername,
password: adminPassword
};
var email = process.env.ADMIN_EMAIL;
if (!(process.env.ADMIN_USERNAME && process.env.ADMIN_PASS)) {
login = {
user: adminUsername,
password: adminPassword
};
email = adminEmail;
}
describe('API default', () => {
// Required by mobile apps
@ -90,7 +80,7 @@ describe('API v1', () => {
expect(res.body).to.have.property('username', login.user);
expect(res.body).to.have.property('active');
expect(res.body).to.have.property('name');
expect(res.body).to.have.deep.property('emails[0].address', email);
expect(res.body).to.have.deep.property('emails[0].address', adminEmail);
})
.end(done);
});

Loading…
Cancel
Save