Merge branch 'keyeh-feat/recursive-folder'
commit
4f3c2493b9
|
@ -222,7 +222,7 @@ class ApiBase extends Controller
|
||||||
|
|
||||||
protected function isRecursive()
|
protected function isRecursive()
|
||||||
{
|
{
|
||||||
return null === $this->request->getParam('folder');
|
return null === $this->request->getParam('folder') || $this->request->getParam('recursive');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isArchive()
|
protected function isArchive()
|
||||||
|
|
|
@ -323,7 +323,10 @@ export default defineComponent({
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async routeChange(to: any, from?: any) {
|
async routeChange(to: any, from?: any) {
|
||||||
if (from?.path !== to.path) {
|
if (
|
||||||
|
from?.path !== to.path ||
|
||||||
|
JSON.stringify(from.query) !== JSON.stringify(to.query)
|
||||||
|
) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,6 +637,9 @@ export default defineComponent({
|
||||||
// Folder
|
// Folder
|
||||||
if (this.$route.name === "folders") {
|
if (this.$route.name === "folders") {
|
||||||
query.set("folder", utils.getFolderRoutePath(this.config_foldersPath));
|
query.set("folder", utils.getFolderRoutePath(this.config_foldersPath));
|
||||||
|
if (this.$route.query.recursive) {
|
||||||
|
query.set("recursive", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Archive
|
// Archive
|
||||||
|
|
|
@ -15,7 +15,21 @@
|
||||||
</NcBreadcrumbs>
|
</NcBreadcrumbs>
|
||||||
|
|
||||||
<div class="right-actions">
|
<div class="right-actions">
|
||||||
<NcActions :inline="1">
|
<NcActions :inline="2">
|
||||||
|
<NcActionRouter
|
||||||
|
:to="{ query: recursive ? {} : { recursive: '1' } }"
|
||||||
|
close-after-click
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
recursive
|
||||||
|
? t("memories", "Folder View")
|
||||||
|
: t("memories", "Timeline View")
|
||||||
|
}}
|
||||||
|
<template #icon>
|
||||||
|
<FoldersIcon v-if="recursive" :size="20" />
|
||||||
|
<TimelineIcon v-else :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcActionRouter>
|
||||||
<NcActionButton
|
<NcActionButton
|
||||||
:aria-label="t('memories', 'Share folder')"
|
:aria-label="t('memories', 'Share folder')"
|
||||||
@click="$refs.shareModal.open(false)"
|
@click="$refs.shareModal.open(false)"
|
||||||
|
@ -41,11 +55,14 @@ const NcBreadcrumb = () =>
|
||||||
import("@nextcloud/vue/dist/Components/NcBreadcrumb");
|
import("@nextcloud/vue/dist/Components/NcBreadcrumb");
|
||||||
import NcActions from "@nextcloud/vue/dist/Components/NcActions";
|
import NcActions from "@nextcloud/vue/dist/Components/NcActions";
|
||||||
import NcActionButton from "@nextcloud/vue/dist/Components/NcActionButton";
|
import NcActionButton from "@nextcloud/vue/dist/Components/NcActionButton";
|
||||||
|
import NcActionRouter from "@nextcloud/vue/dist/Components/NcActionRouter";
|
||||||
|
|
||||||
import FolderShareModal from "../modal/FolderShareModal.vue";
|
import FolderShareModal from "../modal/FolderShareModal.vue";
|
||||||
|
|
||||||
import HomeIcon from "vue-material-design-icons/Home.vue";
|
import HomeIcon from "vue-material-design-icons/Home.vue";
|
||||||
import ShareIcon from "vue-material-design-icons/ShareVariant.vue";
|
import ShareIcon from "vue-material-design-icons/ShareVariant.vue";
|
||||||
|
import TimelineIcon from "vue-material-design-icons/ImageMultiple.vue";
|
||||||
|
import FoldersIcon from "vue-material-design-icons/FolderMultiple.vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "FolderTopMatter",
|
name: "FolderTopMatter",
|
||||||
|
@ -54,13 +71,17 @@ export default defineComponent({
|
||||||
NcBreadcrumb,
|
NcBreadcrumb,
|
||||||
NcActions,
|
NcActions,
|
||||||
NcActionButton,
|
NcActionButton,
|
||||||
|
NcActionRouter,
|
||||||
FolderShareModal,
|
FolderShareModal,
|
||||||
HomeIcon,
|
HomeIcon,
|
||||||
ShareIcon,
|
ShareIcon,
|
||||||
|
TimelineIcon,
|
||||||
|
FoldersIcon,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
topMatter: null as TopMatterFolder | null,
|
topMatter: null as TopMatterFolder | null,
|
||||||
|
recursive: false,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -92,8 +113,10 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
this.recursive = this.$route.query.recursive === "1";
|
||||||
} else {
|
} else {
|
||||||
this.topMatter = null;
|
this.topMatter = null;
|
||||||
|
this.recursive = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -105,12 +128,20 @@ export default defineComponent({
|
||||||
display: flex;
|
display: flex;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.right-actions {
|
.right-actions {
|
||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep span {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -814,6 +814,7 @@ export default defineComponent({
|
||||||
if (this.$route.hash?.startsWith("#v")) {
|
if (this.$route.hash?.startsWith("#v")) {
|
||||||
this.$router.replace({
|
this.$router.replace({
|
||||||
hash: "",
|
hash: "",
|
||||||
|
query: this.$route.query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue