diff --git a/frontend/wizard-vue/src/components/EditUrlModal.vue b/frontend/wizard-vue/src/components/EditUrlModal.vue
index 2dcf666..ec48d50 100644
--- a/frontend/wizard-vue/src/components/EditUrlModal.vue
+++ b/frontend/wizard-vue/src/components/EditUrlModal.vue
@@ -5,6 +5,7 @@ import {type Field as FieldSpec} from "@/urlmaker/specs";
import {validateUrl} from "@/urlmaker/validators.ts";
import Btn from "@/components/Btn.vue";
import {onMounted, onUnmounted, ref, watch} from "vue";
+import Modal from "@/components/Modal.vue";
const field: FieldSpec = {
name: '',
@@ -15,18 +16,17 @@ const field: FieldSpec = {
validate: validateUrl,
}
-const {visible, modelValue} = defineProps({
- visible: Boolean,
+const visible = defineModel('visible');
+const {modelValue} = defineProps({
modelValue: {
type: String,
required: true,
}
});
-
-const emit = defineEmits(['close', 'update:modelValue']);
+const emit = defineEmits(['update:modelValue', 'update:visible']);
const url = ref(modelValue);
-watch(() => visible, () => {
+watch(visible, () => {
url.value = modelValue;
});
@@ -39,12 +39,12 @@ const accept = () => {
valid.value = field.validate(url.value).ok;
if (valid.value) {
emit('update:modelValue', url.value);
- emit('close');
+ emit('update:visible', false);
}
}
const listener = (e: KeyboardEvent) => {
- if (e.code === 'Escape') emit('close');
+ if (e.code === 'Escape') emit('update:visible', false);
if (e.code === 'Enter') accept();
};
onMounted(() => {
@@ -57,35 +57,12 @@ onUnmounted(() => {
-
-
-
+
+
+ Edit
+
diff --git a/frontend/wizard-vue/src/components/Modal.vue b/frontend/wizard-vue/src/components/Modal.vue
new file mode 100644
index 0000000..42e8a05
--- /dev/null
+++ b/frontend/wizard-vue/src/components/Modal.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
diff --git a/frontend/wizard-vue/src/pages/WizardPage.vue b/frontend/wizard-vue/src/pages/WizardPage.vue
index 7c66d58..580085d 100644
--- a/frontend/wizard-vue/src/pages/WizardPage.vue
+++ b/frontend/wizard-vue/src/pages/WizardPage.vue
@@ -18,7 +18,6 @@ watch(existingLink, async (value) => {
existingLink.value = "";
try {
store.updateSpecs(await decodeUrl(value));
- link.value = "";
} catch (e) {
console.log(e);
alert(`Decoding error: ${e}`);
@@ -58,8 +57,7 @@ function screenshot() {
Edit existing task
Reset Form
-
+