Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into mess…
Browse files Browse the repository at this point in the history
…age-template-2

* 'develop' of github.com:RocketChat/Rocket.Chat:
  [FIX] FormData uploads not working (#25069)
  [FIX] Video and Audio not skipping forward (#19866)
  [FIX] NPS never finishing sending results (#25067)
  [IMPROVE] Add tooltip to sidebar room menu (#24405)
  [IMPROVE] Added tooltip options for message menu (#24431)
  [FIX] Replace encrypted text to Encrypted Message Placeholder (#24166)
  [FIX] Prevent sequential messages edited icon to hide on hover #24984
  [IMPROVE] Improve active/hover colors in account sidebar (#25024)
  [FIX] Full error message is visible (#24856)
  Chore: Cancel running jobs if PR is updated (#24708)
  • Loading branch information
gabriellsh committed Apr 7, 2022
2 parents bee878a + 8f9b2d1 commit afff7f8
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CI: true
MONGO_URL: mongodb://localhost:27017
Expand Down
4 changes: 0 additions & 4 deletions app/theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -2013,10 +2013,6 @@

width: 60px;
}

&:hover .edited {
display: none;
}
}

& .body {
Expand Down
8 changes: 6 additions & 2 deletions app/ui-message/client/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@
{{> Blocks blocks=msg.blocks rid=msg.rid mid=msg._id}}
</div>
{{else}}
{{{body}}}
{{# if isDecrypting}}
{{_ "E2E_message_encrypted_placeholder"}}
{{else}}
{{{body}}}
{{/if}}
{{/if}}
{{#if msg.location}}
{{> messageLocation location=msg.location}}
Expand Down Expand Up @@ -144,7 +148,7 @@
</button>
{{/each}}
</div>
<div class="message-actions__menu" aria-haspopup="true">
<div class="message-actions__menu" aria-haspopup="true" title="{{_ "More_options"}}">
{{> icon block="message-actions__menu-icon" icon="menu"}}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const AudioAttachment: FC<AudioAttachmentProps> = ({
</Attachment.Row>
{!collapsed && (
<Attachment.Content border='none'>
<audio controls>
<audio controls preload='metadata'>
<source src={getURL(url)} type={type} />
</audio>
</Attachment.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const VideoAttachment: FC<VideoAttachmentProps> = ({
title_link_download: hasDownload,
}) => {
const [collapsed, collapse] = useCollapse(collapsedDefault);
// useTranslation();
const getURL = useMediaUrl();

return (
<Attachment>
<Attachment.Row>
Expand All @@ -30,7 +30,7 @@ export const VideoAttachment: FC<VideoAttachmentProps> = ({
</Attachment.Row>
{!collapsed && (
<Attachment.Content width='full'>
<Box is='video' width='full' controls>
<Box is='video' width='full' controls preload='metadata'>
<source src={getURL(url)} type={type} />
</Box>
{description && (
Expand Down
2 changes: 1 addition & 1 deletion client/components/Sidebar/GenericItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const GenericItem = ({ href, active, children, customColors, textColor = 'defaul
${customColors ? `background-color: ${customColors.default} !important;` : ''}
&:hover,
&:focus,
&.active:focus,
&.active:hover {
background-color: ${customColors?.hover || 'var(--sidebar-background-light-hover)'} !important;
}
Expand Down
6 changes: 3 additions & 3 deletions client/hooks/useEndpointUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export const useEndpointUpload = (
endpoint: string,
params = {},
successMessage: string,
): ((...args: any[]) => Promise<{ success: boolean }>) => {
): ((formData: FormData) => Promise<{ success: boolean }>) => {
const sendData = useUpload(endpoint);
const dispatchToastMessage = useToastMessageDispatch();

return useCallback(
async (...args) => {
async (formData: FormData) => {
try {
const data = sendData(params, [...args]);
const data = sendData(params, formData);

const promise = data instanceof Promise ? data : data.promise;

Expand Down
1 change: 0 additions & 1 deletion client/hooks/useMethodData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const useMethodData = <MethodName extends keyof ServerMethods, Result = A
}, [reset, getData, args, resolve, dispatchToastMessage, reject]);

useEffect(() => {
console.log('as');
fetchData();
}, [fetchData]);

Expand Down
1 change: 1 addition & 0 deletions client/sidebar/RoomMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const RoomMenu = ({ rid, unread, threadUnread, alert, roomOpen, type, cl, name =
return (
<Menu
rcx-sidebar-item__menu
title={t('Options')}
mini
aria-keyshortcuts='alt'
tabIndex={-1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const MailExportForm: FC<MailExportFormProps> = ({ onCancel, rid }) => {
</Field.Row>
</Field>

{errorMessage && <Callout type={'danger'} title={errorMessage} />}
{errorMessage && <Callout type={'danger'}>{errorMessage}</Callout>}

<ButtonGroup stretch mb='x12'>
<Button onClick={onCancel}>{t('Cancel')}</Button>
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3091,6 +3091,7 @@
"More_direct_messages": "More direct messages",
"More_groups": "More private groups",
"More_unreads": "More unreads",
"More_options": "More options",
"Most_popular_channels_top_5": "Most popular channels (Top 5)",
"Most_recent_updated": "Most recent updated",
"Move_beginning_message": "`%s` - Move to the beginning of the message",
Expand Down
2 changes: 1 addition & 1 deletion server/services/nps/sendNpsResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SystemLogger } from '../../lib/logger/system';

type NPSResultPayload = {
total: number;
votes: INpsVote[];
votes: Pick<INpsVote, 'identifier' | 'roles' | 'score' | 'comment'>[];
};

export const sendNpsResults = Meteor.bindEnvironment(function sendNpsResults(npsId: string, data: NPSResultPayload) {
Expand Down
14 changes: 10 additions & 4 deletions server/services/nps/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export class NPSService extends ServiceClassInternal implements INPSService {
},
{
projection: {
_id: 0,
identifier: 1,
roles: 1,
score: 1,
Expand All @@ -121,17 +120,24 @@ export class NPSService extends ServiceClassInternal implements INPSService {
}),
);

const votes = sending.filter(Boolean) as INpsVote[];
const votes = sending.filter(Boolean) as Pick<INpsVote, '_id' | 'identifier' | 'roles' | 'score' | 'comment'>[];
if (votes.length > 0) {
const voteIds = votes.map(({ _id }) => _id);

const votesWithoutIds = votes.map(({ identifier, roles, score, comment }) => ({
identifier,
roles,
score,
comment,
}));

const payload = {
total,
votes,
votes: votesWithoutIds,
};
sendNpsResults(nps._id, payload);

this.NpsVote.updateVotesToSent(voteIds);
await this.NpsVote.updateVotesToSent(voteIds);
}

const totalSent = await this.NpsVote.findByNpsIdAndStatus(nps._id, INpsVoteStatus.SENT).count();
Expand Down

0 comments on commit afff7f8

Please sign in to comment.