Skip to content

Commit 1d77548

Browse files
authored
allow to hide calling setting and feedback (#617)
* allow to hide calling setting and feedback * update show audio
1 parent 7770862 commit 1d77548

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

src/components/SettingsPanel/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default function SettingsPanel({
5757
isCallQueueMember,
5858
showPresenceSettings,
5959
showAudioSettings,
60+
showFeedback,
6061
additional,
6162
supportedLocales,
6263
savedLocale,
@@ -105,6 +106,14 @@ export default function SettingsPanel({
105106
</LinkLine>
106107
)
107108
: null;
109+
const feedback = showFeedback
110+
? (
111+
<LinkLine
112+
onClick={onFeedbackSettingsLinkClick} >
113+
{i18n.getString('feedback', currentLocale)}
114+
</LinkLine>
115+
)
116+
: null;
108117
const presenceSetting = (dndStatus && userStatus) ?
109118
(
110119
<PresenceSettingSection
@@ -195,10 +204,7 @@ export default function SettingsPanel({
195204
{autoLogSMS}
196205
{clickToDial}
197206
{additional}
198-
<LinkLine
199-
onClick={onFeedbackSettingsLinkClick} >
200-
{i18n.getString('feedback', currentLocale)}
201-
</LinkLine>
207+
{feedback}
202208
<section className={styles.section}>
203209
<Line>
204210
<EulaRenderer
@@ -265,6 +271,7 @@ SettingsPanel.propTypes = {
265271
toggleAcceptCallQueueCalls: PropTypes.func,
266272
showPresenceSettings: PropTypes.bool,
267273
showAudioSettings: PropTypes.bool,
274+
showFeedback: PropTypes.bool,
268275
additional: PropTypes.node,
269276
supportedLocales: PropTypes.arrayOf(PropTypes.string),
270277
savedLocale: PropTypes.string,
@@ -305,4 +312,5 @@ SettingsPanel.defaultProps = {
305312
supportedLocales: undefined,
306313
savedLocale: undefined,
307314
saveLocale: undefined,
315+
showFeedback: true,
308316
};

src/containers/SettingsPage/index.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function mapToProps(_, {
1919
rolesAndPermissions,
2020
detailedPresence,
2121
},
22+
showRegion = true,
23+
showCalling = true,
24+
showAudio = true,
25+
showFeedback = true,
2226
params,
2327
}) {
2428
let loginNumber = '';
@@ -46,18 +50,24 @@ function mapToProps(_, {
4650
extensionInfo.ready &&
4751
locale.ready &&
4852
regionSettings.ready &&
49-
callingSettings.ready &&
53+
(!callingSettings || callingSettings.ready) &&
5054
rolesAndPermissions.ready &&
5155
(!detailedPresence || detailedPresence.ready) &&
5256
(!localeSettings || localeSettings.ready)
5357
),
54-
showCalling: rolesAndPermissions.callingEnabled,
55-
showAudio: rolesAndPermissions.callingEnabled,
56-
showRegion: loggedIn && brand.id === '1210' && (
57-
regionSettings.availableCountries.length > 1 ||
58-
!!regionSettings.availableCountries.find(c => c.isoCode === 'US') ||
59-
!!regionSettings.availableCountries.find(c => c.isoCode === 'CA')
60-
) && rolesAndPermissions.callingEnabled,
58+
showFeedback,
59+
showCalling: showCalling && callingSettings && rolesAndPermissions.callingEnabled,
60+
showAudio: showAudio && rolesAndPermissions.callingEnabled,
61+
showRegion:
62+
loggedIn &&
63+
brand.id === '1210' &&
64+
(
65+
regionSettings.availableCountries.length > 1 ||
66+
!!regionSettings.availableCountries.find(c => c.isoCode === 'US') ||
67+
!!regionSettings.availableCountries.find(c => c.isoCode === 'CA')
68+
) &&
69+
rolesAndPermissions.callingEnabled &&
70+
showRegion,
6171
loginNumber,
6272
version,
6373
currentLocale: locale.currentLocale,

0 commit comments

Comments
 (0)