-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add templates to database #1522
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
👍 Looks great... updated the email in the DB, changes were seen. Deleted the Template from the DB, and the file-system version was used. |
aaronjudd
pushed a commit
that referenced
this pull request
Dec 21, 2016
* Register template (#1362) * added email templates package Added ability to register html and react templates with new helper Reaction.registerTemplate. * Schema updates and render render functions Added handlebars render functions, as well as the ability to register a custom template renderer. Added caching for handlebars templates. Updated templates schema with more properties. * Updated tests and template registration functionality * add handlebars * Quick fixes for template registration (#1518) Fixed import of "Import" module. Fixed type in jsDoc comments for "Import.template" function. * Remove unused imports * Add templates to database (#1522) * Register all email templates * Fetch email templates from database * Add helper to get email template file without any extra dependencies * Update method for fetching email template file * Fix template paths * Re-added missing comment * Fixed path to core order "new" email template * Admin Invite & Password reset emails (#1523) * added some comments to break up html table * reorganized data for email template removed all [0]. type variables from new.html email template, so all variables are set in orders.js for easy manipulation * welcome to the shop email template * extract social from template, add on/off switch * invite shop member email * shopName variable updates * update reaction address This was driving me crazy seeing the wrong address in all these emails being tested. * add Collections imports for Accounts, Cart, Shopts * password reset emails * update subject of order confirmation email * lint fix * renamed file for email template * removed test text * update const to conform to new file name (#1528) Will take care of `WARN Reaction: Template not found: accounts/reset_password. Falling back to coreDefault.html` error * Add registry settings to package * Conditionally show search * Make naming consistent * Look up in registry to determine whether to show search, and if so which template * Add migration to update existing registries * Modify all search-ui record * Loop until missing record is available to modify * Logging * No hook, no conditional * Make field label more explicit * Set name which is required for some reason * Make registry consistent with migration. I guess schema is not validated here either? * Remove logging * Update package.json to reflect release number * Discounts (#1556) * discount skeleton - remove from core - add core/discounts - add discounts-rates - add discount-codes - new discount schemas [WIP] * local module import of translations - adds `loadTranslations` and `loadTranslation` methods - removes necessity to add translations to core - `import { loadTranslations } from "/server/startup/i18n”;` - multiple file import illustrated in reaction-taxes - single import illustrated in reaction-discounts - introduces mergeDeep helper in i18n/startup and updates to translation resource structure to accommodate additional namespaces for package (uses package name). * updated i18n namespace and handling - add i18n handling for griddle column headers - add local i18n imports to discounts - updated i18n taxSettings namespace (into packages + admin) * change info logging to debug * schemas, forms, ui, i18n for discount modules * updated Discount schemas - implement client collections for DiscountCodes, DiscountRates - implement multi-schema on server Discounts collection * updated discounts pub - split security out * Meteor 1.4.2.1 updated to Meteor 1.4.2.1. * group payments packages - resolves #1408 - consolidates all payment packages into a single admin group - rename include payment package folders `payment-` - add initial local i18n, moved from en.json (TODO, other lang). - move “default method” setting from shop to new `core/payments` package. - move checkout/payment templates from core to `core/payments` package. - expose icon in public registry * PDP Package Layout - ReactionLayout (#1536) * Build product detail page from JS object * Allow for nested blocks, custom styling. Removed old code. Added default columns of 12 if block columns not specified. * Fix responsive image issues in media gallery * Fix pdp add to cart button styles * ReactionLayout for react Moved layout generator to "layout" core module. Added permission check for top level blocks. * Permissions for components in React ReactionLayout renderer * Pass ProductDetail props to component in layout tree. * Style updates for product detail page configuration. * Remove logger, as it doesn't provide useful data in its current form * Adds ability to add react template layout to database to render full page views * Adds ability to use media queries when defining blocks * add missing dependency for radium * fix broken template tests * More email templates (#1557) * added some comments to break up html table * reorganized data for email template removed all [0]. type variables from new.html email template, so all variables are set in orders.js for easy manipulation * welcome to the shop email template * extract social from template, add on/off switch * invite shop member email * shopName variable updates * update reaction address This was driving me crazy seeing the wrong address in all these emails being tested. * add Collections imports for Accounts, Cart, Shopts * password reset emails * update subject of order confirmation email * lint fix * renamed file for email template * removed test text * path file organization * mail -> SMTP for clarification * Merge branch 'release-0.18.0' into email-template-expansion-v2 # Conflicts: # imports/plugins/included/email-templates/lib/paths.js * i18n for email template admin * publication for Templates * conflict fix * add email subject into saved DB data * add server methods for deleting email templates * Add a duplicate, editable template to the template collection (#1548) Mark one of those templates and an original, which can be used to revert editable templates. * server methods for updating email templates * added check for original template * new translations * Merge branch 'release-0.18.0' into email-template-expansion-v2 * core workflow emails - processing & completed * test - new workflow email exports * Update email schema * shipping email * conflict fixes * removed comments * removed comments * import new email schema * template updates * removed commented code * organize templates * added todo to schema * updated comments * cleanup methods file * updated error messaging * schema update * update comments * i18n updates * removed testing alerts * i18n updates * file organization * Revision control for images (#1555) * Add media hook. Rename file to "hooks'" * Only return published images for non-admin users * Only set product images as unpublished * Capture revision record and show Publish button when image changes are made * Adding images deferred until published * Removing images deferred until published * Capturing and deferring other changes to metadata (priority really) * Combine revisions when making multiple changes before publishing * Properly handle non-product revisions in applyProductRevision so that product doesn't get wiped. * Find the product correctly based on revision type * Fix regression where images weren't being published because revision data was wrong * Setting priceRange should be in an `else` statement * If you add an image and then delete it before publishing it, just remove it. * Update revisions with media * Show visual indicator on image if there are pending revisions * Discard drafts of image revisions * Sometimes rendering the "edited" marker * Reset revisions so that removals take effect * Set priority to revision priority * Fix issue where changing order wouldn't stick * Remove logging * Change lost in merge * Another change from merge * Green flash on fields in PDP page after change success (#1558) * Green flash on fields in PDP page after change success * Updated tags and metafields with a flash of green on success submit * Fixed broken PDP template Removed duplicate Templates publication * Patched 0.18 tests (#1566) * updated tests for discount methods * updated meteor versions - includes update johanbrook:publication-collector * move discount rates to catalog/codes to payments * restore default method data * Expandable cards PDP admin panel now has expandable cards with selecting fields to edit from PDP page. * Loading component added for reactionLayout * Add missing NPM dependency * Use App helper rather than ad-hoc query * change templates importing to use Assets collection * renamed templates function * fixed listing errors * add flush & changed onCoreInit -> afterCoreInit * removed isOriginalTemplate, which is no longer used * InitTemplates() -> initTemplates() * move import settings (#1573) - moved “Import” from settings/settings.html to import/import.html - is currently not used and won’t be visible, but can be basis for import settings. resolves #1050 * Update Order Progress Workflow (#1580) * update workflow when process is not done the traditional way * update import order * fixed linting issues * removed old / unused nom packages * PDP 500 (#1572) * Added add button for variant list. Hide available options divider, if there are no available options. * UX tweaks for varying numbers of variants in list - Hide options label when there is only one top level variant - add tooltip to add button * Hide add button for non-admin users * More UI tweaks for products without variants Hide add to cart button if there are no variant options available. Hide options separator if there are no variant options and use is not an admin. * Added i18n * i18n updates for the Templates package (#1571) * fix for templates not loading on initial reaction startup * changed the order * move i18n to new modular style * formatting * Update core.js * Update core.js * Update index.js * Update email.html * removed "moo" * Fix remove icon not displaying / revision change (#1564) * Add media hook. Rename file to "hooks'" * Only return published images for non-admin users * Only set product images as unpublished * Capture revision record and show Publish button when image changes are made * Adding images deferred until published * Removing images deferred until published * Capturing and deferring other changes to metadata (priority really) * Combine revisions when making multiple changes before publishing * Properly handle non-product revisions in applyProductRevision so that product doesn't get wiped. * Find the product correctly based on revision type * Fix regression where images weren't being published because revision data was wrong * Setting priceRange should be in an `else` statement * If you add an image and then delete it before publishing it, just remove it. * Update revisions with media * Show visual indicator on image if there are pending revisions * Discard drafts of image revisions * Sometimes rendering the "edited" marker * Reset revisions so that removals take effect * Set priority to revision priority * Fix issue where changing order wouldn't stick * Remove logging * Change lost in merge * Another change from merge * Don't show remove icon once an item has been removed. * Protect against a non-existent product * updated subject to use SSR * update templates to use SSR * update templates to use SSR * added new field to update * update schema for email templates * removed unused fields * converted old shipping code to email template * Added ecmascript dependency to gridfs package * updated npm dependencies country-data ^0.0.30 → ^0.0.31 griddle-react ^0.6.1 → ^0.7.0 i18next ^3.4.3 → ^4.0.0 sortablejs ^1.4.2 → ^1.5.0-rc1 sweetalert2 ^5.3.8 → ^6.1.0 wdio-mocha-framework ^0.4.3 → ^0.5.4 * removed no longer needs isOriginalTemplate * remove old console.logs * fixed type * add ecmascript to gridfs to enable strict * Fixed issue with closing cards on edit cleanup of various eslint issues. * fixed prop validation * updated welcome email to use SSR for subject * Upgrade to react-komposer v2 Added composeWithTracker wrapper around v2 features in lib. Updated all react-komposer imports to use version from lib. * Fix alerts Was trying to call Alerts on the server, instead of the client. Fixed. * New Email: Refunds * remove unused email templates * finalizing email templates - recovery commit * email template registration * linting fixes * launchdock verification email * removed errant console * subject update * camelCasing some things * updated subject for unavailable templates * disabled form fields that shouldn't be touched * send order notification when user adds email * [WIP] Updates to package registry * updated reaction Apps Updated package registry handling, updates for payments. * Add localhost WS browser-policy Resolve `websocket because it does not appear in the connect-src directive of the Content Security Policy` error in safari when using —production build. * Payment package updates, removes name - removes name from some payment method registry entries - use name if separate settings and permissions are needed - applies permission checks in package publication for filtering enabled views - uses package name as default settings key, used when no name * Move mergeDeep into /lib/api/helpers * Update settings handling - Cleanup handling in taxes, discounts, catalog package handling - Fix error where registry update was overwriting existing settings - use mergeDeep for registry updates * Cleanup panels in payments, taxes - remove excessive panels - add i18n - generic alerts - convert panel-title to alert info - show alert message only pre-setup * Updated package momentjs:moment upgraded from 2.16.0 to 2.17.0 * PayPal as split payment methods - Process multiple matching entries in registry - adds i18n for PayPal client views - splits PayPal into two payment methods for settings/checkout - todo add migration for express_enabled to express.enabled - todo add migration for payflow_enabled to payflow.enabled - add browser policy akamai.mathtag.com - apply standard button style + i18n to all payment settings * Add Month Translations to monthOptions helper * updated payments styling, missing i18n - single card payment layout - removes default payment method and collapse handling in checkout - commented in dashboard payment settings. TBD. - resolves #1408 * object-curly-spacing lint rules applied * Avoid localLocale.defineLocale warning * Clarify Auth.net credentials messaging * Only display enabled payment methods to admin in checkout - could have just used if in template, or alternate display - but this is clean and simple for now. * Updated import/requires for moment Fix error loading moment for template helpers. * Updated translation * Update styling for payment settings - remove Authnet/dashboard - unused legacy settings? * Templates fixes (#1600) * Remove unused settings icon * Fix "required" name field * Update sidebar Reactively when changes are made * Removed references to "email" Templates are not just for emails, so I removed references to “Email” in all the i18n translations * Removed "email" as Templates are more than email * Remove unused functions * Updated i18n * Renamed variable away from "template" * Use description for HTML description (#1606) * Fix permissions on Order when "guest" user (#1607) * Don't publish changes on a product when product is not found (happens during tests) (#1603) * Fix bug that causes duplicated variants to be missing images. (#1611) * Fix bug that causes duplicated variants to be missing images. Added a copyFile helper that will bypass revision control to copy a file. * Add missing export * Don't blank out titles (#1617) * fix browser-policy for websockets in Safari * Fix for page title not updating when selecting product. (#1623) This fix also ensures all metadata related to a product is updated when the product is selected. * Default product to blank object for instances where it may be undefined. (#1619) * Build index immediately on startup so that search doesn't throw an error (#1621) * added audience permissions to registry schema, and Reaction.Apps now checks audience perms against user roles and registry item audience if any * Fix typo in i18n file so that error message showed key instead of text (#1635) * audience is passed as an array to match any user role, excluded owner from audience check * Prerender.io Integration - Feature #1249 (#1643) * Move Template editing to Sidebar (#1612) * Move Template editing to Sidebar * Removed logs * Linting fixes * i18n updates * renamed filed to remove email designation * package name update * add info box around React message * Fix price updates (#1633) * add applyProductRevision to Products.findOne * fix price range for revisions * fix isVisible price updates * fix for price object not initially being created * add product.range updating to non-revision enabled app * Checkout discount code input (#1620) * Fix typo in CircularProgress indetermate -> indeterminate * Enabled false for Express on initial startup * Updated payments method - Replaces `payments/paymentMethod` with `payments/cart/apply` - add discounts/codes/remove - add discounts/codes/apply * Initial DiscountList DiscountForm components * functional discount code input * basic discount calculations in cart * Updated discount input loader * Only display shipping, discounts, taxes gt 0 * Order discount not to exceed 0 (no neg values) * Update plugin structure * fix typo in taxes input numericInputProps "taxes" * apply discounts in order process - DiscountList and DiscountForm components can be used for Orders or Cart collection - working CODES as discounts through order process - a number of outstanding TODO’s remain for discount conditional logic and limit handling - Order process is easily broken, and will need modification to payment handling to check for authorization below above current authorization if discount is removed. * Fix event handling in FF * disable delete discount in admin ui * Format discount * Implement credit/debit payment method selectors - Replace order.billing[0] with credit selector - update and enforce that paymentMethod.method should be “credit”, “debit”. - refactor Order updates to allow for credit to be in any position * Minor lint updates * Updated billing constants * Updated billing constants * Updated selector constants * Set min-height on cart-items - prevent some of the ugly transitions. Needs loader. * add fallback paymentMethod for email - add processor in case there isn’t a storedCard * Add calculation method to schema/forms * info -> debug - for `not creating default admin user”` - for `Reaction.init() has run` * implement hooks for per processor calculation methods * Info -> debug logging * discount, credit, sale, shipping calculations * Discount code form cleanup - add a few additional checks on fresh carts * import indexOf * Codes disabled by default * autoEnable discount-codes - is actually required right now, as the logic in payment doesn’t extend to enabling the package. * Patch link for non-configured payments * Add default calculation method - ensure that rates/discount exists - cleanup jsdocs * Updated orders discounts/credit/shipping summary * Attempt to make tests more consistent (#1565) * Fixes to inventory tests * Create new versions of cart fixtures that create less "random" versions so that db impact is minimized. * Eliminate unneeded originals entries * Put expectations in callbacks rather than putting in sleeps * Make this global wait more visible * The quantity on remove quantity should always be 1 now that we are using the custom fixture. * Allow direct importing of inventory function * creating createCart function * test for createCart function * Directly call registerInventory to avoid permissions check that doesn't apply * Add singleVariant version of addProduct * Trying to get these tests to run reliably by trying to normalize the inventory beforehand * createCart function * test for createCart function * Change currency symbol for PHP (wut?) * Db-normalized inventory tests * Just blindly increase this timeout * Add comment explaining why we need this long timeout * Remove Logger * Extend timeout on cart test * Add sleep for createVariant tests * Quiet inventory register logging that I should not have put there anyway * Don't operate on product if it's not found * Update to fixed publication-collector * Increase timeout on discount test * Update publication-collector * Don't call Alert in a server method * Lint cleanup
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related To: #1515
Adds emails that are on disc in
private/email/templates/
into theTemplates
collection in the database.Fetches email template from database when it exists using
Reaction.Email.getTemplate()
.