Skip to content
Snippets Groups Projects
Commit a4c3760d authored by Guilherme Gazzo's avatar Guilherme Gazzo
Browse files

fix: Registration Data (#31185)

parent 55c95e45
No related branches found
No related tags found
No related merge requests found
......@@ -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'));
......@@ -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,
......
......@@ -114,10 +114,6 @@ const SetupWizardProvider = ({ children }: { children: ReactElement }): ReactEle
} = setupWizardData;
await dispatchSettings([
{
_id: 'Statistics_reporting',
value: true,
},
{
_id: 'Register_Server',
value: true,
......
......@@ -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}` }) };
......
......@@ -287,6 +287,7 @@ export const createGeneralSettings = () =>
await this.section('Reporting', async function () {
return this.add('Statistics_reporting', true, {
type: 'boolean',
hidden: true,
});
});
await this.section('Notifications', async function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment