"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "components/collections/teams/Folder.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.

Folder.vue  (hoppscotch-2.0.0):Folder.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
skipping to change at line 32 skipping to change at line 34
@click="toggleShowChildren()" @click="toggleShowChildren()"
> >
<span class="truncate"> <span class="truncate">
{{ folder.name ? folder.name : folder.title }} {{ folder.name ? folder.name : folder.title }}
</span> </span>
</span> </span>
<div class="flex"> <div class="flex">
<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="$emit('add-folder', { folder, path: folderPath })" @click.native="$emit('add-folder', { folder, path: folderPath })"
/> />
<span> <span>
<tippy <tippy
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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, path: folderPath }) () => {
$refs.options.tippy().hide() $emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'" v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="edit" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-folder', { () => {
folder, $emit('edit-folder', {
folderIndex, folder,
collectionIndex, folderIndex,
folderPath: '', collectionIndex,
}) folderPath: '',
$refs.options.tippy().hide() })
$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="(subFolder, subFolderIndex) in folder.children"
:key="`subFolder-${subFolderIndex}`"
class="border-l border-dividerLight ml-6"
:folder="subFolder"
:folder-index="subFolderIndex"
:collection-index="collectionIndex"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:folder-path="`${folderPath}/${subFolderIndex}`"
:picked="picked"
@add-folder="$emit('add-folder', $event)"
@edit-folder="$emit('edit-folder', $event)"
@edit-request="$emit('edit-request', $event)"
@update-team-collections="$emit('update-team-collections')"
@select="$emit('select', $event)"
@expand-collection="expandCollection"
@remove-request="removeRequest"
/>
<CollectionsTeamsRequest
v-for="(request, index) in folder.requests"
:key="`request-${index}`"
class="border-l border-dividerLight ml-6"
:request="request.request"
:collection-index="collectionIndex"
:folder-index="folderIndex"
:folder-name="folder.name"
:request-index="request.id"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
@edit-request="$emit('edit-request', $event)"
@select="$emit('select', $event)"
@remove-request="removeRequest"
/>
<div <div
v-if="
(folder.children == undefined || folder.children.length === 0) &&
(folder.requests == undefined || folder.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.folder") }} <CollectionsTeamsFolder
</span> v-for="(subFolder, subFolderIndex) in folder.children"
:key="`subFolder-${subFolderIndex}`"
:folder="subFolder"
:folder-index="subFolderIndex"
:collection-index="collectionIndex"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:folder-path="`${folderPath}/${subFolderIndex}`"
:picked="picked"
@add-folder="$emit('add-folder', $event)"
@edit-folder="$emit('edit-folder', $event)"
@edit-request="$emit('edit-request', $event)"
@update-team-collections="$emit('update-team-collections')"
@select="$emit('select', $event)"
@expand-collection="expandCollection"
@remove-request="removeRequest"
/>
<CollectionsTeamsRequest
v-for="(request, index) in folder.requests"
:key="`request-${index}`"
:request="request.request"
:collection-index="collectionIndex"
:folder-index="folderIndex"
:folder-name="folder.name"
:request-index="request.id"
:doc="doc"
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
@edit-request="$emit('edit-request', $event)"
@select="$emit('select', $event)"
@remove-request="removeRequest"
/>
<div
v-if="
(folder.children == undefined || folder.children.length === 0) &&
(folder.requests == undefined || folder.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.folder") }}
</span>
</div>
</div> </div>
</div> </div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_folder')" :title="$t('confirm.remove_folder')"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="removeFolder" @resolve="removeFolder"
/> />
</div> </div>
</template> </template>
skipping to change at line 192 skipping to change at line 222
}, },
computed: { computed: {
isSelected() { isSelected() {
return ( return (
this.picked && this.picked &&
this.picked.pickedType === "teams-folder" && this.picked.pickedType === "teams-folder" &&
this.picked.folderID === this.folder.id this.picked.folderID === this.folder.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: {
toggleShowChildren() { toggleShowChildren() {
if (this.$props.saveRequest) if (this.$props.saveRequest)
this.$emit("select", { this.$emit("select", {
picked: { picked: {
pickedType: "teams-folder", pickedType: "teams-folder",
folderID: this.folder.id, folderID: this.folder.id,
 End of changes. 15 change blocks. 
75 lines changed or deleted 105 lines changed or added

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