Skip to content

Commit ddd6b1d

Browse files
author
antoine
committed
cleanup
1 parent 669086c commit ddd6b1d

File tree

7 files changed

+16
-21
lines changed

7 files changed

+16
-21
lines changed

resources/js/Pages/Form/Form.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959

6060
<SharpForm
6161
:form="form"
62-
:entity-key="entityKey"
63-
:instance-id="instanceId"
6462
:show-error-alert="Object.values(props.errors).length > 0"
6563
@submit="submit"
6664
>

resources/js/commands/components/CommandFormModal.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
<div>
4949
<SharpForm
5050
:post-fn="(data) => commands.postForm(data)"
51-
:entity-key="commands.state.currentCommandEndpoints.entityKey"
52-
:instance-id="commands.state.currentCommandEndpoints.instanceId"
5351
:form="commands.state.currentCommandForm"
5452
@loading="(loading) => commands.state.currentCommandFormLoading = loading"
5553
:key="`form-${currentFormUpdatedKey}`"

resources/js/form/components/Form.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
2323
const props = defineProps<{
2424
form: Form
25-
entityKey: string,
26-
instanceId?: string | number,
2725
inline?: boolean,
2826
postFn?: (data: FormData['data']) => Promise<ApiResponse<any>>,
2927
showErrorAlert?: boolean,

resources/js/form/components/fields/editor/Editor.vue

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,21 @@
183183
<EditorContent :editor="editor" :key="locale ?? 'editor'" />
184184
</EditorAttributes>
185185

186-
<EditorUploadModal
187-
:field="field"
188-
:editor="editor"
189-
ref="uploadModal"
190-
/>
186+
<template v-if="props.field.uploads">
187+
<EditorUploadModal
188+
:field="field"
189+
:editor="editor"
190+
ref="uploadModal"
191+
/>
192+
</template>
191193

192-
<EditorEmbedModal
193-
:editor="editor"
194-
:field="field"
195-
ref="embedModal"
196-
/>
194+
<template v-if="props.field.embeds">
195+
<EditorEmbedModal
196+
:editor="editor"
197+
:field="field"
198+
ref="embedModal"
199+
/>
200+
</template>
197201

198202
<!-- Commenting this for now because it causes infinite loop on HMR -->
199203

resources/js/form/components/fields/editor/extensions/embed/EditorEmbedModal.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474
</DialogHeader>
7575

7676
<SharpForm
77-
:entity-key="parentForm.entityKey"
78-
:instance-id="parentForm.instanceId"
7977
:form="modalEmbed?.form"
8078
:post-fn="postForm"
8179
inline

resources/js/types/generated.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export type EmbedData = {
108108
tag: string;
109109
icon: IconData | null;
110110
attributes: Array<string>;
111-
template: string;
112111
fields: { [key: string]: FormFieldData };
113112
};
114113
export type EmbedFormData = {
@@ -334,7 +333,7 @@ export type FormEditorFieldData = {
334333
markdown: boolean;
335334
inline: boolean;
336335
showCharacterCount: boolean;
337-
uploads: FormEditorFieldUploadData;
336+
uploads: FormEditorFieldUploadData | null;
338337
embeds: { [embedKey: string]: EmbedData };
339338
toolbar: Array<FormEditorToolbarButton>;
340339
maxHeight: number | null;

src/Data/Form/Fields/FormEditorFieldData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(
2929
public bool $markdown,
3030
public bool $inline,
3131
public bool $showCharacterCount,
32-
#[TypeScriptType(FormEditorFieldUploadData::class)]
32+
#[LiteralTypeScriptType('FormEditorFieldUploadData | null')]
3333
public ?array $uploads = null,
3434
#[LiteralTypeScriptType('{ [embedKey:string]:EmbedData }')]
3535
public ?array $embeds = null,

0 commit comments

Comments
 (0)