chore: uniform ui in rest and graphql collections
This commit is contained in:
@@ -205,7 +205,7 @@
|
|||||||
:src="`/images/states/${colorMode.value}/pack.svg`"
|
:src="`/images/states/${colorMode.value}/pack.svg`"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
|
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
|
||||||
:alt="`${t('empty.collection')}`"
|
:alt="`${t('empty.collections')}`"
|
||||||
/>
|
/>
|
||||||
<span class="pb-4 text-center">
|
<span class="pb-4 text-center">
|
||||||
{{ t("empty.collections") }}
|
{{ t("empty.collections") }}
|
||||||
@@ -213,7 +213,6 @@
|
|||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
:label="t('add.new')"
|
:label="t('add.new')"
|
||||||
filled
|
filled
|
||||||
class="mb-4"
|
|
||||||
outline
|
outline
|
||||||
@click="emit('display-modal-add')"
|
@click="emit('display-modal-add')"
|
||||||
/>
|
/>
|
||||||
@@ -235,7 +234,6 @@
|
|||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
:label="t('add.new')"
|
:label="t('add.new')"
|
||||||
filled
|
filled
|
||||||
class="mb-4"
|
|
||||||
outline
|
outline
|
||||||
@click="
|
@click="
|
||||||
node.data.type === 'collections' &&
|
node.data.type === 'collections' &&
|
||||||
|
|||||||
@@ -27,9 +27,8 @@
|
|||||||
</label>
|
</label>
|
||||||
<CollectionsGraphql
|
<CollectionsGraphql
|
||||||
v-if="mode === 'graphql'"
|
v-if="mode === 'graphql'"
|
||||||
:show-coll-actions="false"
|
|
||||||
:picked="picked"
|
:picked="picked"
|
||||||
:saving-mode="true"
|
:save-request="true"
|
||||||
@select="onSelect"
|
@select="onSelect"
|
||||||
/>
|
/>
|
||||||
<Collections
|
<Collections
|
||||||
|
|||||||
@@ -201,7 +201,7 @@
|
|||||||
:src="`/images/states/${colorMode.value}/pack.svg`"
|
:src="`/images/states/${colorMode.value}/pack.svg`"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
|
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
|
||||||
:alt="`${t('empty.collection')}`"
|
:alt="`${t('empty.collections')}`"
|
||||||
/>
|
/>
|
||||||
<span class="pb-4 text-center">
|
<span class="pb-4 text-center">
|
||||||
{{ t("empty.collections") }}
|
{{ t("empty.collections") }}
|
||||||
@@ -244,12 +244,11 @@
|
|||||||
filled
|
filled
|
||||||
outline
|
outline
|
||||||
:title="t('team.no_access')"
|
:title="t('team.no_access')"
|
||||||
:label="t('action.new')"
|
:label="t('add.new')"
|
||||||
/>
|
/>
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-else
|
v-else
|
||||||
:icon="IconPlus"
|
:label="t('add.new')"
|
||||||
:label="t('action.new')"
|
|
||||||
filled
|
filled
|
||||||
outline
|
outline
|
||||||
@click="
|
@click="
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-1">
|
<div class="flex flex-1">
|
||||||
<SmartIntersection
|
<SmartIntersection
|
||||||
class="flex flex-1 flex-col"
|
class="flex flex-col flex-1"
|
||||||
@intersecting="onTeamSelectIntersect"
|
@intersecting="onTeamSelectIntersect"
|
||||||
>
|
>
|
||||||
<tippy
|
<tippy
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="isTeamListLoading && myTeams.length === 0"
|
v-if="isTeamListLoading && myTeams.length === 0"
|
||||||
class="flex flex-col flex-1 items-center justify-center p-2"
|
class="flex flex-col items-center justify-center flex-1 p-2"
|
||||||
>
|
>
|
||||||
<SmartSpinner class="my-2" />
|
<SmartSpinner class="my-2" />
|
||||||
<span class="text-secondaryLight">{{ t("state.loading") }}</span>
|
<span class="text-secondaryLight">{{ t("state.loading") }}</span>
|
||||||
@@ -75,15 +75,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="flex flex-col items-center justify-center text-secondaryLight p-2"
|
class="flex flex-col items-center justify-center p-2 text-secondaryLight"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
:src="`/images/states/${colorMode.value}/add_group.svg`"
|
:src="`/images/states/${colorMode.value}/add_group.svg`"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
class="inline-flex flex-col object-contain object-center w-14 h-14 mb-4"
|
class="inline-flex flex-col object-contain object-center mb-4 w-14 h-14"
|
||||||
:alt="`${t('empty.teams')}`"
|
:alt="`${t('empty.teams')}`"
|
||||||
/>
|
/>
|
||||||
<span class="text-center pb-4">
|
<span class="pb-4 text-center">
|
||||||
{{ t("empty.teams") }}
|
{{ t("empty.teams") }}
|
||||||
</span>
|
</span>
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
v-for="(folder, index) in collection.folders"
|
v-for="(folder, index) in collection.folders"
|
||||||
:key="`folder-${String(index)}`"
|
:key="`folder-${String(index)}`"
|
||||||
:picked="picked"
|
:picked="picked"
|
||||||
:saving-mode="savingMode"
|
:save-request="saveRequest"
|
||||||
:folder="folder"
|
:folder="folder"
|
||||||
:folder-index="index"
|
:folder-index="index"
|
||||||
:folder-path="`${collectionIndex}/${String(index)}`"
|
:folder-path="`${collectionIndex}/${String(index)}`"
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
v-for="(request, index) in collection.requests"
|
v-for="(request, index) in collection.requests"
|
||||||
:key="`request-${String(index)}`"
|
:key="`request-${String(index)}`"
|
||||||
:picked="picked"
|
:picked="picked"
|
||||||
:saving-mode="savingMode"
|
:save-request="saveRequest"
|
||||||
:request="request"
|
:request="request"
|
||||||
:collection-index="collectionIndex"
|
:collection-index="collectionIndex"
|
||||||
:folder-index="-1"
|
:folder-index="-1"
|
||||||
@@ -183,9 +183,19 @@
|
|||||||
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
|
class="inline-flex flex-col object-contain object-center w-16 h-16 mb-4"
|
||||||
:alt="`${t('empty.collection')}`"
|
:alt="`${t('empty.collection')}`"
|
||||||
/>
|
/>
|
||||||
<span class="text-center">
|
<span class="pb-4 text-center">
|
||||||
{{ t("empty.collection") }}
|
{{ t("empty.collection") }}
|
||||||
</span>
|
</span>
|
||||||
|
<ButtonSecondary
|
||||||
|
:label="t('add.new')"
|
||||||
|
filled
|
||||||
|
outline
|
||||||
|
@click="
|
||||||
|
emit('add-folder', {
|
||||||
|
path: `${collectionIndex}`,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -219,7 +229,7 @@ import {
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
picked: { type: Object, default: null },
|
picked: { type: Object, default: null },
|
||||||
// Whether the viewing context is related to picking (activates 'select' events)
|
// Whether the viewing context is related to picking (activates 'select' events)
|
||||||
savingMode: { type: Boolean, default: false },
|
saveRequest: { type: Boolean, default: false },
|
||||||
collectionIndex: { type: Number, default: null },
|
collectionIndex: { type: Number, default: null },
|
||||||
collection: { type: Object, default: () => ({}) },
|
collection: { type: Object, default: () => ({}) },
|
||||||
isFiltered: Boolean,
|
isFiltered: Boolean,
|
||||||
@@ -275,7 +285,7 @@ const pick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const toggleShowChildren = () => {
|
const toggleShowChildren = () => {
|
||||||
if (props.savingMode) {
|
if (props.saveRequest) {
|
||||||
pick()
|
pick()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
v-for="(subFolder, subFolderIndex) in folder.folders"
|
v-for="(subFolder, subFolderIndex) in folder.folders"
|
||||||
:key="`subFolder-${String(subFolderIndex)}`"
|
:key="`subFolder-${String(subFolderIndex)}`"
|
||||||
:picked="picked"
|
:picked="picked"
|
||||||
:saving-mode="savingMode"
|
:save-request="saveRequest"
|
||||||
:folder="subFolder"
|
:folder="subFolder"
|
||||||
:folder-index="subFolderIndex"
|
:folder-index="subFolderIndex"
|
||||||
:folder-path="`${folderPath}/${String(subFolderIndex)}`"
|
:folder-path="`${folderPath}/${String(subFolderIndex)}`"
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
v-for="(request, index) in folder.requests"
|
v-for="(request, index) in folder.requests"
|
||||||
:key="`request-${String(index)}`"
|
:key="`request-${String(index)}`"
|
||||||
:picked="picked"
|
:picked="picked"
|
||||||
:saving-mode="savingMode"
|
:save-request="saveRequest"
|
||||||
:request="request"
|
:request="request"
|
||||||
:collection-index="collectionIndex"
|
:collection-index="collectionIndex"
|
||||||
:folder-index="folderIndex"
|
:folder-index="folderIndex"
|
||||||
@@ -212,7 +212,7 @@ const colorMode = useColorMode()
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
picked: { type: Object, default: null },
|
picked: { type: Object, default: null },
|
||||||
// Whether the request is in a selectable mode (activates 'select' event)
|
// Whether the request is in a selectable mode (activates 'select' event)
|
||||||
savingMode: { type: Boolean, default: false },
|
saveRequest: { type: Boolean, default: false },
|
||||||
folder: { type: Object, default: () => ({}) },
|
folder: { type: Object, default: () => ({}) },
|
||||||
folderIndex: { type: Number, default: null },
|
folderIndex: { type: Number, default: null },
|
||||||
collectionIndex: { type: Number, default: null },
|
collectionIndex: { type: Number, default: null },
|
||||||
@@ -263,7 +263,7 @@ const pick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const toggleShowChildren = () => {
|
const toggleShowChildren = () => {
|
||||||
if (props.savingMode) {
|
if (props.saveRequest) {
|
||||||
pick()
|
pick()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-if="!savingMode"
|
v-if="!saveRequest"
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:icon="IconRotateCCW"
|
:icon="IconRotateCCW"
|
||||||
:title="t('action.restore')"
|
:title="t('action.restore')"
|
||||||
@@ -148,7 +148,7 @@ const props = defineProps({
|
|||||||
// Whether the object is selected (show the tick mark)
|
// Whether the object is selected (show the tick mark)
|
||||||
picked: { type: Object, default: null },
|
picked: { type: Object, default: null },
|
||||||
// Whether the request is being saved (activate 'select' event)
|
// Whether the request is being saved (activate 'select' event)
|
||||||
savingMode: { type: Boolean, default: false },
|
saveRequest: { type: Boolean, default: false },
|
||||||
request: { type: Object as PropType<HoppGQLRequest>, default: () => ({}) },
|
request: { type: Object as PropType<HoppGQLRequest>, default: () => ({}) },
|
||||||
folderPath: { type: String, default: null },
|
folderPath: { type: String, default: null },
|
||||||
requestIndex: { type: Number, default: null },
|
requestIndex: { type: Number, default: null },
|
||||||
@@ -178,7 +178,7 @@ const pick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const selectRequest = () => {
|
const selectRequest = () => {
|
||||||
if (props.savingMode) {
|
if (props.saveRequest) {
|
||||||
pick()
|
pick()
|
||||||
} else {
|
} else {
|
||||||
setGQLSession({
|
setGQLSession({
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{ 'rounded border border-divider': savingMode }">
|
<div :class="{ 'rounded border border-divider': saveRequest }">
|
||||||
<div
|
<div
|
||||||
class="sticky top-0 z-10 flex flex-col flex-shrink-0 overflow-x-auto border-b divide-y divide-dividerLight border-dividerLight"
|
class="sticky z-10 flex flex-col flex-shrink-0 overflow-x-auto rounded-t bg-primary"
|
||||||
:class="{ 'bg-primary': !savingMode }"
|
:style="
|
||||||
|
saveRequest ? 'top: calc(-1 * var(--line-height-body))' : 'top: 0'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
v-if="showCollActions"
|
|
||||||
v-model="filterText"
|
v-model="filterText"
|
||||||
type="search"
|
type="search"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
:placeholder="t('action.search')"
|
:placeholder="t('action.search')"
|
||||||
class="flex px-4 py-2 bg-transparent"
|
class="py-2 pl-4 pr-2 bg-transparent"
|
||||||
/>
|
/>
|
||||||
<div class="flex justify-between flex-1">
|
<div
|
||||||
|
class="flex justify-between flex-1 flex-shrink-0 border-y bg-primary border-dividerLight"
|
||||||
|
>
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
:icon="IconPlus"
|
:icon="IconPlus"
|
||||||
:label="t('action.new')"
|
:label="t('action.new')"
|
||||||
@@ -28,7 +31,7 @@
|
|||||||
:icon="IconHelpCircle"
|
:icon="IconHelpCircle"
|
||||||
/>
|
/>
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
v-if="showCollActions"
|
v-if="!saveRequest"
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="t('modal.import_export')"
|
:title="t('modal.import_export')"
|
||||||
:icon="IconArchive"
|
:icon="IconArchive"
|
||||||
@@ -37,7 +40,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-col">
|
<div class="flex flex-col">
|
||||||
<CollectionsGraphqlCollection
|
<CollectionsGraphqlCollection
|
||||||
v-for="(collection, index) in filteredCollections"
|
v-for="(collection, index) in filteredCollections"
|
||||||
:key="`collection-${index}`"
|
:key="`collection-${index}`"
|
||||||
@@ -46,7 +49,7 @@
|
|||||||
:collection-index="index"
|
:collection-index="index"
|
||||||
:collection="collection"
|
:collection="collection"
|
||||||
:is-filtered="filterText.length > 0"
|
:is-filtered="filterText.length > 0"
|
||||||
:saving-mode="savingMode"
|
:save-request="saveRequest"
|
||||||
@edit-collection="editCollection(collection, index)"
|
@edit-collection="editCollection(collection, index)"
|
||||||
@add-request="addRequest($event)"
|
@add-request="addRequest($event)"
|
||||||
@add-folder="addFolder($event)"
|
@add-folder="addFolder($event)"
|
||||||
@@ -154,10 +157,8 @@ import { useColorMode } from "@composables/theming"
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
// Whether to activate the ability to pick items (activates 'select' events)
|
// Whether to activate the ability to pick items (activates 'select' events)
|
||||||
savingMode: { type: Boolean, default: false },
|
saveRequest: { type: Boolean, default: false },
|
||||||
picked: { type: Object, default: null },
|
picked: { type: Object, default: null },
|
||||||
// Whether to show the 'New' and 'Import/Export' actions
|
|
||||||
showCollActions: { type: Boolean, default: true },
|
|
||||||
},
|
},
|
||||||
emits: ["select", "use-collection"],
|
emits: ["select", "use-collection"],
|
||||||
setup() {
|
setup() {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="rootNodes.status === 'loading'"
|
v-else-if="rootNodes.status === 'loading'"
|
||||||
class="flex flex-1 flex-col items-center justify-center p-4"
|
class="flex flex-col items-center justify-center flex-1 p-4"
|
||||||
>
|
>
|
||||||
<SmartSpinner class="my-4" />
|
<SmartSpinner class="my-4" />
|
||||||
<span class="text-secondaryLight">{{ t("state.loading") }}</span>
|
<span class="text-secondaryLight">{{ t("state.loading") }}</span>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="childNodes.status === 'loading'"
|
v-if="childNodes.status === 'loading'"
|
||||||
class="flex flex-1 flex-col items-center justify-center p-4"
|
class="flex flex-col items-center justify-center flex-1 p-4"
|
||||||
>
|
>
|
||||||
<SmartSpinner class="my-4" />
|
<SmartSpinner class="my-4" />
|
||||||
<span class="text-secondaryLight">{{ t("state.loading") }}</span>
|
<span class="text-secondaryLight">{{ t("state.loading") }}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user