refactor: port collection move/reorder
This commit is contained in:
@@ -656,7 +656,12 @@ export class PersonalWorkspaceProviderService
|
||||
type: "collection",
|
||||
value: {
|
||||
collectionID: `${collectionID}/${id}`,
|
||||
isLastItem:
|
||||
item.folders?.length > 1
|
||||
? id === item.folders.length - 1
|
||||
: false,
|
||||
name: childColl.name,
|
||||
parentCollectionID: collectionID,
|
||||
},
|
||||
}
|
||||
})
|
||||
@@ -665,6 +670,11 @@ export class PersonalWorkspaceProviderService
|
||||
return <RESTCollectionViewItem>{
|
||||
type: "request",
|
||||
value: {
|
||||
isLastItem:
|
||||
item.requests?.length > 1
|
||||
? id === item.requests.length - 1
|
||||
: false,
|
||||
parentCollectionID: collectionID,
|
||||
requestID: `${collectionID}/${id}`,
|
||||
request: req,
|
||||
},
|
||||
@@ -711,7 +721,10 @@ export class PersonalWorkspaceProviderService
|
||||
return this.restCollectionState.value.state.map((coll, id) => {
|
||||
return {
|
||||
collectionID: id.toString(),
|
||||
isLastItem:
|
||||
id === this.restCollectionState.value.state.length - 1,
|
||||
name: coll.name,
|
||||
parentIndex: null,
|
||||
}
|
||||
})
|
||||
}),
|
||||
|
||||
@@ -10,7 +10,9 @@ export type RESTCollectionLevelAuthHeadersView = {
|
||||
export type RESTCollectionViewCollection = {
|
||||
collectionID: string
|
||||
|
||||
isLastItem: boolean
|
||||
name: string
|
||||
parentCollectionID: string | null
|
||||
}
|
||||
|
||||
export type RESTCollectionViewRequest = {
|
||||
@@ -18,6 +20,8 @@ export type RESTCollectionViewRequest = {
|
||||
requestID: string
|
||||
|
||||
request: HoppRESTRequest
|
||||
isLastItem: boolean
|
||||
parentCollectionID: string | null
|
||||
}
|
||||
|
||||
export type RESTCollectionViewItem =
|
||||
|
||||
Reference in New Issue
Block a user