Skip to content

Commit

Permalink
Merge pull request #734 from wintercms/develop
Browse files Browse the repository at this point in the history
Release v1.2.1
  • Loading branch information
LukeTowers authored Oct 20, 2022
2 parents 6c690a9 + dc70c90 commit 70592de
Show file tree
Hide file tree
Showing 183 changed files with 2,980 additions and 1,051 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/subsplit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Module sub-split

on:
push:
create:
delete:

jobs:
split:
name: Sub-split
runs-on: ubuntu-latest
container: wintercms/cli:0.3.4
env:
WINTER_CLI_GITHUB_TOKEN: ${{ secrets.WINTER_SPLIT_TOKEN }}
steps:
- name: Create tag
if: github.event_name == 'create' && github.ref_type == 'tag'
run: winter split -a "${{ github.ref_name }}"
- name: Delete branch
if: github.event_name == 'delete' && github.ref_type == 'branch'
run: winter split --remove-branch="${{ github.event.ref }}"
- name: Delete tag
if: github.event_name == 'delete' && github.ref_type == 'tag'
run: winter split --remove-tag="${{ github.event.ref }}"
- name: Push
if: github.event_name == 'push'
run: winter split -b "${{ github.ref_name }}"
96 changes: 80 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,96 @@ name: Tests
on:
push:
branches:
- 1.0
- 1.1
- 1.2
- '1.2'
- develop
pull_request:

jobs:
frontendTests:
runs-on: ubuntu-latest
name: JavaScript
strategy:
max-parallel: 2
matrix:
operatingSystem: [ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.operatingSystem }}
name: ${{ matrix.operatingSystem }} / JavaScript
env:
nodeVersion: 16
phpVersion: '8.0'
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
key: winter-cms-cache-develop
steps:
- name: Cancel previous incomplete runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout changes
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup extension cache
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ env.phpVersion }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v3
with:
fetch-depth: 0
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.phpVersion }}
extensions: ${{ env.extensions }}

- name: Install Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 12
node-version: ${{ env.nodeVersion }}

- name: Install Node dependencies
working-directory: ./modules/system/tests/js
run: npm install
- name: Echo branches
run: echo "${{ github.ref }} | ${{ github.head_ref }} | ${{ github.ref_name }} | ${{ github.base_ref }}"

- name: Switch library dependency (develop)
if: github.ref == 'refs/heads/develop' || github.base_ref == 'develop'
run: php ./.github/workflows/utilities/library-switcher "dev-develop as 1.2"

- name: Switch library dependency (1.2)
if: github.head_ref == '1.2' || github.ref == 'refs/heads/1.2' || github.base_ref == '1.2'
run: php ./.github/workflows/utilities/library-switcher "1.2.x-dev as 1.2"

- name: Setup dependency cache
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-scripts

- name: Reset modules
run: |
git reset --hard
git clean -fd
- name: Run post-update Composer scripts
run: php artisan package:discover

- name: Run tests
working-directory: ./modules/system/tests/js
run: npm run test
run: |
php artisan mix:install
php artisan mix:run module-system test
phpUnitTests:
strategy:
Expand Down Expand Up @@ -108,7 +170,9 @@ jobs:
run: composer install --no-interaction --no-progress --no-scripts

- name: Reset modules
run: git reset --hard
run: |
git reset --hard
git clean -fd
- name: Run post-update Composer scripts
run: php artisan package:discover
Expand All @@ -120,4 +184,4 @@ jobs:
- name: Run Linting and Tests
run: |
composer lint
./vendor/bin/phpunit
php artisan winter:test -m system -m backend -m cms
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ Please follow the following guides and code standards:

