Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/meteor/app/cloud/server/functions/buildRegistrationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ export async function buildWorkspaceRegistrationData<T extends string | undefine
const firstUser = await Users.getOldest({ projection: { name: 1, emails: 1 } });
const contactName = firstUser?.name || '';

const { organizationType, industry, size: orgSize, country, language, serverType: workspaceType, registerServer } = stats.wizard;
const country = settings.get<string>('Country');
const language = settings.get<string>('Language');
const organizationType = settings.get<string>('Organization_Type');
const industry = settings.get<string>('Industry');
const orgSize = settings.get<string>('Organization_Size');
const workspaceType = settings.get<string>('Server_Type');

const seats = await Users.getActiveLocalUserCount();
const [macs] = await LivechatRooms.getMACStatisticsForPeriod(moment.utc().format('YYYY-MM'));

Expand Down Expand Up @@ -94,7 +100,7 @@ export async function buildWorkspaceRegistrationData<T extends string | undefine
...(license && { license }),
enterpriseReady: true,
setupComplete: setupWizardState === 'completed',
connectionDisable: !registerServer,
connectionDisable: false,
npsEnabled,
MAC: macs?.contactsCount ?? 0,
// activeContactsBillingMonth: stats.omnichannelContactsBySource.contactsCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ const SetupWizardProvider = ({ children }: { children: ReactElement }): ReactEle
} = setupWizardData;

await dispatchSettings([
{
_id: 'Statistics_reporting',
value: true,
},
{
_id: 'Register_Server',
value: true,
Expand Down
5 changes: 0 additions & 5 deletions apps/meteor/server/cron/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ import { serverFetch as fetch } from '@rocket.chat/server-fetch';
import { Meteor } from 'meteor/meteor';

import { getWorkspaceAccessToken } from '../../app/cloud/server';
import { settings } from '../../app/settings/server';
import { statistics } from '../../app/statistics/server';

async function generateStatistics(logger: Logger): Promise<void> {
const cronStatistics = await statistics.save();

if (!settings.get('Statistics_reporting')) {
return;
}

try {
const token = await getWorkspaceAccessToken();
const headers = { ...(token && { Authorization: `Bearer ${token}` }) };
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/server/settings/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export const createGeneralSettings = () =>
await this.section('Reporting', async function () {
Comment thread
ggazzo marked this conversation as resolved.
return this.add('Statistics_reporting', true, {
type: 'boolean',
hidden: true,
});
});
await this.section('Notifications', async function () {
Expand Down