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:
@@ -238,23 +238,17 @@ export default class Document extends ParanoidModel {
|
||||
}
|
||||
|
||||
@action
|
||||
share = async () => {
|
||||
return this.store.rootStore.shares.create({
|
||||
share = async () =>
|
||||
this.store.rootStore.shares.create({
|
||||
documentId: this.id,
|
||||
});
|
||||
};
|
||||
|
||||
archive = () => {
|
||||
return this.store.archive(this);
|
||||
};
|
||||
archive = () => this.store.archive(this);
|
||||
|
||||
restore = (options?: { revisionId?: string; collectionId?: string }) => {
|
||||
return this.store.restore(this, options);
|
||||
};
|
||||
restore = (options?: { revisionId?: string; collectionId?: string }) =>
|
||||
this.store.restore(this, options);
|
||||
|
||||
unpublish = () => {
|
||||
return this.store.unpublish(this);
|
||||
};
|
||||
unpublish = () => this.store.unpublish(this);
|
||||
|
||||
@action
|
||||
enableEmbeds = () => {
|
||||
@@ -267,12 +261,11 @@ export default class Document extends ParanoidModel {
|
||||
};
|
||||
|
||||
@action
|
||||
pin = (collectionId?: string) => {
|
||||
return this.store.rootStore.pins.create({
|
||||
pin = (collectionId?: string) =>
|
||||
this.store.rootStore.pins.create({
|
||||
documentId: this.id,
|
||||
...(collectionId ? { collectionId } : {}),
|
||||
});
|
||||
};
|
||||
|
||||
@action
|
||||
unpin = (collectionId?: string) => {
|
||||
@@ -287,14 +280,10 @@ export default class Document extends ParanoidModel {
|
||||
};
|
||||
|
||||
@action
|
||||
star = () => {
|
||||
return this.store.star(this);
|
||||
};
|
||||
star = () => this.store.star(this);
|
||||
|
||||
@action
|
||||
unstar = () => {
|
||||
return this.store.unstar(this);
|
||||
};
|
||||
unstar = () => this.store.unstar(this);
|
||||
|
||||
/**
|
||||
* Subscribes the current user to this document.
|
||||
@@ -302,9 +291,7 @@ export default class Document extends ParanoidModel {
|
||||
* @returns A promise that resolves when the subscription is created.
|
||||
*/
|
||||
@action
|
||||
subscribe = () => {
|
||||
return this.store.subscribe(this);
|
||||
};
|
||||
subscribe = () => this.store.subscribe(this);
|
||||
|
||||
/**
|
||||
* Unsubscribes the current user to this document.
|
||||
@@ -312,9 +299,7 @@ export default class Document extends ParanoidModel {
|
||||
* @returns A promise that resolves when the subscription is destroyed.
|
||||
*/
|
||||
@action
|
||||
unsubscribe = (userId: string) => {
|
||||
return this.store.unsubscribe(userId, this);
|
||||
};
|
||||
unsubscribe = (userId: string) => this.store.unsubscribe(userId, this);
|
||||
|
||||
@action
|
||||
view = () => {
|
||||
@@ -336,9 +321,7 @@ export default class Document extends ParanoidModel {
|
||||
};
|
||||
|
||||
@action
|
||||
templatize = () => {
|
||||
return this.store.templatize(this.id);
|
||||
};
|
||||
templatize = () => this.store.templatize(this.id);
|
||||
|
||||
@action
|
||||
save = async (options?: SaveOptions | undefined) => {
|
||||
@@ -359,13 +342,10 @@ export default class Document extends ParanoidModel {
|
||||
}
|
||||
};
|
||||
|
||||
move = (collectionId: string, parentDocumentId?: string | undefined) => {
|
||||
return this.store.move(this.id, collectionId, parentDocumentId);
|
||||
};
|
||||
move = (collectionId: string, parentDocumentId?: string | undefined) =>
|
||||
this.store.move(this.id, collectionId, parentDocumentId);
|
||||
|
||||
duplicate = () => {
|
||||
return this.store.duplicate(this);
|
||||
};
|
||||
duplicate = () => this.store.duplicate(this);
|
||||
|
||||
getSummary = (paragraphs = 4) => {
|
||||
const result = this.text.trim().split("\n").slice(0, paragraphs).join("\n");
|
||||
@@ -405,8 +385,8 @@ export default class Document extends ParanoidModel {
|
||||
};
|
||||
}
|
||||
|
||||
download = (contentType: ExportContentType) => {
|
||||
return client.post(
|
||||
download = (contentType: ExportContentType) =>
|
||||
client.post(
|
||||
`/documents.export`,
|
||||
{
|
||||
id: this.id,
|
||||
@@ -418,5 +398,4 @@ export default class Document extends ParanoidModel {
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user