diff --git a/pages/form-builder/manage.vue b/pages/form-builder/manage.vue index 0bf7148..de2100d 100644 --- a/pages/form-builder/manage.vue +++ b/pages/form-builder/manage.vue @@ -47,65 +47,71 @@
-
-
- - - +
+
+
+ + + +
+ +
+ +
+ +
+ +
+ +
+ + + Clear + + + + + Refresh + +
- -
- -
- -
- - -
- -
- - - - Clear Filters - - - - - Refresh - -
@@ -116,133 +122,115 @@
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionCategoryGroupCreatedLast UpdatedActions
-
- -

- {{ searchQuery ? 'No forms match your search' : 'No forms found' }} -

-

- {{ searchQuery ? 'Try adjusting your search terms' : 'Create your first form to get started' }} -

- - -
-
Search: "{{ searchQuery }}"
-
- -
- - - Clear Filters - - - - Create New Form - -
+ +
+
+
+
+
+

{{ form.name || 'Untitled Form' }}

+
+ + {{ form.category }} + + + {{ form.group }} +
-
-
{{ form.name || 'Untitled Form' }}
-
ID: {{ form.id }}
-
-
-
- {{ form.description }} -
-
- No description -
-
-
-
- - {{ form.category }} - -
-
No category
-
-
- - {{ form.group }} - -
-
No group
-
-
{{ formatDate(form.createdAt) }}
-
-
{{ formatDate(form.updatedAt) }}
-
-
- - - - - - - +
+ +

+ {{ form.description || 'No description available' }} +

+ +
+
+ + ID: {{ form.id }}
-
+
+ + Created {{ formatDate(form.createdAt) }} +
+
+ + Updated {{ formatDate(form.updatedAt) }} +
+
+
+ +
+ + + + + + + +
+ + + + + +
+ +

+ {{ hasActiveFilters ? 'No forms match your filters' : 'No forms found' }} +

+

+ {{ hasActiveFilters ? 'Try adjusting your search or filter criteria' : 'Create your first form to get started' }} +

+ + +
+
Search: "{{ searchQuery }}"
+
Category: {{ selectedCategory }}
+
Group: {{ selectedGroup }}
+
+ +
+ + + Clear Filters + + + + Create New Form + +
@@ -541,18 +529,17 @@ const duplicateForm = async (form) => { loading.value = true; const newName = `${form.name || 'Form'} (Copy)`; - // Create a copy of the form - const duplicatedForm = { - ...form, - id: null, // Will get new ID when saved - name: newName, - createdAt: new Date().toISOString(), - updatedAt: new Date().toISOString() - }; - - // Load the original form, duplicate it, and save as new + // Load the original form first await formStore.loadForm(form.id); + + // Clear the current form ID to ensure a new form is created + formStore.currentFormId = null; + + // Update the form name for the duplicate formStore.setFormName(newName); + + // Mark as having unsaved changes and save as new form + formStore.hasUnsavedChanges = true; await formStore.saveForm(); // Refresh the form list @@ -923,9 +910,17 @@ const closeImportModal = () => {