In order to ensure that the Winter community is welcoming to all, please review and abide by the [Code of Conduct](https://github.com/wintercms/.github/blob/master/CODE_OF_CONDUCT.md).

## Sponsors

Winter CMS development is financially supported by the generosity of the following sponsors:

### Organizations

[![Spatial Media logo](https://cdn.ca.spatialmedia.io/media/images/sm-logo-dark-full.svg)](https://spatialmedia.io)
Spatial Media employs two of the core contributors (Luke Towers & Jack Wilkinson) and contributes to the ongoing development of Winter.

[![Froala logo](https://froala.com/wp-content/uploads/2019/10/froala.svg)](https://froala.com/wysiwyg-editor/)

Froala provides a perpetual, Enterprise license to Winter CMS which allows us and our users to use the Froala WYSIWYG Editor in Winter CMS powered projects.

### Individuals
- Orville

If you would like to have your name, company and link added to this list and support open-source development, feel free to make a donation to our [Open Collective](https://opencollective.com/wintercms).

## License

The Winter platform is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"extra": {
"merge-plugin": {
"include": [
"plugins/*/*/composer.json"
"plugins/myauthor/*/composer.json"
],
"recurse": true,
"replace": false,
Expand Down
25 changes: 21 additions & 4 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@
*/

'asset_url' => env('ASSET_URL', null),

/*
|--------------------------------------------------------------------------
| Temporary Path
|--------------------------------------------------------------------------
|
| This is used to set the application's temporary path. Normally this value
| is set automatically by the application, however on some systems you
| may need to change it (Laravel Vapor / read-only systems: /tmp).
|
*/

'tempPath' => env('APP_TEMP_PATH', null),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -106,14 +119,18 @@
| - array: An array of proxies to trust
|
| Examples:
| - To trust all proxies:
| - To trust any proxy (i.e. a single proxy with an unknown IP address):
|
| 'trustedProxies' => '*',
|
| - To trust all proxies (i.e. AWS ELB behind CloudFront):
|
| 'trustedProxies' => '*'
| 'trustedProxies' => '**',
|
| - To trust two IP addresses as proxies
|
| 'trustedProxies' => '192.168.1.1, 192.168.1.2'
| 'trustedProxies' => ['192.168.1.1', '192.168.1.2']
| 'trustedProxies' => '192.168.1.1, 192.168.1.2',
| 'trustedProxies' => ['192.168.1.1', '192.168.1.2'],
*/

'trustedProxies' => null,
Expand Down
4 changes: 4 additions & 0 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
| NOTE: s3's stream_uploads option requires the Winter.DriverAWS plugin
| to be installed and enabled.
|
*/

'disks' => [
Expand All @@ -42,6 +45,7 @@
'key' => env('AWS_ACCESS_KEY_ID'),
'region' => env('AWS_DEFAULT_REGION'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'stream_uploads' => env('AWS_S3_STREAM_UPLOADS', false),
'url' => env('AWS_URL'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
],
Expand Down
22 changes: 22 additions & 0 deletions modules/backend/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2013-2021.03.01 October CMS
Copyright (c) 2021 Winter CMS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions modules/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Winter CMS - Backend Module

This repository is a read-only sub-split of the Winter CMS `Backend` module for use in Composer. Please note that we do not accept any pull requests to this repository.

If you wish to make changes to this module, please submit them to the [main repository](https://github.com/wintercms/winter).
3 changes: 2 additions & 1 deletion modules/backend/assets/less/controls/filelist.less
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@
.list-icon {
position: absolute;
left: 14px;
top: 15px;
top: 50%;
transform: translateY(-50%);
font-size: 22px;
color: #b7c0c2;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/behaviors/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* values as either a YAML file, located in the controller view directory,
* or directly as a PHP array.
*
* @see http://wintercms.com/docs/backend/forms Back-end form documentation
* @see https://wintercms.com/docs/backend/forms Back-end form documentation
* @package winter\wn-backend-module
* @author Alexey Bobkov, Samuel Georges
*/
Expand Down
5 changes: 3 additions & 2 deletions modules/backend/behaviors/ImportExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use League\Csv\Reader as CsvReader;
use League\Csv\Writer as CsvWriter;
use League\Csv\EscapeFormula as CsvEscapeFormula;
use League\Csv\Statement as CsvStatement;
use ApplicationException;
use SplTempFileObject;
use Exception;
Expand Down Expand Up @@ -250,10 +251,10 @@ public function onImportLoadColumnSampleForm()
$reader = $this->createCsvReader($path);

if (post('first_row_titles')) {
$reader->setOffset(1);
$reader->setHeaderOffset(1);
}

$result = $reader->setLimit(50)->fetchColumn((int) $columnId);
$result = (new CsvStatement())->limit(50)->process($reader)->fetchColumn((int) $columnId);
$data = iterator_to_array($result, false);

/*
Expand Down
7 changes: 7 additions & 0 deletions modules/backend/console/WinterPasswd.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ class WinterPasswd extends Command
* @var string The console command description.
*/
protected $description = 'Change the password of a Backend user.';

/**
* @var array List of commands that this command replaces (aliases)
*/
protected $replaces = [
'winter:password',
];

/**
* @var bool Was the password automatically generated?
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/console/scaffold/controller/create.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
type="button"
data-request="onSave"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.creating_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>"
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/console/scaffold/controller/update.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
type="button"
data-request="onSave"
data-request-data="redirect:0"
data-hotkey="ctrl+s, cmd+s"
Expand Down
4 changes: 1 addition & 3 deletions modules/backend/controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ public function signin_onSubmit()
'password' => post('password')
], $remember);

if (is_null($runMigrationsOnLogin = Config::get('cms.runMigrationsOnLogin', null))) {
$runMigrationsOnLogin = Config::get('app.debug', false);
}
$runMigrationsOnLogin = (bool) Config::get('cms.runMigrationsOnLogin', Config::get('app.debug', false));

if ($runMigrationsOnLogin) {
try {
Expand Down
Loading

0 comments on commit 70592de

Please sign in to comment.