aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/client/ui/VProgressIndicator.java
diff options
context:
space:
mode:
authormlindfors <majuli@vaadin.com>2025-08-11 16:53:43 +0300
committerGitHub <noreply@github.com>2025-08-11 16:53:43 +0300
commit89e104326c9cfd0205159f804cf83aae728b0e33 (patch)
tree20ec5e67fbdaf16f65aad79038575adbf46c4adf /src/com/vaadin/terminal/gwt/client/ui/VProgressIndicator.java
parentdb4c7a160321c3871db3fc0aa33fd55bed51e2c5 (diff)
downloadvaadin-framework-master.tar.gz
vaadin-framework-master.zip
Update CHANGELOG-VAADIN7.md (#12654)HEADmaster
Added the 7.7.48 changes
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/ui/VProgressIndicator.java')
0 files changed, 0 insertions, 0 deletions
e='automated/noid/master-update-psalm-baseline'>automated/noid/master-update-psalm-baseline Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/components/AccountMenu/AccountMenuProfileEntry.vue
blob: 8b895b8ca3147c9df1562e78d48ae65977180b56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!--
  - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  - SPDX-License-Identifier: AGPL-3.0-or-later
-->

<template>
	<NcListItem :id="profileEnabled ? undefined : id"
		:anchor-id="id"
		:active="active"
		compact
		:href="profileEnabled ? href : undefined"
		:name="displayName"
		target="_self">
		<template v-if="profileEnabled" #subname>
			{{ name }}
		</template>
		<template v-if="loading" #indicator>
			<NcLoadingIcon />
		</template>
	</NcListItem>
</template>

<script lang="ts">
import { loadState } from '@nextcloud/initial-state'
import { getCurrentUser } from '@nextcloud/auth'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { defineComponent } from 'vue'

import NcListItem from '@nextcloud/vue/components/NcListItem'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'

const { profileEnabled } = loadState('user_status', 'profileEnabled', { profileEnabled: false })

export default defineComponent({
	name: 'AccountMenuProfileEntry',

	components: {
		NcListItem,
		NcLoadingIcon,
	},

	props: {
		id: {
			type: String,
			required: true,
		},
		name: {
			type: String,
			required: true,
		},
		href: {
			type: String,
			required: true,
		},
		active: {
			type: Boolean,
			required: true,
		},
	},

	setup() {
		return {
			profileEnabled,
			displayName: getCurrentUser()!.displayName,
		}
	},

	data() {
		return {
			loading: false,
		}
	},

	mounted() {
		subscribe('settings:profile-enabled:updated', this.handleProfileEnabledUpdate)
		subscribe('settings:display-name:updated', this.handleDisplayNameUpdate)
	},

	beforeDestroy() {
		unsubscribe('settings:profile-enabled:updated', this.handleProfileEnabledUpdate)
		unsubscribe('settings:display-name:updated', this.handleDisplayNameUpdate)
	},

	methods: {
		handleClick() {
			if (this.profileEnabled) {
				this.loading = true
			}
		},

		handleProfileEnabledUpdate(profileEnabled: boolean) {
			this.profileEnabled = profileEnabled
		},

		handleDisplayNameUpdate(displayName: string) {
			this.displayName = displayName
		},
	},
})
</script>