Skip to content

Commit 7bf9382

Browse files
authored
Merge pull request #29482 from nextcloud/feat/revamp-profile-visibility-section
2 parents 42cafb9 + 19c62d0 commit 7bf9382

39 files changed

+426
-287
lines changed

apps/settings/js/vue-settings-admin-delegation.js

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-admin-delegation.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-admin-security.js

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-admin-security.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-apps-users-management.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-apps-users-management.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-apps.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-nextcloud-pdf.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-nextcloud-pdf.js.map

+1-1
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

+20-20
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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-users.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-users.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-vendors-settings-apps-settings-users.js

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-vendors-settings-apps-settings-users.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-vendors-settings-apps.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-vendors-settings-apps.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-vendors-settings-users.js

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-vendors-settings-users.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/lib/Settings/Personal/PersonalInfo.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function getForm(): TemplateResponse {
187187
];
188188

189189
$profileParameters = [
190-
'profileConfig' => $this->profileManager->getProfileConfig($user, $user),
190+
'profileConfig' => $this->profileManager->getProfileConfigWithMetadata($user, $user),
191191
];
192192

193193
$this->initialStateService->provideInitialState('personalInfoParameters', $personalInfoParameters);

apps/settings/src/components/PersonalInfo/BiographySection/BiographySection.vue

+1-11
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
<Biography
3131
:biography.sync="primaryBiography.value"
3232
:scope.sync="primaryBiography.scope" />
33-
34-
<VisibilityDropdown
35-
:param-id="accountPropertyId"
36-
:display-id="accountProperty"
37-
:visibility.sync="visibility" />
3833
</section>
3934
</template>
4035

@@ -43,28 +38,23 @@ import { loadState } from '@nextcloud/initial-state'
4338

4439
import Biography from './Biography'
4540
import HeaderBar from '../shared/HeaderBar'
46-
import VisibilityDropdown from '../shared/VisibilityDropdown'
4741

