refactor(ui): minor ui improvements

This commit is contained in:
liyasthomas
2021-08-20 15:08:54 +05:30
parent a121445b1e
commit 7082eb27db
63 changed files with 296 additions and 305 deletions

View File

@@ -47,8 +47,8 @@ export default Vue.extend({
methods: {
addNewCollection() {
if (!this.name) {
this.$toast.info(this.$t("collection.invalid_name").toString(), {
icon: "info",
this.$toast.error(this.$t("collection.invalid_name").toString(), {
icon: "error_outline",
})
return
}

View File

@@ -10,7 +10,7 @@
@dragend="dragging = false"
>
<span
class="cursor-pointer flex w-10 justify-center items-center truncate"
class="cursor-pointer flex px-4 justify-center items-center"
@click="toggleShowChildren()"
>
<i class="material-icons" :class="{ 'text-green-500': isSelected }">
@@ -93,7 +93,7 @@
<CollectionsGraphqlFolder
v-for="(folder, index) in collection.folders"
:key="`folder-${index}`"
class="border-l border-dividerLight ml-5"
class="border-l border-dividerLight ml-6"
:picked="picked"
:saving-mode="savingMode"
:folder="folder"
@@ -110,7 +110,7 @@
<CollectionsGraphqlRequest
v-for="(request, index) in collection.requests"
:key="`request-${index}`"
class="border-l border-dividerLight ml-5"
class="border-l border-dividerLight ml-6"
:picked="picked"
:saving-mode="savingMode"
:request="request"
@@ -131,7 +131,7 @@
border-l border-dividerLight
flex flex-col
text-secondaryLight
ml-5
ml-6
p-4
items-center
justify-center
@@ -187,8 +187,8 @@ export default Vue.extend({
},
getCollectionIcon() {
if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else if (!this.showChildren && !this.isFiltered) return "folder"
else if (this.showChildren || this.isFiltered) return "folder_open"
else return "folder"
},
},
@@ -218,8 +218,7 @@ export default Vue.extend({
this.$emit("select", { picked: null })
}
removeGraphqlCollection(this.collectionIndex)
this.$toast.error(this.$t("state.deleted").toString(), {
this.$toast.success(this.$t("state.deleted").toString(), {
icon: "delete",
})
},

View File

@@ -49,8 +49,8 @@ export default Vue.extend({
methods: {
saveCollection() {
if (!this.name) {
this.$toast.info(this.$t("collection.invalid_name").toString(), {
icon: "info",
this.$toast.error(this.$t("collection.invalid_name").toString(), {
icon: "error_outline",
})
return
}

View File

@@ -50,8 +50,8 @@ export default Vue.extend({
methods: {
editFolder() {
if (!this.name) {
this.$toast.info(this.$t("collection.invalid_name").toString(), {
icon: "info",
this.$toast.error(this.$t("collection.invalid_name").toString(), {
icon: "error_outline",
})
return
}

View File

@@ -49,8 +49,8 @@ export default Vue.extend({
methods: {
saveRequest() {
if (!this.requestUpdateData.name) {
this.$toast.info(this.$t("collection.invalid_name").toString(), {
icon: "info",
this.$toast.error(this.$t("collection.invalid_name").toString(), {
icon: "error_outline",
})
return
}

View File

@@ -10,7 +10,7 @@
@dragend="dragging = false"
>
<span
class="cursor-pointer flex w-10 justify-center items-center truncate"
class="cursor-pointer flex px-4 justify-center items-center"
@click="toggleShowChildren()"
>
<i class="material-icons" :class="{ 'text-green-500': isSelected }">
@@ -89,7 +89,7 @@
<CollectionsGraphqlFolder
v-for="(subFolder, subFolderIndex) in folder.folders"
:key="`subFolder-${subFolderIndex}`"
class="border-l border-dividerLight ml-5"
class="border-l border-dividerLight ml-6"
:picked="picked"
:saving-mode="savingMode"
:folder="subFolder"
@@ -106,7 +106,7 @@
<CollectionsGraphqlRequest
v-for="(request, index) in folder.requests"
:key="`request-${index}`"
class="border-l border-dividerLight ml-5"
class="border-l border-dividerLight ml-6"
:picked="picked"
:saving-mode="savingMode"
:request="request"
@@ -130,7 +130,7 @@
border-l border-dividerLight
flex flex-col
text-secondaryLight
ml-5
ml-6
p-4
items-center
justify-center
@@ -185,8 +185,8 @@ export default Vue.extend({
},
getCollectionIcon() {
if (this.isSelected) return "check_circle_outline"
else if (!this.showChildren && !this.isFiltered) return "arrow_right"
else if (this.showChildren || this.isFiltered) return "arrow_drop_down"
else if (!this.showChildren && !this.isFiltered) return "folder"
else if (this.showChildren || this.isFiltered) return "folder_open"
else return "folder"
},
},
@@ -217,7 +217,7 @@ export default Vue.extend({
}
removeGraphqlFolder(this.folderPath)
this.$toast.error(this.$t("state.deleted").toString(), {
this.$toast.success(this.$t("state.deleted").toString(), {
icon: "delete",
})
},

View File

@@ -23,7 +23,7 @@
$refs.options.tippy().hide()
"
/>
<SmartItem
<span
v-tippy="{ theme: 'tooltip' }"
:title="
!currentUser
@@ -32,20 +32,23 @@
? $t('export.require_github')
: null
"
:disabled="
!currentUser
? true
: currentUser.provider !== 'github.com'
? true
: false
"
icon="assignment_turned_in"
:label="$t('export.create_secret_gist')"
@click.native="
createCollectionGist
$refs.options.tippy().hide()
"
/>
>
<SmartItem
:disabled="
!currentUser
? true
: currentUser.provider !== 'github.com'
? true
: false
"
icon="assignment_turned_in"
:label="$t('export.create_secret_gist')"
@click.native="
createCollectionGist
$refs.options.tippy().hide()
"
/>
</span>
</tippy>
</span>
</template>
@@ -143,7 +146,7 @@ export default defineComponent({
})
.catch((e) => {
this.$toast.error(this.$t("error.something_went_wrong"), {
icon: "error",
icon: "error_outline",
})
console.error(e)
})
@@ -249,7 +252,7 @@ export default defineComponent({
document.body.appendChild(a)
a.click()
this.$toast.success(this.$t("state.download_started"), {
icon: "done",
icon: "downloading",
})
setTimeout(() => {
document.body.removeChild(a)
@@ -257,13 +260,13 @@ export default defineComponent({
}, 1000)
},
fileImported() {
this.$toast.info(this.$t("state.file_imported"), {
this.$toast.success(this.$t("state.file_imported"), {
icon: "folder_shared",
})
},
failedImport() {
this.$toast.error(this.$t("import.failed"), {
icon: "error",
icon: "error_outline",
})
},
parsePostmanCollection({ info, name, item }) {

View File

@@ -12,8 +12,8 @@
class="
cursor-pointer
flex
mx-2
w-12
px-2
w-16
justify-center
items-center
truncate
@@ -171,7 +171,7 @@ export default Vue.extend({
}
removeGraphqlRequest(this.folderPath, this.requestIndex)
this.$toast.error(this.$t("state.deleted").toString(), {
this.$toast.success(this.$t("state.deleted").toString(), {
icon: "delete",
})
},