summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2023-09-17 14:31:48 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2023-09-18 12:43:28 +0000
commitcdc2529c4dbc076871f47c203a04e020f7f068b0 (patch)
treeae0a0557c2f8063b45c5f775cf3c8bf22dcdeb55 /apps
parent9ea97430119626d70481f79e461ca87ad489c84a (diff)
downloadnextcloud-server-cdc2529c4dbc076871f47c203a04e020f7f068b0.tar.gz
nextcloud-server-cdc2529c4dbc076871f47c203a04e020f7f068b0.zip
fix(files): CustomElementRender $el replacement bug
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/components/CustomElementRender.vue9
-rw-r--r--apps/files/src/components/FileEntry.vue2
-rw-r--r--apps/files/src/components/FilesListVirtual.vue5
-rw-r--r--apps/systemtags/src/actions/inlineSystemTagsAction.spec.ts20
-rw-r--r--apps/systemtags/src/actions/inlineSystemTagsAction.ts18
5 files changed, 45 insertions, 9 deletions
diff --git a/apps/files/src/components/CustomElementRender.vue b/apps/files/src/components/CustomElementRender.vue
index 62e33b06acf..66774bb52a0 100644
--- a/apps/files/src/components/CustomElementRender.vue
+++ b/apps/files/src/components/CustomElementRender.vue
@@ -59,14 +59,11 @@ export default {
},
methods: {
async updateRootElement() {
- const span = document.createElement('span') as HTMLSpanElement
- this.$el.replaceWith(span)
- this.$el = span
-
const element = await this.render(this.source, this.currentView)
if (element) {
- this.$el.replaceWith(element)
- this.$el = element
+ this.$el.replaceChildren(element)
+ } else {
+ this.$el.replaceChildren()
}
},
},
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 9ba85709b15..30ab98c9dc6 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -25,7 +25,7 @@
data-cy-files-list-row
:data-cy-files-list-row-fileid="fileid"
:data-cy-files-list-row-name="source.basename"
- class="list__row"
+ class="files-list__row"
@contextmenu="onRightClick">
<!-- Failed indicator -->
<span v-if="source.attributes.failed" class="files-list__row--failed" />
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index 9ea7dfc569f..ace8d87fc8c 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -309,9 +309,12 @@ export default Vue.extend({
}
}
- .files-list__row{
+ .files-list__row {
&:hover, &:focus, &:active, &--active {
background-color: var(--color-background-dark);
+ > * {
+ --color-border: var(--color-border-dark);
+ }
// Hover state of the row should also change the favorite markers background
.favorite-marker-icon svg path {
stroke: var(--color-background-dark);
diff --git a/apps/systemtags/src/actions/inlineSystemTagsAction.spec.ts b/apps/systemtags/src/actions/inlineSystemTagsAction.spec.ts
index 0910a6039dd..e3ddcea203f 100644
--- a/apps/systemtags/src/actions/inlineSystemTagsAction.spec.ts
+++ b/apps/systemtags/src/actions/inlineSystemTagsAction.spec.ts
@@ -43,8 +43,26 @@ describe('Inline system tags action conditions tests', () => {
expect(action.displayName([file], view)).toBe('')
expect(action.iconSvgInline([], view)).toBe('')
expect(action.default).toBeUndefined()
- expect(action.enabled).toBeUndefined()
+ expect(action.enabled).toBeDefined()
expect(action.order).toBe(0)
+ expect(action.enabled!([file], view)).toBe(false)
+ })
+
+ test('Enabled with valid system tags', () => {
+ const file = new File({
+ id: 1,
+ source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
+ owner: 'admin',
+ mime: 'text/plain',
+ permissions: Permission.ALL,
+ attributes: {
+ 'system-tags': {
+ 'system-tag': 'Confidential',
+ },
+ },
+ })
+
+ expect(action.enabled!([file], view)).toBe(true)
})
})
diff --git a/apps/systemtags/src/actions/inlineSystemTagsAction.ts b/apps/systemtags/src/actions/inlineSystemTagsAction.ts
index c92b5cbe13b..8d99502a5b2 100644
--- a/apps/systemtags/src/actions/inlineSystemTagsAction.ts
+++ b/apps/systemtags/src/actions/inlineSystemTagsAction.ts
@@ -50,6 +50,24 @@ export const action = new FileAction({
id: 'system-tags',
displayName: () => '',
iconSvgInline: () => '',
+
+ enabled(nodes: Node[]) {
+ // Only show the action on single nodes
+ if (nodes.length !== 1) {
+ return false
+ }
+
+ const node = nodes[0]
+ const tags = getNodeSystemTags(node)
+
+ // Only show the action if the node has system tags
+ if (tags.length === 0) {
+ return false
+ }
+
+ return true
+ },
+
exec: async () => null,
async renderInline(node: Node) {