feat: actions in empty state

This commit is contained in:
liyasthomas
2021-08-01 20:04:25 +05:30
parent 6d67b1e51f
commit fd3b5ecf08
13 changed files with 81 additions and 30 deletions

View File

@@ -241,27 +241,35 @@
:root[data-accent="blue"] { :root[data-accent="blue"] {
@include blueTheme; @include blueTheme;
} }
:root[data-accent="green"] { :root[data-accent="green"] {
@include greenTheme; @include greenTheme;
} }
:root[data-accent="teal"] { :root[data-accent="teal"] {
@include tealTheme; @include tealTheme;
} }
:root[data-accent="indigo"] { :root[data-accent="indigo"] {
@include indigoTheme; @include indigoTheme;
} }
:root[data-accent="purple"] { :root[data-accent="purple"] {
@include purpleTheme; @include purpleTheme;
} }
:root[data-accent="orange"] { :root[data-accent="orange"] {
@include orangeTheme; @include orangeTheme;
} }
:root[data-accent="pink"] { :root[data-accent="pink"] {
@include pinkTheme; @include pinkTheme;
} }
:root[data-accent="red"] { :root[data-accent="red"] {
@include redTheme; @include redTheme;
} }
:root[data-accent="yellow"] { :root[data-accent="yellow"] {
@include yellowTheme; @include yellowTheme;
} }

View File

@@ -47,6 +47,7 @@
'<br>' + '<br>' +
`<sub>${currentUser.email || 'Email not found'}</sub>` `<sub>${currentUser.email || 'Email not found'}</sub>`
" "
:indicator="isOnLine ? 'bg-green-500' : 'bg-red-500'"
/> />
<TabPrimary <TabPrimary
v-else v-else
@@ -82,6 +83,7 @@ export default {
// prompt. // prompt.
showInstallPrompt: null, showInstallPrompt: null,
showLogin: false, showLogin: false,
isOnLine: navigator.onLine,
} }
}, },
subscriptions() { subscriptions() {
@@ -90,6 +92,13 @@ export default {
} }
}, },
async mounted() { async mounted() {
window.addEventListener("online", () => {
this.isOnLine = true
})
window.addEventListener("offline", () => {
this.isOnLine = false
})
// Initializes the PWA code - checks if the app is installed, // Initializes the PWA code - checks if the app is installed,
// etc. // etc.
this.showInstallPrompt = await intializePwa() this.showInstallPrompt = await intializePwa()

View File

@@ -65,9 +65,13 @@
class="flex flex-col text-secondaryLight p-4 items-center justify-center" class="flex flex-col text-secondaryLight p-4 items-center justify-center"
> >
<i class="opacity-75 pb-2 material-icons">create_new_folder</i> <i class="opacity-75 pb-2 material-icons">create_new_folder</i>
<span class="text-center"> <span class="text-center pb-4">
{{ $t("create_new_collection") }} {{ $t("collections_empty") }}
</span> </span>
<ButtonSecondary
:label="$t('add_new')"
@click.native="displayModalAdd(true)"
/>
</div> </div>
<div <div
v-if="!(filteredCollections.length !== 0 || collections.length === 0)" v-if="!(filteredCollections.length !== 0 || collections.length === 0)"

View File

@@ -100,9 +100,25 @@
class="flex flex-col text-secondaryLight p-4 items-center justify-center" class="flex flex-col text-secondaryLight p-4 items-center justify-center"
> >
<i class="opacity-75 pb-2 material-icons">create_new_folder</i> <i class="opacity-75 pb-2 material-icons">create_new_folder</i>
<span class="text-center"> <span class="text-center pb-4">
{{ $t("create_new_collection") }} {{ $t("collections_empty") }}
</span> </span>
<ButtonSecondary
v-if="
collectionsType.type == 'team-collections' &&
(collectionsType.selectedTeam == undefined ||
collectionsType.selectedTeam.myRole == 'VIEWER')
"
v-tippy="{ theme: 'tooltip' }"
disabled
:title="$t('disable_new_collection')"
:label="$t('add_new')"
/>
<ButtonSecondary
v-else
:label="$t('add_new')"
@click.native="displayModalAdd(true)"
/>
</div> </div>
<div <div
v-if="!(filteredCollections.length !== 0 || collections.length === 0)" v-if="!(filteredCollections.length !== 0 || collections.length === 0)"

View File

@@ -63,9 +63,13 @@
class="flex flex-col text-secondaryLight p-4 items-center justify-center" class="flex flex-col text-secondaryLight p-4 items-center justify-center"
> >
<i class="opacity-75 pb-2 material-icons">library_add</i> <i class="opacity-75 pb-2 material-icons">library_add</i>
<span class="text-center"> <span class="text-center pb-4">
{{ $t("create_new_environment") }} {{ $t("environments_empty") }}
</span> </span>
<ButtonSecondary
:label="$t('add_new')"
@click.native="displayModalAdd(true)"
/>
</div> </div>
<div class="flex flex-col"> <div class="flex flex-col">
<EnvironmentsEnvironment <EnvironmentsEnvironment

View File

@@ -145,9 +145,10 @@
class="flex flex-col text-secondaryLight p-4 items-center justify-center" class="flex flex-col text-secondaryLight p-4 items-center justify-center"
> >
<i class="opacity-75 pb-2 material-icons">post_add</i> <i class="opacity-75 pb-2 material-icons">post_add</i>
<span class="text-center"> <span class="text-center pb-4">
{{ $t("headers_empty") }} {{ $t("headers_empty") }}
</span> </span>
<ButtonSecondary :label="$t('add_new')" @click.native="addHeader" />
</div> </div>
</AppSection> </AppSection>
</template> </template>

View File

@@ -166,9 +166,10 @@
class="flex flex-col text-secondaryLight p-4 items-center justify-center" class="flex flex-col text-secondaryLight p-4 items-center justify-center"
> >
<i class="opacity-75 pb-2 material-icons">post_add</i> <i class="opacity-75 pb-2 material-icons">post_add</i>
<span class="text-center"> <span class="text-center pb-4">
{{ $t("parameters_empty") }} {{ $t("parameters_empty") }}
</span> </span>
<ButtonSecondary :label="$t('add_new')" @click.native="addParam" />
</div> </div>
</AppSection> </AppSection>
</template> </template>

View File

@@ -16,18 +16,10 @@
/> />
<div class="rounded-full shadow-inner inset-0 absolute"></div> <div class="rounded-full shadow-inner inset-0 absolute"></div>
<span <span
v-if="indicator" :class="[
class=" 'border-primary rounded-full border-2 h-3 -top-1 -right-1 w-3 absolute',
bg-accent indicator,
border-primary ]"
rounded-full
border-2
h-3
-top-1
-right-1
w-3
absolute
"
></span> ></span>
</div> </div>
</template> </template>
@@ -46,8 +38,8 @@ export default {
default: "Profile picture", default: "Profile picture",
}, },
indicator: { indicator: {
type: Boolean, type: String,
default: false, default: "bg-green-500",
}, },
}, },
} }

