diff --git a/app/models/WebhookSubscription.ts b/app/models/WebhookSubscription.ts
index be7c73320..093df0315 100644
--- a/app/models/WebhookSubscription.ts
+++ b/app/models/WebhookSubscription.ts
@@ -15,6 +15,10 @@ class WebhookSubscription extends BaseModel {
@observable
url: string;
+ @Field
+ @observable
+ secret: string;
+
@Field
@observable
enabled: boolean;
diff --git a/app/scenes/Settings/components/WebhookSubscriptionForm.tsx b/app/scenes/Settings/components/WebhookSubscriptionForm.tsx
index fc58ec498..629f514ba 100644
--- a/app/scenes/Settings/components/WebhookSubscriptionForm.tsx
+++ b/app/scenes/Settings/components/WebhookSubscriptionForm.tsx
@@ -146,6 +146,7 @@ type Props = {
interface FormData {
name: string;
url: string;
+ secret: string;
events: string[];
}
@@ -163,6 +164,7 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) {
events: webhookSubscription ? [...webhookSubscription.events] : [],
name: webhookSubscription?.name,
url: webhookSubscription?.url,
+ secret: webhookSubscription?.secret,
},
});
@@ -237,6 +239,7 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) {
autoFocus
flex
label={t("Name")}
+ placeholder={t("A memorable identifer")}
{...register("name", {
required: true,
})}
@@ -250,6 +253,14 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) {
label={t("URL")}
{...register("url", { required: true })}
/>
+
diff --git a/app/typings/styled-components.d.ts b/app/typings/styled-components.d.ts
index c8e571d58..a51e8e5d0 100644
--- a/app/typings/styled-components.d.ts
+++ b/app/typings/styled-components.d.ts
@@ -16,7 +16,6 @@ declare module "styled-components" {
tableDivider: string;
tableSelected: string;
tableSelectedBackground: string;
- tableHeaderBackground: string;
quote: string;
codeBackground: string;
codeBorder: string;
diff --git a/package.json b/package.json
index 308c9c555..9a231f1a6 100644
--- a/package.json
+++ b/package.json
@@ -163,7 +163,7 @@
"prosemirror-transform": "1.2.5",
"prosemirror-utils": "^0.9.6",
"prosemirror-view": "1.26.5",
- "query-string": "^7.0.1",
+ "query-string": "^7.1.1",
"quoted-printable": "^1.0.1",
"randomstring": "1.1.5",
"rate-limiter-flexible": "^2.3.7",
@@ -306,7 +306,7 @@
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"babel-plugin-tsconfig-paths-module-resolver": "^1.0.3",
- "concurrently": "^7.3.0",
+ "concurrently": "^7.4.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.32.0",
@@ -335,7 +335,7 @@
"rimraf": "^2.5.4",
"terser-webpack-plugin": "^4.1.0",
"typescript": "^4.7.4",
- "url-loader": "^0.6.2",
+ "url-loader": "^4.1.1",
"webpack": "4.44.1",
"webpack-cli": "^4.10.0",
"webpack-manifest-plugin": "^3.0.0",
diff --git a/server/commands/revisionCreator.ts b/server/commands/revisionCreator.ts
index 9ce4db287..962b8fe7f 100644
--- a/server/commands/revisionCreator.ts
+++ b/server/commands/revisionCreator.ts
@@ -10,10 +10,7 @@ export default async function revisionCreator({
user: User;
ip?: string;
}) {
- let transaction;
-
- try {
- transaction = await sequelize.transaction();
+ return sequelize.transaction(async (transaction) => {
const revision = await Revision.createFromDocument(document, {
transaction,
});
@@ -32,13 +29,6 @@ export default async function revisionCreator({
transaction,
}
);
- await transaction.commit();
return revision;
- } catch (err) {
- if (transaction) {
- await transaction.rollback();
- }
-
- throw err;
- }
+ });
}
diff --git a/server/emails/templates/DocumentNotificationEmail.tsx b/server/emails/templates/DocumentNotificationEmail.tsx
index f7c7a54f4..d99a1693b 100644
--- a/server/emails/templates/DocumentNotificationEmail.tsx
+++ b/server/emails/templates/DocumentNotificationEmail.tsx
@@ -3,6 +3,7 @@ import { Document } from "@server/models";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
import Button from "./components/Button";
+import Diff from "./components/Diff";
import EmailTemplate from "./components/EmailLayout";
import EmptySpace from "./components/EmptySpace";
import Footer from "./components/Footer";
@@ -17,6 +18,7 @@ type InputProps = {
eventName: string;
teamUrl: string;
unsubscribeUrl: string;
+ content: string;
};
type BeforeSend = {
@@ -73,25 +75,34 @@ Open Document: ${teamUrl}${document.url}
eventName = "published",
teamUrl,
unsubscribeUrl,
+ content,
}: Props) {
+ const link = `${teamUrl}${document.url}?ref=notification-email`;
+
return (
- "{document.title}" {eventName}
+ “{document.title}” {eventName}
- {actorName} {eventName} the document "{document.title}", in the{" "}
- {collectionName} collection.
+ {actorName} {eventName} the document{" "}
+ {document.title}, in the {collectionName}{" "}
+ collection.
-
-
- {document.getSummary()}
-
+ {content && (
+ <>
+
+
+
+
+
+ >
+ )}
-
+
diff --git a/server/emails/templates/InviteEmail.tsx b/server/emails/templates/InviteEmail.tsx
index c7259fa56..a80f0fffe 100644
--- a/server/emails/templates/InviteEmail.tsx
+++ b/server/emails/templates/InviteEmail.tsx
@@ -57,7 +57,7 @@ Join now: ${teamUrl}
-
+