From f445cd4d86343c8fee51828a29c44fa2d58375be Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 22 Apr 2021 16:06:29 +0100 Subject: [PATCH] Formatting. --- .../src/api/controllers/admin/templates.js | 7 ++++++- packages/worker/src/constants/index.js | 6 +++--- .../worker/src/constants/templates/index.js | 20 ++++++++++++++----- packages/worker/src/utilities/fileSystem.js | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/packages/worker/src/api/controllers/admin/templates.js b/packages/worker/src/api/controllers/admin/templates.js index ccf057c485..0314ca6099 100644 --- a/packages/worker/src/api/controllers/admin/templates.js +++ b/packages/worker/src/api/controllers/admin/templates.js @@ -4,7 +4,12 @@ const { StaticDatabases, } = require("@budibase/auth").db const { CouchDB } = require("../../../db") -const { TemplatePurposePretty, TemplateTypes, EmailTemplatePurpose, TemplatePurpose } = require("../../../constants") +const { + TemplatePurposePretty, + TemplateTypes, + EmailTemplatePurpose, + TemplatePurpose, +} = require("../../../constants") const { getTemplateByPurpose } = require("../../../constants/templates") const GLOBAL_DB = StaticDatabases.GLOBAL.name diff --git a/packages/worker/src/constants/index.js b/packages/worker/src/constants/index.js index 8edba58fda..44ca57ea17 100644 --- a/packages/worker/src/constants/index.js +++ b/packages/worker/src/constants/index.js @@ -43,7 +43,7 @@ const TemplatePurposePretty = { }, { name: "Password Recovery", - value: EmailTemplatePurpose.PASSWORD_RECOVERY + value: EmailTemplatePurpose.PASSWORD_RECOVERY, }, { name: "New User Invitation", @@ -52,8 +52,8 @@ const TemplatePurposePretty = { { name: "Custom", value: EmailTemplatePurpose.CUSTOM, - } - ] + }, + ], } // all purpose combined diff --git a/packages/worker/src/constants/templates/index.js b/packages/worker/src/constants/templates/index.js index 42fbcf70ab..53db5f2b42 100644 --- a/packages/worker/src/constants/templates/index.js +++ b/packages/worker/src/constants/templates/index.js @@ -5,11 +5,21 @@ const { join } = require("path") const TEMPLATE_PATH = join(__dirname, "..", "constants", "templates") exports.EmailTemplates = { - [EmailTemplatePurpose.PASSWORD_RECOVERY]: readStaticFile(join(TEMPLATE_PATH, "passwordRecovery.html")), - [EmailTemplatePurpose.INVITATION]: readStaticFile(join(TEMPLATE_PATH, "invitation.html")), - [EmailTemplatePurpose.HEADER]: readStaticFile(join(TEMPLATE_PATH, "header.html")), - [EmailTemplatePurpose.FOOTER]: readStaticFile(join(TEMPLATE_PATH, "footer.html")), - [EmailTemplatePurpose.STYLES]: readStaticFile(join(TEMPLATE_PATH, "style.css")), + [EmailTemplatePurpose.PASSWORD_RECOVERY]: readStaticFile( + join(TEMPLATE_PATH, "passwordRecovery.html") + ), + [EmailTemplatePurpose.INVITATION]: readStaticFile( + join(TEMPLATE_PATH, "invitation.html") + ), + [EmailTemplatePurpose.HEADER]: readStaticFile( + join(TEMPLATE_PATH, "header.html") + ), + [EmailTemplatePurpose.FOOTER]: readStaticFile( + join(TEMPLATE_PATH, "footer.html") + ), + [EmailTemplatePurpose.STYLES]: readStaticFile( + join(TEMPLATE_PATH, "style.css") + ), } exports.getTemplateByPurpose = purpose => { diff --git a/packages/worker/src/utilities/fileSystem.js b/packages/worker/src/utilities/fileSystem.js index 7df21db695..8f0bc8d3ed 100644 --- a/packages/worker/src/utilities/fileSystem.js +++ b/packages/worker/src/utilities/fileSystem.js @@ -2,4 +2,4 @@ const { readFileSync } = require("fs") exports.readStaticFile = path => { return readFileSync(path, "utf-8") -} \ No newline at end of file +}