feat(File Uploader): open file details from search

This commit is contained in:
barredterra 2023-08-18 14:06:05 +02:00
parent 06ba61ff97
commit 62e4df8a1f
2 changed files with 27 additions and 0 deletions

View file

@ -8,6 +8,16 @@
>
<div v-html="icon"></div>
<a class="tree-label">{{ node.label }}</a>
<!-- Icon open File record in new tab -->
<a
v-if="node.is_leaf"
:href="open_file(node.value)"
:disabled="node.fetching"
target="_blank"
class="file-doc-link ml-3"
>
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg>
</a>
</span>
<ul class="tree-children" v-show="node.open">
<TreeNode
@ -59,6 +69,10 @@ let icon = computed(() => {
return icons.closed;
});
let open_file = (filename) => {
return frappe.utils.get_form_link("File", filename);
};
</script>
<style scoped>

View file

@ -58,6 +58,19 @@
}
}
.tree-link .file-doc-link {
opacity: 0;
}
.tree-link:hover .file-doc-link {
opacity: 0.4;
}
.tree-link .file-doc-link:hover {
transform: scale(1.1);
opacity: 0.5;
}
.tree-hover {
background-color: var(--highlight-color);
min-height: 25px;