feat: collection level headers and authorization (#3505)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Nivedin
2023-12-13 22:43:18 +05:30
committed by GitHub
parent f3edd001d7
commit 47e009267b
95 changed files with 3221 additions and 970 deletions

View File

@@ -71,6 +71,13 @@
collection: node.data.data.data,
})
"
@edit-properties="
node.data.type === 'collections' &&
emit('edit-properties', {
collectionIndex: node.id,
collection: node.data.data.data,
})
"
@export-data="
node.data.type === 'collections' &&
emit('export-data', node.data.data.data)
@@ -139,6 +146,13 @@
folder: node.data.data.data,
})
"
@edit-properties="
node.data.type === 'folders' &&
emit('edit-properties', {
collectionIndex: node.id,
collection: node.data.data.data,
})
"
@export-data="
node.data.type === 'folders' &&
emit('export-data', node.data.data.data)
@@ -344,7 +358,7 @@ export type Collection = {
isLastItem: boolean
data: {
parentIndex: null
data: HoppCollection<HoppRESTRequest>
data: HoppCollection
}
}
@@ -353,7 +367,7 @@ type Folder = {
isLastItem: boolean
data: {
parentIndex: string
data: HoppCollection<HoppRESTRequest>
data: HoppCollection
}
}
@@ -380,7 +394,7 @@ type CollectionType =
const props = defineProps({
filteredCollections: {
type: Array as PropType<HoppCollection<HoppRESTRequest>[]>,
type: Array as PropType<HoppCollection[]>,
default: () => [],
required: true,
},
@@ -412,28 +426,35 @@ const emit = defineEmits<{
event: "add-request",
payload: {
path: string
folder: HoppCollection<HoppRESTRequest>
folder: HoppCollection
}
): void
(
event: "add-folder",
payload: {
path: string
folder: HoppCollection<HoppRESTRequest>
folder: HoppCollection
}
): void
(
event: "edit-collection",
payload: {
collectionIndex: string
collection: HoppCollection<HoppRESTRequest>
collection: HoppCollection
}
): void
(
event: "edit-folder",
payload: {
folderPath: string
folder: HoppCollection<HoppRESTRequest>
folder: HoppCollection
}
): void
(
event: "edit-properties",
payload: {
collectionIndex: string
collection: HoppCollection
}
): void
(
@@ -451,7 +472,7 @@ const emit = defineEmits<{
request: HoppRESTRequest
}
): void
(event: "export-data", payload: HoppCollection<HoppRESTRequest>): void
(event: "export-data", payload: HoppCollection): void
(event: "remove-collection", payload: string): void
(event: "remove-folder", payload: string): void
(
@@ -665,10 +686,10 @@ const updateCollectionOrder = (
type MyCollectionNode = Collection | Folder | Requests
class MyCollectionsAdapter implements SmartTreeAdapter<MyCollectionNode> {
constructor(public data: Ref<HoppCollection<HoppRESTRequest>[]>) {}
constructor(public data: Ref<HoppCollection[]>) {}
navigateToFolderWithIndexPath(
collections: HoppCollection<HoppRESTRequest>[],
collections: HoppCollection[],
indexPaths: number[]
) {
if (indexPaths.length === 0) return null