From 0d9fc0593b56d0e319028885ce1475b7269c6acd Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Wed, 18 Jan 2023 21:40:31 +1300 Subject: [PATCH 1/8] DEP Upgrade dependencies for CMS 5 compatibility --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 3ff2c017..d3cad270 100644 --- a/composer.json +++ b/composer.json @@ -30,19 +30,19 @@ "issues": "http://github.com/tractorcow-farm/silverstripe-fluent/issues" }, "require": { - "php": "^7.1 || ^8", - "silverstripe/vendor-plugin": "^1.6", - "silverstripe/framework": "^4.7", - "silverstripe/admin": "^1", - "silverstripe/versioned": "^1.7", - "symbiote/silverstripe-gridfieldextensions": "^3.1", + "php": "^8.1", + "silverstripe/vendor-plugin": "^2", + "silverstripe/framework": "^5", + "silverstripe/admin": "^2", + "silverstripe/versioned": "^2", + "symbiote/silverstripe-gridfieldextensions": "^4", "ext-json": "*" }, "suggest": { "silverstripe/cms": "Localise pages" }, "require-dev": { - "silverstripe/recipe-testing": "^2" + "silverstripe/recipe-testing": "^3" }, "extra": { "branch-alias": { From 820e1f51b44bb84ea40edd8ebc5704c08c6b55b5 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 19 Jan 2023 10:11:58 +1300 Subject: [PATCH 2/8] FIX Get fluent to dev/build --- _config.php | 5 ----- src/Model/CachableModel.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 _config.php diff --git a/_config.php b/_config.php deleted file mode 100644 index e1f5792a..00000000 --- a/_config.php +++ /dev/null @@ -1,5 +0,0 @@ -get(static::class, 'default_sort'); if ($sort) { - $dataList = $dataList->sort($sort); + $dataList = $dataList->orderBy($sort); } // If DB isn't ready, silently return empty array to prevent bootstrapping issues From 49e7197e3e9622b3497ba8c76cb0532fc399245f Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 20 Jan 2023 16:52:50 +1300 Subject: [PATCH 3/8] MNT Remove legacy upgrader config --- .upgrade.yml | 4 ---- src/Forms/LocaleToggleColumn.php | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 .upgrade.yml diff --git a/.upgrade.yml b/.upgrade.yml deleted file mode 100644 index addf2a6a..00000000 --- a/.upgrade.yml +++ /dev/null @@ -1,4 +0,0 @@ -mappings: - FluentExtension: TractorCow\Fluent\Extension\FluentExtension - FluentFilteredExtension: TractorCow\Fluent\Extension\FluentFilteredExtension - FluentSiteTree: TractorCow\Fluent\Extension\FluentSiteTreeExtension diff --git a/src/Forms/LocaleToggleColumn.php b/src/Forms/LocaleToggleColumn.php index 88611c9c..6c4a88ef 100644 --- a/src/Forms/LocaleToggleColumn.php +++ b/src/Forms/LocaleToggleColumn.php @@ -18,9 +18,6 @@ class LocaleToggleColumn implements GridField_SaveHandler, GridField_ColumnProvi { use Injectable; - /** - * @skipUpgrade - */ const COLUMN_NAME = 'VisibleToggle'; /** From e85e5b82daf904374628d87fbc9a15c319acf435 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 26 Jan 2023 16:47:23 +1300 Subject: [PATCH 4/8] DEP Upgrade frontend build stack --- .nvmrc | 2 +- babel.config.json | 6 + client/dist/js/fluent.js | 2 +- client/dist/styles/fluent.css | 2 +- package.json | 23 +- webpack.config.js | 51 +- yarn.lock | 8558 ++++++++++++++++++--------------- 7 files changed, 4733 insertions(+), 3911 deletions(-) create mode 100644 babel.config.json diff --git a/.nvmrc b/.nvmrc index f599e28b..3c032078 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -10 +18 diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 00000000..4f06b0cd --- /dev/null +++ b/babel.config.json @@ -0,0 +1,6 @@ +{ + "presets": [ + "@babel/preset-env", + "@babel/preset-react" + ] +} diff --git a/client/dist/js/fluent.js b/client/dist/js/fluent.js index 9021a4c4..605301fb 100644 --- a/client/dist/js/fluent.js +++ b/client/dist/js/fluent.js @@ -1 +1 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,n){"use strict";function r(t){switch(t.arrayFormat){case"index":return function(e,n,r){return null===n?[s(e,t),"[",r,"]"].join(""):[s(e,t),"[",s(r,t),"]=",s(n,t)].join("")};case"bracket":return function(e,n){return null===n?s(e,t):[s(e,t),"[]=",s(n,t)].join("")};default:return function(e,n){return null===n?s(e,t):[s(e,t),"=",s(n,t)].join("")}}}function o(t){var e;switch(t.arrayFormat){case"index":return function(t,n,r){if(e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),!e)return void(r[t]=n);void 0===r[t]&&(r[t]={}),r[t][e[1]]=n};case"bracket":return function(t,n,r){return e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0===r[t]?void(r[t]=[n]):void(r[t]=[].concat(r[t],n)):void(r[t]=n)};default:return function(t,e,n){if(void 0===n[t])return void(n[t]=e);n[t]=[].concat(n[t],e)}}}function s(t,e){return e.encode?e.strict?a(t):encodeURIComponent(t):t}function i(t){return Array.isArray(t)?t.sort():"object"==typeof t?i(Object.keys(t)).sort(function(t,e){return Number(t)-Number(e)}).map(function(e){return t[e]}):t}var a=n(9),h=n(4),c=n(3);e.extract=function(t){var e=t.indexOf("?");return-1===e?"":t.slice(e+1)},e.parse=function(t,e){e=h({arrayFormat:"none"},e);var n=o(e),r=Object.create(null);return"string"!=typeof t?r:(t=t.trim().replace(/^[?#&]/,""))?(t.split("&").forEach(function(t){var e=t.replace(/\+/g," ").split("="),o=e.shift(),s=e.length>0?e.join("="):void 0;s=void 0===s?null:c(s),n(c(o),s,r)}),Object.keys(r).sort().reduce(function(t,e){var n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=i(n):t[e]=n,t},Object.create(null))):r},e.stringify=function(t,e){e=h({encode:!0,strict:!0,arrayFormat:"none"},e);var n=r(e);return t?Object.keys(t).sort().map(function(r){var o=t[r];if(void 0===o)return"";if(null===o)return s(r,e);if(Array.isArray(o)){var i=[];return o.slice().forEach(function(t){void 0!==t&&i.push(n(r,t,i.length))}),i.join("&")}return s(r,e)+"="+s(o,e)}).filter(function(t){return t.length>0}).join("&"):""}},function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(t,e,n){if(t&&c.isObject(t)&&t instanceof r)return t;var o=new r;return o.parse(t,e,n),o}function s(t){return c.isString(t)&&(t=o(t)),t instanceof r?t.format():r.prototype.format.call(t)}function i(t,e){return o(t,!1,!0).resolve(e)}function a(t,e){return t?o(t,!1,!0).resolveObject(e):e}var h=n(5),c=n(10);e.parse=o,e.resolve=i,e.resolveObject=a,e.format=s,e.Url=r;var u=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(p),d=["'"].concat(m),v=["%","/","?",";","#"].concat(d),y=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,j={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=n(8);r.prototype.parse=function(t,e,n){if(!c.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),o=-1!==r&&r127?S+="x":S+=P[N];if(!S.match(g)){var $=E.slice(0,I),T=E.slice(I+1),L=P.match(b);L&&($.push(L[1]),T.unshift(L[2])),T.length&&(a="/"+T.join(".")+a),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=h.toASCII(this.hostname));var z=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+z,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!j[m])for(var I=0,F=d.length;I0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return n.search=t.search,n.query=t.query,c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var I=x.slice(-1)[0],U=(n.host||t.host||x.length>1)&&("."===I||".."===I)||""===I,R=0,q=x.length;q>=0;q--)I=x[q],"."===I?x.splice(q,1):".."===I?(x.splice(q,1),R++):R&&(x.splice(q,1),R--);if(!b&&!j)for(;R--;R)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),U&&"/"!==x.join("/").substr(-1)&&x.push("");var k=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(C){n.hostname=n.host=k?"":x.length?x.shift():"";var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return b=b||n.host&&x.length,b&&!k&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n.n(r),s=n(0),i=n.n(s);window.jQuery.entwine("ss",function(t){var e=function(){if(window&&window.ss&&window.ss.config&&window.ss.config.sections){var t=window.ss.config.sections.find(function(t){return"TractorCow\\Fluent\\Control\\LocaleAdmin"===t.name});if(t)return t.fluent||{}}return{}},n=function(t,n){var r=e();if(!r.param)return t;var s=o.a.parse(t),a=i.a.parse(s.search);return a[r.param]=n,s.search=i.a.stringify(a),o.a.format(s)};t("input[data-hides]").entwine({onmatch:function(){this._super();var e=this.data("hides"),n=t("[name='"+e+"']").closest(".field");this.is(":checked")?n.hide():n.show()},onunmatch:function(){this._super()},onchange:function(){var e=this.data("hides"),n=t("[name='"+e+"']").closest(".field");this.is(":checked")?n.slideUp():n.slideDown()}}),t(".cms > .cms-container > .cms-menu > .cms-panel-content").entwine({onmatch:function(){this._super();var n=e();if(void 0!==n.locales&&0!==n.locales.length){var r=t("
\n \n
");n.locales.forEach(function(e){var o=t("