feat: indicate global variable

This commit is contained in:
liyasthomas
2022-02-22 12:55:19 +05:30
parent be1bb520a0
commit afc109965a
3 changed files with 47 additions and 18 deletions

View File

@@ -59,6 +59,20 @@
</p> </p>
</div> </div>
</div> </div>
<HttpTestResultEnv
v-for="(env, index) in testResults.envDiff.global.additions"
:key="`env-${env.key}-${index}`"
:env="env"
status="additions"
global
/>
<HttpTestResultEnv
v-for="(env, index) in testResults.envDiff.global.updations"
:key="`env-${env.key}-${index}`"
:env="env"
status="updations"
global
/>
<HttpTestResultEnv <HttpTestResultEnv
v-for="(env, index) in testResults.envDiff.selected.additions" v-for="(env, index) in testResults.envDiff.selected.additions"
:key="`env-${env.key}-${index}`" :key="`env-${env.key}-${index}`"

View File

@@ -1,5 +1,6 @@
<template> <template>
<div class="flex items-center px-4 py-2"> <div class="flex items-center justify-between px-4 py-2">
<div class="flex items-center">
<i <i
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
class="mr-4 material-icons cursor-help" class="mr-4 material-icons cursor-help"
@@ -18,6 +19,13 @@
{{ ` \xA0 \xA0 ${env.previousValue}` }} {{ ` \xA0 \xA0 ${env.previousValue}` }}
</span> </span>
</div> </div>
<span
v-if="global"
class="bg-accentLight px-1 rounded text-accentContrast text-tiny"
>
Global
</span>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -31,9 +39,12 @@ type Props = {
previousValue?: string previousValue?: string
} }
status: Status status: Status
global: boolean
} }
defineProps<Props>() withDefaults(defineProps<Props>(), {
global: false,
})
const t = useI18n() const t = useI18n()

View File

@@ -24,7 +24,11 @@
:label="$t('test.results')" :label="$t('test.results')"
:indicator=" :indicator="
testResults && testResults &&
(testResults.expectResults.length || testResults.tests.length) (testResults.expectResults.length ||
testResults.tests.length ||
testResults.envDiff.selected.additions.length ||
testResults.envDiff.selected.updations.length ||
testResults.envDiff.global.updations.length)
? true ? true
: false : false
" "