View File

@@ -211,6 +211,7 @@ export default {
@apply w-full; @apply w-full;
@apply block; @apply block;
@apply py-2 px-4; @apply py-2 px-4;
@apply text-secondaryLight;
@apply font-semibold font-mono; @apply font-semibold font-mono;
&:last-child { &:last-child {

View File

@@ -119,7 +119,7 @@
"no_prerequest_script": "No pre-request script", "no_prerequest_script": "No pre-request script",
"search": "Search", "search": "Search",
"history_empty": "History is empty", "history_empty": "History is empty",
"history_deleted": "History Deleted", "history_deleted": "History deleted",
"clear": "Clear", "clear": "Clear",
"clear_all": "Clear All", "clear_all": "Clear All",
"cleared": "Cleared", "cleared": "Cleared",
@@ -356,5 +356,7 @@
"script": "Script", "script": "Script",
"results": "Results", "results": "Results",
"add_test_scripts": "Add test script", "add_test_scripts": "Add test script",
"protocols_empty": "Protocols are empty" "protocols_empty": "Protocols are empty",
"environments_empty": "Environments are empty",
"collections_empty": "Collections are empty"
} }

View File

@@ -67,7 +67,7 @@ export const defaultSettings: SettingsType = {
httpPassword: true, httpPassword: true,
bearerToken: true, bearerToken: true,
}, },
THEME_COLOR: "green", THEME_COLOR: "indigo",
BG_COLOR: "system", BG_COLOR: "system",
TELEMETRY_ENABLED: true, TELEMETRY_ENABLED: true,
SHORTCUT_INDICATOR: false, SHORTCUT_INDICATOR: false,

View File

@@ -204,6 +204,15 @@
:spellcheck="false" :spellcheck="false"
:value="header.key" :value="header.key"
autofocus autofocus
styles="
bg-primaryLight
flex
font-semibold font-mono
flex-1
py-1
px-4
focus:outline-none
"
@input=" @input="
$store.commit('setGQLHeaderKey', { $store.commit('setGQLHeaderKey', {
index, index,
@@ -216,8 +225,8 @@
bg-primaryLight bg-primaryLight
flex flex
font-semibold font-mono font-semibold font-mono
flex-1 w-full
py-2 py-1
px-4 px-4
focus:outline-none focus:outline-none
" "
@@ -281,9 +290,13 @@
" "
> >
<i class="opacity-75 pb-2 material-icons">post_add</i> <i class="opacity-75 pb-2 material-icons">post_add</i>
<span class="text-center"> <span class="text-center pb-4">
{{ $t("headers_empty") }} {{ $t("headers_empty") }}
</span> </span>
<ButtonSecondary
:label="$t('add_new')"
@click.native="addRequestHeader"
/>
</div> </div>
</AppSection> </AppSection>
</SmartTab> </SmartTab>

View File

@@ -299,10 +299,10 @@
bg-primaryLight bg-primaryLight
border border-divider border border-divider
rounded-r rounded-r
flex
font-semibold font-mono font-semibold font-mono
flex-1 flex-1
mr-2 mr-2
w-full
py-2 py-2
px-4 px-4
block block
@@ -396,7 +396,7 @@ export default defineComponent({
showLogin: false, showLogin: false,
active: getLocalConfig("THEME_COLOR") || "green", active: getLocalConfig("THEME_COLOR") || "indigo",
confirmRemove: false, confirmRemove: false,
} }
}, },