Skip to content

Commit

Permalink
Merge branch 'release-6.5.0' into fix/archive-room-error
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 21, 2023
2 parents 31429ac + 9045c0d commit 31aa1b0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/meteor/app/livechat/server/lib/LivechatTyped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,12 @@ class LivechatClass {

async saveGuest(guestData: Pick<ILivechatVisitor, '_id' | 'name' | 'livechatData'> & { email?: string; phone?: string }, userId: string) {
const { _id, name, email, phone, livechatData = {} } = guestData;

const visitor = await LivechatVisitors.findOneById(_id, { projection: { _id: 1 } });
if (!visitor) {
throw new Error('error-invalid-visitor');
}

this.logger.debug({ msg: 'Saving guest', guestData });
const updateData: {
name?: string | undefined;
Expand Down
25 changes: 25 additions & 0 deletions apps/meteor/client/views/admin/subscription/SubscriptionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Box, Button, ButtonGroup, Callout, Grid, Throbber } from '@rocket.chat/fuselage';
import { useSessionStorage } from '@rocket.chat/fuselage-hooks';
import { useRouter } from '@rocket.chat/ui-contexts';
import { t } from 'i18next';
import React, { memo, useCallback, useEffect } from 'react';
import tinykeys from 'tinykeys';

import Page from '../../../components/Page';
import { useIsEnterprise } from '../../../hooks/useIsEnterprise';
Expand All @@ -23,7 +25,25 @@ import PlanCardCommunity from './components/cards/PlanCard/PlanCardCommunity';
import SeatsCard from './components/cards/SeatsCard';
import { useWorkspaceSync } from './hooks/useWorkspaceSync';

function useShowLicense() {
const [showLicenseTab, setShowLicenseTab] = useSessionStorage('admin:showLicenseTab', false);

useEffect(() => {
const unsubscribe = tinykeys(window, {
'ArrowUp ArrowUp ArrowDown ArrowDown ArrowLeft ArrowRight ArrowLeft ArrowRight b a': () => {
setShowLicenseTab((showLicenseTab) => !showLicenseTab);
},
});
return () => {
unsubscribe();
};
});

return showLicenseTab;
}

const SubscriptionPage = () => {
const showLicense = useShowLicense();
const router = useRouter();
const { data: enterpriseData } = useIsEnterprise();
const { isRegistered } = useRegistrationStatus();
Expand Down Expand Up @@ -89,6 +109,11 @@ const SubscriptionPage = () => {
{!isLicenseLoading && (
<Box marginBlock='none' marginInline='auto' width='full' color='default'>
<Grid m={0}>
{showLicense && (
<Grid.Item lg={12} xs={4} p={8}>
<pre>{JSON.stringify(licensesData, null, 2)}</pre>
</Grid.Item>
)}
<Grid.Item lg={4} xs={4} p={8}>
{license && (
<PlanCard
Expand Down

0 comments on commit 31aa1b0

Please sign in to comment.