From f3ccaa00c4590387bd864f1941f367d80a04ec23 Mon Sep 17 00:00:00 2001 From: Dominik Zborowski Date: Mon, 28 Oct 2024 13:11:43 +0100 Subject: [PATCH] Instructions toggle --- domains/grid/components/AddWidgetBasic.vue | 29 ++++++++++++++++++++++ translations/en_US.json | 1 + 2 files changed, 30 insertions(+) diff --git a/domains/grid/components/AddWidgetBasic.vue b/domains/grid/components/AddWidgetBasic.vue index 59c15ae6..cfdc9fbb 100644 --- a/domains/grid/components/AddWidgetBasic.vue +++ b/domains/grid/components/AddWidgetBasic.vue @@ -21,6 +21,7 @@ const { handleFieldChange, handleFormErrors, } = useForm(schema, (await schema?.safeParseAsync(props.properties))?.data) +const isInstructionsVisible = ref(false) const handleSave = async () => { if (!canSubmit.value) { @@ -69,6 +70,12 @@ const handleBackToSelection = () => { }, }) } + +const widgetInstructions = computed(() => { + return formatMessage(`add_widget_${props.type.toLowerCase()}_instructions`) +}) + +const hasInstructions = computed(() => widgetInstructions.value !== '-')