Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into develop
Browse files Browse the repository at this point in the history
* 'develop' of github.com:RocketChat/Rocket.Chat: (25 commits)
  [FIX] Not redirecting to `First Channel After Login` on register (#17664)
  Regression: Pressing enter on search reloads the page - admin pages (#17663)
  [NEW] Admin refactor  Second phase (#17551)
  [IMPROVE] Unused styles (#17554)
  [FIX] Directory search user placeholder (#17652)
  [NEW] Added "Add custom emoji" link to emoji picker (#16250)
  [FIX] Marketplace tiered pricing plan wording (#17644)
  [FIX] Secret Registration not properly validating Invite Token (#17618)
  Improve: New PR Template (#16968)
  Add engine versions for houston with templates (#17403)
  Use Users.findOneByAppId instead of querying directly (#16480)
  Remove unnecessary setting redefinition (#17587)
  Deprecate compatibility cordova setting (#17586)
  Hyper.sh went out of business in early 2019 (#17622)
  [NEW] Add Permissions to deal with Omnichannel visitor past chats history (#17580)
  [NEW] Add permissions to deal with Omnichannel custom fields (#17567)
  [FIX] Livechat iframe allow microphone and camera (#9956)
  [FIX] Do not allow passwords on private channels (#15642)
  [FIX] Mail Messages > Cannot mail own user. (#17625)
  [FIX] remove multiple options from dontAskMeAgain (#17514)
  ...
  • Loading branch information
ggazzo committed May 16, 2020
2 parents fad71e6 + ef0e827 commit 1d2a6c4
Show file tree
Hide file tree
Showing 208 changed files with 4,801 additions and 6,023 deletions.
45 changes: 40 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -1,11 +1,46 @@
<!-- INSTRUCTION: Your Pull Request name should start with one of the following tags -->
<!-- This is a pull request template, you do not need to uncomment or remove the comments, they won't show up in the PR text. -->
<!-- Your Pull Request name should start with one of the following tags -->
<!-- [NEW] For new features -->
<!-- [FIX] For bug fixes -->
<!-- [BREAK] For pull requests including breaking changes -->

<!-- INSTRUCTION: Inform the issue number that this PR closes, or remove the line below -->
Closes #ISSUE_NUMBER
## Proposed changes
<!-- Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue below. -->

<!-- INSTRUCTION: Link to a https://github.com/RocketChat/docs PR with added/updated documentation or an update to the missing/outdated documentation list, see https://rocket.chat/docs/contributing/documentation/ -->
## Issue(s)
<!-- Link the issues being closed by or related to this PR. For example, you can use #594 if this PR closes issue number 594 -->

## How to test or reproduce
<!-- Mention how you would reproduce the bug if not mentioned on the issue page already. Also mention which screens are going to have the changes if applicable -->

## Screenshots

## Types of changes
<!-- What types of changes does your code introduce to Rocket.Chat? -->
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] Improvement (non-breaking change which improves a current function)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Hotfix (a major bugfix that has to be merged asap)
- [ ] Documentation Update (if none of the other choices apply)

## Checklist
<!-- Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code. -->

- [ ] I have read the [CONTRIBUTING](https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat) doc
- [ ] I have signed the [CLA](https://cla-assistant.io/RocketChat/Rocket.Chat)
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
- [ ] I have added necessary documentation (if applicable)
- [ ] Any dependent changes have been merged and published in downstream modules

## Changelog
<!-- CHANGELOG -->
<!-- Enter HERE a brief text that would go up on the changelog on our releases page -->
<!-- END CHANGELOG -->

## Further comments
<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->

<!-- INSTRUCTION: Tell us more about your PR with screen shots if you can -->
File renamed without changes.
2 changes: 2 additions & 0 deletions .houston/templates/prs.hbs
@@ -0,0 +1,2 @@
{{> versions}}
{{> _prs}}
13 changes: 13 additions & 0 deletions .houston/templates/versions.hbs
@@ -0,0 +1,13 @@
{{#if (or release.node_version release.npm_version release.mongo_versions)}}

### Engine versions
{{#if release.node_version}}
- Node: `{{ release.node_version }}`
{{/if}}
{{#if release.npm_version}}
- NPM: `{{ release.npm_version }}`
{{/if}}
{{#if release.mongo_versions}}
- MongoDB: `{{ join release.mongo_versions ', ' }}`
{{/if}}
{{/if}}
3 changes: 1 addition & 2 deletions .postcssrc
Expand Up @@ -10,7 +10,6 @@
"autoprefixer": {}
},
"excludedPackages": [
"deepwell:bootstrap-datepicker2",
"smoral:sweetalert"
"deepwell:bootstrap-datepicker2"
]
}
2 changes: 1 addition & 1 deletion .storybook/mocks/decorators.js
Expand Up @@ -24,7 +24,7 @@ export const rocketChatDecorator = (fn) => {
}
`}</style>
<div dangerouslySetInnerHTML={{ __html: icons }} />
<div className='global-font-family color-primary-font-color'>
<div className='color-primary-font-color'>
{fn()}
</div>
</MeteorProviderMock>;
Expand Down
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -35,7 +35,6 @@
* [Raspberry Pi 2](#raspberry-pi-2)
* [Koozali SME](#koozali-sme)
* [Ubuntu VPS](#ubuntu-vps)
* [Hyper.sh](#hypersh)
* [WeDeploy](#wedeploy)
* [D2C.io](#d2cio)
* [Syncloud.org](#syncloudorg)
Expand Down Expand Up @@ -196,9 +195,6 @@ Add Rocket.Chat to this world famous time tested small enterprise server today.
## Ubuntu VPS
Follow these [deployment instructions](https://rocket.chat/docs/installation/manual-installation/ubuntu/).

## Hyper.sh
Follow their [deployment instructions](https://rocket.chat/docs/installation/paas-deployments/hyper-sh/) to install a per-second billed Rocket.Chat instance on [Hyper.sh](https://rocket.chat/docs/installation/paas-deployments/hyper-sh/).

## WeDeploy
Install Rocket.Chat on [WeDeploy](https://wedeploy.com):

Expand Down
10 changes: 5 additions & 5 deletions app/apps/client/admin/appManage.html
Expand Up @@ -359,8 +359,8 @@ <h2> {{_ "Settings"}} </h2>
</div>
{{> CodeMirror name=id options=getEditorOptions code=value }}
<div class="buttons">
<button class="button primary button-fullscreen">{{_ "Full_Screen"}}</button>
<button class="button primary button-restore">{{_ "Exit_Full_Screen"}}</button>
<button class="rc-button rc-button--primary button-fullscreen">{{_ "Full_Screen"}}</button>
<button class="rc-button rc-button--primary button-restore">{{_ "Exit_Full_Screen"}}</button>
</div>
</div>
{{/if}}
Expand Down Expand Up @@ -463,7 +463,7 @@ <h2> {{_ "Settings"}} </h2>
{{#if hasChanges section}}
<span style="line-height: 40px" class="secondary-font-color">{{_ "Save_to_enable_this_action"}}</span>
{{else}}
<button type="button" class="button primary action" data-setting="{{id}}" data-action="{{value}}">{{_ actionText}}</button>
<button type="button" class="rc-button rc-button--primary action" data-setting="{{id}}" data-action="{{value}}">{{_ actionText}}</button>
{{/if}}
{{/if}}

Expand All @@ -472,14 +472,14 @@ <h2> {{_ "Settings"}} </h2>
<div class="settings-file-preview">
<div class="preview" style="background-image:url({{value.url}}?_dc={{random}});"></div>
<div class="action">
<button type="button" class="button danger delete-asset"><i class="icon-trash secondary-font-color"></i>{{_ 'Delete'}}</button>
<button type="button" class="rc-button rc-button--danger delete-asset"><i class="icon-trash secondary-font-color"></i>{{_ 'Delete'}}</button>
</div>
</div>
{{else}}
<div class="settings-file-preview">
<div class="preview no-file background-transparent-light secondary-font-color"><i class="icon-upload secondary-font-color"></i></div>
<div class="action">
<div class="button primary">{{_ 'Select_file'}}
<div class="rc-button rc-button--primary">{{_ 'Select_file'}}
<input type="file" accept="{{assetAccept fileConstraints}}" />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/apps/client/admin/apps.js
Expand Up @@ -226,7 +226,7 @@ Template.apps.events({
} = instance.state.get('apps').find(({ id }) => id === currentTarget.dataset.id);
FlowRouter.go('app-manage', { appId }, { version });
},
async 'click .js-install, click .js-update'(event, instance) {
async 'click .js-update'(event, instance) {
event.preventDefault();
event.stopPropagation();

Expand All @@ -240,7 +240,7 @@ Template.apps.events({
instance.startAppWorking(app.id);

try {
const { status } = await Apps.installApp(app.id, app.marketplaceVersion);
const { status } = await Apps.updateApp(app.id, app.marketplaceVersion);
warnStatusChange(app.name, status);
} catch (error) {
handleAPIError(error);
Expand Down
3 changes: 2 additions & 1 deletion app/apps/client/admin/helpers.js
Expand Up @@ -363,11 +363,12 @@ export const appStatusSpanProps = ({

export const formatPrice = (price) => `\$${ Number.parseFloat(price).toFixed(2) }`;

export const formatPricingPlan = ({ strategy, price, tiers }) => {
export const formatPricingPlan = ({ strategy, price, tiers = [] }) => {
const { perUnit = false } = (Array.isArray(tiers) && tiers.find((tier) => tier.price === price)) || {};

const pricingPlanTranslationString = [
'Apps_Marketplace_pricingPlan',
Array.isArray(tiers) && tiers.length > 0 && 'startingAt',
strategy,
perUnit && 'perUser',
].filter(Boolean).join('_');
Expand Down
28 changes: 27 additions & 1 deletion app/apps/client/admin/marketplace.js
Expand Up @@ -273,7 +273,7 @@ Template.marketplace.events({
} = instance.state.get('apps').find(({ id }) => id === currentTarget.dataset.id);
FlowRouter.go('marketplace-app', { appId }, { version: version || marketplaceVersion });
},
async 'click .js-install, click .js-update'(event, instance) {
async 'click .js-install'(event, instance) {
event.preventDefault();
event.stopPropagation();

Expand All @@ -284,6 +284,7 @@ Template.marketplace.events({
}

const { currentTarget: button } = event;

const app = instance.state.get('apps').find(({ id }) => id === button.dataset.id);

instance.startAppWorking(app.id);
Expand All @@ -297,6 +298,31 @@ Template.marketplace.events({
instance.stopAppWorking(app.id);
}
},
async 'click .js-update'(event, instance) {
event.preventDefault();
event.stopPropagation();

const isLoggedInCloud = await checkCloudLogin();
instance.state.set('isLoggedInCloud', isLoggedInCloud);
if (!isLoggedInCloud) {
return;
}

const { currentTarget: button } = event;

const app = instance.state.get('apps').find(({ id }) => id === button.dataset.id);

instance.startAppWorking(app.id);

try {
const { status } = await Apps.updateApp(app.id, app.marketplaceVersion);
warnStatusChange(app.name, status);
} catch (error) {
handleAPIError(error);
} finally {
instance.stopAppWorking(app.id);
}
},
async 'click .js-purchase'(event, instance) {
event.preventDefault();
event.stopPropagation();
Expand Down
5 changes: 2 additions & 3 deletions app/apps/server/bridges/users.js
@@ -1,10 +1,9 @@
import { Random } from 'meteor/random';

import { setUserAvatar, checkUsernameAvailability, deleteUser, _setStatusTextPromise } from '../../../lib/server/functions';
import { Users } from '../../../models';
import { Users } from '../../../models/server';
import { Users as UsersRaw } from '../../../models/server/raw';


export class AppUserBridge {
constructor(orch) {
this.orch = orch;
Expand All @@ -25,7 +24,7 @@ export class AppUserBridge {
async getAppUser(appId) {
this.orch.debugLog(`The App ${ appId } is getting its assigned user`);

const user = Users.findOne({ appId });
const user = Users.findOneByAppId(appId);

return this.orch.getConverters().get('users').convertToApp(user);
}
Expand Down

0 comments on commit 1d2a6c4

Please sign in to comment.