diff --git a/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue b/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue index 82f20e056d..3a9d01e4cd 100644 --- a/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue +++ b/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue @@ -16,48 +16,48 @@ {{ $t('api_test.request.assertions.add') }} @@ -67,22 +67,23 @@ + v-if="isShowJsonPathSuggest" + :open-tip="$t('api_test.request.assertions.json_path_suggest')" + :clear-tip="$t('api_test.request.assertions.json_path_clear')" + @open="suggestJsonOpen" + @clear="clearJson"/> + :is-read-only="isReadOnly" + :assertions="assertions" + :apiId="apiId" + :reloadData="reloadData" + style="margin-bottom: 20px"/> + :tip="$t('api_test.request.extract.suggest_tip')" + @addSuggest="addJsonPathSuggest" + ref="jsonpathSuggest"/> @@ -144,6 +145,10 @@ export default { isReadOnly: { type: Boolean, default: false + }, + isShowJsonPathSuggest: { + type: Boolean, + default: true } }, data() { @@ -197,9 +202,9 @@ export default { let expect = jsonItem.expect; if (expect) { expect = expect.replaceAll('\\', "\\\\").replaceAll('(', "\\(").replaceAll(')', "\\)") - .replaceAll('+', "\\+").replaceAll('.', "\\.").replaceAll('[', "\\[").replaceAll(']', "\\]") - .replaceAll('?', "\\?").replaceAll('/', "\\/").replaceAll('*', "\\*") - .replaceAll('^', "\\^").replaceAll('{', "\\{").replaceAll('}', "\\}").replaceAll('$', "\\$"); + .replaceAll('+', "\\+").replaceAll('.', "\\.").replaceAll('[', "\\[").replaceAll(']', "\\]") + .replaceAll('?', "\\?").replaceAll('/', "\\/").replaceAll('*', "\\*") + .replaceAll('^', "\\^").replaceAll('{', "\\{").replaceAll('}', "\\}").replaceAll('$', "\\$"); } jsonItem.expect = expect; this.assertions.jsonPath.push(jsonItem); diff --git a/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue b/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue index 75907ac22c..164f462d2e 100644 --- a/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue +++ b/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue @@ -63,7 +63,7 @@ - + - - +