Skip to content

Commit 8289e2b

Browse files
Pytalnextcloud-command
authored andcommitted
Fix unsupported scopes being shown for properties which do not support publishing
- Shorten disabled scope messages - Update wording Signed-off-by: Christopher Ng <chrng8@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent b453fea commit 8289e2b

4 files changed

Lines changed: 33 additions & 19 deletions

File tree

apps/settings/js/vue-settings-personal-info.js

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-personal-info.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/src/components/PersonalInfo/shared/FederationControl.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ import { showError } from '@nextcloud/dialogs'
4646
4747
import FederationControlAction from './FederationControlAction'
4848
49-
import { ACCOUNT_PROPERTY_READABLE_ENUM, PROPERTY_READABLE_KEYS_ENUM, PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM, SCOPE_ENUM, SCOPE_PROPERTY_ENUM } from '../../../constants/AccountPropertyConstants'
49+
import {
50+
ACCOUNT_PROPERTY_READABLE_ENUM,
51+
PROPERTY_READABLE_KEYS_ENUM,
52+
PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM,
53+
SCOPE_ENUM, SCOPE_PROPERTY_ENUM,
54+
UNPUBLISHED_READABLE_PROPERTIES,
55+
} from '../../../constants/AccountPropertyConstants'
5056
import { savePrimaryAccountPropertyScope } from '../../../service/PersonalInfo/PersonalInfoService'
5157
5258
const { lookupServerUploadEnabled } = loadState('settings', 'accountParameters', {})
@@ -108,7 +114,7 @@ export default {
108114
},
109115
110116
supportedScopes() {
111-
if (lookupServerUploadEnabled) {
117+
if (lookupServerUploadEnabled && !UNPUBLISHED_READABLE_PROPERTIES.includes(this.accountProperty)) {
112118
return [
113119
...PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.accountProperty],
114120
SCOPE_ENUM.FEDERATED,

apps/settings/src/constants/AccountPropertyConstants.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ export const PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM = Object.freeze({
122122
[ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
123123
})
124124

125+
/** List of readable account properties which aren't published to the lookup server */
126+
export const UNPUBLISHED_READABLE_PROPERTIES = Object.freeze([
127+
ACCOUNT_PROPERTY_READABLE_ENUM.BIOGRAPHY,
128+
ACCOUNT_PROPERTY_READABLE_ENUM.HEADLINE,
129+
ACCOUNT_PROPERTY_READABLE_ENUM.ORGANISATION,
130+
ACCOUNT_PROPERTY_READABLE_ENUM.ROLE,
131+
])
132+
125133
/** Scope suffix */
126134
export const SCOPE_SUFFIX = 'Scope'
127135

@@ -135,7 +143,7 @@ export const SCOPE_PROPERTY_ENUM = Object.freeze({
135143
name: SCOPE_ENUM.PRIVATE,
136144
displayName: t('settings', 'Private'),
137145
tooltip: t('settings', 'Only visible to people matched via phone number integration through Talk on mobile'),
138-
tooltipDisabled: t('settings', 'Unavailable as this property is required for core functionality including file sharing and calendar invitations\n\nOnly visible to people matched via phone number integration through Talk on mobile'),
146+
tooltipDisabled: t('settings', 'Not available as this property is required for core functionality including file sharing and calendar invitations'),
139147
iconClass: 'icon-phone',
140148
},
141149
[SCOPE_ENUM.LOCAL]: {
@@ -149,14 +157,14 @@ export const SCOPE_PROPERTY_ENUM = Object.freeze({
149157
name: SCOPE_ENUM.FEDERATED,
150158
displayName: t('settings', 'Federated'),
151159
tooltip: t('settings', 'Only synchronize to trusted servers'),
152-
tooltipDisabled: t('settings', 'Unavailable as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions\n\nOnly synchronize to trusted servers'),
160+
tooltipDisabled: t('settings', 'Not available as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions'),
153161
iconClass: 'icon-contacts-dark',
154162
},
155163
[SCOPE_ENUM.PUBLISHED]: {
156164
name: SCOPE_ENUM.PUBLISHED,
157165
displayName: t('settings', 'Published'),
158166
tooltip: t('settings', 'Synchronize to trusted servers and the global and public address book'),
159-
tooltipDisabled: t('settings', 'Unavailable as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions\n\nSynchronize to trusted servers and the global and public address book'),
167+
tooltipDisabled: t('settings', 'Not available as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions'),
160168
iconClass: 'icon-link',
161169
},
162170
})

0 commit comments

Comments
 (0)