Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Dec 8, 2023
1 parent 0e8e2e5 commit 78cf230
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
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
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4893,7 +4893,6 @@
"Started_a_video_call": "Started a Video Call",
"Started_At": "Started At",
"Statistics": "Statistics",
"Statistics_reporting": "Send Statistics to Rocket.Chat",
"Statistics_reporting_Description": "By sending your statistics, you'll help us identify how many instances of Rocket.Chat are deployed, as well as how good the system is behaving, so we can further improve it. Don't worry, as no user information is sent and all the information we receive is kept confidential.",
"Stats_Active_Guests": "Activated Guests",
"Stats_Active_Users": "Activated Users",
Expand Down Expand Up @@ -6242,4 +6241,4 @@
"Seat_limit_reached": "Seat limit reached",
"Seat_limit_reached_Description": "Your workspace reached its contractual seat limit. Buy more seats to add more users.",
"Buy_more_seats": "Buy more seats"
}
}
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
6 changes: 1 addition & 5 deletions apps/meteor/server/settings/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,7 @@ export const createGeneralSettings = () =>
public: true,
});
});
await this.section('Reporting', async function () {
return this.add('Statistics_reporting', true, {
type: 'boolean',
});
});

await this.section('Notifications', async function () {
await this.add('Notifications_Max_Room_Members', 100, {
type: 'int',
Expand Down

0 comments on commit 78cf230

Please sign in to comment.