"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "components/collections/teams/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)
<template> <template>
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex items-center group"> <div class="flex items-center group">
<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.title }} </span> <span class="truncate"> {{ collection.title }} </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="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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 69 skipping to change at line 71
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
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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">
<CollectionsTeamsFolder
v-for="(folder, index) in collection.children"
: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)"
@expand-collection="expandCollection"
@remove-request="removeRequest"
/>
<CollectionsTeamsRequest
v-for="(request, index) in collection.requests"
:key="`request-${index}`"
class="border-l border-dividerLight ml-6"
:request="request.request"
:collection-index="collectionIndex"
:folder-index="-1"
:folder-name="collection.name"
:request-index="request.id"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
@edit-request="editRequest($event)"
@select="$emit('select', $event)"
@remove-request="removeRequest"
/>
<div <div
v-if="
(collection.children == undefined ||
collection.children.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") }} <CollectionsTeamsFolder
</span> v-for="(folder, index) in collection.children"
: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)"
@expand-collection="expandCollection"
@remove-request="removeRequest"
/>
<CollectionsTeamsRequest
v-for="(request, index) in collection.requests"
:key="`request-${index}`"
:request="request.request"
:collection-index="collectionIndex"
:folder-index="-1"
:folder-name="collection.name"
:request-index="request.id"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
@edit-request="editRequest($event)"
@select="$emit('select', $event)"
@remove-request="removeRequest"
/>
<div
v-if="
(collection.children == undefined ||
collection.children.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 209 skipping to change at line 240
}, },
computed: { computed: {
isSelected() { isSelected() {
return ( return (
this.picked && this.picked &&
this.picked.pickedType === "teams-collection" && this.picked.pickedType === "teams-collection" &&
this.picked.collectionID === this.collection.id this.picked.collectionID === this.collection.id
) )
}, },
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)
if (this.$props.saveRequest) if (this.$props.saveRequest)
this.$emit("select", { this.$emit("select", {
picked: { picked: {
pickedType: "teams-collection", pickedType: "teams-collection",
 End of changes. 17 change blocks. 
76 lines changed or deleted 107 lines changed or added

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