Skip to content

Commit 5a6fb35

Browse files
authored
Merge pull request #38655 from nextcloud/fix/loading-system-tags
2 parents 3ef53a2 + 5acbe6f commit 5a6fb35

File tree

4 files changed

+33
-22
lines changed

4 files changed

+33
-22
lines changed

apps/files/src/views/Sidebar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ export default {
470470
*/
471471
close() {
472472
this.Sidebar.file = ''
473+
this.showTags = false
473474
this.resetData()
474475
},
475476

apps/systemtags/src/components/SystemTags.vue

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,38 @@
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 */
5055
import Vue from 'vue'
56+
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
5157
import NcSelectTags from '@nextcloud/vue/dist/Components/NcSelectTags.js'
5258
5359
import { 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
},

dist/files-sidebar.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-sidebar.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)