From 902aecf4f0f6e1d918f2d869f677070bf7aea63c Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Sun, 30 Jan 2022 17:55:35 +0530 Subject: [PATCH] feat: expand overflow error warning --- .../components/environments/Edit.vue | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/hoppscotch-app/components/environments/Edit.vue b/packages/hoppscotch-app/components/environments/Edit.vue index 2bda3f7d5..48bdc6fb7 100644 --- a/packages/hoppscotch-app/components/environments/Edit.vue +++ b/packages/hoppscotch-app/components/environments/Edit.vue @@ -41,6 +41,12 @@ /> +
+ {{ $t("environment.nested_overflow") }} +
import clone from "lodash/clone" import { computed, defineComponent, PropType } from "@nuxtjs/composition-api" +import * as E from "fp-ts/Either" import { Environment, getEnviroment, @@ -124,6 +131,7 @@ import { setGlobalEnvVariables, updateEnvironment, } from "~/newstore/environments" +import { parseTemplateStringE } from "~/helpers/templating" export default defineComponent({ props: { @@ -158,6 +166,22 @@ export default defineComponent({ clearIcon: "trash-2", } }, + computed: { + evnExpandError(): boolean { + for (const variable of this.vars) { + const result = parseTemplateStringE( + variable.value, + this.workingEnv?.variables ?? [] + ) + + if (E.isLeft(result)) { + console.error("error", result.left) + return true + } + } + return false + }, + }, watch: { show() { this.name = this.workingEnv?.name ?? null