Skip to content

Commit

Permalink
Merge branch 'develop' into fix/receipts-not-created-first-read
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 authored Oct 10, 2023
2 parents fa36418 + 4855fa8 commit 596a560
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-radios-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed DM room with "guest" user kept as "read only" after reactivating user
5 changes: 5 additions & 0 deletions .changeset/heavy-ads-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fix: Change plan name from Enterprise to Premium on marketplace filtering
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const useFilteredApps = ({
explore: fallback,
installed: fallback,
private: fallback,
premium: (apps: App[]) => apps.filter(({ categories }) => categories.includes('Enterprise')),
premium: (apps: App[]) => apps.filter(({ categories }) => categories.includes('Premium')),
requested: (apps: App[]) => apps.filter(({ appRequestStats, installed }) => Boolean(appRequestStats) && !installed),
};

Expand Down
9 changes: 5 additions & 4 deletions apps/meteor/ee/client/hooks/useTagsList.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ILivechatTagRecord } from '@rocket.chat/core-typings';
import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useCallback, useState } from 'react';

Expand All @@ -12,17 +11,19 @@ type TagsListOptions = {
viewAll?: boolean;
};

type TagListItem = { _id: string; label: string; value: string; _updatedAt: Date };

type UseTagsListResult = {
itemsList: RecordList<ILivechatTagRecord>;
itemsList: RecordList<TagListItem>;
initialItemCount: number;
reload: () => void;
loadMoreItems: (start: number, end: number) => void;
};

export const useTagsList = (options: TagsListOptions): UseTagsListResult => {
const { viewAll, department, filter } = options;
const [itemsList, setItemsList] = useState(() => new RecordList<ILivechatTagRecord>());
const reload = useCallback(() => setItemsList(new RecordList<ILivechatTagRecord>()), []);
const [itemsList, setItemsList] = useState(() => new RecordList<TagListItem>());
const reload = useCallback(() => setItemsList(new RecordList<TagListItem>()), []);

const getTags = useEndpoint('GET', '/v1/livechat/tags');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { PaginatedMultiSelectOption } from '@rocket.chat/fuselage';
import { PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage';
import { useDebouncedValue } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
Expand All @@ -7,9 +8,21 @@ import { useRecordList } from '../../../../client/hooks/lists/useRecordList';
import { AsyncStatePhase } from '../../../../client/hooks/useAsyncState';
import { useTagsList } from '../../hooks/useTagsList';

const AutoCompleteTagMultiple = (props) => {
const { value, onlyMyTags = false, onChange = () => {}, department, viewAll = false } = props;
type AutoCompleteTagsMultipleProps = {
value?: PaginatedMultiSelectOption[];
onlyMyTags?: boolean;
onChange?: (value: PaginatedMultiSelectOption[]) => void;
department?: string;
viewAll?: boolean;
};

const AutoCompleteTagsMultiple = ({
value = [],
onlyMyTags = false,
onChange = () => undefined,
department,
viewAll = false,
}: AutoCompleteTagsMultipleProps) => {
const t = useTranslation();
const [tagsFilter, setTagsFilter] = useState('');

Expand Down Expand Up @@ -41,9 +54,11 @@ const AutoCompleteTagMultiple = (props) => {
flexShrink={0}
flexGrow={0}
placeholder={t('Select_an_option')}
endReached={tagsPhase === AsyncStatePhase.LOADING ? () => {} : (start) => loadMoreTags(start, Math.min(50, tagsTotal))}
endReached={
tagsPhase === AsyncStatePhase.LOADING ? () => undefined : (start) => start && loadMoreTags(start, Math.min(50, tagsTotal))
}
/>
);
};

export default memo(AutoCompleteTagMultiple);
export default memo(AutoCompleteTagsMultiple);
2 changes: 1 addition & 1 deletion apps/meteor/ee/client/omnichannel/tags/CurrentChatTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

import AutoCompleteTagsMultiple from './AutoCompleteTagsMultiple';

type CurrentChatTagsProps = { value: Array<string>; handler: () => void; department?: string; viewAll?: boolean };
type CurrentChatTagsProps = { value: Array<{ value: string; label: string }>; handler: () => void; department?: string; viewAll?: boolean };

const CurrentChatTags: FC<CurrentChatTagsProps> = ({ value, handler, department, viewAll }) => (
<AutoCompleteTagsMultiple onChange={handler} value={value} department={department} viewAll={viewAll} />
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/server/models/raw/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,6 @@ export class UsersRaw extends BaseRaw {
{
active: true,
type: { $nin: ['app'] },
roles: { $ne: ['guest'] },
_id: { $in: ids },
},
options,
Expand Down

0 comments on commit 596a560

Please sign in to comment.