chore: update opened team coll tab and toast added

This commit is contained in:
nivedin
2023-12-12 19:43:08 +05:30
committed by Andrew Bastin
parent 00ff318194
commit b07d0c69cc
2 changed files with 19 additions and 15 deletions

View File

@@ -174,6 +174,7 @@
"new": "New Collection", "new": "New Collection",
"order_changed": "Collection Order Updated", "order_changed": "Collection Order Updated",
"properties":"Colection Properties", "properties":"Colection Properties",
"properties_updated": "Collection Properties Updated",
"renamed": "Collection renamed", "renamed": "Collection renamed",
"request_in_use": "Request in use", "request_in_use": "Request in use",
"save_as": "Save as", "save_as": "Save as",

View File

@@ -2130,24 +2130,27 @@ const setCollectionProperties = (newCollection: {
(err: GQLError<string>) => { (err: GQLError<string>) => {
toast.error(`${getErrorMessage(err)}`) toast.error(`${getErrorMessage(err)}`)
}, },
async () => { () => {
nextTick(() => { toast.success(t("collection.properties_updated"))
const { auth, headers } =
teamCollectionAdapter.cascadeParentCollectionForHeaderAuth(path)
updateInheritedPropertiesForAffectedRequests(
path,
{
auth,
headers,
},
"rest",
"team"
)
})
} }
) )
)() )()
//This is a hack to update the inherited properties of the requests if there an tab opened
// since it takes a little bit of time to update the collection tree
setTimeout(() => {
const { auth, headers } =
teamCollectionAdapter.cascadeParentCollectionForHeaderAuth(path)
updateInheritedPropertiesForAffectedRequests(
path,
{
auth,
headers,
},
"rest",
"team"
)
}, 200)
} }
displayModalEditProperties(false) displayModalEditProperties(false)