v3.7.0
Laravel Enso's Changelog
3.7.0
The major purpose of this release is three fold:
- the switch to VueCli 4 which allows using the latest official VueJS tooling and should be more future-proof
- the date handling flow was simplified: we now expect that the front-end will send the date in the database's date format (usually
Y-m-dorY-m-d H:i:s) and on the back-end, all dates should be cast to Carbon\Carbon. - the back-end packages were updated to require PHP 7.3+
front-end
accessories
- default value for Documents.vue's disableUpload was fixed causing users to not be able to upload files
calendar
- added Event recurrency support
- small fixes and under the hood refactor
- import of VueCal language packs for the Enso supported languages which fixed translation issue
companies
- fixed small bug when assigning a person to the company, which caused the person to not be listed as assigned
confirmation
- fixed small styling issue with the control's position
currencies
- added filters on the index page
- for the currency display, symbols are used insteand of icons
datepicker
- default date format was updated from
'd-m-Y'to'Y-m-d' alt-format&alt-inputparameter usage was fixed
filters
- DateFilter now has a
directionparameter & control: you can now choose to filter from past & future presets - DateFilter also has a new
forwardboolean parameter which makes the component to start by default with the
future presets - under the hood date format handling has been improved
forms
- fixed the
alt-input&alt-formathandling for the date field - instead of a single
actionsslot, the form now has a twoactions-left&actions-rightslots. This is a breaking change - see the upgrade steps
products
- various small css fixes
select
- making another request when the last request is still in progress will trigger the existing request's cancellation
- fixed bug when using the select in Object mode
- improved serverSide checking strategy
- the CoreSelect's
valueparameter is now required
tables
- fixed issue with unneeded scrollbars appearing under some circumstances
- small cleanup
themes
- theme files were renamed due to switching to VueCli and using the style loader webpack plugin
- Bulma version was bumped to ^0.8.0
- button sizes are customized to appear smaller than the new Bulma default (and slightly smaller than the old default)
ui
- the media resources that belonged to the UI (such as notification image SVGs, some logos) were moved to the ui package and are copied on build
- a new component is available in the navbar and being used to notify the currently
logged in users whenever a new application update has been deployed - small changes made due to VueCli upgrade (routes, styles, themes)
- other small fixes
back-end
activity-log
- updated date parsing due to filters changes
avatar
- added support for gif files
calendar
- recurring events are now supported
- various bugs were fixed
- updated the tests
companies
- updated message when setting/updating an assigned person/mandatary
countries (new)
- functionality derives from 'addresses` which now is now better encapsulated
core
- some of the resources used during the VueCli build process have been moved to this package, namely:
- stubs for the index page
- images used in the emails
- a new command (
php artisan enso:announce-app-update)and logic has been implemented that can be used to notify currently logged in users that a new application version has been deplyed - the older, deprecated upgrade commands where purged
- improved local state handling (breaking change)
- aded upgrade commands for calendar, countries & tutorials
- the themes' configuration was updated
currencies
- created a Converter service which can convert from one currency to another, at a given date
- refactores fixer currency API
- fixed exchange rate validation and more
- fixed config API link
- updated date parsing due to datepicker changes
- added seeders for 17 currencies
- added
exchange_ratesdate index - various under the hood improvements
- updated the tests
enums
- updated PHP dependency to 7.3+
excel
- updated PHP dependency to 7.3+
files
- updated date parsing as required for latest filters usage
- fixed invalidMimeType exception message
forms
- updated date parsing for latest datepicker usage
- updated the config: the previous
dateFormatparameter is now namedaltDateFormat(breaking change) - fixed route generation in Builder
- updated the tests
helpers
- the
DateAttributestrait was removed as a consequence of the new date handling flow (breaking change)
people
- updated date parsing as required for latest filters usage
permissions
- added menu related check when deleting permission
rememberable
- fixed caching bug when choosing to cache 'forever'
tables
- updated date filtering strategy which resulted in much simpler and robust code
- fixed default sort issue
- fixed rawTotal computation issue for empty tables
- fixed bug when exporting nested columns
tutorials
- the
showroute was renamed toload - fixed small form bug
versions
- updated PHP dependency to 7.3+
Upgrade steps
Before getting into the actual upgrade steps, an overview of the changes is useful.
When switching from Laravel Mix to VueCli a few things happen:
- the front-end resources location will change from
resources/jstoclient/src/js - the front-end dependecies location will change from
node_modulestoclient/node_modules - the
package.jsonconfiguration file location will change from project root toclient - the front-end patches location will change from
patchestoclient/patches - when installing dependencies using Yarn, building or serving the front-end, you will need to
cdinto the client folder first. - instead of using Laravel Mix's
webpack.mix.jsfile to configure the build, we will be using VueCli'svue.config.js - we can still use Valet to serve the back-end but we must use
yarn serveto serve the front-end for
hot module replacement
VueCli upgrade related steps
-
copy the
clientfolder from the Enso repo into your project root -
add any (package) aliases you had previously added to the
webpack.mix.jsfile into:- the
settings.import-resolve.alias.mapsection of theclient/.eslintrc.jsfile - the
configureWebpack.resolve.aliassection of theclient/vue.config.jsfile
- the
-
update/replace your project root
.eslintrc.jswith the contents fromclient/.eslintrc.jsand correct the aliases paths -
if you had customized the
.babelrcfile, move those customizations to theclient/.babelrcfile, and remove the root file -
move your patches from
patchestoclient/patches -
move any local dependencies you had added to the
package.jsonto theclient/package.jsonfile -
move any additions from the
resources/js/app.jsfile to theclient/src/js/app.js -
move any additions from the
resources/js/localState.jsfile to theclient/src/js/localState.js -
move any additions from the
resources/js/router.jsfile to theclient/src/js/router.js -
move your local components, pages, routes & store from
resources/jstoclient/src/js -
once you have moved your js files, you may delete the
resources/jsfolder -
if you have any local image resources in
resources/imagesyou can create aclient/src/imagesfolder and move them there. Afterwards, you should add a new CopyPlugin instance to theconfigureWebpack.pluginssection withinvue.config.jsso that the images are copied on build (and overwrite, if needed, the default Enso assets).You may then delete the
resources/imagesfolder (the image files provided with Enso, such as the ones in theemailsandcornershave been extracted to their respective packages) -
move any addtions from within the
resources/sassfiles to theclient/src/sassfiles -
once you've moved everything, the
resourcesfolder should look like on the Enso repo here -
remove the
webpack.mix.jsfile -
update
.gitignoreusing Enso's as example and double checkclient/.gitignore -
within
composer.jsonupdate:laravel-enso/coreto4.6.*laravel-enso/calendarto1.4.*(if using the calendar package)
-
run
composer updatein the project root to update the back-end packages -
cd into the
clientfolder and runyarnto install the front-end packages -
make a copy of the
client/.env.examplefile, name it.env, then edit it an set the url you're currently using with Valet, for your project -
update the themes' configuration (
config/enso/themes) to:
return [
'light' => 'light',
'dark' => 'dark',
'light-rtl' => 'light-rtl',
'dark-rtl' => 'dark-rtl',
];Enso upgrade related steps:
- search for any
DateAttributesusages, remove the import and any date setters you might have added - when refactoring date attributes, you may use this commit as an example
- search and replace the
LaravelEnso\Addresses\app\Models\Country;namespace withLaravelEnso\Countries\app\Models\Country; - where using the
actionsslot within forms, replace theactionsslot withactions-leftand/oractions-rightslots as required - the local state implementation class should be bound in the service container to the
LaravelEnso\Core\app\Services\LocalState - publish the updated
AddressFactory.php:
php artisan vendor:publish --tag=addresses-factory --force
- publish the updated
CountrySeeder.php
php artisan vendor:publish --tag=countries-seeder --force
-
if using the Calendar, also:
- publish the calendar factories
php artisan vendor:publish --tag=calendar-factories --force- add the calendar test suite to
phpunit.xml:
<testsuite name="calendar"> <directory suffix="Test.php">./vendor/laravel-enso/calendar/tests</directory> </testsuite>
- add the following namespace
"LaravelEnso\\Calendar\\tests\\features\\": "vendor/laravel-enso/calendar/tests/features/",tocomposer.json'sautoload-dev.psr-4
-
in
config/enso/config.phpincrement the version to 3.7.0 -
in
config/enso/forms.phpupdate thedateFormatkey toaltDateFormat -
cd into the
clientfolder and serve the front-end withyarn serveor build it withyarn build -
(optional) a new feature allows you to notify your currently logged in users that a new application update/version was deployed.
To use it, update your live deployment process and after the deploy is done, add a hook that calls
php artisan enso:announce-app-update.
The logged in users will get a toaster message as a well a pulsing notification control in the navbar, which, when clicked, will reload the page.Note that for the user to be notified, the current in-page version must be different from the released version, so don't forget to update the
enso.config.versionvalue.Reloading helps avoid js errors related to the lazy loading of the front-end assets as well as any mismatches between the stale front-end and the updated back-end API.
The page reload is not done automatically for a better user experience as well as to give users the chance to save their work.
Serving the assets
Serving the assets has changed from running yarn run hot to cd-ing into the
client folder and running yarn serve.
No other steps are necessary if you are serving the back-end API as before, for example with Valet.
Alternatively, if you don't want to use Valet, you may run php artisan serve and then point to the back-end URL, within the client/.env config.
Building the assets
Building the assets has changed from running yarn run prod to cd-ing into the
client folder and running yarn build.
While the command is different, the resulted build is, for all practical purposes, indentical to the one resulted when using Laravel Mix.
Deploying in production
To deploy the build you shoul follow the same flow as before.
IF within your worfklow you are also building the front-end, you should update your scripts so as to take into the account the client folder (see above).