mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
feat(user-picker): fix eslint errors
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
bf64cb17c8
commit
668db370d2
3 changed files with 18 additions and 13 deletions
|
|
@ -5,14 +5,14 @@
|
|||
{{ t('user_picker', 'Profile picker') }}
|
||||
</h2>
|
||||
<div class="input-wrapper">
|
||||
<NcSelect ref="profiles-search-input"
|
||||
<NcSelect
|
||||
ref="profiles-search-input"
|
||||
v-model="selectedProfile"
|
||||
input-id="profiles-search"
|
||||
:loading="loading"
|
||||
:filterable="false"
|
||||
:placeholder="t('user_picker', 'Search for a user profile')"
|
||||
:clear-search-on-blur="() => false"
|
||||
:user-select="true"
|
||||
:multiple="false"
|
||||
:options="options"
|
||||
label="displayName"
|
||||
|
|
@ -30,7 +30,8 @@
|
|||
</NcEmptyContent>
|
||||
</div>
|
||||
<div class="profile-picker__footer">
|
||||
<NcButton v-if="selectedProfile !== null"
|
||||
<NcButton
|
||||
v-if="selectedProfile !== null"
|
||||
variant="primary"
|
||||
:aria-label="t('user_picker', 'Insert selected user profile link')"
|
||||
:disabled="loading || selectedProfile === null"
|
||||
|
|
@ -48,11 +49,9 @@
|
|||
import axios from '@nextcloud/axios'
|
||||
import { generateOcsUrl, generateUrl } from '@nextcloud/router'
|
||||
import debounce from 'debounce'
|
||||
|
||||
import NcSelect from '@nextcloud/vue/components/NcSelect'
|
||||
import NcButton from '@nextcloud/vue/components/NcButton'
|
||||
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
|
||||
|
||||
import NcSelect from '@nextcloud/vue/components/NcSelect'
|
||||
import AccountOutline from 'vue-material-design-icons/AccountOutline.vue'
|
||||
import ArrowRightIcon from 'vue-material-design-icons/ArrowRight.vue'
|
||||
|
||||
|
|
@ -72,6 +71,7 @@ export default {
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
|
||||
accessible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
|
@ -97,8 +97,9 @@ export default {
|
|||
}
|
||||
return []
|
||||
},
|
||||
|
||||
noResultText() {
|
||||
return this.loading ? t('user_picker', 'Searching …') : t('user_picker', 'Not found')
|
||||
return this.loading ? t('user_picker', 'Searching …') : t('user_picker', 'Not found')
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -130,7 +131,7 @@ export default {
|
|||
const url = generateOcsUrl('core/autocomplete/get?search={searchQuery}&itemType=%20&itemId=%20&shareTypes[]=0&limit=20', { searchQuery: query })
|
||||
try {
|
||||
const res = await axios.get(url)
|
||||
this.profiles = res.data.ocs.data.map(userAutocomplete => {
|
||||
this.profiles = res.data.ocs.data.map((userAutocomplete) => {
|
||||
return {
|
||||
user: userAutocomplete.id,
|
||||
displayName: userAutocomplete.label,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { registerWidget, registerCustomPickerElement, NcCustomPickerRenderResult } from '@nextcloud/vue/components/NcRichText'
|
||||
import { NcCustomPickerRenderResult, registerCustomPickerElement, registerWidget } from '@nextcloud/vue/components/NcRichText'
|
||||
|
||||
registerWidget('user_picker_profile', async (el, { richObjectType, richObject, accessible }) => {
|
||||
const { createApp } = await import('vue')
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@
|
|||
<HandshakeOutline :size="20" />
|
||||
{{ richObject.role }}
|
||||
</span>
|
||||
<span v-if="richObject.bio"
|
||||
<span
|
||||
v-if="richObject.bio"
|
||||
class="bio"
|
||||
:title="richObject.full_bio">
|
||||
<TextAccount :size="20" />
|
||||
|
|
@ -52,13 +53,12 @@
|
|||
|
||||
<script>
|
||||
import NcAvatar from '@nextcloud/vue/components/NcAvatar'
|
||||
|
||||
import AccountOutline from 'vue-material-design-icons/AccountOutline.vue'
|
||||
import MapMarkerOutline from 'vue-material-design-icons/MapMarkerOutline.vue'
|
||||
import Web from 'vue-material-design-icons/Web.vue'
|
||||
import Domain from 'vue-material-design-icons/Domain.vue'
|
||||
import HandshakeOutline from 'vue-material-design-icons/HandshakeOutline.vue'
|
||||
import MapMarkerOutline from 'vue-material-design-icons/MapMarkerOutline.vue'
|
||||
import TextAccount from 'vue-material-design-icons/TextAccount.vue'
|
||||
import Web from 'vue-material-design-icons/Web.vue'
|
||||
|
||||
export default {
|
||||
name: 'ProfilePickerReferenceWidget',
|
||||
|
|
@ -71,20 +71,24 @@ export default {
|
|||
HandshakeOutline,
|
||||
TextAccount,
|
||||
},
|
||||
|
||||
props: {
|
||||
richObjectType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
richObject: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
|
||||
accessible: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
beforeMount() {
|
||||
console.debug('ProfilePickerReferenceWidget', this.richObject)
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue