Skip to content

Commit 70592de

Browse files
authored
Merge pull request #734 from wintercms/develop
Release v1.2.1
2 parents 6c690a9 + dc70c90 commit 70592de

File tree

183 files changed

+2980
-1051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+2980
-1051
lines changed

.github/workflows/subsplit.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Module sub-split
2+
3+
on:
4+
push:
5+
create:
6+
delete:
7+
8+
jobs:
9+
split:
10+
name: Sub-split
11+
runs-on: ubuntu-latest
12+
container: wintercms/cli:0.3.4
13+
env:
14+
WINTER_CLI_GITHUB_TOKEN: ${{ secrets.WINTER_SPLIT_TOKEN }}
15+
steps:
16+
- name: Create tag
17+
if: github.event_name == 'create' && github.ref_type == 'tag'
18+
run: winter split -a "${{ github.ref_name }}"
19+
- name: Delete branch
20+
if: github.event_name == 'delete' && github.ref_type == 'branch'
21+
run: winter split --remove-branch="${{ github.event.ref }}"
22+
- name: Delete tag
23+
if: github.event_name == 'delete' && github.ref_type == 'tag'
24+
run: winter split --remove-tag="${{ github.event.ref }}"
25+
- name: Push
26+
if: github.event_name == 'push'
27+
run: winter split -b "${{ github.ref_name }}"

.github/workflows/tests.yml

+80-16
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,96 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- 1.0
7-
- 1.1
8-
- 1.2
6+
- '1.2'
97
- develop
108
pull_request:
119

1210
jobs:
1311
frontendTests:
14-
runs-on: ubuntu-latest
15-
name: JavaScript
12+
strategy:
13+
max-parallel: 2
14+
matrix:
15+
operatingSystem: [ubuntu-latest, windows-latest]
16+
fail-fast: false
17+
runs-on: ${{ matrix.operatingSystem }}
18+
name: ${{ matrix.operatingSystem }} / JavaScript
19+
env:
20+
nodeVersion: 16
21+
phpVersion: '8.0'
22+
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
23+
key: winter-cms-cache-develop
1624
steps:
25+
- name: Cancel previous incomplete runs
26+
uses: styfle/[email protected]
27+
with:
28+
access_token: ${{ github.token }}
29+
1730
- name: Checkout changes
18-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
32+
33+
- name: Setup extension cache
34+
id: extcache
35+
uses: shivammathur/cache-extensions@v1
36+
with:
37+
php-version: ${{ env.phpVersion }}
38+
extensions: ${{ env.extensions }}
39+
key: ${{ env.key }}
40+
41+
- name: Cache extensions
42+
uses: actions/cache@v3
1943
with:
20-
fetch-depth: 0
44+
path: ${{ steps.extcache.outputs.dir }}
45+
key: ${{ steps.extcache.outputs.key }}
46+
restore-keys: ${{ steps.extcache.outputs.key }}
47+
48+
- name: Install PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: ${{ env.phpVersion }}
52+
extensions: ${{ env.extensions }}
2153

2254
- name: Install Node
23-
uses: actions/setup-node@v1
55+
uses: actions/setup-node@v3
2456
with:
25-
node-version: 12
57+
node-version: ${{ env.nodeVersion }}
2658

27-
- name: Install Node dependencies
28-
working-directory: ./modules/system/tests/js
29-
run: npm install
59+
- name: Echo branches
60+
run: echo "${{ github.ref }} | ${{ github.head_ref }} | ${{ github.ref_name }} | ${{ github.base_ref }}"
61+
62+
- name: Switch library dependency (develop)
63+
if: github.ref == 'refs/heads/develop' || github.base_ref == 'develop'
64+
run: php ./.github/workflows/utilities/library-switcher "dev-develop as 1.2"
65+
66+
- name: Switch library dependency (1.2)
67+
if: github.head_ref == '1.2' || github.ref == 'refs/heads/1.2' || github.base_ref == '1.2'
68+
run: php ./.github/workflows/utilities/library-switcher "1.2.x-dev as 1.2"
69+
70+
- name: Setup dependency cache
71+
id: composercache
72+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
73+
74+
- name: Cache dependencies
75+
uses: actions/cache@v3
76+
with:
77+
path: ${{ steps.composercache.outputs.dir }}
78+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
79+
restore-keys: ${{ runner.os }}-composer-
80+
81+
- name: Install Composer dependencies
82+
run: composer install --no-interaction --no-progress --no-scripts
83+
84+
- name: Reset modules
85+
run: |
86+
git reset --hard
87+
git clean -fd
88+
89+
- name: Run post-update Composer scripts
90+
run: php artisan package:discover
3091

