"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "components/collections/my/Collection.vue" between
hoppscotch-2.0.0.tar.gz and hoppscotch-2.1.0.tar.gz

About: Hoppscotch is a light-weight, web based API development suite.

Collection.vue  (hoppscotch-2.0.0):Collection.vue  (hoppscotch-2.1.0)
skipping to change at line 16 skipping to change at line 16
@drop.prevent="dropEvent" @drop.prevent="dropEvent"
@dragover="dragging = true" @dragover="dragging = true"
@drop="dragging = false" @drop="dragging = false"
@dragleave="dragging = false" @dragleave="dragging = false"
@dragend="dragging = false" @dragend="dragging = false"
> >
<span <span
class="cursor-pointer flex px-4 justify-center items-center" class="cursor-pointer flex px-4 justify-center items-center"
@click="toggleShowChildren()" @click="toggleShowChildren()"
> >
<i class="material-icons" :class="{ 'text-green-500': isSelected }"> <SmartIcon
{{ getCollectionIcon }} class="svg-icons"
</i> :class="{ 'text-green-500': isSelected }"
:name="getCollectionIcon"
/>
</span> </span>
<span <span
class=" class="
cursor-pointer cursor-pointer
flex flex-1 flex flex-1
min-w-0 min-w-0
py-2 py-2
pr-2 pr-2
transition transition
group-hover:text-secondaryDark group-hover:text-secondaryDark
" "
@click="toggleShowChildren()" @click="toggleShowChildren()"
> >
<span class="truncate"> {{ collection.name }} </span> <span class="truncate"> {{ collection.name }} </span>
</span> </span>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary
v-if="doc && !selected" v-if="doc && !selected"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('import.title')" :title="$t('import.title')"
icon="radio_button_unchecked" svg="circle"
color="green" color="green"
@click.native="$emit('select-collection')" @click.native="$emit('select-collection')"
/> />
<ButtonSecondary <ButtonSecondary
v-if="doc && selected" v-if="doc && selected"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('action.remove')" :title="$t('action.remove')"
icon="check_circle_outline" svg="check-circle"
color="green" color="green"
@click.native="$emit('unselect-collection')" @click.native="$emit('unselect-collection')"
/> />
<ButtonSecondary <ButtonSecondary
v-if="!doc" v-if="!doc"
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
icon="create_new_folder" svg="folder-plus"
:title="$t('folder.new')" :title="$t('folder.new')"
class="hidden group-hover:inline-flex" class="hidden group-hover:inline-flex"
@click.native=" @click.native="
$emit('add-folder', { $emit('add-folder', {
folder: collection, folder: collection,
path: `${collectionIndex}`, path: `${collectionIndex}`,
}) })
" "
/> />
<span> <span>
skipping to change at line 76 skipping to change at line 78
ref="options" ref="options"
interactive interactive
trigger="click" trigger="click"
theme="popover" theme="popover"
arrow arrow
> >
<template #trigger> <template #trigger>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('action.more')" :title="$t('action.more')"
icon="more_vert" svg="more-vertical"
/> />
</template> </template>
<SmartItem <SmartItem
icon="create_new_folder" svg="folder-plus"
:label="$t('folder.new')" :label="$t('folder.new')"
@click.native=" @click.native="
$emit('add-folder', { () => {
folder: collection, $emit('add-folder', {
path: `${collectionIndex}`, folder: collection,
}) path: `${collectionIndex}`,
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
icon="create" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-collection') () => {
$refs.options.tippy().hide() $emit('edit-collection')
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
icon="delete" svg="trash-2"
color="red" color="red"
:label="$t('action.delete')" :label="$t('action.delete')"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
</span> </span>
</div> </div>
</div> </div>
<div v-if="showChildren || isFiltered"> <div v-if="showChildren || isFiltered" class="flex">
<CollectionsMyFolder
v-for="(folder, index) in collection.folders"
:key="`folder-${index}`"
class="border-l border-dividerLight ml-6"
:folder="folder"
:folder-index="index"
:folder-path="`${collectionIndex}/${index}`"
:collection-index="collectionIndex"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:is-filtered="isFiltered"
:picked="picked"
@add-folder="$emit('add-folder', $event)"
@edit-folder="$emit('edit-folder', $event)"
@edit-request="$emit('edit-request', $event)"
@select="$emit('select', $event)"
@remove-request="$emit('remove-request', $event)"
/>
<CollectionsMyRequest
v-for="(request, index) in collection.requests"
:key="`request-${index}`"
class="border-l border-dividerLight ml-6"
:request="request"
:collection-index="collectionIndex"
:folder-index="-1"
:folder-name="collection.name"
:folder-path="collectionIndex.toString()"
:request-index="index"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
@edit-request="editRequest($event)"
@select="$emit('select', $event)"
@remove-request="$emit('remove-request', $event)"
/>
<div <div
v-if="
(collection.folders == undefined ||
collection.folders.length === 0) &&
(collection.requests == undefined || collection.requests.length === 0)
"
class=" class="
border-l border-dividerLight flex
flex flex-col w-1
text-secondaryLight transform
ml-6 transition
p-4 cursor-nsResize
items-center ml-5.5
justify-center bg-dividerLight
hover:scale-x-125 hover:bg-dividerDark
" "
> @click="toggleShowChildren()"
<i class="opacity-75 pb-2 material-icons">folder_open</i> ></div>
<span class="text-center"> <div class="flex flex-col flex-1 truncate">
{{ $t("empty.collection") }} <CollectionsMyFolder
</span> v-for="(folder, index) in collection.folders"
:key="`folder-${index}`"
:folder="folder"
:folder-index="index"
:folder-path="`${collectionIndex}/${index}`"
:collection-index="collectionIndex"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:is-filtered="isFiltered"
:picked="picked"
@add-folder="$emit('add-folder', $event)"
@edit-folder="$emit('edit-folder', $event)"
@edit-request="$emit('edit-request', $event)"
@select="$emit('select', $event)"
@remove-request="$emit('remove-request', $event)"
/>
<CollectionsMyRequest
v-for="(request, index) in collection.requests"
:key="`request-${index}`"
:request="request"
:collection-index="collectionIndex"
:folder-index="-1"
:folder-name="collection.name"
:folder-path="`${collectionIndex}`"
:request-index="index"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
@edit-request="editRequest($event)"
@select="$emit('select', $event)"
@remove-request="$emit('remove-request', $event)"
/>
<div
v-if="
(collection.folders == undefined ||
collection.folders.length === 0) &&
(collection.requests == undefined ||
collection.requests.length === 0)
"
class="
flex flex-col
text-secondaryLight
p-4
items-center
justify-center
"
>
<img
:src="`/images/states/${$colorMode.value}/pack.svg`"
loading="lazy"
class="
flex-col
mb-4
object-contain object-center
h-16
w-16
inline-flex
"
/>
<span class="text-center">
{{ $t("empty.collection") }}
</span>
</div>
</div> </div>
</div> </div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_collection')" :title="$t('confirm.remove_collection')"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="removeCollection" @resolve="removeCollection"
/> />
</div> </div>
</template> </template>
skipping to change at line 215 skipping to change at line 246
}, },
computed: { computed: {
isSelected() { isSelected() {
return ( return (
this.picked && this.picked &&
this.picked.pickedType === "my-collection" && this.picked.pickedType === "my-collection" &&
this.picked.collectionIndex === this.collectionIndex this.picked.collectionIndex === this.collectionIndex
) )
}, },
getCollectionIcon() { getCollectionIcon() {
if (this.isSelected) return "check_circle_outline" if (this.isSelected) return "check-circle"
else if (!this.showChildren && !this.isFiltered) return "folder" else if (!this.showChildren && !this.isFiltered) return "folder"
else if (this.showChildren || this.isFiltered) return "folder_open" else if (this.showChildren || this.isFiltered) return "folder-minus"
else return "folder" else return "folder"
}, },
}, },
methods: { methods: {
editRequest(event) { editRequest(event) {
this.$emit("edit-request", event) this.$emit("edit-request", event)
}, },
toggleShowChildren() { toggleShowChildren() {
if (this.$props.saveRequest) if (this.$props.saveRequest)
this.$emit("select", { this.$emit("select", {
skipping to change at line 248 skipping to change at line 279
this.$emit("remove-collection", { this.$emit("remove-collection", {
collectionsType: this.collectionsType, collectionsType: this.collectionsType,
collectionIndex: this.collectionIndex, collectionIndex: this.collectionIndex,
collectionID: this.collection.id, collectionID: this.collection.id,
}) })
}, },
dropEvent({ dataTransfer }) { dropEvent({ dataTransfer }) {
this.dragging = !this.dragging this.dragging = !this.dragging
const folderPath = dataTransfer.getData("folderPath") const folderPath = dataTransfer.getData("folderPath")
const requestIndex = dataTransfer.getData("requestIndex") const requestIndex = dataTransfer.getData("requestIndex")
moveRESTRequest(folderPath, requestIndex, this.collectionIndex.toString()) moveRESTRequest(folderPath, requestIndex, `${this.collectionIndex}`)
}, },
}, },
}) })
</script> </script>
 End of changes. 18 change blocks. 
77 lines changed or deleted 108 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)