48-
import { ACCOUNT_PROPERTY_ENUM, ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
42+
import { ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
4943

5044
const { biographyMap: { primaryBiography } } = loadState('settings', 'personalInfoParameters', {})
51-
const { profileConfig: { biography: { visibility } } } = loadState('settings', 'profileParameters', {})
5245

5346
export default {
5447
name: 'BiographySection',
5548

5649
components: {
5750
Biography,
5851
HeaderBar,
59-
VisibilityDropdown,
6052
},
6153

6254
data() {
6355
return {
6456
accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.BIOGRAPHY,
65-
accountPropertyId: ACCOUNT_PROPERTY_ENUM.BIOGRAPHY,
6657
primaryBiography,
67-
visibility,
6858
}
6959
},
7060
}

apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayNameSection.vue

+1-11
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
<DisplayName
3434
:display-name.sync="primaryDisplayName.value"
3535
:scope.sync="primaryDisplayName.scope" />
36-
37-
<VisibilityDropdown
38-
:param-id="accountPropertyId"
39-
:display-id="accountProperty"
40-
:visibility.sync="visibility" />
4136
</template>
4237

4338
<span v-else>
@@ -51,31 +46,26 @@ import { loadState } from '@nextcloud/initial-state'
5146

5247
import DisplayName from './DisplayName'
5348
import HeaderBar from '../shared/HeaderBar'
54-
import VisibilityDropdown from '../shared/VisibilityDropdown'
5549

56-
import { ACCOUNT_PROPERTY_ENUM, ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
50+
import { ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
5751
import { validateStringInput } from '../../../utils/validate'
5852

5953
const { displayNameMap: { primaryDisplayName } } = loadState('settings', 'personalInfoParameters', {})
6054
const { displayNameChangeSupported } = loadState('settings', 'accountParameters', {})
61-
const { profileConfig: { displayname: { visibility } } } = loadState('settings', 'profileParameters', {})
6255

6356
export default {
6457
name: 'DisplayNameSection',
6558

6659
components: {
6760
DisplayName,
6861
HeaderBar,
69-
VisibilityDropdown,
7062
},
7163

7264
data() {
7365
return {
7466
accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.DISPLAYNAME,
75-
accountPropertyId: ACCOUNT_PROPERTY_ENUM.DISPLAYNAME,
7667
displayNameChangeSupported,
7768
primaryDisplayName,
78-
visibility,
7969
}
8070
},
8171

apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue

+1-11
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
:active-notification-email.sync="notificationEmail"
4141
@update:email="onUpdateEmail"
4242
@update:notification-email="onUpdateNotificationEmail" />
43-
44-
<VisibilityDropdown
45-
:param-id="accountPropertyId"
46-
:display-id="accountProperty"
47-
:visibility.sync="visibility" />
4843
</template>
4944

5045
<span v-else>
@@ -73,35 +68,30 @@ import { showError } from '@nextcloud/dialogs'
7368

7469
import Email from './Email'
7570
import HeaderBar from '../shared/HeaderBar'
76-
import VisibilityDropdown from '../shared/VisibilityDropdown'
7771

78-
import { ACCOUNT_PROPERTY_ENUM, ACCOUNT_PROPERTY_READABLE_ENUM, DEFAULT_ADDITIONAL_EMAIL_SCOPE } from '../../../constants/AccountPropertyConstants'
72+
import { ACCOUNT_PROPERTY_READABLE_ENUM, DEFAULT_ADDITIONAL_EMAIL_SCOPE } from '../../../constants/AccountPropertyConstants'
7973
import { savePrimaryEmail, savePrimaryEmailScope, removeAdditionalEmail } from '../../../service/PersonalInfo/EmailService'
8074
import { validateEmail } from '../../../utils/validate'
8175

8276
const { emailMap: { additionalEmails, primaryEmail, notificationEmail } } = loadState('settings', 'personalInfoParameters', {})
8377
const { displayNameChangeSupported } = loadState('settings', 'accountParameters', {})
84-
const { profileConfig: { email: { visibility } } } = loadState('settings', 'profileParameters', {})
8578

8679
export default {
8780
name: 'EmailSection',
8881

8982
components: {
9083
HeaderBar,
9184
Email,
92-
VisibilityDropdown,
9385
},
9486

9587
data() {
9688
return {
9789
accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.EMAIL,
98-
accountPropertyId: ACCOUNT_PROPERTY_ENUM.EMAIL,
9990
additionalEmails,
10091
displayNameChangeSupported,
10192
primaryEmail,
10293
savePrimaryEmailScope,
10394
notificationEmail,
104-
visibility,
10595
}
10696
},
10797

apps/settings/src/components/PersonalInfo/HeadlineSection/HeadlineSection.vue

+1-11
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
<Headline
3131
:headline.sync="primaryHeadline.value"
3232
:scope.sync="primaryHeadline.scope" />
33-
34-
<VisibilityDropdown
35-
:param-id="accountPropertyId"
36-
:display-id="accountProperty"
37-
:visibility.sync="visibility" />
3833
</section>
3934
</template>
4035

@@ -43,28 +38,23 @@ import { loadState } from '@nextcloud/initial-state'
4338

4439
import Headline from './Headline'
4540
import HeaderBar from '../shared/HeaderBar'
46-
import VisibilityDropdown from '../shared/VisibilityDropdown'
4741

48-
import { ACCOUNT_PROPERTY_ENUM, ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
42+
import { ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
4943

5044
const { headlineMap: { primaryHeadline } } = loadState('settings', 'personalInfoParameters', {})
51-
const { profileConfig: { headline: { visibility } } } = loadState('settings', 'profileParameters', {})
5245

5346
export default {
5447
name: 'HeadlineSection',
5548

5649
components: {
5750
Headline,
5851
HeaderBar,
59-
VisibilityDropdown,
6052
},
6153

6254
data() {
6355
return {
6456
accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.HEADLINE,
65-
accountPropertyId: ACCOUNT_PROPERTY_ENUM.HEADLINE,
6657
primaryHeadline,
67-
visibility,
6858
}
6959
},
7060
}

apps/settings/src/components/PersonalInfo/OrganisationSection/OrganisationSection.vue

+1-11
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
<Organisation
3131
:organisation.sync="primaryOrganisation.value"
3232
:scope.sync="primaryOrganisation.scope" />
33-
34-
<VisibilityDropdown
35-
:param-id="accountPropertyId"
36-
:display-id="accountProperty"
37-
:visibility.sync="visibility" />
3833
</section>
3934
</template>
4035

@@ -43,28 +38,23 @@ import { loadState } from '@nextcloud/initial-state'
4338

4439
import Organisation from './Organisation'
4540
import HeaderBar from '../shared/HeaderBar'
46-
import VisibilityDropdown from '../shared/VisibilityDropdown'
4741

48-
import { ACCOUNT_PROPERTY_ENUM, ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
42+
import { ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
4943

5044
const { organisationMap: { primaryOrganisation } } = loadState('settings', 'personalInfoParameters', {})
51-
const { profileConfig: { organisation: { visibility } } } = loadState('settings', 'profileParameters', {})
5245

5346
export default {
5447
name: 'OrganisationSection',
5548

5649
components: {
5750
Organisation,
5851
HeaderBar,
59-
VisibilityDropdown,
6052
},
6153

6254
data() {
6355
return {
6456
accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.ORGANISATION,
65-
accountPropertyId: ACCOUNT_PROPERTY_ENUM.ORGANISATION,
6657
primaryOrganisation,
67-
visibility,
6858
}
6959
},
7060
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<!--
2+
- @copyright 2021 Christopher Ng <chrng8@gmail.com>
3+
-
4+
- @author Christopher Ng <chrng8@gmail.com>
5+
-
6+
- @license GNU AGPL version 3 or any later version
7+
-
8+
- This program is free software: you can redistribute it and/or modify
9+
- it under the terms of the GNU Affero General Public License as
10+
- published by the Free Software Foundation, either version 3 of the
11+
- License, or (at your option) any later version.
12+
-
13+
- This program is distributed in the hope that it will be useful,
14+
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
- GNU Affero General Public License for more details.
17+
-
18+
- You should have received a copy of the GNU Affero General Public License
19+
- along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
-
21+
-->
22+
23+
<template>
24+
<a
25+
:class="{ disabled }"
26+
href="#profile-visibility"
27+
v-on="$listeners">
28+
<ChevronDownIcon
29+
class="anchor-icon"
30+
decorative
31+
title=""
32+
:size="22" />
33+
{{ t('settings', 'Edit your Profile visibility') }}
34+
</a>
35+
</template>
36+
37+
<script>
38+
import ChevronDownIcon from 'vue-material-design-icons/ChevronDown'
39+
40+
export default {
41+
name: 'EditProfileAnchorLink',
42+
43+
components: {
44+
ChevronDownIcon,
45+
},
46+
47+
props: {
48+
profileEnabled: {
49+
type: Boolean,
50+
required: true,
51+
},
52+
},
53+
54+
computed: {
55+
disabled() {
56+
return !this.profileEnabled
57+
},
58+
},
59+
}
60+
</script>
61+
62+
<style lang="scss">
63+
html {
64+
scroll-behavior: smooth;
65+
66+
@media screen and (prefers-reduced-motion: reduce) {
67+
scroll-behavior: auto;
68+
}
69+
}
70+
</style>
71+
72+
<style lang="scss" scoped>
73+
a {
74+
display: block;
75+
height: 44px;
76+
width: 290px;
77+
line-height: 44px;
78+
padding: 0 16px;
79+
margin: 14px auto;
80+
border-radius: var(--border-radius-pill);
81+
opacity: 0.4;
82+
background-color: transparent;
83+
84+
.anchor-icon {
85+
display: inline-block;
86+
vertical-align: middle;
87+
margin-top: 6px;
88+
margin-right: 8px;
89+
}
90+
91+
&:hover {
92+
opacity: 0.8;
93+
background-color: rgba(127, 127, 127, .25);
94+
}
95+
96+
&.disabled {
97+
pointer-events: none;
98+
}
99+
}
100+
</style>

apps/settings/src/components/PersonalInfo/ProfileSection/ProfileSection.vue

+5
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@
3333
:display-name="displayName"
3434
:profile-enabled="profileEnabled"
3535
:user-id="userId" />
36+
37+
<EditProfileAnchorLink
38+
:profile-enabled="profileEnabled" />
3639
</section>
3740
</template>
3841

3942
<script>
4043
import { loadState } from '@nextcloud/initial-state'
4144
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
4245

46+
import EditProfileAnchorLink from './EditProfileAnchorLink'
4347
import HeaderBar from '../shared/HeaderBar'
4448
import ProfileCheckbox from './ProfileCheckbox'
4549
import ProfilePreviewCard from './ProfilePreviewCard'
@@ -57,6 +61,7 @@ export default {
5761
name: 'ProfileSection',
5862

5963
components: {
64+
EditProfileAnchorLink,
6065
HeaderBar,
6166
ProfileCheckbox,
6267
ProfilePreviewCard,

0 commit comments

Comments
 (0)