3192
- name: Run tests
32-
working-directory: ./modules/system/tests/js
33-
run: npm run test
93+
run: |
94+
php artisan mix:install
95+
php artisan mix:run module-system test
3496
3597
phpUnitTests:
3698
strategy:
@@ -108,7 +170,9 @@ jobs:
108170
run: composer install --no-interaction --no-progress --no-scripts
109171

110172
- name: Reset modules
111-
run: git reset --hard
173+
run: |
174+
git reset --hard
175+
git clean -fd
112176
113177
- name: Run post-update Composer scripts
114178
run: php artisan package:discover
@@ -120,4 +184,4 @@ jobs:
120184
- name: Run Linting and Tests
121185
run: |
122186
composer lint
123-
./vendor/bin/phpunit
187+
php artisan winter:test -m system -m backend -m cms

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,24 @@ Please follow the following guides and code standards:
8383

8484
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).
8585

86+
## Sponsors
87+
88+
Winter CMS development is financially supported by the generosity of the following sponsors:
89+
90+
### Organizations
91+
92+
[![Spatial Media logo](https://cdn.ca.spatialmedia.io/media/images/sm-logo-dark-full.svg)](https://spatialmedia.io)
93+
Spatial Media employs two of the core contributors (Luke Towers & Jack Wilkinson) and contributes to the ongoing development of Winter.
94+
95+
[![Froala logo](https://froala.com/wp-content/uploads/2019/10/froala.svg)](https://froala.com/wysiwyg-editor/)
96+
97+
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.
98+
99+
### Individuals
100+
- Orville
101+
102+
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).
103+
86104
## License
87105

88106
The Winter platform is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"extra": {
6969
"merge-plugin": {
7070
"include": [
71-
"plugins/*/*/composer.json"
71+
"plugins/myauthor/*/composer.json"
7272
],
7373
"recurse": true,
7474
"replace": false,

config/app.php

+21-4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@
5959
*/
6060

6161
'asset_url' => env('ASSET_URL', null),
62+
63+
/*
64+
|--------------------------------------------------------------------------
65+
| Temporary Path
66+
|--------------------------------------------------------------------------
67+
|
68+
| This is used to set the application's temporary path. Normally this value
69+
| is set automatically by the application, however on some systems you
70+
| may need to change it (Laravel Vapor / read-only systems: /tmp).
71+
|
72+
*/
73+
74+
'tempPath' => env('APP_TEMP_PATH', null),
6275

6376
/*
6477
|--------------------------------------------------------------------------
@@ -106,14 +119,18 @@
106119
| - array: An array of proxies to trust
107120
|
108121
| Examples:
109-
| - To trust all proxies:
122+
| - To trust any proxy (i.e. a single proxy with an unknown IP address):
123+
|
124+
| 'trustedProxies' => '*',
125+
|
126+
| - To trust all proxies (i.e. AWS ELB behind CloudFront):
110127
|
111-
| 'trustedProxies' => '*'
128+
| 'trustedProxies' => '**',
112129
|
113130
| - To trust two IP addresses as proxies
114131
|
115-
| 'trustedProxies' => '192.168.1.1, 192.168.1.2'
116-
| 'trustedProxies' => ['192.168.1.1', '192.168.1.2']
132+
| 'trustedProxies' => '192.168.1.1, 192.168.1.2',
133+
| 'trustedProxies' => ['192.168.1.1', '192.168.1.2'],
117134
*/
118135

119136
'trustedProxies' => null,

config/filesystems.php

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
|
2727
| Supported Drivers: "local", "ftp", "sftp", "s3"
2828
|
29+
| NOTE: s3's stream_uploads option requires the Winter.DriverAWS plugin
30+
| to be installed and enabled.
31+
|
2932
*/
3033

3134
'disks' => [
@@ -42,6 +45,7 @@
4245
'key' => env('AWS_ACCESS_KEY_ID'),
4346
'region' => env('AWS_DEFAULT_REGION'),
4447
'secret' => env('AWS_SECRET_ACCESS_KEY'),
48+
'stream_uploads' => env('AWS_S3_STREAM_UPLOADS', false),
4549
'url' => env('AWS_URL'),
4650
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
4751
],

modules/backend/LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2013-2021.03.01 October CMS
4+
Copyright (c) 2021 Winter CMS
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

modules/backend/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Winter CMS - Backend Module
2+
3+
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.
4+
5+
If you wish to make changes to this module, please submit them to the [main repository](https://github.com/wintercms/winter).

modules/backend/assets/less/controls/filelist.less

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@
284284
.list-icon {
285285
position: absolute;
286286
left: 14px;
287-
top: 15px;
287+
top: 50%;
288+
transform: translateY(-50%);
288289
font-size: 22px;
289290
color: #b7c0c2;
290291
}

modules/backend/behaviors/FormController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* values as either a YAML file, located in the controller view directory,
3434
* or directly as a PHP array.
3535
*
36-
* @see http://wintercms.com/docs/backend/forms Back-end form documentation
36+
* @see https://wintercms.com/docs/backend/forms Back-end form documentation
3737
* @package winter\wn-backend-module
3838
* @author Alexey Bobkov, Samuel Georges
3939
*/

modules/backend/behaviors/ImportExportController.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use League\Csv\Reader as CsvReader;
1313
use League\Csv\Writer as CsvWriter;
1414
use League\Csv\EscapeFormula as CsvEscapeFormula;
15+
use League\Csv\Statement as CsvStatement;
1516
use ApplicationException;
1617
use SplTempFileObject;
1718
use Exception;
@@ -250,10 +251,10 @@ public function onImportLoadColumnSampleForm()
250251
$reader = $this->createCsvReader($path);
251252

252253
if (post('first_row_titles')) {
253-
$reader->setOffset(1);
254+
$reader->setHeaderOffset(1);
254255
}
255256

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

259260
/*

modules/backend/console/WinterPasswd.php

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ class WinterPasswd extends Command
3131
* @var string The console command description.
3232
*/
3333
protected $description = 'Change the password of a Backend user.';
34+
35+
/**
36+
* @var array List of commands that this command replaces (aliases)
37+
*/
38+
protected $replaces = [
39+
'winter:password',
40+
];
3441

3542
/**
3643
* @var bool Was the password automatically generated?

modules/backend/console/scaffold/controller/create.stub

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="form-buttons">
1717
<div class="loading-indicator-container">
1818
<button
19-
type="submit"
19+
type="button"
2020
data-request="onSave"
2121
data-hotkey="ctrl+s, cmd+s"
2222
data-load-indicator="<?= e(trans('backend::lang.form.creating_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>"

modules/backend/console/scaffold/controller/update.stub

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="form-buttons">
1717
<div class="loading-indicator-container">
1818
<button
19-
type="submit"
19+
type="button"
2020
data-request="onSave"
2121
data-request-data="redirect:0"
2222
data-hotkey="ctrl+s, cmd+s"

modules/backend/controllers/Auth.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ public function signin_onSubmit()
9090
'password' => post('password')
9191
], $remember);
9292

93-
if (is_null($runMigrationsOnLogin = Config::get('cms.runMigrationsOnLogin', null))) {
94-
$runMigrationsOnLogin = Config::get('app.debug', false);
95-
}
93+
$runMigrationsOnLogin = (bool) Config::get('cms.runMigrationsOnLogin', Config::get('app.debug', false));
9694

9795
if ($runMigrationsOnLogin) {
9896
try {

0 commit comments

Comments
 (0)