Skip to content

Commit

Permalink
Merge branch 'develop' into 1.1
Browse files Browse the repository at this point in the history
* develop: (65 commits)
  Update maximum supported PHP version for 1.1 (#603)
  Update EditorConfig link (#602)
  Apply consistent path normalisation to fix Windows test
  Fix view maker unit test for Windows
  Outputs time respecting backend preferences (#572)
  Rebuild Snowboard agian
  Revert "Rebuild Snowboard"
  Rebuild Snowboard
  Allow a string selector for the form in a request
  Use correct line breaks for Windows tests
  Backport ViewMaker tests from 1.2 branch
  farsi spelling correction (#579)
  Add Winter 1.2 as version option in bug report
  Adjust early termination of requests from success/error
  Increase stale check to 6 months
  Let composer resolve current php process in scripts (#563)
  Fix track input not keeping timeout
  Add jQuery AJAX prefilter as early as possible
  Add additional debugging for errors thrown in events
  Abstract Snowboard plugin constructors and destructors (#561)
  ...

# Conflicts:
#	composer.json
  • Loading branch information
LukeTowers committed Jul 15, 2022
2 parents ec46549 + e764d0f commit 107e1d0
Show file tree
Hide file tree
Showing 106 changed files with 2,354 additions and 507 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EditorConfig is awesome: http://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/1_BUG_REPORT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ body:
description: Please select the Winter CMS build that you encountered your issue with. You can find the version in the **Updates & Plugins** section of the Settings page of the Backend, or by running the `php artisan winter:version` command.
options:
- dev-develop
- 1.2
- 1.1
- 1.0 (please try updating first)
- Other (please specify below)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ jobs:
- uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60
days-before-stale: 182
days-before-close: 3
stale-issue-message: >
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the [Premium Support Program](https://wintercms.com/premium-support) where a Service Level Agreement is offered.
If this issue is still relevant or you would like to see it actioned, please respond within 3 days.
If this issue is critical for your business, please reach out to us at wintercms@luketowers.ca.
stale-pr-message: >
This pull request will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this is still being worked on, please respond and we will re-open this pull request.
This pull request will be closed and archived in 3 days, as there has been no activity in this pull request for the last 6 months.
If this pull request is critical to your business, consider joining the [Premium Support Program](https://wintercms.com/premium-support) where a Service Level Agreement is offered.
If you intend to continue working on this pull request, please respond within 3 days.
If this pull request is critical for your business, please reach out to us at [email protected].
stale-issue-label: 'Status: Archived'
stale-pr-label: 'Status: Archived'
exempt-issue-label: 'Status: In Progress'
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ jobs:
with:
node-version: 12

- name: Install Node dependencies
working-directory: ./modules/system/assets/js/snowboard
- name: Install Node dependencies for System Module
working-directory: ./modules/system
run: npm install

- name: Run code quality checks
working-directory: ./modules/system/assets/js/snowboard
- name: Run code quality checks on System Module
working-directory: ./modules/system
run: npx eslint .

- name: Install Node dependencies for Backend Module
working-directory: ./modules/backend
run: npm install

- name: Run code quality checks on Backend Module
working-directory: ./modules/backend
run: npx eslint .
1 change: 1 addition & 0 deletions .gitpod/gitpod-hide-config
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ git update-index --skip-worktree config/database.php
git update-index --skip-worktree config/mail.php
git update-index --skip-worktree config/queue.php
git update-index --skip-worktree config/session.php
git update-index --skip-worktree package.json
1 change: 1 addition & 0 deletions .gitpod/gitpod-show-config
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ git update-index --no-skip-worktree config/database.php
git update-index --no-skip-worktree config/mail.php
git update-index --no-skip-worktree config/queue.php
git update-index --no-skip-worktree config/session.php
git update-index --no-skip-worktree package.json
10 changes: 7 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files.associations": {
"**/modules/*/behaviors/*/partials/*.htm": "php",
"**/modules/*/controllers/*.htm": "php",
"**/modules/*/controllers/*/*.htm": "php",
"**/modules/*/formwidgets/*/partials/*.htm": "php",
"**/modules/*/layouts/*.htm": "php",
"**/modules/*/models/*/*.htm": "php",
Expand All @@ -11,7 +11,7 @@
"**/modules/*/widgets/*/partials/*.htm": "php",

"**/plugins/*/*/behaviors/*/partials/*.htm": "php",
"**/plugins/*/*/components/*/*.htm": "twig",
"**/plugins/*/*/components/*/*.htm": "wintercms-twig",
"**/plugins/*/*/controllers/*/*.htm": "php",
"**/plugins/*/*/formwidgets/*/partials/*.htm": "php",
"**/plugins/*/*/layouts/*.htm": "php",
Expand All @@ -25,5 +25,9 @@
"**/themes/*/layouts/*.htm": "wintercms",
"**/themes/*/pages/**/*.htm": "wintercms",
"**/themes/*/partials/**/*.htm": "wintercms"
}
},
"eslint.validate": [
"javascript",
"vue"
]
}
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"source": "https://github.com/wintercms/winter"
},
"require": {
"php": "^7.2.9|^8.0",
"php": "^7.2.9|~8.0.0",
"winter/storm": "~1.1.2",
"winter/wn-system-module": "~1.1.2",
"winter/wn-backend-module": "~1.1.2",
Expand All @@ -55,12 +55,12 @@
},
"scripts": {
"post-create-project-cmd": [
"php artisan key:generate",
"php artisan package:discover"
"@php artisan key:generate",
"@php artisan package:discover"
],
"post-update-cmd": [
"php artisan winter:version",
"php artisan package:discover"
"@php artisan winter:version",
"@php artisan package:discover"
],
"test": [
"phpunit --stop-on-failure"
Expand Down
14 changes: 14 additions & 0 deletions modules/backend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ignore build files
**/node_modules/**
build/*.js
**/build/*.js
**/mix.webpack.js

# Ignore all JS except for Mix-based assets
assets/js
assets/vendor
behaviors/**/*.js
controllers/**/*.js
formwidgets/**/*.js
reportwidgets/**/*.js
widgets/**/*.js
36 changes: 36 additions & 0 deletions modules/backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"es6": true,
"browser": true
},
"globals": {
"Snowboard": "writable"
},
"extends": [
"airbnb-base",
"plugin:vue/vue3-recommended"
],
"rules": {
"class-methods-use-this": ["off"],
"indent": ["error", 4, {
"SwitchCase": 1
}],
"max-len": ["off"],
"new-cap": ["error", { "properties": false }],
"no-alert": ["off"],
"no-param-reassign": ["error", {
"props": false
}],
"vue/html-indent": ["error", 4],
"vue/html-self-closing": ["error", {
"html": {
"void": "never",
"normal": "any",
"component": "always"
},
"svg": "always",
"math": "always"
}],
"vue/multi-word-component-names": ["off"]
}
}
6 changes: 6 additions & 0 deletions modules/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Backend module ignores

# Ignore Mix files
node_modules
package-lock.json
mix.webpack.js
140 changes: 0 additions & 140 deletions modules/backend/assets/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
* Winter General Utilities
*/

/*
* Ensure the CSRF token is added to all AJAX requests.
*/

$.ajaxPrefilter(function(options) {
var token = $('meta[name="csrf-token"]').attr('content')

if (token) {
if (!options.headers) options.headers = {}
options.headers['X-CSRF-TOKEN'] = token
}
})

/*
* Path helpers
*/
Expand All @@ -36,133 +23,6 @@ $.wn.backendUrl = function(url) {
return backendBasePath + '/' + url
}

/*
* Asset Manager
*
* Usage: assetManager.load({ css:[], js:[], img:[] }, onLoadedCallback)
*/

AssetManager = function() {

var o = {

load: function(collection, callback) {
var jsList = (collection.js) ? collection.js : [],
cssList = (collection.css) ? collection.css : [],
imgList = (collection.img) ? collection.img : []

jsList = $.grep(jsList, function(item){
return $('head script[src="'+item+'"]').length == 0
})

cssList = $.grep(cssList, function(item){
return $('head link[href="'+item+'"]').length == 0
})

var cssCounter = 0,
jsLoaded = false,
imgLoaded = false

if (jsList.length === 0 && cssList.length === 0 && imgList.length === 0) {
callback && callback()
return
}

o.loadJavaScript(jsList, function(){
jsLoaded = true
checkLoaded()
})

$.each(cssList, function(index, source){
o.loadStyleSheet(source, function(){
cssCounter++
checkLoaded()
})
})

o.loadImage(imgList, function(){
imgLoaded = true
checkLoaded()
})

function checkLoaded() {
if (!imgLoaded)
return false

if (!jsLoaded)
return false

if (cssCounter < cssList.length)
return false

callback && callback()
}
},

/*
* Loads StyleSheet files
*/
loadStyleSheet: function(source, callback) {
var cssElement = document.createElement('link')

cssElement.setAttribute('rel', 'stylesheet')
cssElement.setAttribute('type', 'text/css')
cssElement.setAttribute('href', source)
cssElement.addEventListener('load', callback, false)

if (typeof cssElement != 'undefined') {
document.getElementsByTagName('head')[0].appendChild(cssElement)
}

return cssElement
},

/*
* Loads JavaScript files in sequence
*/
loadJavaScript: function(sources, callback) {
if (sources.length <= 0)
return callback()

var source = sources.shift(),
jsElement = document.createElement('script');

jsElement.setAttribute('type', 'text/javascript')
jsElement.setAttribute('src', source)
jsElement.addEventListener('load', function() {
o.loadJavaScript(sources, callback)
}, false)

if (typeof jsElement != 'undefined') {
document.getElementsByTagName('head')[0].appendChild(jsElement)
}
},

/*
* Loads Image files
*/
loadImage: function(sources, callback) {
if (sources.length <= 0)
return callback()

var loaded = 0
$.each(sources, function(index, source){
var img = new Image()
img.onload = function() {
if (++loaded == sources.length && callback)
callback()
}
img.src = source
})
}

};

return o;
};

assetManager = new AssetManager();

/*
* String escape
*/
Expand Down
Loading

0 comments on commit 107e1d0

Please sign in to comment.