refactor: request section

This commit is contained in:
liyasthomas
2021-07-10 18:45:39 +05:30
parent c7062ad613
commit d94c8aec51
17 changed files with 2461 additions and 2307 deletions

View File

@@ -54,7 +54,7 @@ html {
body { body {
@apply bg-primary; @apply bg-primary;
@apply text-secondary; @apply text-secondary;
@apply text-sm; @apply !text-sm;
@apply font-medium; @apply font-medium;
@apply select-none; @apply select-none;
@apply overflow-x-hidden; @apply overflow-x-hidden;
@@ -168,14 +168,15 @@ hr {
@apply w-full; @apply w-full;
@apply px-4; @apply px-4;
@apply py-2; @apply py-2;
@apply bg-primaryLight; @apply bg-primary;
@apply truncate; @apply truncate;
@apply rounded-lg; @apply rounded-lg;
@apply font-semibold; @apply font-semibold;
@apply border-2;
@apply border-divider;
@apply transition;
@apply focus:outline-none; @apply focus:outline-none;
@apply focus-visible:ring; @apply focus:border-accent;
@apply focus-visible:ring-inset;
@apply focus-visible:ring-accent;
} }
.input[type="file"], .input[type="file"],

View File

@@ -20,7 +20,6 @@ export default {
return { return {
primaryNavigation: [ primaryNavigation: [
{ target: "index", icon: "home", title: "Home" }, { target: "index", icon: "home", title: "Home" },
{ target: "api", icon: "apps", title: "APIs" },
{ target: "realtime", icon: "language", title: "Realtime" }, { target: "realtime", icon: "language", title: "Realtime" },
{ target: "graphql", icon: "code", title: "GraphQL" }, { target: "graphql", icon: "code", title: "GraphQL" },
{ target: "doc", icon: "book", title: "Docs" }, { target: "doc", icon: "book", title: "Docs" },

View File

@@ -25,6 +25,7 @@
py-3 py-3
focus:outline-none focus:outline-none
border-b border-dividerLight border-b border-dividerLight
font-medium
bg-primaryLight bg-primaryLight
" "
@change="updateSelectedTeam(myTeams[$event.target.value])" @change="updateSelectedTeam(myTeams[$event.target.value])"

View File

@@ -43,6 +43,7 @@
<span class="truncate"> {{ request.name }} </span> <span class="truncate"> {{ request.name }} </span>
</span> </span>
<ButtonSecondary <ButtonSecondary
v-if="!savingMode"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
icon="replay" icon="replay"
:title="$t('restore')" :title="$t('restore')"

View File

@@ -1,6 +1,13 @@
<template> <template>
<AppSection label="collections"> <AppSection
<div class="flex flex-col sticky top-10 z-10 bg-primary"> label="collections"
class=""
:class="{ 'rounded-lg border-2 border-divider': savingMode }"
>
<div
class="flex flex-col sticky top-10 z-10"
:class="{ 'bg-primary': !savingMode }"
>
<input <input
v-if="showCollActions" v-if="showCollActions"
v-model="filterText" v-model="filterText"
@@ -12,6 +19,7 @@
text-xs text-xs
border-b border-dividerLight border-b border-dividerLight
flex flex-1 flex flex-1
font-medium
bg-primaryLight bg-primaryLight
focus:outline-none focus:outline-none
" "

View File

@@ -1,6 +1,12 @@
<template> <template>
<AppSection label="collections"> <AppSection
<div class="flex flex-col sticky top-10 z-10 bg-primary"> label="collections"
:class="{ 'rounded-lg border-2 border-divider': saveRequest }"
>
<div
class="flex flex-col sticky top-10 z-10"
:class="{ 'bg-primary': !saveRequest }"
>
<input <input
v-if="!saveRequest" v-if="!saveRequest"
v-model="filterText" v-model="filterText"
@@ -12,6 +18,7 @@
text-xs text-xs
border-b border-dividerLight border-b border-dividerLight
flex flex-1 flex flex-1
font-medium
bg-primaryLight bg-primaryLight
focus:outline-none focus:outline-none
" "

View File

@@ -51,6 +51,7 @@
<span class="truncate"> {{ request.name }} </span> <span class="truncate"> {{ request.name }} </span>
</span> </span>
<ButtonSecondary <ButtonSecondary
v-if="!saveRequest"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
icon="replay" icon="replay"
:title="$t('restore')" :title="$t('restore')"

View File

@@ -44,6 +44,7 @@
<span class="truncate"> {{ request.name }} </span> <span class="truncate"> {{ request.name }} </span>
</span> </span>
<ButtonSecondary <ButtonSecondary
v-if="!saveRequest"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
icon="replay" icon="replay"
:title="$t('restore')" :title="$t('restore')"

View File

@@ -13,6 +13,7 @@
py-3 py-3
focus:outline-none focus:outline-none
border-b border-dividerLight border-b border-dividerLight
font-medium
bg-primaryLight bg-primaryLight
" "
> >

View File

@@ -13,7 +13,15 @@
<input <input
v-model="filterText" v-model="filterText"
type="search" type="search"
class="px-4 py-3 text-xs flex flex-1 bg-primaryLight focus:outline-none" class="
px-4
py-3
text-xs
flex flex-1
font-medium
bg-primaryLight
focus:outline-none
"
:placeholder="$t('search')" :placeholder="$t('search')"
/> />
<ButtonSecondary <ButtonSecondary

View File

@@ -1,24 +1,24 @@
<template> <template>
<AppSection label="parameters"> <AppSection label="parameters">
<ul v-if="params.length !== 0"> <div
<li> v-if="params.length !== 0"
<div class="flex flex-1"> class="flex flex-1 items-center justify-between pl-4"
<label for="paramList">{{ $t("parameter_list") }}</label> >
<div> <label for="paramList" class="font-semibold text-xs">
<ButtonSecondary {{ $t("parameter_list") }}
v-tippy="{ theme: 'tooltip' }" </label>
:title="$t('clear')" <ButtonSecondary
icon="clear_all" v-tippy="{ theme: 'tooltip' }"
@click.native="clearContent('parameters', $event)" :title="$t('clear')"
/> icon="clear_all"
</div> @click.native="clearContent('parameters', $event)"
</div> />
</li> </div>
</ul> <div
<ul
v-for="(param, index) in params" v-for="(param, index) in params"
:key="index" :key="index"
class=" class="
flex
border-b border-dashed border-b border-dashed
divide-y divide-y
md:divide-x md:divide-x
@@ -28,39 +28,62 @@
" "
:class="{ 'border-t': index == 0 }" :class="{ 'border-t': index == 0 }"
> >
<li> <input
<input class="
class="input" px-4
:placeholder="$t('parameter_count', { count: index + 1 })" py-3
:name="'param' + index" text-xs
:value="param.key" flex flex-1
autofocus font-semibold
@change=" bg-primaryLight
$store.commit('setKeyParams', { focus:outline-none
index, "
value: $event.target.value, :placeholder="$t('parameter_count', { count: index + 1 })"
}) :name="'param' + index"
" :value="param.key"
/> autofocus
</li> @change="
<li> $store.commit('setKeyParams', {
<input index,
class="input" value: $event.target.value,
:placeholder="$t('value_count', { count: index + 1 })" })
:name="'value' + index" "
:value="param.value" />
@change=" <input
$store.commit('setValueParams', { class="
index, px-4
value: $event.target.value, py-3
}) text-xs
" flex flex-1
/> font-semibold
</li> bg-primaryLight
<li> focus:outline-none
"
:placeholder="$t('value_count', { count: index + 1 })"
:name="'value' + index"
:value="param.value"
@change="
$store.commit('setValueParams', {
index,
value: $event.target.value,
})
"
/>
<div class="flex relative">
<span class="select-wrapper"> <span class="select-wrapper">
<select <select
class="select" class="
flex
w-full
px-4
text-xs
py-3
mr-8
focus:outline-none
border-b border-dividerLight
font-medium
bg-primaryLight
"
:name="'type' + index" :name="'type' + index"
@change=" @change="
$store.commit('setTypeParams', { $store.commit('setTypeParams', {
@@ -77,54 +100,49 @@
</option> </option>
</select> </select>
</span> </span>
</li>
<div>
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="
param.hasOwnProperty('active')
? param.active
? $t('turn_off')
: $t('turn_on')
: $t('turn_off')
"
:icon="
param.hasOwnProperty('active')
? param.active
? 'check_box'
: 'check_box_outline_blank'
: 'check_box'
"
@click.native="
$store.commit('setActiveParams', {
index,
value: param.hasOwnProperty('active') ? !param.active : false,
})
"
/>
</li>
</div> </div>
<div> <div>
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')"
icon="delete"
@click.native="removeRequestParam(index)"
/>
</li>
</div>
</ul>
<ul>
<li>
<ButtonSecondary <ButtonSecondary
icon="add" v-tippy="{ theme: 'tooltip' }"
:label="$t('add_new')" :title="
@click.native="addRequestParam" param.hasOwnProperty('active')
? param.active
? $t('turn_off')
: $t('turn_on')
: $t('turn_off')
"
:icon="
param.hasOwnProperty('active')
? param.active
? 'check_box'
: 'check_box_outline_blank'
: 'check_box'
"
@click.native="
$store.commit('setActiveParams', {
index,
value: param.hasOwnProperty('active') ? !param.active : false,
})
"
/> />
</li> </div>
</ul> <div>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')"
icon="delete"
@click.native="removeRequestParam(index)"
/>
</div>
</div>
<div class="flex sticky bottom-0 bg-primary z-10 flex-1">
<ButtonSecondary
icon="add"
class="flex-1"
:label="$t('add_new')"
@click.native="addRequestParam"
/>
</div>
</AppSection> </AppSection>
</template> </template>

View File

@@ -26,7 +26,8 @@
"label": "Label", "label": "Label",
"content_type": "Content Type", "content_type": "Content Type",
"raw_input": "Raw input", "raw_input": "Raw input",
"parameter_list": "Parameter List", "parameter_list": "Query Parameters",
"body": "Body",
"request_body": "Request Body", "request_body": "Request Body",
"raw_request_body": "Raw Request Body", "raw_request_body": "Raw Request Body",
"response_body": "Response Body", "response_body": "Response Body",
@@ -201,10 +202,10 @@
"deprecated": "DEPRECATED", "deprecated": "DEPRECATED",
"add_one_header": "(add at least one header)", "add_one_header": "(add at least one header)",
"add_one_parameter": "(add at least one parameter)", "add_one_parameter": "(add at least one parameter)",
"header_count": "header {count}", "header_count": "Header {count}",
"parameter_count": "parameter {count}", "parameter_count": "Parameter {count}",
"variable_count": "variable {count}", "variable_count": "Variable {count}",
"value_count": "value {count}", "value_count": "Value {count}",
"send_request_first": "Send a request first", "send_request_first": "Send a request first",
"generate_docs": "Generate Documentation", "generate_docs": "Generate Documentation",
"generate_docs_message": "Import any Hoppscotch Collection to Generate Documentation on-the-go.", "generate_docs_message": "Import any Hoppscotch Collection to Generate Documentation on-the-go.",
@@ -340,7 +341,7 @@
"hide_sidebar": "Hide sidebar", "hide_sidebar": "Hide sidebar",
"show_sidebar": "Show sidebar", "show_sidebar": "Show sidebar",
"protocols": "Protocols", "protocols": "Protocols",
"protocol_count": "protocol {count}", "protocol_count": "Protocol {count}",
"share": "Share", "share": "Share",
"interceptor": "Interceptor", "interceptor": "Interceptor",
"profile": "Profile", "profile": "Profile",

View File

@@ -204,10 +204,10 @@ export default {
// Google Fonts module configuration (https://github.com/nuxt-community/google-fonts-module) // Google Fonts module configuration (https://github.com/nuxt-community/google-fonts-module)
googleFonts: { googleFonts: {
display: "swap", display: "block",
families: { families: {
"Material+Icons": true,
Montserrat: [400, 500, 600, 700, 800], Montserrat: [400, 500, 600, 700, 800],
"Material+Icons": true,
"Roboto+Mono": true, "Roboto+Mono": true,
}, },
}, },

File diff suppressed because it is too large Load Diff

View File

@@ -343,6 +343,7 @@
py-3 py-3
text-xs text-xs
flex flex-1 flex flex-1
font-medium
bg-primaryLight bg-primaryLight
focus:outline-none focus:outline-none
" "
@@ -420,16 +421,27 @@
</SmartTab> </SmartTab>
</div> </div>
</SmartTabs> </SmartTabs>
<p <div
v-if=" v-if="
queryFields.length === 0 && queryFields.length === 0 &&
mutationFields.length === 0 && mutationFields.length === 0 &&
subscriptionFields.length === 0 && subscriptionFields.length === 0 &&
graphqlTypes.length === 0 graphqlTypes.length === 0
" "
class="
flex
items-center
text-secondaryLight
flex-col
p-4
justify-center
"
> >
{{ $t("send_request_first") }} <i class="material-icons opacity-50 pb-2">description</i>
</p> <span class="text-xs">
{{ $t("send_request_first") }}
</span>
</div>
</AppSection> </AppSection>
</SmartTab> </SmartTab>

10
pages/home.vue Normal file
View File

@@ -0,0 +1,10 @@
<template>
<div class="flex flex-col space-y-16">
<LandingHero />
<LandingStats />
<LandingUsers />
<LandingFeatures />
<LandingCTA />
<LandingFooter />
</div>
</template>

File diff suppressed because it is too large Load Diff