Skip to content

Commit aa23493

Browse files
committed
feat: #135 add support for generated secrets in templates
1 parent 82c0687 commit aa23493

File tree

6 files changed

+293
-50
lines changed

6 files changed

+293
-50
lines changed

Diff for: package-lock.json

+65
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
},
2929
"dependencies": {
3030
"dayjs": "^1.11.11",
31+
"handlebars": "^4.7.8",
32+
"lodash.set": "^4.3.2",
3133
"swrv": "^1.0.4"
3234
},
3335
"lint-staged": {

Diff for: resources/js/Pages/Services/Create.vue

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
<script setup>
2-
import InputError from "@/Components/InputError.vue";
3-
import InputLabel from "@/Components/InputLabel.vue";
42
import PrimaryButton from "@/Components/PrimaryButton.vue";
53
import AppLayout from "@/Layouts/AppLayout.vue";
6-
import TextInput from "@/Components/TextInput.vue";
74
import ActionSection from "@/Components/ActionSection.vue";
85
import { useForm } from "@inertiajs/vue3";
9-
import FormField from "@/Components/FormField.vue";
10-
import Select from "@/Components/Select.vue";
116
import SecondaryButton from "@/Components/SecondaryButton.vue";
12-
import TextArea from "@/Components/TextArea.vue";
13-
import { computed, effect, reactive } from "vue";
7+
import { reactive } from "vue";
148
import ServiceDetailsForm from "@/Pages/Services/Partials/ServiceDetailsForm.vue";
159
import DeploymentData from "@/Pages/Services/Partials/DeploymentData.vue";
1610
import TemplatePicker from "@/Pages/Services/Partials/TemplatePicker.vue";

Diff for: resources/js/Pages/Services/Partials/DynamicForm.vue

+49-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { computed } from "vue";
2+
import { computed, effect, ref } from "vue";
33
import TextInput from "@/Components/TextInput.vue";
44
import TextArea from "@/Components/TextArea.vue";
55
import FormField from "@/Components/FormField.vue";
@@ -12,12 +12,14 @@ const props = defineProps({
1212
});
1313
1414
const itemName = computed(() => {
15-
if (props.scope) {
16-
return `${props.scope}/${props.item.name}`;
17-
}
18-
19-
return props.item.name;
15+
return `${props.scope}/${props.item.name}`;
2016
});
17+
18+
const isCollapsibleOpen = ref(false);
19+
20+
const toggleCollapsible = () => {
21+
isCollapsibleOpen.value = !isCollapsibleOpen.value;
22+
};
2123
</script>
2224

2325
<template>
@@ -43,6 +45,47 @@ const itemName = computed(() => {
4345
</template>
4446
</div>
4547

48+
<div
49+
v-else-if="item.type === 'collapsible'"
50+
class="w-full my-2"
51+
v-auto-animate
52+
>
53+
<button
54+
@click="toggleCollapsible"
55+
class="flex items-center text-sm font-medium text-gray-700 hover:text-gray-900"
56+
>
57+
<span class="w-full nowrap">{{
58+
item.label || "Advanced Options"
59+
}}</span>
60+
<svg
61+
:class="{ 'rotate-180': isCollapsibleOpen }"
62+
class="w-5 h-5 transition-transform duration-200"
63+
xmlns="http://www.w3.org/2000/svg"
64+
viewBox="0 0 20 20"
65+
fill="currentColor"
66+
>
67+
<path
68+
fill-rule="evenodd"
69+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
70+
clip-rule="evenodd"
71+
/>
72+
</svg>
73+
</button>
74+
<div v-if="isCollapsibleOpen" class="mt-2 flex flex-col gap-4">
75+
<template
76+
v-for="subItem in item.items"
77+
:key="'collapsible-' + subItem.id"
78+
>
79+
<DynamicForm
80+
:item="subItem"
81+
:form="form"
82+
:errors="errors"
83+
:scope="scope"
84+
/>
85+
</template>
86+
</div>
87+
</div>
88+
4689
<template v-else>
4790
<FormField class="w-full" :error="errors[itemName]">
4891
<template #label>{{ item.label }}</template>

0 commit comments

Comments
 (0)