feat: revamp environments ui

This commit is contained in:
liyasthomas
2021-07-08 13:36:37 +05:30
parent 207dc2b6a6
commit a070bed7c9
5 changed files with 121 additions and 95 deletions

View File

@@ -39,11 +39,11 @@
// Dark Background color // Dark Background color
--primary-dark-color: theme("colors.gray.100"); --primary-dark-color: theme("colors.gray.100");
// Text color // Text color
--secondary-color: theme("colors.gray.600"); --secondary-color: theme("colors.gray.500");
// Light Text color // Light Text color
--secondary-light-color: theme("colors.gray.400"); --secondary-light-color: theme("colors.gray.400");
// Dark Text color // Dark Text color
--secondary-dark-color: theme("colors.gray.700"); --secondary-dark-color: theme("colors.gray.600");
// Border color // Border color
--divider-color: theme("colors.gray.200"); --divider-color: theme("colors.gray.200");
// Light Border color // Light Border color

View File

@@ -15,7 +15,7 @@
:class="[ :class="[
color color
? `text-${color}-400 hover:text-${color}-600 focus:text-${color}-600` ? `text-${color}-400 hover:text-${color}-600 focus:text-${color}-600`
: 'text-secondaryLight hover:text-secondary focus:text-secondary', : 'text-secondary hover:text-secondaryDark focus:text-secondaryDark',
label ? 'px-3 rounded-lg' : 'px-2 rounded-full', label ? 'px-3 rounded-lg' : 'px-2 rounded-full',
rounded ? 'rounded-full' : 'rounded-lg', rounded ? 'rounded-full' : 'rounded-lg',
{ 'opacity-50 cursor-not-allowed': disabled }, { 'opacity-50 cursor-not-allowed': disabled },

View File

@@ -1,13 +1,36 @@
<template> <template>
<div> <div class="flex items-center group">
<div class="flex flex-1"> <span
<div> class="
<ButtonSecondary flex
icon="layers" justify-center
:label="environment.name" items-center
@click.native="$emit('edit-environment')" text-xs
/> w-10
</div> truncate
cursor-pointer
"
@click="$emit('edit-environment')"
>
<i class="material-icons">layers</i>
</span>
<span
class="
py-3
cursor-pointer
pr-3
flex flex-1
min-w-0
text-xs
group-hover:text-secondaryDark
transition
"
@click="$emit('edit-environment')"
>
<span class="truncate">
{{ environment.name }}
</span>
</span>
<tippy <tippy
ref="options" ref="options"
interactive interactive
@@ -17,7 +40,7 @@
arrow arrow
> >
<template #trigger> <template #trigger>
<TabPrimary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('more')" :title="$t('more')"
icon="more_vert" icon="more_vert"
@@ -40,7 +63,6 @@
" "
/> />
</tippy> </tippy>
</div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('are_you_sure_remove_environment')" :title="$t('are_you_sure_remove_environment')"

View File

@@ -1,11 +1,17 @@
<template> <template>
<AppSection label="environments"> <AppSection label="environments">
<div class="flex">
<span class="select-wrapper">
<select <select
v-model="selectedEnvironmentIndex" v-model="selectedEnvironmentIndex"
:disabled="environments.length == 0" :disabled="environments.length == 0"
class="select rounded-t-lg" class="
flex
w-full
px-4
text-xs
py-2
focus:outline-none
border-b border-dividerLight
"
> >
<option :value="-1">No environment</option> <option :value="-1">No environment</option>
<option v-if="environments.length === 0" value="0"> <option v-if="environments.length === 0" value="0">
@@ -19,8 +25,6 @@
{{ environment.name }} {{ environment.name }}
</option> </option>
</select> </select>
</span>
</div>
<EnvironmentsAdd <EnvironmentsAdd
:show="showModalAdd" :show="showModalAdd"
@hide-modal="displayModalAdd(false)" @hide-modal="displayModalAdd(false)"
@@ -35,36 +39,36 @@
:show="showModalImportExport" :show="showModalImportExport"
@hide-modal="displayModalImportExport(false)" @hide-modal="displayModalImportExport(false)"
/> />
<div class="border-b flex flex-1 border-divider"> <div class="border-b flex justify-between flex-1 border-dividerLight">
<div>
<ButtonSecondary <ButtonSecondary
icon="add" icon="add"
:label="$t('new')" :label="$t('new')"
@click.native="displayModalAdd(true)" @click.native="displayModalAdd(true)"
/> />
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
icon="import_export"
:title="$t('import_export')"
@click.native="displayModalImportExport(true)"
/>
</div> </div>
<div> <div
<ButtonSecondary @click.native="displayModalImportExport(true)" /> v-if="environments.length === 0"
{{ $t("import_export") }} class="flex items-center text-secondaryLight flex-col p-4 justify-center"
</div> >
</div> <i class="material-icons opacity-50 pb-2">library_add</i>
<p v-if="environments.length === 0"> <span class="text-xs">
<i class="material-icons">help_outline</i>
{{ $t("create_new_environment") }} {{ $t("create_new_environment") }}
</p> </span>
<div class="overflow-auto"> </div>
<ul class="flex-col"> <div class="flex flex-col">
<li <EnvironmentsEnvironment
v-for="(environment, index) in environments" v-for="(environment, index) in environments"
:key="environment.name" :key="environment.name"
>
<EnvironmentsEnvironment
:environment-index="index" :environment-index="index"
:environment="environment" :environment="environment"
@edit-environment="editEnvironment(environment, index)" @edit-environment="editEnvironment(environment, index)"
/> />
</li>
</ul>
</div> </div>
</AppSection> </AppSection>
</template> </template>

View File

@@ -24,8 +24,8 @@
pr-3 pr-3
flex flex-1 flex flex-1
min-w-0 min-w-0
text-secondaryLight text-xs text-xs
group-hover:text-secondary group-hover:text-secondaryDark
transition transition
" "
@click="$emit('use-entry')" @click="$emit('use-entry')"