<!--
  - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  - SPDX-License-Identifier: AGPL-3.0-or-later
-->

<template>
	<AccountPropertySection v-bind.sync="displayName"
		:placeholder="t('settings', 'Your full name')"
		autocomplete="username"
		:is-editable="displayNameChangeSupported"
		:on-validate="onValidate"
		:on-save="onSave" />
</template>

<script>
import { loadState } from '@nextcloud/initial-state'
import { emit } from '@nextcloud/event-bus'

import AccountPropertySection from './shared/AccountPropertySection.vue'

import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js'

const { displayName } = loadState('settings', 'personalInfoParameters', {})
const { displayNameChangeSupported } = loadState('settings', 'accountParameters', {})

export default {
	name: 'DisplayNameSection',

	components: {
		AccountPropertySection,
	},

	data() {
		return {
			displayName: { ...displayName, readable: NAME_READABLE_ENUM[displayName.name] },
			displayNameChangeSupported,
		}
	},

	methods: {
		onValidate(value) {
			return value !== ''
		},

		onSave(value) {
			if (oc_userconfig.avatar.generated) {
				// Update the avatar version so that avatar update handlers refresh correctly
				oc_userconfig.avatar.version = Date.now()
			}
			emit('settings:display-name:updated', value)
		},
	},
}
</script>
angeBars2'>Temp_ChangeBars2</option>
<option value='Temp_ChangingIPDHack'>Temp_ChangingIPDHack</option>
<option value='Temp_Color'>Temp_Color</option>
<option value='Temp_ComplexScripts'>Temp_ComplexScripts</option>
<option value='Temp_Floats'>Temp_Floats</option>
<option value='Temp_FontMerging'>Temp_FontMerging</option>
<option value='Temp_FopFontsForSVG'>Temp_FopFontsForSVG</option>
<option value='Temp_Gradle_Build'>Temp_Gradle_Build</option>
<option value='Temp_ImagePackageRedesign'>Temp_ImagePackageRedesign</option>
<option value='Temp_ImproveAccessibility'>Temp_ImproveAccessibility</option>
<option value='Temp_InlineContainer'>Temp_InlineContainer</option>
<option value='Temp_Interleaved_Page_Line_Breaking'>Temp_Interleaved_Page_Line_Breaking</option>
<option value='Temp_KnuthStylePageBreaking'>Temp_KnuthStylePageBreaking</option>
<option value='Temp_MergeFrom11'>Temp_MergeFrom11</option>
<option value='Temp_PCLSoftFonts'>Temp_PCLSoftFonts</option>
<option value='Temp_PDFLinearization'>Temp_PDFLinearization</option>
<option value='Temp_PDF_ObjectStreams'>Temp_PDF_ObjectStreams</option>
<option value='Temp_PDF_in_PDF'>Temp_PDF_in_PDF</option>
<option value='Temp_ProcessingFeedback'>Temp_ProcessingFeedback</option>
<option value='Temp_RoundedCorners'>Temp_RoundedCorners</option>
<option value='Temp_SpaceResolution'>Temp_SpaceResolution</option>
<option value='Temp_SurrogatePairs'>Temp_SurrogatePairs</option>
<option value='Temp_TrueTypeInPostScript'>Temp_TrueTypeInPostScript</option>
<option value='Temp_URI_Unification'>Temp_URI_Unification</option>
<option value='Temp_WhitespaceManagement'>Temp_WhitespaceManagement</option>
<option value='Temp_XGC_URI_Resolution'>Temp_XGC_URI_Resolution</option>
<option value='archive'>archive</option>
<option value='dirkx'>dirkx</option>
<option value='fop-0_14_0'>fop-0_14_0</option>
<option value='fop-0_14_0_regions'>fop-0_14_0_regions</option>
<option value='fop-0_17_0_batikSVG'>fop-0_17_0_batikSVG</option>
<option value='fop-0_20_2-maintain'>fop-0_20_2-maintain</option>
<option value='fop-0_90'>fop-0_90</option>
<option value='fop-0_91'>fop-0_91</option>
<option value='fop-0_92'>fop-0_92</option>
<option value='fop-0_93'>fop-0_93</option>
<option value='fop-0_94'>fop-0_94</option>
<option value='fop-0_95'>fop-0_95</option>
<option value='fop-1_0'>fop-1_0</option>
<option value='fop-1_1'>fop-1_1</option>
<option value='fop-1_1old'>fop-1_1old</option>
<option value='fop-1_1rc1'>fop-1_1rc1</option>
<option value='fop-2.6'>fop-2.6</option>
<option value='fop-2_0'>fop-2_0</option>
<option value='fop-2_1'>fop-2_1</option>
<option value='fop-2_10'>fop-2_10</option>
<option value='fop-2_11'>fop-2_11</option>
<option value='fop-2_2'>fop-2_2</option>
<option value='fop-2_3'>fop-2_3</option>
<option value='fop-2_4'>fop-2_4</option>
<option value='fop-2_5'>fop-2_5</option>
<option value='fop-2_6'>fop-2_6</option>
<option value='fop-2_7'>fop-2_7</option>
<option value='fop-2_8'>fop-2_8</option>
<option value='fop-2_9'>fop-2_9</option>
<option value='foray-font'>foray-font</option>
<option value='inlineblock'>inlineblock</option>
<option value='jgoncalves-pdfa-extension-fix'>jgoncalves-pdfa-extension-fix</option>
<option value='main' selected='selected'>main</option>
<option value='maven'>maven</option>
<option value='release-0-13-0'>release-0-13-0</option>
<option value='skynavga/configure-sonar-support'>skynavga/configure-sonar-support</option>
<option value='temp/ssteiner-java23'>temp/ssteiner-java23</option>
<option value='temp/ssteiner-pdfbox3'>temp/ssteiner-pdfbox3</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Apache XML Graphics FOP: https://github.com/apache/xmlgraphics-fop</td><td class='sub right'>www-data</td></tr></table>
<table class='tabs'><tr><td>
<a href='/xmlgraphics-fop.git/about/'>about</a><a href='/xmlgraphics-fop.git/'>summary</a><a href='/xmlgraphics-fop.git/refs/'>refs</a><a href='/xmlgraphics-fop.git/log/fop/lib/xmlgraphics-commons.NOTICE.txt'>log</a><a class='active' href='/xmlgraphics-fop.git/tree/fop/lib/xmlgraphics-commons.NOTICE.txt'>tree</a><a href='/xmlgraphics-fop.git/commit/fop/lib/xmlgraphics-commons.NOTICE.txt'>commit</a><a href='/xmlgraphics-fop.git/diff/fop/lib/xmlgraphics-commons.NOTICE.txt'>diff</a><a href='/xmlgraphics-fop.git/stats/fop/lib/xmlgraphics-commons.NOTICE.txt'>stats</a></td><td class='form'><form class='right' method='get' action='/xmlgraphics-fop.git/log/fop/lib/xmlgraphics-commons.NOTICE.txt'>
<select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/xmlgraphics-fop.git/tree/'>root</a>/<a href='/xmlgraphics-fop.git/tree/fop'>fop</a>/<a href='/xmlgraphics-fop.git/tree/fop/lib'>lib</a>/<a href='/xmlgraphics-fop.git/tree/fop/lib/xmlgraphics-commons.NOTICE.txt'>xmlgraphics-commons.NOTICE.txt</a></div><div class='content'>blob: 76171ea850599d149cb9931758243a69d34c1159 (<a href='/xmlgraphics-fop.git/plain/fop/lib/xmlgraphics-commons.NOTICE.txt'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
</pre></td>
<td class='lines'><pre><code>