Skip to content

Commit 3b15826

Browse files
committed
fix(settings): properly align items
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent d14edfd commit 3b15826

7 files changed

Lines changed: 21 additions & 23 deletions

File tree

apps/settings/src/components/PersonalInfo/BirthdaySection.spec.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { mount } from '@vue/test-utils'
7-
import { afterEach, describe, expect, it, vi } from 'vitest'
7+
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
88

99
let personalInfoParameters
1010
vi.mock('@nextcloud/initial-state', () => ({
@@ -35,10 +35,19 @@ async function mountBirthdaySection() {
3535
})
3636
}
3737

38+
// The component reads its initial state at module scope, so every test has to import it freshly.
39+
// Transforming its module graph once up front keeps that import out of the tests' timeout budget.
40+
beforeAll(async () => {
41+
await import('./BirthdaySection.vue')
42+
})
43+
44+
beforeEach(() => {
45+
vi.resetModules()
46+
})
47+
3848
afterEach(() => {
3949
vi.unstubAllEnvs()
4050
personalInfoParameters = undefined
41-
vi.resetModules()
4251
})
4352

4453
describe('BirthdaySection', () => {

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
:scope="birthdate.scope"
2020
@update:scope="onScopeChange" />
2121
</div>
22-
23-
<p class="property__helper-text-message">
24-
{{ t('settings', 'Enter your date of birth') }}
25-
</p>
2622
</section>
2723
</template>
2824

@@ -31,7 +27,7 @@ import { loadState } from '@nextcloud/initial-state'
3127
import debounce from 'debounce'
3228
import NcDateTimePickerNative from '@nextcloud/vue/components/NcDateTimePickerNative'
3329
import VisibilityScopeControl from './shared/VisibilityScopeControl.vue'
34-
import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js'
30+
import { NAME_READABLE_ENUM, SCOPE_ENUM } from '../../constants/AccountPropertyConstants.ts'
3531
import { savePrimaryAccountProperty } from '../../service/PersonalInfo/PersonalInfoService.js'
3632
import { handleError } from '../../utils/handlers.js'
3733
@@ -63,6 +59,7 @@ export default {
6359
6460
return {
6561
birthdate: {
62+
scope: SCOPE_ENUM.PRIVATE,
6663
...birthdate,
6764
readable: NAME_READABLE_ENUM[birthdate.name],
6865
},
@@ -161,7 +158,7 @@ export default {
161158
162159
&__scope {
163160
position: absolute;
164-
inset-block-start: 0;
161+
inset-block-end: 0; // due to NcDateTimePickerNative's label handling, we need to use inset-block-end instead of block start
165162
inset-inline-start: calc(100% + 8px);
166163
display: flex;
167164
align-items: center;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,5 @@ export default {
188188
flex-direction: column;
189189
gap: 6px;
190190
padding: 6px 0;
191-
192-
&__add {
193-
margin-inline-end: 52px;
194-
}
195191
}
196192
</style>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@
6767
</NcActionButton>
6868
</NcActions>
6969
</div>
70-
71-
<em v-if="isNotificationEmail" class="property-section__note">
72-
{{ t('settings', 'Primary email for password reset and notifications') }}
73-
</em>
7470
</div>
7571
</template>
7672

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
<script>
3737
import { loadState } from '@nextcloud/initial-state'
38+
import { t } from '@nextcloud/l10n'
3839
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
3940
import NcActions from '@nextcloud/vue/components/NcActions'
4041
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
@@ -47,7 +48,7 @@ import {
4748
SCOPE_ENUM,
4849
SCOPE_PROPERTY_ENUM,
4950
UNPUBLISHED_READABLE_PROPERTIES,
50-
} from '../../../constants/AccountPropertyConstants.js'
51+
} from '../../../constants/AccountPropertyConstants.ts'
5152
import { savePrimaryAccountPropertyScope } from '../../../service/PersonalInfo/PersonalInfoService.js'
5253
import { handleError } from '../../../utils/handlers.ts'
5354

apps/settings/src/constants/ProfileConstants.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
/**
1+
/*
22
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
/*
7-
* SYNC to be kept in sync with `core/Db/ProfileConfig.php`
8-
*/
9-
106
import { mdiEyeOffOutline, mdiEyeOutline, mdiLoginVariant } from '@mdi/js'
7+
import { t } from '@nextcloud/l10n'
118

129
/** Enum of profile visibility constants */
1310
export const VISIBILITY_ENUM = Object.freeze({
@@ -18,6 +15,8 @@ export const VISIBILITY_ENUM = Object.freeze({
1815

1916
/**
2017
* Enum of profile visibility constants to properties
18+
*
19+
* SYNC to be kept in sync with `core/Db/ProfileConfig.php`
2120
*/
2221
export const VISIBILITY_PROPERTY_ENUM = Object.freeze({
2322
[VISIBILITY_ENUM.SHOW]: {

apps/settings/src/views/ProfileContactSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const profileEnabledGlobally = loadState('settings', 'profileEnabledGlobally', t
5252
{{ t('settings', 'Contact') }}
5353
</h3>
5454
<p class="profile-contact-settings__hint">
55-
{{ t('settings', 'Notifications will be sent to your primary email') }}
55+
{{ t('settings', 'Notifications and password reset requests will be sent to your primary email') }}
5656
</p>
5757
<EmailSection />
5858
<PhoneSection />

0 commit comments

Comments
 (0)