index.vue (hoppscotch-2.0.0) | : | index.vue (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 17 | skipping to change at line 17 | |||
class=" | class=" | |||
divide-y divide-dividerLight | divide-y divide-dividerLight | |||
bg-primary | bg-primary | |||
border-b border-dividerLight | border-b border-dividerLight | |||
rounded-t | rounded-t | |||
flex flex-col | flex flex-col | |||
top-0 | top-0 | |||
z-10 | z-10 | |||
sticky | sticky | |||
" | " | |||
:class="{ '!top-sidebarPrimaryStickyFold': !saveRequest && !doc }" | ||||
> | > | |||
<div v-if="!saveRequest" class="search-wrapper"> | <div v-if="!saveRequest" class="search-wrappe"> | |||
<input | <input | |||
v-model="filterText" | v-model="filterText" | |||
type="search" | type="search" | |||
autocomplete="off" | ||||
:placeholder="$t('action.search')" | :placeholder="$t('action.search')" | |||
class="bg-transparent flex w-full py-2 pr-2 pl-10" | class="bg-transparent flex w-full py-2 pr-2 pl-4" | |||
/> | /> | |||
</div> | </div> | |||
<CollectionsChooseType | <CollectionsChooseType | |||
:collections-type="collectionsType" | :collections-type="collectionsType" | |||
:show="showTeamCollections" | :show="showTeamCollections" | |||
:doc="doc" | :doc="doc" | |||
@update-collection-type="updateCollectionType" | @update-collection-type="updateCollectionType" | |||
@update-selected-team="updateSelectedTeam" | @update-selected-team="updateSelectedTeam" | |||
/> | /> | |||
<div class="flex flex-1 justify-between"> | <div class="flex flex-1 justify-between"> | |||
<ButtonSecondary | <ButtonSecondary | |||
v-if=" | v-if=" | |||
collectionsType.type == 'team-collections' && | collectionsType.type == 'team-collections' && | |||
(collectionsType.selectedTeam == undefined || | (collectionsType.selectedTeam == undefined || | |||
collectionsType.selectedTeam.myRole == 'VIEWER') | collectionsType.selectedTeam.myRole == 'VIEWER') | |||
" | " | |||
v-tippy="{ theme: 'tooltip' }" | v-tippy="{ theme: 'tooltip' }" | |||
disabled | disabled | |||
class="rounded-none" | class="!rounded-none" | |||
icon="add" | svg="plus" | |||
:title="$t('team.no_access')" | :title="$t('team.no_access')" | |||
:label="$t('action.new')" | :label="$t('action.new')" | |||
/> | /> | |||
<ButtonSecondary | <ButtonSecondary | |||
v-else | v-else | |||
icon="add" | svg="plus" | |||
:label="$t('action.new')" | :label="$t('action.new')" | |||
class="rounded-none" | class="!rounded-none" | |||
@click.native="displayModalAdd(true)" | @click.native="displayModalAdd(true)" | |||
/> | /> | |||
<span class="flex"> | <span class="flex"> | |||
<ButtonSecondary | <ButtonSecondary | |||
v-tippy="{ theme: 'tooltip' }" | v-tippy="{ theme: 'tooltip' }" | |||
to="https://docs.hoppscotch.io/features/collections" | to="https://docs.hoppscotch.io/features/collections" | |||
blank | blank | |||
:title="$t('app.wiki')" | :title="$t('app.wiki')" | |||
icon="help_outline" | svg="help-circle" | |||
/> | /> | |||
<ButtonSecondary | <ButtonSecondary | |||
v-if="!saveRequest" | v-if="!saveRequest" | |||
v-tippy="{ theme: 'tooltip' }" | v-tippy="{ theme: 'tooltip' }" | |||
:disabled=" | :disabled=" | |||
collectionsType.type == 'team-collections' && | collectionsType.type == 'team-collections' && | |||
collectionsType.selectedTeam == undefined | collectionsType.selectedTeam == undefined | |||
" | " | |||
icon="import_export" | svg="archive" | |||
:title="$t('modal.import_export')" | :title="$t('modal.import_export')" | |||
@click.native="displayModalImportExport(true)" | @click.native="displayModalImportExport(true)" | |||
/> | /> | |||
</span> | </span> | |||
</div> | </div> | |||
</div> | </div> | |||
<div class="flex flex-col"> | <div class="flex flex-col"> | |||
<component | <component | |||
:is=" | :is=" | |||
collectionsType.type == 'my-collections' | collectionsType.type == 'my-collections' | |||
skipping to change at line 111 | skipping to change at line 111 | |||
@select="$emit('select', $event)" | @select="$emit('select', $event)" | |||
@expand-collection="expandCollection" | @expand-collection="expandCollection" | |||
@remove-collection="removeCollection" | @remove-collection="removeCollection" | |||
@remove-request="removeRequest" | @remove-request="removeRequest" | |||
/> | /> | |||
</div> | </div> | |||
<div | <div | |||
v-if="filteredCollections.length === 0 && filterText.length === 0" | v-if="filteredCollections.length === 0 && filterText.length === 0" | |||
class="flex flex-col text-secondaryLight p-4 items-center justify-center" | 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 my-4 object-contain object-center h-16 w-16 inline-flex" | ||||
/> | ||||
<span class="text-center pb-4"> | <span class="text-center pb-4"> | |||
{{ $t("empty.collections") }} | {{ $t("empty.collections") }} | |||
</span> | </span> | |||
<ButtonSecondary | <ButtonSecondary | |||
v-if=" | v-if=" | |||
collectionsType.type == 'team-collections' && | collectionsType.type == 'team-collections' && | |||
(collectionsType.selectedTeam == undefined || | (collectionsType.selectedTeam == undefined || | |||
collectionsType.selectedTeam.myRole == 'VIEWER') | collectionsType.selectedTeam.myRole == 'VIEWER') | |||
" | " | |||
v-tippy="{ theme: 'tooltip' }" | v-tippy="{ theme: 'tooltip' }" | |||
skipping to change at line 509 | skipping to change at line 514 | |||
onAddFolder({ name, folder, path }) { | onAddFolder({ name, folder, path }) { | |||
if (this.collectionsType.type === "my-collections") { | if (this.collectionsType.type === "my-collections") { | |||
addRESTFolder(name, path) | addRESTFolder(name, path) | |||
} else if (this.collectionsType.type === "team-collections") { | } else if (this.collectionsType.type === "team-collections") { | |||
if (this.collectionsType.selectedTeam.myRole !== "VIEWER") { | if (this.collectionsType.selectedTeam.myRole !== "VIEWER") { | |||
this.$apollo | this.$apollo | |||
.mutate({ | .mutate({ | |||
mutation: gql` | mutation: gql` | |||
mutation CreateChildCollection( | mutation CreateChildCollection( | |||
$childTitle: String! | $childTitle: String! | |||
$collectionID: String! | $collectionID: ID! | |||
) { | ) { | |||
createChildCollection( | createChildCollection( | |||
childTitle: $childTitle | childTitle: $childTitle | |||
collectionID: $collectionID | collectionID: $collectionID | |||
) { | ) { | |||
id | id | |||
} | } | |||
} | } | |||
`, | `, | |||
// Parameters | // Parameters | |||
skipping to change at line 616 | skipping to change at line 621 | |||
this.picked.collectionID === collectionID | this.picked.collectionID === collectionID | |||
) { | ) { | |||
this.$emit("select", { picked: null }) | this.$emit("select", { picked: null }) | |||
} | } | |||
if (collectionsType.selectedTeam.myRole !== "VIEWER") { | if (collectionsType.selectedTeam.myRole !== "VIEWER") { | |||
this.$apollo | this.$apollo | |||
.mutate({ | .mutate({ | |||
// Query | // Query | |||
mutation: gql` | mutation: gql` | |||
mutation ($collectionID: String!) { | mutation ($collectionID: ID!) { | |||
deleteCollection(collectionID: $collectionID) | deleteCollection(collectionID: $collectionID) | |||
} | } | |||
`, | `, | |||
// Parameters | // Parameters | |||
variables: { | variables: { | |||
collectionID, | collectionID, | |||
}, | }, | |||
}) | }) | |||
.then(() => { | .then(() => { | |||
this.$toast.success(this.$t("state.deleted"), { | this.$toast.success(this.$t("state.deleted"), { | |||
End of changes. 12 change blocks. | ||||
11 lines changed or deleted | 16 lines changed or added |