From a4bf17fd6f8b055da9da3b4467a0705265c3a54f Mon Sep 17 00:00:00 2001 From: tblivet Date: Tue, 13 Aug 2024 18:02:16 +0200 Subject: [PATCH] feat: checklist --- css/styles.css | 2 +- css/styles.css.map | 2 +- package.json | 5 +- scss/_layout.scss | 0 scss/_mixins.scss | 2 +- scss/_variables.scss | 2 +- scss/components/_alert.scss | 2 +- scss/components/_badge.scss | 2 +- scss/components/_check-requirements.scss | 13 +- scss/components/_index.scss | 2 +- scss/components/_radio-card.scss | 71 ++- scss/components/_typography.scss | 4 +- scss/components/form/_index.scss | 2 +- scss/components/form/_radio.scss | 12 +- scss/styles.scss | 112 ++++- .../components/CheckRequirements.stories.js | 39 +- .../stories/components/RadioCard.stories.js | 11 +- .../components/check-requirements.html.twig | 473 ++++++++---------- .../templates/components/radio-card.html.twig | 10 +- 19 files changed, 413 insertions(+), 353 deletions(-) create mode 100644 scss/_layout.scss diff --git a/css/styles.css b/css/styles.css index 9dc74e6270..4e2a4c05a9 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1 +1 @@ -#update_assistant .alert{margin-block-end:0}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}#update_assistant .check-requirements{--ua-requirements-background-color: #f7f7f7;--ua-requirements-loader-color: #1d1d1b;--ua-requirements-loader-dot-color: #5C92AA;margin-block-start:.5rem;padding:1rem;background-color:var(--ua-requirements-background-color)}#update_assistant .check-requirements__loader{position:relative;margin-block-end:1rem;width:1.625rem;height:1.625rem;background:linear-gradient(var(--ua-requirements-background-color), var(--ua-requirements-background-color)) padding-box,conic-gradient(from 0, transparent, #78c4d8) border-box;border:.1875rem solid rgba(0,0,0,0);border-radius:100%;text-align:center;animation:rotate 1.5s linear infinite;margin-inline:auto}#update_assistant .check-requirements__loader::before{content:"";position:absolute;top:0;left:50%;display:block;width:.1875rem;height:.1875rem;background:#5c92aa;border-radius:50%;transform:translate(-50%, -100%)}#update_assistant .check-requirements__loader-title{font-size:.875rem;font-weight:700;color:var(--ua-requirements-loader-color);line-height:1.4;text-align:center}#update_assistant .check-requirements__message{margin-block-end:1rem}#update_assistant .check-requirements__list{display:flex;flex-direction:column;gap:.5rem;margin-block-end:1rem}#update_assistant .check-requirements__requirement{padding-inline-start:2rem;background-position:left center;background-repeat:no-repeat;background-size:1.5rem 1.5rem;font-size:.875rem;line-height:1.4}#update_assistant .check-requirements__requirement--nok{background-image:url("../img/close.svg")}#update_assistant .check-requirements__requirement--warning{background-image:url("../img/warning.svg")}#update_assistant .check-requirements__requirement--ok{background-image:url("../img/check.svg")}#update_assistant .require-star{--ua-required-color: #ba151a;color:var(--ua-required-color)}#update_assistant .form-group{margin-block-end:.5rem}#update_assistant label{font-size:.875rem;font-weight:500;line-height:1.4;margin-block-end:.25rem}#update_assistant select{appearance:none;background-image:url("../img/unfold_more.svg");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.125rem 1.125rem;padding-inline-end:2rem}#update_assistant .radio{--ua-radio-border-color: #1D1D1B;--ua-radio-background-color-checked: #1D1D1B;--ua-radio-border-color-checked: #1D1D1B;--ua-radio-border-color-disabled: #BBBBBB;position:relative;margin:0;padding:0;width:20px;height:20px;background:rgba(0,0,0,0);background-clip:content-box;border:2px solid var(--ua-radio-border-color);border-radius:50%;outline:none !important;line-height:0;-webkit-appearance:none;cursor:pointer}#update_assistant .radio:checked{padding:3px;background-color:var(--ua-radio-background-color-checked);border:2px solid var(--ua-radio-border-color-checked)}#update_assistant .radio:disabled{border-color:var(--ua-radio-border-color-disabled)}#update_assistant .radio-card{--ua-radio-card-title-color: #1D1D1B;--ua-radio-card-title-color-disabled: #BBBBBB;--ua-radio-card-message-color: #5E5E5E;--ua-radio-card-message-color-disabled: #BBBBBB;--ua-radio-card-disabled-message-color: #FFFFFF;--ua-radio-card-disabled-message-background-color: #1D1D1B;--ua-radio-card-border-radius: 0;--ua-radio-card-border-color: #DDDDDD;--ua-radio-card-border-color-hover: #1D1D1B;--ua-radio-card-border-color-active: var(--ua-radio-card-border-color-hover);--ua-radio-card-release-color: #1D1D1B;--ua-radio-card-release-border-color: #DDDDDD;--ua-radio-card-badge-color: #1D1D1B;--ua-radio-card-badge-background-color: #D1DCFC;all:unset;display:flex;gap:.5rem;padding:1rem;background-color:#fff;border:1px solid var(--ua-radio-card-border-color);border-radius:var(--ua-radio-card-border-radius);transition:border-color .15s}#update_assistant .radio-card:not(.radio-card--disabled):hover{border-color:var(--ua-radio-card-border-color-hover);cursor:pointer}#update_assistant .radio-card:has(input[type=radio]:checked){border-color:var(--ua-radio-card-border-color-active)}#update_assistant .radio-card__radio-wrapper{flex-shrink:0}#update_assistant .radio-card__infos-wrapper{flex-grow:1}#update_assistant .radio-card__infos-top{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between}#update_assistant .radio-card__title{display:inline-flex;flex-wrap:wrap;gap:.5rem;align-items:center;font-size:.875rem;font-weight:700;color:var(--ua-radio-card-title-color);line-height:1.4;margin-block:0}#update_assistant .radio-card__badge{flex-shrink:0;padding:.125rem .5rem;background-color:var(--ua-radio-card-badge-background-color);border-radius:2rem;font-size:.875rem;font-weight:500;color:var(--ua-radio-card-badge-color);line-height:1.4}#update_assistant .radio-card__message{font-size:.875rem;margin-block:.5rem 0;color:var(--ua-radio-card-message-color)}#update_assistant .radio-card__release-note{display:inline-flex;gap:.25rem;align-items:center;justify-content:flex-end;font-size:.875rem;color:var(--ua-radio-card-release-color);line-height:1.4;text-decoration:none;border-bottom:1px solid var(--ua-radio-card-release-border-color)}#update_assistant .radio-card__release-note:hover{text-decoration:none}#update_assistant .radio-card__release-note i{font-size:.875rem}#update_assistant .radio-card__disabled-message{position:absolute;top:50%;left:50%;display:none;padding:.5rem .75rem;background-color:var(--ua-radio-card-disabled-message-background-color);transform:translate(-50%, -50%);font-size:.875rem;color:var(--ua-radio-card-disabled-message-color);line-height:1.4em}#update_assistant .radio-card__local-archive{padding-block-start:.5rem}#update_assistant .radio-card--disabled{position:relative;cursor:not-allowed}#update_assistant .radio-card--disabled .radio-card__title{color:var(--ua-radio-card-title-color-disabled)}#update_assistant .radio-card--disabled .radio-card__message{color:var(--ua-radio-card-message-color-disabled)}#update_assistant .radio-card--disabled .radio-card__badge,#update_assistant .radio-card--disabled .radio-card__release-note{opacity:.4;pointer-events:none}#update_assistant .radio-card--disabled .radio-card__disabled-message{display:block}#update_assistant{--ua-typography-color: #1d1d1b;--ua-link-color: #1d1d1b;--ua-link-hover-color: #1d1d1b}#update_assistant h1,#update_assistant h2,#update_assistant h3,#update_assistant h4,#update_assistant h5,#update_assistant h6,#update_assistant .h1,#update_assistant .h2,#update_assistant .h3,#update_assistant .h4,#update_assistant .h5,#update_assistant .h6{color:var(--ua-typography-color)}#update_assistant .h1{font-size:1.5rem;font-weight:600;margin-block:0 1.5rem}#update_assistant .h2{font-size:1.25rem;font-weight:600;margin-block:0 1rem}#update_assistant .h3{margin-block:0 .5rem;font-size:1.125rem;font-weight:600}#update_assistant p{font-size:.875rem}#update_assistant a{color:var(--ua-link-color);text-decoration:underline;text-underline-offset:.125rem;transition:text-underline-offset .15s}#update_assistant a:hover{color:var(--ua-link-hover-color);text-underline-offset:.25rem}*{box-sizing:border-box}.upgradestep{margin-right:5px;padding-left:10px;padding-right:5px}.processing{border:2px outset gray;margin-top:1px;overflow:auto}#infoStep{height:100px}#infoError{height:100px}#quickInfo{height:200px}#errorDuringUpgrade{color:#c00}#checkPrestaShopFilesVersion,#checkPrestaShopModifiedFiles{margin-bottom:20px}.changedFileList{margin-left:20px;padding-left:5px}.changedNotice li{color:gray}.changedImportant li{color:red;font-weight:bold}.upgradeDbError{background-color:#feefb3}.upgradeDbOk{background-color:#dff2bf}.small_label{font-weight:normal;width:300px;float:none;text-align:left;padding:0}.ocu-feature-list{margin:0;padding:0;list-style:none}.ocu-feature-list li{background:url(../img/admin/enabled.gif) no-repeat;padding-left:20px;margin:0}.label-small{width:130px}.margin-form-small{padding:0 0 1em 130px}.nextStep{font-weight:bold}#diffList,#changedList{margin-top:20px}#autoupgradePhpWarningMainIcon{font-size:3em}#autoupgradePhpWarn .icon-stack-text{color:#fff}.panel-heading{text-transform:uppercase}.required{color:#c00}/*# sourceMappingURL=styles.css.map */ +#update_assistant .alert{margin-block-end:0}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}#update_assistant .check-requirements{--ua-requirements-background-color: #f7f7f7;--ua-requirements-loader-color: #1d1d1b;--ua-requirements-loader-dot-color: #5c92aa;margin-block-start:.5rem;padding:1rem;background-color:var(--ua-requirements-background-color)}#update_assistant .check-requirements__loader{position:relative;margin-block-end:1rem;width:1.625rem;height:1.625rem;background:linear-gradient(var(--ua-requirements-background-color), var(--ua-requirements-background-color)) padding-box,conic-gradient(from 0, transparent, #78c4d8) border-box;border:.1875rem solid rgba(0,0,0,0);border-radius:100%;text-align:center;animation:rotate 1.5s linear infinite;margin-inline:auto}#update_assistant .check-requirements__loader::before{content:"";position:absolute;top:0;left:50%;display:block;width:.1875rem;height:.1875rem;background:#5c92aa;border-radius:50%;transform:translate(-50%, -100%)}#update_assistant .check-requirements__loader-title{font-size:.875rem;font-weight:700;color:var(--ua-requirements-loader-color);line-height:1.4;text-align:center}#update_assistant .check-requirements__message{margin-block-end:1rem}#update_assistant .check-requirements__list{display:flex;flex-direction:column;gap:.5rem;margin-block-end:1rem}#update_assistant .check-requirements__requirement{padding-inline-start:2rem;background-position:left center;background-repeat:no-repeat;background-size:1.5rem 1.5rem;font-size:.875rem;line-height:1.4}#update_assistant .check-requirements__requirement--nok{background-image:url("../img/close.svg")}#update_assistant .check-requirements__requirement--warning{background-image:url("../img/warning.svg")}#update_assistant .check-requirements__requirement--ok{background-image:url("../img/check.svg")}#update_assistant .check-requirements--success{background-color:none;padding:0}#update_assistant .require-star{--ua-required-color: #ba151a;color:var(--ua-required-color)}#update_assistant .form-group{margin-block-end:.5rem}#update_assistant label{font-size:.875rem;font-weight:500;line-height:1.4;margin-block-end:.25rem}#update_assistant select{appearance:none;background-image:url("../img/unfold_more.svg");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.125rem 1.125rem;padding-inline-end:2rem}#update_assistant .radio{--ua-radio-border-color: #1d1d1b;--ua-radio-background-color-checked: #1d1d1b;--ua-radio-border-color-checked: #1d1d1b;--ua-radio-border-color-disabled: #bbbbbb;position:relative;margin:0;padding:0;width:20px;height:20px;background:rgba(0,0,0,0);background-clip:content-box;border:2px solid var(--ua-radio-border-color);border-radius:50%;outline:none !important;line-height:0;-webkit-appearance:none;cursor:pointer}#update_assistant .radio:checked{padding:3px;background-color:var(--ua-radio-background-color-checked);border:2px solid var(--ua-radio-border-color-checked)}#update_assistant .radio:disabled{border-color:var(--ua-radio-border-color-disabled)}#update_assistant .radio-card{--ua-radio-card-title-color: #1d1d1b;--ua-radio-card-title-color-disabled: #bbbbbb;--ua-radio-card-message-color: #5e5e5e;--ua-radio-card-message-color-disabled: #bbbbbb;--ua-radio-card-disabled-message-color: #ffffff;--ua-radio-card-disabled-message-background-color: #1d1d1b;--ua-radio-card-border-radius: 0;--ua-radio-card-border-color: #dddddd;--ua-radio-card-border-color-hover: #1d1d1b;--ua-radio-card-border-color-active: var(--ua-radio-card-border-color-hover);--ua-radio-card-release-color: #1d1d1b;--ua-radio-card-release-border-color: #dddddd;--ua-radio-card-release-border-color-hover: var(--ua-radio-card-release-color);--ua-radio-card-badge-color: #1d1d1b;--ua-radio-card-badge-background-color: #f7f7f7;--ua-radio-card-badge-border-color: #dddddd;--ua-radio-card-badge-major-background-color: #f8f0f7;--ua-radio-card-badge-major-border-color: #decde7;--ua-radio-card-badge-minor-background-color: #e4f4f8;--ua-radio-card-badge-minor-border-color: #a4dbe8;all:unset;display:flex;gap:.5rem;padding:1rem;background-color:#fff;border:1px solid var(--ua-radio-card-border-color);border-radius:var(--ua-radio-card-border-radius);transition:border-color .15s}#update_assistant .radio-card:not(.radio-card--disabled):hover{border-color:var(--ua-radio-card-border-color-hover);cursor:pointer}#update_assistant .radio-card:has(input[type=radio]:checked){border-color:var(--ua-radio-card-border-color-active)}#update_assistant .radio-card__radio-wrapper{flex-shrink:0}#update_assistant .radio-card__infos-wrapper{flex-grow:1}#update_assistant .radio-card__infos-top{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between}#update_assistant .radio-card__title{display:inline-flex;flex-wrap:wrap;gap:.5rem;align-items:center;font-size:.875rem;font-weight:700;color:var(--ua-radio-card-title-color);line-height:1.4;margin-block:0}#update_assistant .radio-card__badge{flex-shrink:0;padding:.125rem .5rem;background-color:var(--ua-radio-card-badge-background-color);border-radius:2rem;font-size:12px;font-weight:500;color:var(--ua-radio-card-badge-color);line-height:1.5;border:.0625rem solid var(--ua-radio-card-badge-border-color)}#update_assistant .radio-card__badge--major{background-color:var(--ua-radio-card-badge-major-background-color);border-color:var(--ua-radio-card-badge-major-border-color)}#update_assistant .radio-card__badge--minor{background-color:var(--ua-radio-card-badge-minor-background-color);border-color:var(--ua-radio-card-badge-minor-border-color)}#update_assistant .radio-card__message{font-size:.875rem;margin-block:.5rem 0;color:var(--ua-radio-card-message-color)}#update_assistant .radio-card__release-note{display:inline-flex;gap:.25rem;align-items:center;justify-content:flex-end;font-size:.875rem;color:var(--ua-radio-card-release-color);line-height:1.4;text-decoration:none;border-bottom:1px solid var(--ua-radio-card-release-border-color);transition:border-color .15s}#update_assistant .radio-card__release-note:hover{text-decoration:none;border-color:var(--ua-radio-card-release-border-color-hover)}#update_assistant .radio-card__release-note i{font-size:.875rem}#update_assistant .radio-card__disabled-message{position:absolute;top:50%;left:50%;display:none;padding:.5rem .75rem;background-color:var(--ua-radio-card-disabled-message-background-color);transform:translate(-50%, -50%);font-size:.875rem;color:var(--ua-radio-card-disabled-message-color);line-height:1.4em}#update_assistant .radio-card__local-archive{padding-block-start:.5rem}#update_assistant .radio-card--disabled{position:relative;cursor:not-allowed}#update_assistant .radio-card--disabled .radio-card__title{color:var(--ua-radio-card-title-color-disabled)}#update_assistant .radio-card--disabled .radio-card__message{color:var(--ua-radio-card-message-color-disabled)}#update_assistant .radio-card--disabled .radio-card__badge,#update_assistant .radio-card--disabled .radio-card__release-note{opacity:.4;pointer-events:none}#update_assistant .radio-card--disabled .radio-card__disabled-message{display:block}#update_assistant{--ua-typography-color: #1d1d1b;--ua-link-color: #1d1d1b;--ua-link-color-hover: #1d1d1b}#update_assistant h1,#update_assistant h2,#update_assistant h3,#update_assistant h4,#update_assistant h5,#update_assistant h6,#update_assistant .h1,#update_assistant .h2,#update_assistant .h3,#update_assistant .h4,#update_assistant .h5,#update_assistant .h6{color:var(--ua-typography-color)}#update_assistant .h1{font-size:1.5rem;font-weight:600;margin-block:0 1.5rem}#update_assistant .h2{font-size:1.25rem;font-weight:600;margin-block:0 1rem}#update_assistant .h3{margin-block:0 .5rem;font-size:1.125rem;font-weight:600}#update_assistant p{font-size:.875rem}#update_assistant a{color:var(--ua-link-color);text-decoration:underline;text-underline-offset:.125rem;transition:text-underline-offset .15s}#update_assistant a:hover{color:var(--ua-link-color-hover);text-underline-offset:.25rem}.upgradestep{margin-right:5px;padding-left:10px;padding-right:5px}.processing{border:2px outset gray;margin-top:1px;overflow:auto}#infoStep{height:100px}#infoError{height:100px}#quickInfo{height:200px}#errorDuringUpgrade{color:#c00}#checkPrestaShopFilesVersion,#checkPrestaShopModifiedFiles{margin-bottom:20px}.changedFileList{margin-left:20px;padding-left:5px}.changedNotice li{color:gray}.changedImportant li{color:red;font-weight:bold}.upgradeDbError{background-color:#feefb3}.upgradeDbOk{background-color:#dff2bf}.small_label{font-weight:normal;width:300px;float:none;text-align:left;padding:0}.ocu-feature-list{margin:0;padding:0;list-style:none}.ocu-feature-list li{background:url(../img/admin/enabled.gif) no-repeat;padding-left:20px;margin:0}.label-small{width:130px}.margin-form-small{padding:0 0 1em 130px}.nextStep{font-weight:bold}#diffList,#changedList{margin-top:20px}#autoupgradePhpWarningMainIcon{font-size:3em}#autoupgradePhpWarn .icon-stack-text{color:#fff}.panel-heading{text-transform:uppercase}.required{color:#c00}/*# sourceMappingURL=styles.css.map */ diff --git a/css/styles.css.map b/css/styles.css.map index f61470b48e..2902cf3368 100644 --- a/css/styles.css.map +++ b/css/styles.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/components/_alert.scss","../scss/_mixins.scss","../scss/components/_check-requirements.scss","../scss/components/form/_form.scss","../scss/components/form/_radio.scss","../scss/components/_radio-card.scss","../scss/components/_typography.scss","../scss/styles.scss"],"names":[],"mappings":"AAKE,yBACE,mBCLJ,kBACE,KACE,uBAEF,GACE,gECCA,4CACA,wCACA,4CACA,yBACA,aACA,yDAEA,8CACE,kBACA,sBACA,eACA,gBACA,WACE,sKAMF,oCACA,mBACA,kBACA,sCACA,mBAEA,sDACE,WACA,kBACA,MACA,SACA,cACA,eACA,gBACA,mBACA,kBACA,iCAIJ,oDACE,kBACA,gBACA,0CACA,gBACA,kBAGF,+CACE,sBAGF,4CACE,aACA,sBACA,UACA,sBAGF,mDACE,0BACA,gCACA,4BACA,8BACA,kBACA,gBAEA,wDACE,yCAGF,4DACE,2CAGF,uDACE,yCC/EN,gCACE,6BACA,+BAIA,8BACE,uBAIJ,wBACE,kBACA,gBACA,gBACA,wBAGF,yBACE,gBACA,+CACA,uCACA,4BACA,kCACA,wBCtBF,yBACE,iCACA,6CACA,yCACA,0CACA,kBACA,SACA,UACA,WACA,YACA,yBACA,4BACA,8CACA,kBAEA,wBACA,cACA,wBACA,eAEA,iCACE,YACA,0DACA,sDAGF,kCACE,mDC3BJ,8BACE,qCACA,8CACA,uCACA,gDACA,gDACA,2DACA,iCACA,sCACA,4CACA,6EACA,uCACA,8CACA,qCACA,gDACA,UACA,aACA,UACA,aACA,sBACA,mDACA,iDACA,6BAGE,+DACE,qDACA,eAIJ,6DACE,sDAGF,6CACE,cAGF,6CACE,YAGF,yCACE,aACA,eACA,UACA,mBACA,8BAGF,qCACE,oBACA,eACA,UACA,mBACA,kBACA,gBACA,uCACA,gBACA,eAGF,qCACE,cACA,sBACA,6DACA,mBACA,kBACA,gBACA,uCACA,gBAGF,uCACE,kBACA,qBACA,yCAGF,4CACE,oBACA,WACA,mBACA,yBACA,kBACA,yCACA,gBACA,qBACA,kEAEA,kDACE,qBAGF,8CACE,kBAIJ,gDACE,kBACA,QACA,SACA,aACA,qBACA,wEACA,gCACA,kBACA,kDACA,kBAGF,6CACE,0BAGF,wCACE,kBACA,mBAEA,2DACE,gDAGF,6DACE,kDAGF,6HAEE,WACA,oBAGF,sEACE,cC3IR,kBACE,+BACA,yBACA,+BAEA,kQAYE,iCAGF,sBACE,iBACA,gBACA,sBAGF,sBACE,kBACA,gBACA,oBAGF,sBACE,qBACA,mBACA,gBAGF,oBACE,kBAGF,oBACE,2BACA,0BACA,8BACA,sCAEA,0BACE,iCACA,6BClDN,EACE,sBAEF,kEACA,gEACA,uBACA,wBACA,wBACA,+BACA,8EACA,mDACA,6BACA,gDACA,yCACA,sCACA,iFACA,qDACA,mGACA,yBACA,yCACA,2BACA,uCACA,6CACA,gDACA,wCACA","file":"styles.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../scss/components/_alert.scss","../scss/_mixins.scss","../scss/components/_check-requirements.scss","../scss/components/form/_form.scss","../scss/components/form/_radio.scss","../scss/components/_radio-card.scss","../scss/components/_typography.scss","../scss/styles.scss"],"names":[],"mappings":"AAKE,yBACE,mBCLJ,kBACE,KACE,uBAEF,GACE,gECCA,4CACA,wCACA,4CACA,yBACA,aACA,yDAEA,8CACE,kBACA,sBACA,eACA,gBACA,WACE,sKAMF,oCACA,mBACA,kBACA,sCACA,mBAEA,sDACE,WACA,kBACA,MACA,SACA,cACA,eACA,gBACA,mBACA,kBACA,iCAIJ,oDACE,kBACA,gBACA,0CACA,gBACA,kBAGF,+CACE,sBAGF,4CACE,aACA,sBACA,UACA,sBAGF,mDACE,0BACA,gCACA,4BACA,8BACA,kBACA,gBAEA,wDACE,yCAGF,4DACE,2CAGF,uDACE,yCAIJ,+CACE,sBACA,UCrFJ,gCACE,6BACA,+BAIA,8BACE,uBAIJ,wBACE,kBACA,gBACA,gBACA,wBAGF,yBACE,gBACA,+CACA,uCACA,4BACA,kCACA,wBCtBF,yBACE,iCACA,6CACA,yCACA,0CACA,kBACA,SACA,UACA,WACA,YACA,yBACA,4BACA,8CACA,kBAEA,wBACA,cACA,wBACA,eAEA,iCACE,YACA,0DACA,sDAGF,kCACE,mDC3BJ,8BACE,qCACA,8CACA,uCACA,gDACA,gDACA,2DACA,iCACA,sCACA,4CACA,6EACA,uCACA,8CACA,+EACA,qCACA,gDACA,4CACA,sDACA,kDACA,sDACA,kDACA,UACA,aACA,UACA,aACA,sBACA,mDACA,iDACA,6BAGE,+DACE,qDACA,eAIJ,6DACE,sDAGF,6CACE,cAGF,6CACE,YAGF,yCACE,aACA,eACA,UACA,mBACA,8BAGF,qCACE,oBACA,eACA,UACA,mBACA,kBACA,gBACA,uCACA,gBACA,eAGF,qCACE,cACA,sBACA,6DACA,mBACA,eACA,gBACA,uCACA,gBACA,8DAEA,4CACE,mEACA,2DAGF,4CACE,mEACA,2DAIJ,uCACE,kBACA,qBACA,yCAGF,4CACE,oBACA,WACA,mBACA,yBACA,kBACA,yCACA,gBACA,qBACA,kEACA,6BAEA,kDACE,qBACA,6DAGF,8CACE,kBAIJ,gDACE,kBACA,QACA,SACA,aACA,qBACA,wEACA,gCACA,kBACA,kDACA,kBAGF,6CACE,0BAGF,wCACE,kBACA,mBAEA,2DACE,gDAGF,6DACE,kDAGF,6HAEE,WACA,oBAGF,sEACE,cC9JR,kBACE,+BACA,yBACA,+BAEA,kQAYE,iCAGF,sBACE,iBACA,gBACA,sBAGF,sBACE,kBACA,gBACA,oBAGF,sBACE,qBACA,mBACA,gBAGF,oBACE,kBAGF,oBACE,2BACA,0BACA,8BACA,sCAEA,0BACE,iCACA,6BCjDN,aACE,iBACA,kBACA,kBAEF,YACE,uBACA,eACA,cAEF,UACE,aAEF,WACE,aAEF,WACE,aAEF,oBACE,WAEF,2DAEE,mBAEF,iBACE,iBACA,iBAEF,kBACE,WAEF,qBACE,UACA,iBAEF,gBACE,yBAEF,aACE,yBAEF,aACE,mBACA,YACA,WACA,gBACA,UAEF,kBACE,SACA,UACA,gBAEF,qBACE,mDACA,kBACA,SAEF,aACE,YAEF,mBACE,sBAEF,UACE,iBAEF,uBAEE,gBAEF,+BACE,cAEF,qCACE,WAEF,eACE,yBAEF,UACE","file":"styles.css"} \ No newline at end of file diff --git a/package.json b/package.json index e3ac1e6b0a..4037955b04 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,12 @@ "test": "tests" }, "scripts": { - "watch": "sass --watch --style compressed --source-map scss/styles.scss:css/styles.css", + "build": "npx prettier --write scss && sass --style compressed --source-map scss/styles.scss:css/styles.css", "lint:scss": "npx stylelint scss/**/*.scss", "lint-fix:scss": "npx stylelint --fix scss/**/*.scss", + "prettier": "npx prettier --write scss", + "prettier-check": "npx prettier --check scss", + "watch": "sass --watch --style compressed --source-map scss/styles.scss:css/styles.css", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/scss/_layout.scss b/scss/_layout.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scss/_mixins.scss b/scss/_mixins.scss index 9b51f330ba..c5a8124917 100644 --- a/scss/_mixins.scss +++ b/scss/_mixins.scss @@ -6,4 +6,4 @@ to { transform: rotate(360deg); } -} \ No newline at end of file +} diff --git a/scss/_variables.scss b/scss/_variables.scss index 9a796ca68f..eb6e89c338 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -1 +1 @@ -$ua-prefix: "#update_assistant"; \ No newline at end of file +$ua-prefix: "#update_assistant"; diff --git a/scss/components/_alert.scss b/scss/components/_alert.scss index 9e2cc576af..8dd7829cb7 100644 --- a/scss/components/_alert.scss +++ b/scss/components/_alert.scss @@ -6,4 +6,4 @@ $e: ".alert"; #{$e} { margin-block-end: 0; } -} \ No newline at end of file +} diff --git a/scss/components/_badge.scss b/scss/components/_badge.scss index 53bf253437..4b5020d323 100644 --- a/scss/components/_badge.scss +++ b/scss/components/_badge.scss @@ -6,4 +6,4 @@ $e: ".badge"; #{$e} { } -} */ \ No newline at end of file +} */ diff --git a/scss/components/_check-requirements.scss b/scss/components/_check-requirements.scss index 048994e2a7..d9ebb67656 100644 --- a/scss/components/_check-requirements.scss +++ b/scss/components/_check-requirements.scss @@ -7,7 +7,7 @@ $e: ".check-requirements"; #{$e} { --ua-requirements-background-color: #f7f7f7; --ua-requirements-loader-color: #1d1d1b; - --ua-requirements-loader-dot-color: #5C92AA; + --ua-requirements-loader-dot-color: #5c92aa; margin-block-start: 0.5rem; padding: 1rem; background-color: var(--ua-requirements-background-color); @@ -38,7 +38,7 @@ $e: ".check-requirements"; display: block; width: 0.1875rem; height: 0.1875rem; - background: #5C92AA; + background: #5c92aa; border-radius: 50%; transform: translate(-50%, -100%); } @@ -55,7 +55,7 @@ $e: ".check-requirements"; &__message { margin-block-end: 1rem; } - + &__list { display: flex; flex-direction: column; @@ -74,7 +74,7 @@ $e: ".check-requirements"; &--nok { background-image: url("../img/close.svg"); } - + &--warning { background-image: url("../img/warning.svg"); } @@ -83,5 +83,10 @@ $e: ".check-requirements"; background-image: url("../img/check.svg"); } } + + &--success { + background-color: none; + padding: 0; + } } } diff --git a/scss/components/_index.scss b/scss/components/_index.scss index fb157f7523..290be189cc 100644 --- a/scss/components/_index.scss +++ b/scss/components/_index.scss @@ -3,4 +3,4 @@ @use "check-requirements"; @use "form"; @use "radio-card"; -@use "typography"; \ No newline at end of file +@use "typography"; diff --git a/scss/components/_radio-card.scss b/scss/components/_radio-card.scss index 4b5a14442d..7bd6f16535 100644 --- a/scss/components/_radio-card.scss +++ b/scss/components/_radio-card.scss @@ -4,44 +4,50 @@ $e: ".radio-card"; #{$ua-prefix} { #{$e} { - --ua-radio-card-title-color: #1D1D1B; - --ua-radio-card-title-color-disabled: #BBBBBB; - --ua-radio-card-message-color: #5E5E5E; - --ua-radio-card-message-color-disabled: #BBBBBB; - --ua-radio-card-disabled-message-color: #FFFFFF; - --ua-radio-card-disabled-message-background-color: #1D1D1B; + --ua-radio-card-title-color: #1d1d1b; + --ua-radio-card-title-color-disabled: #bbbbbb; + --ua-radio-card-message-color: #5e5e5e; + --ua-radio-card-message-color-disabled: #bbbbbb; + --ua-radio-card-disabled-message-color: #ffffff; + --ua-radio-card-disabled-message-background-color: #1d1d1b; --ua-radio-card-border-radius: 0; - --ua-radio-card-border-color: #DDDDDD; - --ua-radio-card-border-color-hover: #1D1D1B; + --ua-radio-card-border-color: #dddddd; + --ua-radio-card-border-color-hover: #1d1d1b; --ua-radio-card-border-color-active: var(--ua-radio-card-border-color-hover); - --ua-radio-card-release-color: #1D1D1B; - --ua-radio-card-release-border-color: #DDDDDD; - --ua-radio-card-badge-color: #1D1D1B; - --ua-radio-card-badge-background-color: #D1DCFC; + --ua-radio-card-release-color: #1d1d1b; + --ua-radio-card-release-border-color: #dddddd; + --ua-radio-card-release-border-color-hover: var(--ua-radio-card-release-color); + --ua-radio-card-badge-color: #1d1d1b; + --ua-radio-card-badge-background-color: #f7f7f7; + --ua-radio-card-badge-border-color: #dddddd; + --ua-radio-card-badge-major-background-color: #f8f0f7; + --ua-radio-card-badge-major-border-color: #decde7; + --ua-radio-card-badge-minor-background-color: #e4f4f8; + --ua-radio-card-badge-minor-border-color: #a4dbe8; all: unset; display: flex; gap: 0.5rem; padding: 1rem; - background-color: #FFFFFF; + background-color: #ffffff; border: 1px solid var(--ua-radio-card-border-color); border-radius: var(--ua-radio-card-border-radius); transition: border-color 0.15s; - + &:not(#{$e}--disabled) { &:hover { border-color: var(--ua-radio-card-border-color-hover); cursor: pointer; } } - + &:has(input[type="radio"]:checked) { border-color: var(--ua-radio-card-border-color-active); } - + &__radio-wrapper { flex-shrink: 0; } - + &__infos-wrapper { flex-grow: 1; } @@ -53,7 +59,7 @@ $e: ".radio-card"; align-items: center; justify-content: space-between; } - + &__title { display: inline-flex; flex-wrap: wrap; @@ -71,18 +77,29 @@ $e: ".radio-card"; padding: 0.125rem 0.5rem; background-color: var(--ua-radio-card-badge-background-color); border-radius: 2rem; - font-size: 0.875rem; + font-size: 12px; font-weight: 500; color: var(--ua-radio-card-badge-color); - line-height: 1.4; + line-height: 1.5; + border: 0.0625rem solid var(--ua-radio-card-badge-border-color); + + &--major { + background-color: var(--ua-radio-card-badge-major-background-color); + border-color: var(--ua-radio-card-badge-major-border-color); + } + + &--minor { + background-color: var(--ua-radio-card-badge-minor-background-color); + border-color: var(--ua-radio-card-badge-minor-border-color); + } } - + &__message { font-size: 0.875rem; margin-block: 0.5rem 0; color: var(--ua-radio-card-message-color); } - + &__release-note { display: inline-flex; gap: 0.25rem; @@ -93,11 +110,13 @@ $e: ".radio-card"; line-height: 1.4; text-decoration: none; border-bottom: 1px solid var(--ua-radio-card-release-border-color); - + transition: border-color 0.15s; + &:hover { text-decoration: none; + border-color: var(--ua-radio-card-release-border-color-hover); } - + i { font-size: 0.875rem; } @@ -119,11 +138,11 @@ $e: ".radio-card"; &__local-archive { padding-block-start: 0.5rem; } - + &--disabled { position: relative; cursor: not-allowed; - + #{$e}__title { color: var(--ua-radio-card-title-color-disabled); } diff --git a/scss/components/_typography.scss b/scss/components/_typography.scss index 8be9b99e7f..c8949cb618 100644 --- a/scss/components/_typography.scss +++ b/scss/components/_typography.scss @@ -3,7 +3,7 @@ #{$ua-prefix} { --ua-typography-color: #1d1d1b; --ua-link-color: #1d1d1b; - --ua-link-hover-color: #1d1d1b; + --ua-link-color-hover: #1d1d1b; h1, h2, @@ -49,7 +49,7 @@ transition: text-underline-offset 0.15s; &:hover { - color: var(--ua-link-hover-color); + color: var(--ua-link-color-hover); text-underline-offset: 0.25rem; } } diff --git a/scss/components/form/_index.scss b/scss/components/form/_index.scss index d1103c0ddb..8be602cee0 100644 --- a/scss/components/form/_index.scss +++ b/scss/components/form/_index.scss @@ -1,2 +1,2 @@ @use "form"; -@use "radio"; \ No newline at end of file +@use "radio"; diff --git a/scss/components/form/_radio.scss b/scss/components/form/_radio.scss index c3dce51a5a..07da465e35 100644 --- a/scss/components/form/_radio.scss +++ b/scss/components/form/_radio.scss @@ -4,10 +4,10 @@ $e: ".radio"; #{$ua-prefix} { #{$e} { - --ua-radio-border-color: #1D1D1B; - --ua-radio-background-color-checked: #1D1D1B; - --ua-radio-border-color-checked: #1D1D1B; - --ua-radio-border-color-disabled: #BBBBBB; + --ua-radio-border-color: #1d1d1b; + --ua-radio-background-color-checked: #1d1d1b; + --ua-radio-border-color-checked: #1d1d1b; + --ua-radio-border-color-disabled: #bbbbbb; position: relative; margin: 0; padding: 0; @@ -22,13 +22,13 @@ $e: ".radio"; line-height: 0; -webkit-appearance: none; cursor: pointer; - + &:checked { padding: 3px; background-color: var(--ua-radio-background-color-checked); border: 2px solid var(--ua-radio-border-color-checked); } - + &:disabled { border-color: var(--ua-radio-border-color-disabled); } diff --git a/scss/styles.scss b/scss/styles.scss index e7ef7f0af7..388704da9a 100644 --- a/scss/styles.scss +++ b/scss/styles.scss @@ -1,28 +1,88 @@ @use "components"; +@use "layout"; -* { - box-sizing: border-box; -} -.upgradestep { margin-right: 5px;padding-left: 10px; padding-right: 5px;} -.processing {border:2px outset gray;margin-top:1px;overflow: auto;} -#infoStep {height:100px;} -#infoError {height:100px;} -#quickInfo {height:200px;} -#errorDuringUpgrade {color: #CC0000} -#checkPrestaShopFilesVersion, #checkPrestaShopModifiedFiles{margin-bottom:20px;} -.changedFileList {margin-left:20px; padding-left:5px;} -.changedNotice li{color:gray;} -.changedImportant li{color:red;font-weight:bold} -.upgradeDbError{background-color:#FEEFB3} -.upgradeDbOk{background-color:#DFF2BF} -.small_label{font-weight:normal;width:300px;float:none;text-align:left;padding:0} -.ocu-feature-list{margin:0;padding:0;list-style:none} -.ocu-feature-list li{background:url(../img/admin/enabled.gif) no-repeat; padding-left:20px;margin:0;} -.label-small {width: 130px;} -.margin-form-small {padding: 0 0 1em 130px;} -.nextStep {font-weight: bold;} -#diffList, #changedList {margin-top: 20px;} -#autoupgradePhpWarningMainIcon {font-size: 3em;} -#autoupgradePhpWarn .icon-stack-text {color: white;} -.panel-heading {text-transform: uppercase;} -.required {color: #CC0000} +.upgradestep { + margin-right: 5px; + padding-left: 10px; + padding-right: 5px; +} +.processing { + border: 2px outset gray; + margin-top: 1px; + overflow: auto; +} +#infoStep { + height: 100px; +} +#infoError { + height: 100px; +} +#quickInfo { + height: 200px; +} +#errorDuringUpgrade { + color: #cc0000; +} +#checkPrestaShopFilesVersion, +#checkPrestaShopModifiedFiles { + margin-bottom: 20px; +} +.changedFileList { + margin-left: 20px; + padding-left: 5px; +} +.changedNotice li { + color: gray; +} +.changedImportant li { + color: red; + font-weight: bold; +} +.upgradeDbError { + background-color: #feefb3; +} +.upgradeDbOk { + background-color: #dff2bf; +} +.small_label { + font-weight: normal; + width: 300px; + float: none; + text-align: left; + padding: 0; +} +.ocu-feature-list { + margin: 0; + padding: 0; + list-style: none; +} +.ocu-feature-list li { + background: url(../img/admin/enabled.gif) no-repeat; + padding-left: 20px; + margin: 0; +} +.label-small { + width: 130px; +} +.margin-form-small { + padding: 0 0 1em 130px; +} +.nextStep { + font-weight: bold; +} +#diffList, +#changedList { + margin-top: 20px; +} +#autoupgradePhpWarningMainIcon { + font-size: 3em; +} +#autoupgradePhpWarn .icon-stack-text { + color: white; +} +.panel-heading { + text-transform: uppercase; +} +.required { + color: #cc0000; +} diff --git a/storybook/stories/components/CheckRequirements.stories.js b/storybook/stories/components/CheckRequirements.stories.js index 7f94895d0e..2134899366 100644 --- a/storybook/stories/components/CheckRequirements.stories.js +++ b/storybook/stories/components/CheckRequirements.stories.js @@ -30,16 +30,49 @@ export default { args: { requirementsOk: true, checkingForRequirements: true, + updateAssistantDocs: + "https://devdocs.prestashop-project.org/8/basics/keeping-up-to-date/use-autoupgrade-module/", + moduleIsUpToDate: false, + moduleUpdateLink: + "/admin/index.php/improve/modules/updates?_token=MbkhzPrMc9ZknpvSTqeKbKiekftXvp4IowAxrW4Jcfw", + noMissingFiles: false, + informationLink: + "/admin/index.php/configure/advanced/system-information/?_token=MbkhzPrMc9ZknpvSTqeKbKiekftXvp4IowAxrW4Jcfw", phpRequirementsState: 1, phpCompatibilityRange: { php_min_version: "7.2.5", php_max_version: "8.1", php_current_version: "7.4.33", }, - rootDirectoryIsWritable: true, + rootDirectoryIsWritable: false, rootDirectory: "/var/www/html", - adminDirectoryIsWritable: true, - adminDirectoryWritableReport: "a", + adminDirectoryIsWritable: false, + adminDirectoryWritableReport: "", // Not used + safeModeIsDisabled: false, + allowUrlFopenOrCurlIsEnabled: false, + zipIsEnabled: false, + isLocalEnvironment: false, + storeIsInMaintenance: false, + maintenanceLink: + "/admin/index.php/configure/shop/maintenance/?_token=MbkhzPrMc9ZknpvSTqeKbKiekftXvp4IowAxrW4Jcfw", + cachingIsDisabled: false, + cacheLink: + "/admin/index.php/configure/advanced/performance/?_token=MbkhzPrMc9ZknpvSTqeKbKiekftXvp4IowAxrW4Jcfw", + maxExecutionTime: 5, + checkApacheModRewrite: false, + notLoadedPhpExtensions: [ + "curl", "dom", "fileinfo", "gd", "intl", "json", "mbstring", "openssl", "pdo_mysql", "simplexml", "zip" + ], + notExistsPhpFunctions: [ + "fopen", "fclose", "fread", "fwrite", "rename", "file_exists", "unlink", "rmdir", "mkdir", "getcwd", "chdir", "chmod" + ], + checkMemoryLimit: false, + checkFileUploads: false, + checkKeyGeneration: false, + notWritingDirectories: [ + "autoupgrade", "views", "js", "css" + ], + isShopVersionMatchingVersionInDatabase: false, }, }; diff --git a/storybook/stories/components/RadioCard.stories.js b/storybook/stories/components/RadioCard.stories.js index 777a10786f..b6ee761d60 100644 --- a/storybook/stories/components/RadioCard.stories.js +++ b/storybook/stories/components/RadioCard.stories.js @@ -29,12 +29,21 @@ import CheckRequirements from "./CheckRequirements.stories"; export default { component: RadioCard, + argTypes: { + badgeStatus: { + control: 'select', + options: ['major', 'minor'], + }, + }, args: { + radioCardId: "", + checked: false, title: "Update your store", message: "Update your store to benefit from the latest improvements, bug fixes and security patches.", disabled: false, disabledMessage: "No backup file found on your store.", - badge: "Major version", + badgeLabel: 'Major version', + badgeStatus: 'major', releaseNote: "https://github.com/PrestaShop/autoupgrade", archiveCard: false, checkRequirements: false, diff --git a/views/templates/components/check-requirements.html.twig b/views/templates/components/check-requirements.html.twig index 410f18d427..b98aed9f0c 100644 --- a/views/templates/components/check-requirements.html.twig +++ b/views/templates/components/check-requirements.html.twig @@ -1,292 +1,223 @@ {% if not requirementsOk %} -
- {% if checkingForRequirements %} -
-
-
+
+ {% if checkingForRequirements %} +
+
-
- {{ "Checking requirements..."|trans({}) }} -
-
- {% else %} -

