Assorted cleanup, minor bug fixes, styling fixes, eslint rules (#5165
* fix: Logic error in toast fix: Remove useless component * fix: Logout not clearing all stores * Add icons to notification settings * Add eslint rule to enforce spaced comment * Add eslint rule for arrow-body-style * Add eslint rule to enforce self-closing components * Add menu to api key settings Fix: Deleting webhook subscription does not remove from UI Split webhook subscriptions into active and inactive Styling updates
This commit is contained in:
@@ -477,12 +477,10 @@ class Collection extends ParanoidModel {
|
||||
id: string
|
||||
) => {
|
||||
children = await Promise.all(
|
||||
children.map(async (childDocument) => {
|
||||
return {
|
||||
...childDocument,
|
||||
children: await removeFromChildren(childDocument.children, id),
|
||||
};
|
||||
})
|
||||
children.map(async (childDocument) => ({
|
||||
...childDocument,
|
||||
children: await removeFromChildren(childDocument.children, id),
|
||||
}))
|
||||
);
|
||||
const match = find(children, {
|
||||
id,
|
||||
@@ -562,8 +560,8 @@ class Collection extends ParanoidModel {
|
||||
|
||||
const { id } = updatedDocument;
|
||||
|
||||
const updateChildren = (documents: NavigationNode[]) => {
|
||||
return Promise.all(
|
||||
const updateChildren = (documents: NavigationNode[]) =>
|
||||
Promise.all(
|
||||
documents.map(async (document) => {
|
||||
if (document.id === id) {
|
||||
document = {
|
||||
@@ -577,7 +575,6 @@ class Collection extends ParanoidModel {
|
||||
return document;
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
this.documentStructure = await updateChildren(this.documentStructure);
|
||||
// Sequelize doesn't seem to set the value with splice on JSONB field
|
||||
@@ -619,8 +616,8 @@ class Collection extends ParanoidModel {
|
||||
);
|
||||
} else {
|
||||
// Recursively place document
|
||||
const placeDocument = (documentList: NavigationNode[]) => {
|
||||
return documentList.map((childDocument) => {
|
||||
const placeDocument = (documentList: NavigationNode[]) =>
|
||||
documentList.map((childDocument) => {
|
||||
if (document.parentDocumentId === childDocument.id) {
|
||||
childDocument.children.splice(
|
||||
index !== undefined ? index : childDocument.children.length,
|
||||
@@ -633,7 +630,6 @@ class Collection extends ParanoidModel {
|
||||
|
||||
return childDocument;
|
||||
});
|
||||
};
|
||||
|
||||
this.documentStructure = placeDocument(this.documentStructure);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user