Skip to content

Commit 9d24207

Browse files
fix: Add option to set folder from page settings
1 parent fb656fe commit 9d24207

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

frontend/src/components/Settings/PageGeneral.vue

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@
125125
description="Prevent search engines from indexing this page"
126126
:modelValue="Boolean(store.activePage?.disable_indexing)"
127127
@update:modelValue="(val: Boolean) => store.updateActivePage('disable_indexing', val)" />
128+
<hr class="w-full border-outline-gray-2" />
129+
<div class="flex items-center justify-between">
130+
<div class="flex flex-col gap-2">
131+
<span class="text-base font-medium text-ink-gray-9">Folder</span>
132+
<p class="text-base text-ink-gray-5">Set folder to organize your page</p>
133+
</div>
134+
<div>
135+
<BuilderInput
136+
class="w-fit"
137+
type="select"
138+
:options="folderOptions"
139+
:modelValue="store.activePage?.project_folder"
140+
@update:modelValue="
141+
(val: string) => store.updateActivePage('project_folder', val)
142+
"></BuilderInput>
143+
</div>
144+
</div>
128145
</div>
129146
</div>
130147
</div>
@@ -134,8 +151,10 @@
134151
import ImageUploader from "@/components/Controls/ImageUploader.vue";
135152
import Switch from "@/components/Controls/Switch.vue";
136153
import AuthenticatedUserIcon from "@/components/Icons/AuthenticatedUser.vue";
154+
import builderProjectFolder from "@/data/builderProjectFolder";
137155
import { builderSettings } from "@/data/builderSettings";
138156
import useStore from "@/store";
157+
import { BuilderProjectFolder } from "@/types/Builder/BuilderProjectFolder";
139158
import { Button, Tooltip } from "frappe-ui";
140159
import FeatherIcon from "frappe-ui/src/components/FeatherIcon.vue";
141160
import { computed } from "vue";
@@ -146,6 +165,22 @@ const fullURL = computed(
146165
() => window.location.origin + (store.activePage?.route ? "/" + store.activePage.route : ""),
147166
);
148167
168+
const folderOptions = computed(() => {
169+
const homeOption = {
170+
label: "Home",
171+
value: "",
172+
};
173+
174+
const options = builderProjectFolder.data.map((folder: BuilderProjectFolder) => {
175+
return {
176+
label: folder.folder_name,
177+
value: folder.folder_name,
178+
};
179+
});
180+
181+
return [homeOption, ...options];
182+
});
183+
149184
const handleClick = () => {
150185
console.log("clicked");
151186
};

0 commit comments

Comments
 (0)