- {{ "Update requirements"|trans({}) }} -

+
+ {{ "Checking requirements..."|trans({}) }} +
+
+ {% else %} +

+ {{ "Update requirements"|trans({}) }} +

+ +

+ {{ 'Once all the following conditions are met, you can continue with the update. Read more in the [1]developer documentation[/1].'|trans({ + '[1]' : '', + '[/1]' : '', + })|raw }} +

+ +
+ {# ERROR #} + + {# PHP compatibility error #} + {% if phpRequirementsState and phpRequirementsState != constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_VALID') %} + {% if phpRequirementsState == constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_INVALID') %} +
+ {{ 'Your current PHP version isn\'t compatible with PrestaShop %max_version%. (Expected: %min_version% - %max_version% | Current: %current_version%)'|trans({ + '%min_version%': phpCompatibilityRange['php_min_version'], + '%max_version%': phpCompatibilityRange['php_max_version'], + '%current_version%': phpCompatibilityRange['php_current_version'] + }) }} +
+ {% endif %} + {% endif %} + + {# Root directory is writable #} + {% if not rootDirectoryIsWritable %} +
+ {{ 'Your store\'s root directory (%root_directory%) isn\'t writable. Provide write access to the user running PHP with appropriate permission & ownership.'|trans({ + '%root_directory%': rootDirectory + }) }} +
+ {% endif %} + + {# Admin directory is writable #} + {% if not adminDirectoryIsWritable %} +
+ {{ 'The "/admin/autoupgrade" directory isn\'t writable. Provide write access to the user running PHP with appropriate permission & ownership.'|trans({}) }} +
+ {% endif %} + + {# Safe mode is off #} + {% if not safeModeIsDisabled %} +
+ {{ 'PHP\'s "Safe mode" needs to be disabled.'|trans({})|raw }} +
+ {% endif %} + + {# Enable allow_url_fopen or cURL #} + {% if not allowUrlFopenOrCurlIsEnabled %} +
+ {{ 'Files can\'t be downloaded. Enable PHP\'s "allow_url_fopen" option or install PHP extension "cURL".'|trans({})|raw }} +
+ {% endif %} + + {# Enable zip extension #} + {% if not zipIsEnabled %} +
+ {{ 'Missing PHP extension "zip".'|trans({})|raw }} +
+ {% endif %} -

- {{ "Once all the following conditions are met, you can continue with the update."|trans({}) }} - {{ "Read more in the developer documentation."|trans({}) }} -

- -
- {% if phpRequirementsState != constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_VALID') %} -
- {% if phpRequirementsState == constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_INVALID') %} - {{ 'Your current PHP version isn\'t compatible with your PrestaShop version. (Expected: %s - %s | Current: %s)'|trans([ - phpCompatibilityRange['php_min_version'], - phpCompatibilityRange['php_max_version'], - phpCompatibilityRange['php_current_version'], - ]) }} + {# Enable maintenance #} + {% if not isLocalEnvironment %} + {% if not storeIsInMaintenance %} +
+ {{ 'Maintenance mode needs to be enabled. Enable maintenance mode and add your maintenance IP in [1]Shop parameters > General > Maintenance[/1].'|trans({ + '[1]' : '', + '[/1]' : '', + })|raw }} +
+ {% endif %} + {% endif %} + + {# Cache is disabled #} + {% if not cachingIsDisabled %} +
+ {{ 'PrestaShop\'s caching features needs to be disabled. Disable caching features in [1]Advanced parameters > Performance > Caching[/1].'|trans({ + '[1]' : '', + '[/1]' : '', + })|raw }} +
+ {% endif %} + + {# Max execution time has high value #} + {% if maxExecutionTime <= 30 and maxExecutionTime != 0 %} +
+ {{ 'PHP\'s max_execution_time setting needs to have a high value or needs to be disabled entirely (current value: %s seconds).'|trans([maxExecutionTime]) }} +
+ {% endif %} + + + {# Apache mod_rewrite is enabled #} + {% if not checkApacheModRewrite %} +
+ {{ 'Apache mod_rewrite needs to be enabled.'|trans({}) }} +
+ {% endif %} + + {# PHP extensions that need to be enabled #} + {% if notLoadedPhpExtensions|length > 0 %} +
+ {% if notLoadedPhpExtensions|length > 1 %} + {{ 'The following PHP extensions need to be installed: %extensions%.'|trans({ + '%extensions%': '' ~ notLoadedPhpExtensions|join(', ') ~ '' + })|raw }} {% else %} - {{ 'We were unable to check your PHP compatibility with the destination PrestaShop version.'|trans({}) }} + {{ 'The following PHP extension needs to be installed: %extension%.'|trans({ + '%extension%': '' ~ notLoadedPhpExtensions|first ~ '' + })|raw }} {% endif %}
{% endif %} - {% if not rootDirectoryIsWritable %} + {# PHP function that need to be allowed #} + {% if notExistsPhpFunctions|length > 0 %}
- {{ 'Your store\'s root directory (%s) is writable (with appropriate CHMOD permissions).'|trans([rootDirectory]) }} + {% if notExistsPhpFunctions|length > 1 %} + {{ 'The following PHP functions need to be allowed: %functions%.'|trans({ + '%functions%': '' ~ notExistsPhpFunctions|join(', ') ~ '' + })|raw }} + {% else %} + {{ 'The following PHP function needs to be allowed: %function%.'|trans({ + '%function%': '' ~ notExistsPhpFunctions|first ~ '' + })|raw }} + {% endif %}
{% endif %} - {% if not adminDirectoryIsWritable %} + {# PHP memory_limit is greater than 256 #} + {% if not checkMemoryLimit %}
- {{ "The \"/admin/autoupgrade\" directory isn't writable. Provide write access to the user running PHP with appropriate permission & ownership."|trans({}) }} + {{ 'PHP memory_limit needs to be greater than 256 MB.'|trans({}) }}
{% endif %} -
- {% endif %} -
-{% endif %} + {# PHP file_uploads is enabled #} + {% if not checkFileUploads %} +
+ {{ 'PHP file_uploads configuration needs to be enabled.'|trans({}) }} +
+ {% endif %} -{#
-
-
- {{ 'The pre-Upgrade checklist'|trans({}) }} -
- {% if not moduleIsUpToDate %} -

- {{ 'Your current version of the module is out of date. Update now'|trans({}) }} - {{ 'Modules > Module Manager > Updates'|trans({}) }} -

+ {# Private keys generation #} + {% if not checkKeyGeneration %} +
+ {{ 'Unable to generate private keys using openssl_pkey_new. Check your OpenSSL configuration, especially the path to openssl.cafile.'|trans({}) }} +
+ {% endif %} + + {# Folders writing permissions #} + {% if notWritingDirectories|length > 0 %} +
+ {{ 'It\'s not possible to write in the following folders: %directories%.'|trans({ + '%directories%': '' ~ notWritingDirectories|join(', ') ~ '' + })|raw }} + {{ 'Provide write access to the user running PHP with appropriate permission & ownership.'|trans({}) }} +
{% endif %} - {% if showErrorMessage %} -

{{ 'The checklist is not OK. You can only upgrade your shop once all indicators are green.'|trans({}) }}

+ + {# PrestaShop version mismatch #} + {% if not isShopVersionMatchingVersionInDatabase %} +
+ {{ 'The version of PrestaShop does not match the one stored in database. Your database structure may not be up-to-date and/or the value of PS_VERSION_DB needs to be updated in the configuration table.'|trans({}) }} +
{% endif %} -
-

{{ 'Before starting the upgrade process, please make sure this checklist is all green.'|trans({}) }}

- - {% if phpRequirementsState != constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_VALID') %} - - - - - {% endif %} - - - - - {% if adminDirectoryWritableReport %} - - - - - {% endif %} - - - - - - - - - - - - - {% if not isLocalEnvironment %} - - - - - {% endif %} - - - - - - - - - {% if not checkApacheModRewrite %} - - - - - {% endif %} - {% if notLoadedPhpExtensions|length > 0 %} - - - - - {% endif %} - {% if not checkMemoryLimit %} - - - - - {% endif %} - {% if not checkFileUploads %} - - - - - {% endif %} - {% if notExistsPhpFunctions|length > 0 %} - - - - - {% endif %} - {% if not checkPhpSessions %} - - - - - {% endif %} - {% if not checkKeyGeneration %} - - - - - {% endif %} - {% if missingFiles|length > 0 %} - - - - - {% endif %} - {% if notWritingDirectories|length > 0 %} - - - - - {% endif %} - {% if not isShopVersionMatchingVersionInDatabase %} - - - - - {% endif %} -
- {% if phpRequirementsState == constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_INVALID') %} - {{ 'Your current PHP version isn\'t compatible with your PrestaShop version. (Expected: %s - %s | Current: %s)'|trans([ - phpCompatibilityRange['php_min_version'], - phpCompatibilityRange['php_max_version'], - phpCompatibilityRange['php_current_version'], - ]) }} - {% else %} - {{ 'We were unable to check your PHP compatibility with the destination PrestaShop version.'|trans({}) }} - {% endif %} - - {% if phpRequirementsState == constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_INVALID') %} - {{ icons.nok(psBaseUri) }} - {% else %} - {{ icons.warning(psBaseUri) }} - {% endif %} -
{{ 'Your store\'s root directory (%s) is writable (with appropriate CHMOD permissions).'|trans([rootDirectory]) }} - {% if rootDirectoryIsWritable %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.nok(psBaseUri) }} - {% endif %} -
{{ 'The "/admin/autoupgrade" directory is writable (appropriate CHMOD permissions)'|trans({}) }} - {% if adminDirectoryIsWritable %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.nok(psBaseUri) }} {{ adminDirectoryWritableReport }} - {% endif %} -
{{ 'PHP\'s "Safe mode" option is turned off'|trans({})|raw }} - {% if safeModeIsDisabled %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.warning(psBaseUri) }} - {% endif %} -
{{ 'PHP\'s "allow_url_fopen" option is turned on, or cURL is installed'|trans({})|raw }} - {% if allowUrlFopenOrCurlIsEnabled %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.nok(psBaseUri) }} - {% endif %} -
{{ 'PHP\'s "zip" extension is enabled'|trans({})|raw }} - {% if zipIsEnabled %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.nok(psBaseUri) }} - {% endif %} -
- {% if storeIsInMaintenance %} - {{ 'Your store is in maintenance mode'|trans({}) }} - {% else %} - {{ 'Enable maintenance mode and add your maintenance IP in [1]Shop parameters > General > Maintenance[/1]'|trans({ - '[1]' : '', - '[/1]' : '', - })|raw }} - {% endif %} - - {% if storeIsInMaintenance %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.nok(psBaseUri) }} - {% endif %} -
{{ 'PrestaShop\'s caching features are disabled'|trans({}) }} - {% if cachingIsDisabled %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.nok(psBaseUri) }} - {% endif %} -
- {% if maxExecutionTime == 0 %} - {{ 'PHP\'s max_execution_time setting has a high value or is disabled entirely (current value: unlimited)'|trans({}) }} - {% else %} - {{ 'PHP\'s max_execution_time setting has a high value or is disabled entirely (current value: %s seconds)'|trans([maxExecutionTime]) }} - {% endif %} - - {% if maxExecutionTime == 0 %} - {{ icons.ok(psBaseUri) }} - {% else %} - {{ icons.warning(psBaseUri) }} - {% endif %} -
{{ 'Apache mod_rewrite is disabled.'|trans({}) }}{{ icons.nok(psBaseUri) }}
- {% if notLoadedPhpExtensions|length > 1 %} - {{ 'The following PHP extensions are not installed: %s.'|trans([notLoadedPhpExtensions|join(', ')]) }} - {% else %} - {{ 'The following PHP extension is not installed: %s.'|trans([notLoadedPhpExtensions|first]) }} - {% endif %} - {{ icons.nok(psBaseUri) }}
{{ 'PHP memory_limit is inferior to 256 MB.'|trans({}) }}{{ icons.nok(psBaseUri) }}
{{ 'PHP file_uploads configuration is disabled.'|trans({}) }}{{ icons.nok(psBaseUri) }}
- {% if notExistsPhpFunctions|length > 1 %} - {{ 'The following PHP functions are not installed: %s.'|trans([notExistsPhpFunctions|join(', ')]) }} - {% else %} - {{ 'The following PHP function is not installed: %s.'|trans([notExistsPhpFunctions|first]) }} - {% endif %} - {{ icons.nok(psBaseUri) }}
{{ 'It\'s not possible to create a PHP session.'|trans({}) }}{{ icons.nok(psBaseUri) }}
{{ 'Unable to generate private keys using openssl_pkey_new. Check your OpenSSL configuration, especially the path to openssl.cafile.'|trans({}) }}{{ icons.nok(psBaseUri) }}
- {{ 'The following files are missing:'|trans({}) }} -
    - {% for file in missingFiles %} -
  • {{ file }}
  • - {% endfor %} -
-
{{ icons.nok(psBaseUri) }}
- {{ 'It\'s not possible to write in the following folders:'|trans({}) }} -
    - {% for missingFile in notWritingDirectories %} -
  • {{ missingFile }}
  • - {% endfor %} -
-
{{ icons.nok(psBaseUri) }}
- {{ 'The version of PrestaShop does not match the one stored in database. Your database structure may not be up-to-date and/or the value of PS_VERSION_DB needs to be updated in the configuration table. [1]Learn more[/1].'|trans({ - '[1]': '', - '[/1]': '', - })|raw }} - {{ icons.nok(psBaseUri) }}
-
-

{{ 'Please also make sure you make a full manual backup of your files and database.'|trans({}) }}

- {% if showErrorMessage %} -

{{ 'PrestaShop requirements are not satisfied.'|trans({}) }}

+ + {# WARNING #} + + {# Module is not up to date #} + {% if not moduleIsUpToDate %} +
+ {{ 'Your current version of the module is out of date. Update now %link%'|trans({ + '%link%': 'Modules > Module Manager > Updates' + })|raw }} +
+ {% endif %} + + {# PHP compatibility warning #} + {% if phpRequirementsState and phpRequirementsState != constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_VALID') %} +
+ {% if phpRequirementsState != constant('PrestaShop\\Module\\AutoUpgrade\\UpgradeSelfCheck::PHP_REQUIREMENTS_INVALID') %} + {{ 'We were unable to check your PHP compatibility with the destination PrestaShop version.'|trans({}) }} {% endif %} -
+
+ {% endif %} + + {# Core files missing #} + {% if not noMissingFiles %} +
+ {{ 'Some core files have been altered, customization made on these files will be lost during the update. See the list in %link%'|trans({ + '%link%': 'Advanced parameters > Information' + })|raw }} +
+ {% endif %} +
+ + + {% endif %} +
+{% else %} +
+
+ {{ 'The requirements check is complete, you can update your store (to this version of PrestaShop).'|trans({}) }}
-
- #} \ No newline at end of file +
+{% endif %} diff --git a/views/templates/components/radio-card.html.twig b/views/templates/components/radio-card.html.twig index 8b0afab031..ba31a5c897 100644 --- a/views/templates/components/radio-card.html.twig +++ b/views/templates/components/radio-card.html.twig @@ -1,11 +1,11 @@ -