diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 1aede5d..715fff3 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(){"use strict";var e={774:function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=u(t);if(a&&a.has(e))return a.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var o=n?Object.getOwnPropertyDescriptor(e,l):null;o&&(o.get||o.set)?Object.defineProperty(r,l,o):r[l]=e[l]}r.default=e,a&&a.set(e,r);return r}(a(363)),n=s(a(86)),l=s(a(754)),o=a(127),i=s(a(842));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(u=function(e){return e?a:t})(e)}class c extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(e){return this.setState({popoverOpen:!this.state.popoverOpen}),e.preventDefault(),!1}renderSecurityAlerts(){const{securityAlerts:e}=this.props.dataSchema;return e&&e.length?r.default.createElement("div",{className:"package-summary__security-alerts alert alert-warning"},r.default.createElement("h4",{className:"h5"},l.default._t("ModuleDetails.SECURITY_ALERTS","Security alerts")),r.default.createElement("ul",null,e.map((e=>r.default.createElement("li",{key:e.Identifier},r.default.createElement("a",{href:e.ExternalLink,target:"_blank",rel:"noreferrer"},e.Identifier)))))):null}render(){const{dataSchema:{description:e,link:t,linkTitle:a,rating:n},detailsId:s}=this.props,u=`${s}-popover`,c=`${s}-trigger`;return r.default.createElement("div",{className:"package-summary__details"},r.default.createElement("button",{id:c,className:"package-summary__module-info-trigger btn btn-link edit-link",onClick:this.toggle},l.default._t("ModuleDetails.MODULE_INFO","Module info")),r.default.createElement(o.Popover,{id:u,target:c,placement:"bottom",className:"package-summary__details-popover",isOpen:this.state.popoverOpen,toggle:this.toggle},r.default.createElement(o.PopoverHeader,{className:"package-summary__details-header"},r.default.createElement("span",{className:"package-summary__details-header-text"},l.default._t("ModuleDetails.MODULE_INFO","Module info")),r.default.createElement(i.default,{link:t,rating:n})),r.default.createElement(o.PopoverBody,null,r.default.createElement("p",null,e),r.default.createElement("a",{href:t,title:a,target:"blank",rel:"noopener",className:"btn btn-secondary font-icon-info-circled"},r.default.createElement("span",{className:"btn__title"},l.default._t("ModuleDetails.MORE_INFO","More info"))),this.renderSecurityAlerts())))}}c.propTypes={detailsId:n.default.string.isRequired,dataSchema:n.default.shape({description:n.default.string,link:n.default.string,linkTitle:n.default.string,securityAlerts:n.default.array,rating:n.default.number})};var d=c;t.default=d},842:function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=i(t);if(a&&a.has(e))return a.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var o=n?Object.getOwnPropertyDescriptor(e,l):null;o&&(o.get||o.set)?Object.defineProperty(r,l,o):r[l]=e[l]}r.default=e,a&&a.set(e,r);return r}(a(363)),n=o(a(86)),l=o(a(820));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(i=function(e){return e?a:t})(e)}class s extends r.Component{getSymbolClasses(){const{rating:e}=this.props;let t="health-indicator__symbol--grey";return e>=40&&(t="health-indicator__symbol--green"),(0,l.default)("health-indicator__symbol",t)}renderHalfSymbol(){const{rating:e}=this.props;return e>=40&&e<70?r.default.createElement("div",{className:"health-indicator__symbol--half"}):null}render(){const{rating:e,link:t}=this.props;return r.default.createElement("a",{href:`${t}#rating-breakdown`,className:"health-indicator",target:"_blank",rel:"noreferrer"},r.default.createElement("div",{className:this.getSymbolClasses()},this.renderHalfSymbol()),r.default.createElement("p",null,e,"/100"))}}s.propTypes={link:n.default.string,rating:n.default.number},s.defaultProps={rating:0};var u=s;t.default=u},973:function(){window.jQuery.entwine("ss",(e=>{e("#checkForUpdates").entwine({PollTimeout:null,onclick(){this.setLoading()},onmatch(){this.getButton(!0).length&&this.setLoading()},setLoading(){const t=this.getButton().data("message");e(".ss-gridfield-buttonrow").first().prepend(`
${t}
`),this.poll()},poll(){const t=this;e.ajax({url:t.getButton().data("check"),async:!0,success:e=>{t.clearLoading(JSON.parse(e))}})},getButton(e){let t="button";return e&&(t+=":disabled"),this.children(t).first()},clearLoading(t){!0===t?(clearTimeout(this.getPollTimeout()),this.setPollTimeout(setTimeout((()=>{e("#checkForUpdates").poll()}),5e3))):this.closest("fieldset.ss-gridfield").reload()}})}))},945:function(){window.jQuery.entwine("ss",(e=>{e(".gridfield-dropdown-filter select").entwine({onchange(){this.parent().find(".action").click()}})}))},327:function(e,t,a){var r=o(a(363)),n=a(745),l=o(a(774));function o(e){return e&&e.__esModule?e:{default:e}}window.jQuery.entwine("ss",(e=>{e(".js-injector-boot .package-summary__details-container").entwine({ReactRoot:null,onmatch(){const e=this.data("schema");let t=this.getReactRoot();t||(t=(0,n.createRoot)(this[0]),this.setReactRoot(t)),t.render(r.default.createElement(l.default,{detailsId:this.attr("id"),dataSchema:e}))},onunmatch(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))}}),e(".site-summary .ss-gridfield-item").entwine({onclick(t){e(t.target).is("button")||(this.data("popover-open")?this.data("popover-open",!1):(this.data("popover-open",!0),this.find(".package-summary__module-info-trigger").click()))}})}))},745:function(e,t,a){var r=a(394);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},86:function(e){e.exports=PropTypes},363:function(e){e.exports=React},394:function(e){e.exports=ReactDom},127:function(e){e.exports=Reactstrap},820:function(e){e.exports=classnames},754:function(e){e.exports=i18n}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}a(973),a(945),a(327)}(); \ No newline at end of file +!function(){"use strict";var e={774:function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=u(t);if(a&&a.has(e))return a.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var o=n?Object.getOwnPropertyDescriptor(e,l):null;o&&(o.get||o.set)?Object.defineProperty(r,l,o):r[l]=e[l]}r.default=e,a&&a.set(e,r);return r}(a(363)),n=s(a(86)),l=s(a(754)),o=a(127),i=s(a(842));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(u=function(e){return e?a:t})(e)}class c extends r.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={popoverOpen:!1}}toggle(e){return this.setState({popoverOpen:!this.state.popoverOpen}),e.preventDefault(),!1}renderSecurityAlerts(){const{securityAlerts:e}=this.props.dataSchema;return e&&e.length?r.default.createElement("div",{className:"package-summary__security-alerts alert alert-warning"},r.default.createElement("h4",{className:"h5"},l.default._t("ModuleDetails.SECURITY_ALERTS","Security alerts")),r.default.createElement("ul",null,e.map((e=>r.default.createElement("li",{key:e.Identifier},r.default.createElement("a",{href:e.ExternalLink,target:"_blank",rel:"noreferrer"},e.Identifier)))))):null}render(){const{dataSchema:{description:e,link:t,linkTitle:a,rating:n},detailsId:s}=this.props,u=`${s}-popover`,c=`${s}-trigger`;return r.default.createElement("div",{className:"package-summary__details"},r.default.createElement("button",{id:c,className:"package-summary__module-info-trigger btn btn-link edit-link",onClick:this.toggle},l.default._t("ModuleDetails.MODULE_INFO","Module info")),r.default.createElement(o.Popover,{id:u,target:c,placement:"bottom",className:"package-summary__details-popover",isOpen:this.state.popoverOpen,toggle:this.toggle},r.default.createElement(o.PopoverHeader,{className:"package-summary__details-header"},r.default.createElement("span",{className:"package-summary__details-header-text"},l.default._t("ModuleDetails.MODULE_INFO","Module info")),r.default.createElement(i.default,{link:t,rating:n})),r.default.createElement(o.PopoverBody,null,r.default.createElement("p",null,e),r.default.createElement("a",{href:t,title:a,target:"blank",rel:"noopener",className:"btn btn-secondary font-icon-info-circled"},r.default.createElement("span",{className:"btn__title"},l.default._t("ModuleDetails.MORE_INFO","More info"))),this.renderSecurityAlerts())))}}c.propTypes={detailsId:n.default.string.isRequired,dataSchema:n.default.shape({description:n.default.string,link:n.default.string,linkTitle:n.default.string,securityAlerts:n.default.array,rating:n.default.number})};var d=c;t.default=d},842:function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=i(t);if(a&&a.has(e))return a.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var o=n?Object.getOwnPropertyDescriptor(e,l):null;o&&(o.get||o.set)?Object.defineProperty(r,l,o):r[l]=e[l]}r.default=e,a&&a.set(e,r);return r}(a(363)),n=o(a(86)),l=o(a(820));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(i=function(e){return e?a:t})(e)}class s extends r.Component{getSymbolClasses(){const{rating:e}=this.props;let t="health-indicator__symbol--grey";return e>=40&&(t="health-indicator__symbol--green"),(0,l.default)("health-indicator__symbol",t)}renderHalfSymbol(){const{rating:e}=this.props;return e>=40&&e<70?r.default.createElement("div",{className:"health-indicator__symbol--half"}):null}render(){const{rating:e,link:t}=this.props;return r.default.createElement("a",{href:`${t}#rating-breakdown`,className:"health-indicator",target:"_blank",rel:"noreferrer"},r.default.createElement("div",{className:this.getSymbolClasses()},this.renderHalfSymbol()),r.default.createElement("p",null,e,"/100"))}}s.propTypes={link:n.default.string,rating:n.default.number},s.defaultProps={rating:0};var u=s;t.default=u},973:function(){window.jQuery.entwine("ss",(e=>{e("#checkForUpdates").entwine({PollTimeout:null,onclick(){this.setLoading()},onmatch(){this.getButton(!0).length&&this.setLoading()},setLoading(){const t=this.getButton().data("message");e(".ss-gridfield-buttonrow").first().prepend(`${t}
`),this.poll()},poll(){const t=this;e.ajax({url:t.getButton().data("check"),async:!0,success:e=>{t.clearLoading(JSON.parse(e))}})},getButton(e){let t="button";return e&&(t+=":disabled"),this.children(t).first()},clearLoading(t){!0===t?(clearTimeout(this.getPollTimeout()),this.setPollTimeout(setTimeout((()=>{e("#checkForUpdates").poll()}),5e3))):this.closest("fieldset.ss-gridfield").reload()}})}))},945:function(){window.jQuery.entwine("ss",(e=>{e(".gridfield-dropdown-filter select").entwine({onchange(){this.parent().find(".action").click()}})}))},327:function(e,t,a){var r=o(a(363)),n=a(691),l=o(a(774));function o(e){return e&&e.__esModule?e:{default:e}}window.jQuery.entwine("ss",(e=>{e(".js-injector-boot .package-summary__details-container").entwine({ReactRoot:null,onmatch(){const e=this.data("schema");let t=this.getReactRoot();t||(t=(0,n.createRoot)(this[0]),this.setReactRoot(t)),t.render(r.default.createElement(l.default,{detailsId:this.attr("id"),dataSchema:e}))},onunmatch(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))}}),e(".site-summary .ss-gridfield-item").entwine({onclick(t){e(t.target).is("button")||(this.data("popover-open")?this.data("popover-open",!1):(this.data("popover-open",!0),this.find(".package-summary__module-info-trigger").click()))}})}))},86:function(e){e.exports=PropTypes},363:function(e){e.exports=React},691:function(e){e.exports=ReactDomClient},127:function(e){e.exports=Reactstrap},820:function(e){e.exports=classnames},754:function(e){e.exports=i18n}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}a(973),a(945),a(327)}(); \ No newline at end of file diff --git a/package.json b/package.json index e233a8c..85f7968 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "reactstrap": "^8.9.0" }, "devDependencies": { - "@silverstripe/eslint-config": "^1.0.0-alpha6", - "@silverstripe/webpack-config": "^2.0.0-alpha5", + "@silverstripe/eslint-config": "^1.0.0", + "@silverstripe/webpack-config": "^2.0.0", "webpack": "^5.74.0", "webpack-cli": "^5.0.0" }, diff --git a/yarn.lock b/yarn.lock index 81e8b94..7ff5fdc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1276,10 +1276,10 @@ resolved "https://registry.yarnpkg.com/@sect/modernizr-loader/-/modernizr-loader-1.0.3.tgz#7fd8cec372426c53f113f3cfd9344cb29e959825" integrity sha512-47zKwv4/1I0CYptZz8s4aSYSe0awmuyqa+HFKxN89/75h2q8hr6V752TZ9VjhGDhQ4gU0EU7Plew7b+7bf2crg== -"@silverstripe/eslint-config@^1.0.0-alpha6": - version "1.0.0-alpha6" - resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-1.0.0-alpha6.tgz#1f243b003fddf3503a4abea37f35a8a5968cc96e" - integrity sha512-+P7UzhMRSmc7UlRYCiSXwjauLFYU11oBPwHl/bpacJ7xUcFY3Jt3CgcDt6d+XLvAJO8zMRsG9RcOm5MnxsyCsg== +"@silverstripe/eslint-config@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-1.0.0.tgz#dcf3f9cf2158bb587d8048a7c2860c0513221d40" + integrity sha512-pcHzB+6KWd8BPStBhHM8achdNY/Yj1p3WSTEs/CSw61VRcfBfg5GZECtvEerTSX/0ZeawAM1ABvstIAYihcfAg== dependencies: eslint "^8.26.0" eslint-config-airbnb "^19.0.4" @@ -1289,10 +1289,10 @@ eslint-plugin-react "^7.31.10" eslint-webpack-plugin "^3.2.0" -"@silverstripe/webpack-config@^2.0.0-alpha5": - version "2.0.0-alpha6" - resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-2.0.0-alpha6.tgz#4a781f600344c3604169de08244ca11cacbd46f7" - integrity sha512-cPux01Z6EGwnSg5EezaJZ1S2x4ThfA3TbpTWTsqmW2jvr1VM/7Xu8B3j2HFH+2fNP0dvdmu+fScCD6VPNVQNWw== +"@silverstripe/webpack-config@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-2.0.0.tgz#278a72a1adbc6fa2362497d60424c78fba58e8e1" + integrity sha512-m1qGRxlsdhWL567cWe7IZNBUCzeyg3T1Y9yY9Y6XClwAqlg1oIO9uLfvfauA4dbtECrzU5n1AkaaU6kMRtN6Aw== dependencies: "@babel/core" "^7.19.6" "@babel/preset-env" "^7.19.4"