-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-6.13.0' into fix/gdpr-connection-data-misbehaving
- Loading branch information
Showing
90 changed files
with
763 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@rocket.chat/meteor": minor | ||
"@rocket.chat/i18n": minor | ||
"@rocket.chat/ui-client": minor | ||
--- | ||
|
||
Added new Admin Feature Preview management view, this will allow the workspace admins to both enable feature previewing in the workspace as well as define which feature previews are enabled by default for the users in the workspace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,47 @@ | |
- @rocket.chat/[email protected] | ||
</details> | ||
|
||
## 6.12.1 | ||
|
||
### Patch Changes | ||
|
||
- Bump @rocket.chat/meteor version. | ||
|
||
- Bump @rocket.chat/meteor version. | ||
|
||
- ([#33242](https://github.com/RocketChat/Rocket.Chat/pull/33242) by [@dionisio-bot](https://github.com/dionisio-bot)) Allow to use the token from `room.v` when requesting transcript instead of visitor token. Visitors may change their tokens at any time, rendering old conversations impossible to access for them (or for APIs depending on token) as the visitor token won't match the `room.v` token. | ||
|
||
- ([#33268](https://github.com/RocketChat/Rocket.Chat/pull/33268) by [@dionisio-bot](https://github.com/dionisio-bot)) Security Hotfix (https://docs.rocket.chat/docs/security-fixes-and-updates) | ||
|
||
- ([#33265](https://github.com/RocketChat/Rocket.Chat/pull/33265) by [@dionisio-bot](https://github.com/dionisio-bot)) fixed retention policy max age settings not being respected after upgrade | ||
|
||
- <details><summary>Updated dependencies [3cbb9f6252]:</summary> | ||
|
||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
- @rocket.chat/[email protected] | ||
</details> | ||
|
||
## 6.12.0 | ||
|
||
### Minor Changes | ||
|
4 changes: 2 additions & 2 deletions
4
apps/meteor/client/NavBarV2/NavBarSettingsToolbar/UserMenu/hooks/useAccountItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { FeaturePreviewProps } from '@rocket.chat/ui-client'; | ||
import { useMemo } from 'react'; | ||
|
||
const handleFeaturePreviewEnableQuery = (item: FeaturePreviewProps, _: any, features: FeaturePreviewProps[]) => { | ||
if (item.enableQuery) { | ||
const expected = item.enableQuery.value; | ||
const received = features.find((el) => el.name === item.enableQuery?.name)?.value; | ||
if (expected !== received) { | ||
item.disabled = true; | ||
item.value = false; | ||
} else { | ||
item.disabled = false; | ||
} | ||
} | ||
return item; | ||
}; | ||
|
||
const groupFeaturePreview = (features: FeaturePreviewProps[]) => | ||
Object.entries( | ||
features.reduce((result, currentValue) => { | ||
(result[currentValue.group] = result[currentValue.group] || []).push(currentValue); | ||
return result; | ||
}, {} as Record<FeaturePreviewProps['group'], FeaturePreviewProps[]>), | ||
); | ||
|
||
export const useFeaturePreviewEnableQuery = (features: FeaturePreviewProps[]) => { | ||
return useMemo(() => groupFeaturePreview(features.map(handleFeaturePreviewEnableQuery)), [features]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewBadge.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
apps/meteor/client/views/admin/featurePreview/AdminFeaturePreviewPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import { | ||
ButtonGroup, | ||
Button, | ||
Box, | ||
ToggleSwitch, | ||
Accordion, | ||
Field, | ||
FieldGroup, | ||
FieldLabel, | ||
FieldRow, | ||
FieldHint, | ||
Callout, | ||
Margins, | ||
} from '@rocket.chat/fuselage'; | ||
import { useDefaultSettingFeaturePreviewList } from '@rocket.chat/ui-client'; | ||
import type { TranslationKey } from '@rocket.chat/ui-contexts'; | ||
import { useToastMessageDispatch, useTranslation, useSettingsDispatch } from '@rocket.chat/ui-contexts'; | ||
import type { ChangeEvent } from 'react'; | ||
import React, { Fragment } from 'react'; | ||
import { useForm } from 'react-hook-form'; | ||
|
||
import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; | ||
import { useFeaturePreviewEnableQuery } from '../../../hooks/useFeaturePreviewEnableQuery'; | ||
import { useEditableSetting } from '../EditableSettingsContext'; | ||
import Setting from '../settings/Setting'; | ||
import SettingsGroupPageSkeleton from '../settings/SettingsGroupPage/SettingsGroupPageSkeleton'; | ||
|
||
const AdminFeaturePreviewPage = () => { | ||
const t = useTranslation(); | ||
const dispatchToastMessage = useToastMessageDispatch(); | ||
const allowFeaturePreviewSetting = useEditableSetting('Accounts_AllowFeaturePreview'); | ||
const { features } = useDefaultSettingFeaturePreviewList(); | ||
|
||
const { | ||
watch, | ||
formState: { isDirty }, | ||
setValue, | ||
handleSubmit, | ||
reset, | ||
} = useForm({ | ||
defaultValues: { featuresPreview: features }, | ||
}); | ||
const { featuresPreview } = watch(); | ||
const dispatch = useSettingsDispatch(); | ||
|
||
const handleSave = async () => { | ||
try { | ||
const featuresToBeSaved = featuresPreview.map((feature) => ({ name: feature.name, value: feature.value })); | ||
|
||
await dispatch([ | ||
{ _id: allowFeaturePreviewSetting!._id, value: allowFeaturePreviewSetting!.value }, | ||
{ _id: 'Accounts_Default_User_Preferences_featuresPreview', value: JSON.stringify(featuresToBeSaved) }, | ||
]); | ||
dispatchToastMessage({ type: 'success', message: t('Preferences_saved') }); | ||
} catch (error) { | ||
dispatchToastMessage({ type: 'error', message: error }); | ||
} finally { | ||
reset({ featuresPreview }); | ||
} | ||
}; | ||
|
||
const handleFeatures = (e: ChangeEvent<HTMLInputElement>) => { | ||
const updated = featuresPreview.map((item) => (item.name === e.target.name ? { ...item, value: e.target.checked } : item)); | ||
setValue('featuresPreview', updated, { shouldDirty: true }); | ||
}; | ||
|
||
const grouppedFeaturesPreview = useFeaturePreviewEnableQuery(featuresPreview); | ||
|
||
if (!allowFeaturePreviewSetting) { | ||
// TODO: Implement FeaturePreviewSkeleton component | ||
return <SettingsGroupPageSkeleton />; | ||
} | ||
|
||
return ( | ||
<Page> | ||
<PageHeader title={t('Feature_preview')} /> | ||
<PageScrollableContentWithShadow> | ||
<Box maxWidth='x600' w='full' alignSelf='center'> | ||
<Box> | ||
<Margins block={24}> | ||
<Box fontScale='p1'>{t('Feature_preview_admin_page_description')}</Box> | ||
<Callout>{t('Feature_preview_page_callout')}</Callout> | ||
<Callout>{t('Feature_preview_admin_page_callout')}</Callout> | ||
<Setting settingId='Accounts_AllowFeaturePreview' sectionChanged={allowFeaturePreviewSetting.changed} /> | ||
</Margins> | ||
</Box> | ||
<Accordion> | ||
{grouppedFeaturesPreview?.map(([group, features], index) => ( | ||
<Accordion.Item defaultExpanded={index === 0} key={group} title={t(group as TranslationKey)}> | ||
<FieldGroup> | ||
{features.map((feature) => ( | ||
<Fragment key={feature.name}> | ||
<Field> | ||
<FieldRow> | ||
<FieldLabel htmlFor={feature.name}>{t(feature.i18n)}</FieldLabel> | ||
<ToggleSwitch | ||
id={feature.name} | ||
checked={feature.value} | ||
name={feature.name} | ||
onChange={handleFeatures} | ||
disabled={feature.disabled || !allowFeaturePreviewSetting.value} | ||
/> | ||
</FieldRow> | ||
{feature.description && <FieldHint mbs={12}>{t(feature.description)}</FieldHint>} | ||
</Field> | ||
{feature.imageUrl && <Box is='img' width='100%' height='auto' mbs={16} src={feature.imageUrl} alt='' />} | ||
</Fragment> | ||
))} | ||
</FieldGroup> | ||
</Accordion.Item> | ||
))} | ||
</Accordion> | ||
</Box> | ||
</PageScrollableContentWithShadow> | ||
<PageFooter isDirty={isDirty || allowFeaturePreviewSetting.changed}> | ||
<ButtonGroup> | ||
<Button onClick={() => reset({ featuresPreview: features })}>{t('Cancel')}</Button> | ||
<Button primary disabled={!(isDirty || allowFeaturePreviewSetting.changed)} onClick={handleSubmit(handleSave)}> | ||
{t('Save_changes')} | ||
</Button> | ||
</ButtonGroup> | ||
</PageFooter> | ||
</Page> | ||
); | ||
}; | ||
|
||
export default AdminFeaturePreviewPage; |
26 changes: 26 additions & 0 deletions
26
apps/meteor/client/views/admin/featurePreview/AdminFeaturePreviewRoute.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { usePermission } from '@rocket.chat/ui-contexts'; | ||
import type { ReactElement } from 'react'; | ||
import React, { memo } from 'react'; | ||
|
||
import SettingsProvider from '../../../providers/SettingsProvider'; | ||
import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; | ||
import EditableSettingsProvider from '../settings/EditableSettingsProvider'; | ||
import AdminFeaturePreviewPage from './AdminFeaturePreviewPage'; | ||
|
||
const AdminFeaturePreviewRoute = (): ReactElement => { | ||
const canViewFeaturesPreview = usePermission('manage-cloud'); | ||
|
||
if (!canViewFeaturesPreview) { | ||
return <NotAuthorizedPage />; | ||
} | ||
|
||
return ( | ||
<SettingsProvider privileged> | ||
<EditableSettingsProvider> | ||
<AdminFeaturePreviewPage /> | ||
</EditableSettingsProvider> | ||
</SettingsProvider> | ||
); | ||
}; | ||
|
||
export default memo(AdminFeaturePreviewRoute); |
Oops, something went wrong.