Changelog History
Page 22
-
v2.45.0 Changes
January 11, 2018β Unit tests passing.
β Regression tests passing.
- π The
apostrophe-caches
module has better, clearer documentation and it now supports promises. - All modules can now conveniently send email using Nodemailer. The new
email
method of all modules renders a template in that module'sviews
folder, exactly as you would hope it would, and also automatically generates a plaintext version for the occasional user who does not view HTML email. The automatically generated versions include links properly. - Extending
apostrophe-images-widgets
and other pieces widgets is easier. If your widget name doesn't correspond to the kind of piece you are displaying, a helpful error appears explaining that you need to setpiecesModuleName
. Adding fields to these widgets now behaves reasonably. Also, if you add fields toapostrophe-images
orapostrophe-files
at project level, this now behaves as expected too. - π A locking mechanism has been added during the movement of pages in the page tree. This prevents rare race conditions that could previously have resulted in duplicate page ranks, although the design of the page tree is such that more serious consequences were always avoided.
- π Text justification options for ckeditor are now standard in our build of ckeditor. Of course you still need to configure
sanitize-html
properly when using them. - Any widgets module may now specify a
wrapperTemplate
option. That template is rendered instead of the standardapostrophe-areas:widget.html
template, and can useextends
and override blocks found in that template. This is useful if you need to set attributes of the outer wrapper element of the widget. - The migration added in 2.43.0 to address file permissions for existing attachments in the trash has been greatly accelerated, helpful on large sites.
- π Better error messages for
min
andmax
options of some schema field types; provisions for expanded error messages in general. - β
For those using the
testModule
option to test their own npm modules in the context of Apostrophe, a default shortname is automatically provided. - π Fixed missing space in admin bar markup, thanks to arlecchino.
- π The
-
v2.44.0 Changes
December 15, 2017β Unit tests passing.
β Regression tests passing.
- π Apostrophe's AJAX filter features for
apostrophe-pieces-pages
now support "Load More" buttons and infinite scroll.
To add a "Load More" button:
- Wrap a new element inside your data-apos-ajax-context element around the content that makes up the current "page" of results. This should not wrap around filter links or the "Load More" button itself.
- Give that new element the
data-apos-ajax-append
attribute. - Add
append=1
to the query string of your Load More button. Example:
{% if data.currentPage < data.totalPages %} <a href="{{ data.url }} | build({ page: data.currentPage + 1, append: 1 })">Load More...</a> {% endif %}
β¨ To progressively enhance this for infinite scroll, add a
data-apos-ajax-infinite-scroll
attribute to the button.π Note that we do this via progressive enhancement of a "Load More" button so that Google can still reach and index all of the pages (SEO).
- Attachment schema fields now respect the new
fileGroup
andfileGroups
properties. IffileGroup
is set toimages
, then only image types (GIF, JPEG, PNG) are accepted; if it is set tooffice
only typical business file types are accepted. Note that we have always rejected files that didn't appear on the list for either type. You can also specifyfileGroups
as an array. - π§
fileGroup: 'image'
is now configured by default forapostrophe-images
, as was always intended but incorrectly implemented in the past. - π§ Attachment schema fields now respect the new
extension
andextensions
properties. The former is handy if you only want to allow one extension, the latter if you want to allow more than one. The extensions must be those specified forfileGroups
in the default configuration ofapostrophe-attachments
or your override of it (all lower case; JPEG isjpg
; no period). - The
addDocReferences
migration has been parallelized, as this one-time migration can be time-consuming on a large site. - π Broken
less
calculation fixed, thanks to Antoine COMBES.
- π Apostrophe's AJAX filter features for
-
v2.43.0 Changes
December 12, 2017β Unit tests passing.
β Regression tests passing.
π When a "file" or "image" is moved to the trash, the attachment in question now becomes inaccessible. This is particularly important to stop access to obsolete PDFs, which Google loves to access. If the file or image is removed from the trash, the attachment becomes available again. In the case of images, the 1/6th size remains available by default to provide preview when viewing the trash. If the same attachment is referenced by more than one doc, which can happen due to "Copy" operations or
apostrophe-workflow
, it remains available until all such docs are in the trash.π Parked properties are no longer editable in page settings. Since every site restart always wiped them out anyway, this is a bug fix, not a truly new behavior. With this change, you can finally set
type: 'home'
whenpark
ing the home page, and removehome
from your page types dropdown.π· The
apostrophe-jobs
module now offers arunNonBatch
method, which is useful for long-running operations that don't involve iterating over many instances of the same type of object.π Improvements to background image positioning for images widgets.
A block has been added to override the
lang
attribute easily. Thanks to Ayho.The
imgAlt
block can now be used to conveniently override thealt
attribute of images when overridingwidget.html
forapostrophe-images-widgets
. Thanks to RaphaΓ«l DiRago.The
required
option now works properly for fields of typearray
(there must be at least one item in the array).π Improved error messages for unblessed widget schemas. These are usually related to a widget that is no longer in the page template but appears in the database.
π» A UI bug that caused tabs to become invisible when returning from nested dialog boxes has been fixed.
0οΈβ£ Filters for "select" fields now default to "no opinion," rather than the default choice. This is the normal behavior for other field types.
π Even more promise support!
apos.attachments.insert
,pieces.trash
andpieces.rescue
all return promises if no callback is given.π A YouTube embed unit test was removed to ensure consistent results in Travis CI, which is once again in routine use.
-
v2.42.1 Changes
November 24, 2017β Unit tests passing.
- π§ Use of a capitalized filename that should have been lowercase in a
require
briefly broke Apostrophe's initialization on Linux. We are correcting this by reinstating CI in a Linux environment.
- π§ Use of a capitalized filename that should have been lowercase in a
-
v2.42.0 Changes
November 22, 2017β Unit tests passing.
β Regression tests passing.
- Promises have landed in Apostrophe. Calling
toArray
,toObject
,toDistinct
ortoMongo
on an Apostrophe cursor without a callback will return a promise. That promise will resolve to the expected result.
β‘οΈ In addition,
docs.insert
,docs.update
,pieces.insert
,pieces.update
, andpages.insert
will all return a promise if invoked without a callback.These are the most frequently invoked functions in Apostrophe that formerly required callbacks.
As always with promises, be sure to catch errors with
.catch()
at some level.Note that the
await
keyword can now be used with these methods, as long as you're running Node.js 8.x or newer or using Babel to provide that language feature.Apostrophe's custom
Split
CKEditor toolbar control now works correctly in 2.x. You can give your users theSplit
control to allow them to break up a large rich text widget in order to insert other types of widget "in the middle." Note that the control name is now capitalized to match the way other CKEditor toolbar buttons are named.You may now specify
_url: 1
or_nameOfJoin: 1
in a projection when using Apostrophe'sfind()
methods. Native MongoDB projections naturally can't see these "computed properties" because they don't live in the database β they are computed "on the fly" after documents are fetched. However, Apostrophe now automatically adds the right underlying fields to the projection.
π Only
_url
and the names ofjoinByOne
orjoinByArray
fields are supported. It does not make sense to use a projection onpeople
to locate IDs that are actually attached toproducts
viajoinByOneReverse
orjoinByArrayReverse
.This feature does not conflict with legitimate uses of MongoDB projections because Apostrophe discards all properties beginning with
_
when writing to the database, except for_id
.The
length
property of an Apostropheattachment
object is now correctly populated with the original file size. Thanks to David Keita. Note that images are also made available in many scaled sizes. Also the original may be replaced with a correctly rotated version, in which caselength
will not match. So the most useful scenario for this property is likely to be in working with office formats, especially PDF which can sometimes be very large.π Fixed bug in the
isEmpty
methods for areas and singletons. Thanks to David Keita.
- Promises have landed in Apostrophe. Calling
-
v2.41.0 Changes
November 17, 2017β Unit tests passing.
β Regression tests passing.
- π The new
apostrophe-jobs
module, part of the core of Apostrophe, provides a progress meter mechanism and the ability to stop long-running user-initiated operations, such as batch operations on pieces. See the jobs module documentation. You can also refer to the pieces module for examples if you wish to use this for your own long-running user-initiated operations. - π¨ Batch operations now have more robust support for "select everything." A number of bugs related to multiple selection of pieces have been fixed in a refactoring that made this code much more maintainable and predictable.
- π± The option of pushing an asset of type
template
, which never worked in 2.x and was never used by Apostrophe, has been removed for clarity. Our preference is for rendering assets on the server side dynamically when needed, rather than pushing many templates into the DOM on every page load. - An
.editorconfig
file has been added. Thanks to Fredrik Ekelund. - 0οΈβ£ Parking a page only pushes permanent properties.
_defaults
and_children
should never have been in the database; they are of course still interpreted to decide what should happen, but the properties themselves did not belong in the database. (You may need to write a migration if they are already there and this is causing issues for you.) - π» Scrolling UI behavior of pieces improved; various other UI touch-ups. Thanks to Fredrik Ekelund.
- β‘οΈ
newBrowserCalls
helper forpush
module can be used when you want JavaScript calls queued up withreq.browserCall
to be executed in an AJAX update of just part of a page. - π Fixed bugs affecting access to the published/unpublished batch operations and similar.
- π The new
-
v2.40.0 Changes
November 10, 2017β Unit tests passing.
β Regression tests passing.
- π Support for "select everything" when managing pieces. Once you check the box to select everything on the current page, you are given a secondary option to select everything that matches your current criteria. This works both when choosing pieces for widgets and when working with batch operations like "trash" or "rescue."
- π Fixed various bugs affecting combinations of "select all on page", the chooser and working with images.
- π Improvements to batch operations on pieces. The
requiredField
property is checked correctly, and the newonlyIf
property allows for passing a function that accepts the doc type name and decides whether the button should appear. Multiword action names are properly camelcased. New "success" and "dataSource" options tobatchSimple
allow for carrying out additional operations afterward as well as gathering input independently at the start. And batch operations are composed late so that other modules can add them. - π The
self.api
andself.html
methods ofapostrophe-context
andapostrophe-modal
now support a syntax for making cross-module API calls, just like templates. - β Addressed moog versioning issue with latest npm that caused errors about "synth.instanceOf" not being found depending on the state of your npm cache.
-
v2.39.2 Changes
November 02, 2017β Unit tests passing.
β Startup-related regression tests passing.
- The
APOS_MONGODB_LOG_LEVEL
environment variable can now be set todebug
,info
or anything else supported by the MongoDB driver'sLogger.setLevel
method. This is helpful for debugging database issues at the lowest level.
- The
-
v2.39.1 Changes
November 01, 2017β Unit tests passing.
β Regression tests passing.
- Factored out a
getBaseUrl
method forapostrophe-pages
, allowing overrides of this that pay attention toreq
. - Report
pageBeforeSend
errors and failures to load the global doc properly, don't silently tolerate them. - π Documentation corrections. Thanks to Frederik Ekelund.
- Factored out a
-
v2.39.0 Changes
October 24, 2017β Unit tests passing.
β Regression tests passing.
- π Easier access to options. Introduced the
getOption
method to all modules. Callingself.getOption(req, 'sizes.large')
from your module's server-side JavaScript code, or justmodule.getOption('sizes.large')
from Nunjucks, will return the value ofself.options.sizes.large
for that module. You may also pass an array of keys, i.e.module.getOption([ 'sizes', 'large' ])
. This method is tolerant, it returns undefined if any part of the path does not exist. See also the new apostrophe-override-options which extends this feature to support customizing the returned value for any option based on the current page type, page settings, piece settings and locale. * Helpful warning when maximum area/widget loader recursion level is reached. Always use projections when adding joins to your schema to avoid a performance hit due to runaway recursion. - π New
disabledTypes
option toapostrophe-pages
, primarily for use withapostrophe-override-options
. - π Fixed UI bug relating to area menus at the bottom of the page.
- π Fixed bug that caused a crash when invalid usernames attempted to log in. Thanks to Arthur.
- π Easier access to options. Introduced the