Skip to content

Commit 8264383

Browse files
committed
Extract One-time call logging out
1 parent 2826bb1 commit 8264383

File tree

2 files changed

+36
-18
lines changed

2 files changed

+36
-18
lines changed

src/components/admin/managedSettings/activityLoggingSettingPage.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function getActivityLoggingSettingPageRender({ adminUserSettings, crmManifest, u
2121
items: {
2222
type: 'string',
2323
enum: [
24-
'oneTimeLog',
2524
'autoLogAnsweredIncoming',
2625
'autoLogMissedIncoming',
2726
'autoLogOutgoing',
@@ -32,7 +31,6 @@ function getActivityLoggingSettingPageRender({ adminUserSettings, crmManifest, u
3231

3332
],
3433
enumNames: [
35-
'One-time call logging',
3634
'Answered incoming calls',
3735
'Missed incoming calls',
3836
'Outgoing calls',
@@ -68,6 +66,20 @@ function getActivityLoggingSettingPageRender({ adminUserSettings, crmManifest, u
6866
}
6967
}
7068
},
69+
oneTimeLog: {
70+
type: 'object',
71+
title: 'One-time call logging',
72+
properties: {
73+
customizable: {
74+
type: 'boolean',
75+
title: 'Customizable by user'
76+
},
77+
value: {
78+
type: 'boolean',
79+
title: 'Enable one-time call logging functionality'
80+
}
81+
}
82+
},
7183
autoOpenOptions: {
7284
type: 'object',
7385
title: 'Auto-open logging page after:',
@@ -109,6 +121,9 @@ function getActivityLoggingSettingPageRender({ adminUserSettings, crmManifest, u
109121
logSyncFrequencySection: {
110122
"ui:collapsible": true,
111123
},
124+
oneTimeLog: {
125+
"ui:collapsible": true,
126+
},
112127
autoOpenOptions: {
113128
"ui:collapsible": true,
114129
value: {
@@ -130,17 +145,15 @@ function getActivityLoggingSettingPageRender({ adminUserSettings, crmManifest, u
130145
adminUserSettings?.autoLogVoicemails?.customizable ??
131146
adminUserSettings?.autoLogSMS?.customizable ??
132147
adminUserSettings?.autoLogInboundFax?.customizable ??
133-
adminUserSettings?.autoLogOutboundFax?.customizable ??
134-
adminUserSettings?.oneTimeLog?.customizable ?? true,
148+
adminUserSettings?.autoLogOutboundFax?.customizable ?? true,
135149
value: [
136150
...((adminUserSettings?.autoLogAnsweredIncoming?.value ?? false) ? ['autoLogAnsweredIncoming'] : []),
137151
...((adminUserSettings?.autoLogMissedIncoming?.value ?? false) ? ['autoLogMissedIncoming'] : []),
138152
...((adminUserSettings?.autoLogOutgoing?.value ?? false) ? ['autoLogOutgoing'] : []),
139153
...((adminUserSettings?.autoLogVoicemails?.value ?? false) ? ['autoLogVoicemails'] : []),
140154
...((adminUserSettings?.autoLogSMS?.value ?? false) ? ['autoLogSMS'] : []),
141155
...((adminUserSettings?.autoLogInboundFax?.value ?? false) ? ['autoLogInboundFax'] : []),
142-
...((adminUserSettings?.autoLogOutboundFax?.value ?? false) ? ['autoLogOutboundFax'] : []),
143-
...((adminUserSettings?.oneTimeLog?.value ?? false) ? ['oneTimeLog'] : [])
156+
...((adminUserSettings?.autoLogOutboundFax?.value ?? false) ? ['autoLogOutboundFax'] : [])
144157
]
145158
},
146159
logSyncFrequencySection: {
@@ -149,6 +162,10 @@ function getActivityLoggingSettingPageRender({ adminUserSettings, crmManifest, u
149162
value: adminUserSettings?.logSyncFrequency?.value ?? '10min'
150163
}
151164
},
165+
oneTimeLog: {
166+
customizable: adminUserSettings?.oneTimeLog?.customizable ?? true,
167+
value: adminUserSettings?.oneTimeLog?.value ?? false
168+
},
152169
autoOpenOptions: {
153170
customizable: adminUserSettings?.popupLogPageAfterSMS?.customizable ??
154171
adminUserSettings?.popupLogPageAfterCall?.customizable ?? true,

src/service/embeddableServices.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ async function getServiceManifest() {
6464
checkbox: true,
6565
helper: `Select the types of communications you'd like automatically logged to your CRM.`,
6666
options: [
67-
{
68-
id: 'oneTimeLog',
69-
name: 'One-time call logging'
70-
},
7167
{
7268
id: 'autoLogAnsweredIncoming',
7369
name: 'Answered incoming calls'
@@ -106,8 +102,7 @@ async function getServiceManifest() {
106102
...(userCore.getAutoLogVoicemailsSetting(userSettings).value ? ['autoLogVoicemails'] : []),
107103
...(userCore.getAutoLogSMSSetting(userSettings).value ? ['autoLogSMS'] : []),
108104
...(userCore.getAutoLogInboundFaxSetting(userSettings).value ? ['autoLogInboundFax'] : []),
109-
...(userCore.getAutoLogOutboundFaxSetting(userSettings).value ? ['autoLogOutboundFax'] : []),
110-
...(userCore.getOneTimeLogSetting(userSettings).value ? ['oneTimeLog'] : [])
105+
...(userCore.getAutoLogOutboundFaxSetting(userSettings).value ? ['autoLogOutboundFax'] : [])
111106
];
112107
console.log('Service manifest activity logging values:', activityLoggingValues);
113108
console.log('User settings for activity logging:', {
@@ -117,8 +112,7 @@ async function getServiceManifest() {
117112
autoLogVoicemails: userCore.getAutoLogVoicemailsSetting(userSettings),
118113
autoLogSMS: userCore.getAutoLogSMSSetting(userSettings),
119114
autoLogInboundFax: userCore.getAutoLogInboundFaxSetting(userSettings),
120-
autoLogOutboundFax: userCore.getAutoLogOutboundFaxSetting(userSettings),
121-
oneTimeLog: userCore.getOneTimeLogSetting(userSettings)
115+
autoLogOutboundFax: userCore.getAutoLogOutboundFaxSetting(userSettings)
122116
});
123117
return activityLoggingValues;
124118
})(),
@@ -128,16 +122,14 @@ async function getServiceManifest() {
128122
userCore.getAutoLogVoicemailsSetting(userSettings).readOnly ||
129123
userCore.getAutoLogSMSSetting(userSettings).readOnly ||
130124
userCore.getAutoLogInboundFaxSetting(userSettings).readOnly ||
131-
userCore.getAutoLogOutboundFaxSetting(userSettings).readOnly ||
132-
userCore.getOneTimeLogSetting(userSettings).readOnly,
125+
userCore.getAutoLogOutboundFaxSetting(userSettings).readOnly,
133126
readOnlyReason: userCore.getAutoLogAnsweredIncomingSetting(userSettings, isAdmin).readOnlyReason ||
134127
userCore.getAutoLogMissedIncomingSetting(userSettings, isAdmin).readOnlyReason ||
135128
userCore.getAutoLogOutgoingSetting(userSettings, isAdmin).readOnlyReason ||
136129
userCore.getAutoLogVoicemailsSetting(userSettings).readOnlyReason ||
137130
userCore.getAutoLogSMSSetting(userSettings).readOnlyReason ||
138131
userCore.getAutoLogInboundFaxSetting(userSettings).readOnlyReason ||
139-
userCore.getAutoLogOutboundFaxSetting(userSettings).readOnlyReason ||
140-
userCore.getOneTimeLogSetting(userSettings).readOnlyReason
132+
userCore.getAutoLogOutboundFaxSetting(userSettings).readOnlyReason
141133
},
142134
{
143135
id: "logSyncFrequency",
@@ -174,6 +166,15 @@ async function getServiceManifest() {
174166
readOnly: userCore.getLogSyncFrequencySetting(userSettings).readOnly,
175167
readOnlyReason: userCore.getLogSyncFrequencySetting(userSettings).readOnlyReason,
176168
},
169+
{
170+
id: 'oneTimeLog',
171+
type: 'boolean',
172+
name: 'One-time call logging',
173+
description: 'Enable one-time call logging functionality.',
174+
value: userCore.getOneTimeLogSetting(userSettings).value,
175+
readOnly: userCore.getOneTimeLogSetting(userSettings).readOnly,
176+
readOnlyReason: userCore.getOneTimeLogSetting(userSettings).readOnlyReason
177+
},
177178
{
178179
id: 'autoOpenOptions',
179180
type: 'option',

0 commit comments

Comments
 (0)