refactor(ui): improved empty state for env variables and response sections
This commit is contained in:
@@ -88,6 +88,26 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="vars.length === 0"
|
||||
class="
|
||||
flex flex-col
|
||||
text-secondaryLight
|
||||
p-4
|
||||
items-center
|
||||
justify-center
|
||||
"
|
||||
>
|
||||
<i class="opacity-75 pb-2 material-icons">layers</i>
|
||||
<span class="text-center pb-4">
|
||||
{{ $t("environments_empty") }}
|
||||
</span>
|
||||
<ButtonSecondary
|
||||
:label="$t('add_new')"
|
||||
outline
|
||||
@click.native="addEnvironmentVariable"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -24,39 +24,41 @@
|
||||
{{ environment.name }}
|
||||
</span>
|
||||
</span>
|
||||
<tippy
|
||||
ref="options"
|
||||
interactive
|
||||
tabindex="-1"
|
||||
trigger="click"
|
||||
theme="popover"
|
||||
arrow
|
||||
>
|
||||
<template #trigger>
|
||||
<ButtonSecondary
|
||||
v-tippy="{ theme: 'tooltip' }"
|
||||
:title="$t('more')"
|
||||
icon="more_vert"
|
||||
<span>
|
||||
<tippy
|
||||
ref="options"
|
||||
interactive
|
||||
tabindex="-1"
|
||||
trigger="click"
|
||||
theme="popover"
|
||||
arrow
|
||||
>
|
||||
<template #trigger>
|
||||
<ButtonSecondary
|
||||
v-tippy="{ theme: 'tooltip' }"
|
||||
:title="$t('more')"
|
||||
icon="more_vert"
|
||||
/>
|
||||
</template>
|
||||
<SmartItem
|
||||
icon="create"
|
||||
:label="$t('edit')"
|
||||
@click.native="
|
||||
$emit('edit-environment')
|
||||
$refs.options.tippy().hide()
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
<SmartItem
|
||||
icon="create"
|
||||
:label="$t('edit')"
|
||||
@click.native="
|
||||
$emit('edit-environment')
|
||||
$refs.options.tippy().hide()
|
||||
"
|
||||
/>
|
||||
<SmartItem
|
||||
icon="delete"
|
||||
color="red"
|
||||
:label="$t('delete')"
|
||||
@click.native="
|
||||
confirmRemove = true
|
||||
$refs.options.tippy().hide()
|
||||
"
|
||||
/>
|
||||
</tippy>
|
||||
<SmartItem
|
||||
icon="delete"
|
||||
color="red"
|
||||
:label="$t('delete')"
|
||||
@click.native="
|
||||
confirmRemove = true
|
||||
$refs.options.tippy().hide()
|
||||
"
|
||||
/>
|
||||
</tippy>
|
||||
</span>
|
||||
<SmartConfirmModal
|
||||
:show="confirmRemove"
|
||||
:title="$t('are_you_sure_remove_environment')"
|
||||
|
||||
@@ -9,10 +9,29 @@
|
||||
justify-center
|
||||
"
|
||||
>
|
||||
<i class="opacity-75 pb-2 material-icons">send</i>
|
||||
<span class="text-center pb-4">
|
||||
{{ $t("waiting_send_req") }}
|
||||
</span>
|
||||
<div class="flex space-x-2 pb-8">
|
||||
<div class="flex flex-col space-y-4 items-end">
|
||||
<span class="flex flex-1 items-center">{{ $t("send_request") }}</span>
|
||||
<span class="flex flex-1 items-center">{{
|
||||
$t("reset_request")
|
||||
}}</span>
|
||||
<span class="flex flex-1 items-center"> Show all Shortcuts </span>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-4">
|
||||
<div class="flex">
|
||||
<span class="shortcut-key">{{ getSpecialKey() }}</span>
|
||||
<span class="shortcut-key">G</span>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<span class="shortcut-key">{{ getSpecialKey() }}</span>
|
||||
<span class="shortcut-key">I</span>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<span class="shortcut-key">{{ getSpecialKey() }}</span>
|
||||
<span class="shortcut-key">?</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ButtonSecondary
|
||||
:label="$t('documentation')"
|
||||
to="https://docs.hoppscotch.io"
|
||||
@@ -48,6 +67,7 @@
|
||||
|
||||
<script>
|
||||
import findStatusGroup from "~/helpers/findStatusGroup"
|
||||
import { getPlatformSpecialKey } from "~/helpers/platformutils"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -61,5 +81,19 @@ export default {
|
||||
return findStatusGroup(this.response.statusCode)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getSpecialKey: getPlatformSpecialKey,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.shortcut-key {
|
||||
@apply bg-dividerLight;
|
||||
@apply rounded;
|
||||
@apply ml-2;
|
||||
@apply py-1;
|
||||
@apply px-2;
|
||||
@apply inline-flex;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user