2222
2323<template >
2424 <div class =" system-tags" >
25- <label for =" system-tags-input" >{{ t('systemtags', 'Search or create collaborative tags') }}</label >
26- <NcSelectTags class =" system-tags__select"
27- input-id =" system-tags-input"
28- :placeholder =" t('systemtags', 'Collaborative tags …')"
29- :options =" sortedTags"
30- :value =" selectedTags"
31- :create-option =" createOption"
32- :taggable =" true"
33- :passthru =" true"
34- :fetch-tags =" false"
35- :loading =" loading"
36- @input =" handleInput"
37- @option:selected =" handleSelect"
38- @option:created =" handleCreate"
39- @option:deselected =" handleDeselect" >
40- <template #no-options >
41- {{ t('systemtags', 'No tags to select, type to create a new tag') }}
42- </template >
43- </NcSelectTags >
25+ <NcLoadingIcon v-if =" loadingTags"
26+ :name =" t('systemtags', 'Loading collaborative tags …')"
27+ :size =" 32" />
28+ <template v-else >
29+ <label for =" system-tags-input" >{{ t('systemtags', 'Search or create collaborative tags') }}</label >
30+ <NcSelectTags class =" system-tags__select"
31+ input-id =" system-tags-input"
32+ :placeholder =" t('systemtags', 'Collaborative tags …')"
33+ :options =" sortedTags"
34+ :value =" selectedTags"
35+ :create-option =" createOption"
36+ :taggable =" true"
37+ :passthru =" true"
38+ :fetch-tags =" false"
39+ :loading =" loading"
40+ @input =" handleInput"
41+ @option:selected =" handleSelect"
42+ @option:created =" handleCreate"
43+ @option:deselected =" handleDeselect" >
44+ <template #no-options >
45+ {{ t('systemtags', 'No tags to select, type to create a new tag') }}
46+ </template >
47+ </NcSelectTags >
48+ </template >
4449 </div >
4550</template >
4651
4752<script lang="ts">
4853// FIXME Vue TypeScript ESLint errors
4954/* eslint-disable */
5055import Vue from ' vue'
56+ import NcLoadingIcon from ' @nextcloud/vue/dist/Components/NcLoadingIcon.js'
5157import NcSelectTags from ' @nextcloud/vue/dist/Components/NcSelectTags.js'
5258
5359import { translate as t } from ' @nextcloud/l10n'
@@ -74,6 +80,7 @@ export default Vue.extend({
7480 name: ' SystemTags' ,
7581
7682 components: {
83+ NcLoadingIcon ,
7784 NcSelectTags ,
7885 },
7986
@@ -88,6 +95,7 @@ export default Vue.extend({
8895 return {
8996 sortedTags: [] as TagWithId [],
9097 selectedTags: [] as TagWithId [],
98+ loadingTags: false ,
9199 loading: false ,
92100 }
93101 },
@@ -123,12 +131,14 @@ export default Vue.extend({
123131 fileId: {
124132 immediate: true ,
125133 async handler() {
134+ this .loadingTags = true
126135 try {
127136 this .selectedTags = await fetchSelectedTags (this .fileId )
128137 this .$emit (' has-tags' , this .selectedTags .length > 0 )
129138 } catch (error ) {
130139 showError (t (' systemtags' , ' Failed to load selected tags' ))
131140 }
141+ this .loadingTags = false
132142 },
133143 },
134144 },
0 commit comments