From be4be864de327c4a523b5b6aeeebbfd7969b76dc Mon Sep 17 00:00:00 2001 From: kjmartens Date: Wed, 13 Dec 2023 20:20:58 -0600 Subject: [PATCH] fix(SFT-700): Slight adjustments to diagnostics page pt2 --- .../Resources/css/cp/settings/diagnostics.css | 2 +- .../src/Services/DiagnosticsService.php | 14 +++--- .../src/templates/settings/_diagnostics.twig | 1 - .../styles/src/cp/settings/diagnostics.scss | 44 +++++++++++-------- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/packages/plugin/src/Resources/css/cp/settings/diagnostics.css b/packages/plugin/src/Resources/css/cp/settings/diagnostics.css index 66b8743aa..adf33023e 100644 --- a/packages/plugin/src/Resources/css/cp/settings/diagnostics.css +++ b/packages/plugin/src/Resources/css/cp/settings/diagnostics.css @@ -1 +1 @@ -.diagnostic-color-error{color:#d52817}.diagnostic-color-pass{color:#60aa55}.diagnostic-color-base{color:#5a6875}.diagnostic-color-pass,.diagnostic-color-base{font-style:italic}.diagnostic-color-error,.diagnostic-color-pass,.diagnostic-color-base{font-weight:bold}.banner{margin-bottom:20px;position:relative;border-radius:6px;border-style:solid;border-width:1px}.banner h2{position:relative;margin:0;padding:10px 10px 10px 35px;color:#fff}.banner ul{margin:0;padding:15px 20px}.banner ul>li:not(:last-child){padding-bottom:15px}.banner ul>li h4{margin:0;padding:0}.banner ul>li p{margin:0;padding:0;line-height:16px}.banner-check{border-color:#60aa55}.banner-check h2,.banner-check svg{color:#60aa55}.banner-close{cursor:pointer;height:16x;width:16px;margin:10px 10px 10px 35px}.banner-warnings h2 svg,.banner-suggestions h2 svg,.banner-check h2 svg{position:absolute;top:12px;left:10px;width:16px;height:16px}.banner-warnings{border-color:#f28d03}.banner-warnings h2,.banner-warnings svg{color:#f28d03}.banner-suggestions{border-color:#009adb}.banner-suggestions h2,.banner-suggestions svg{color:#009adb}.gridy{display:grid;gap:40px;grid-template-columns:35% auto}@media(max-width: 750px){.gridy{grid-template-columns:1fr}}.diag{display:flex;flex-direction:column;gap:30px}.diag-list>ul>li{padding:1px 0}.diag-list>ul>li svg{position:relative;top:3px;flex-basis:14px;width:14px;height:14px}.diag-list>ul>li h3{padding:5px 0 10px 0;margin:0}.diag-list>ul>li>ul:not(.notices)>li{padding:1px 0}.diag-list>ul>li>ul:not(.notices)>li:last-child{margin-bottom:10px}.diag-list>ul>li ul.notices>li{font-style:italic;font-size:12px}.diag-list>ul>li ul.notices>li.suggestionvalidator{color:#009adb}.diag-list>ul>li ul.notices>li.warningvalidator{color:#f28d03}.diag-list>ul>li ul.notices>li.warningvalidator>a{color:#f28d03;text-decoration:underline}.items{display:flex;gap:5px}.items>.item{display:flex;gap:5px}.items>.item svg{position:relative;top:3px;flex-basis:14px;width:14px;height:14px}.items>.item-warnings{color:#f28d03}.items>.item-warnings svg{color:#f28d03}.items>.item-suggestions{color:#009adb}.items>.item-suggestions svg{color:#009adb} +.diagnostic-color-error{color:#d52817}.diagnostic-color-pass{color:var(--enabled-color)}.diagnostic-color-base{color:#5a6875}.diagnostic-color-pass,.diagnostic-color-base{font-style:italic}.diagnostic-color-error,.diagnostic-color-pass,.diagnostic-color-base{font-weight:bold}.banner{margin-bottom:10px;position:relative;border-radius:6px;border-style:solid;border-width:1px}.banner h2{position:relative;margin:0;padding:10px 10px 10px 35px;color:#fff}.banner ul{margin:0;padding:15px 20px}.banner ul>li:not(:last-child){padding-bottom:15px}.banner ul>li h4{margin:0;padding:0}.banner ul>li p{margin:0;padding:0;line-height:16px}.banner-check{border-color:var(--enabled-color)}.banner-check h2,.banner-check svg{color:var(--enabled-color)}.banner-close{cursor:pointer;height:16x;width:16px;margin:10px 10px 10px 35px}.banner-warnings h2 svg,.banner-suggestions h2 svg,.banner-check h2 svg{position:absolute;top:12px;left:10px;width:16px;height:16px}.banner-warnings{border-color:var(--warning-color)}.banner-warnings h2,.banner-warnings svg{color:var(--warning-color)}.banner-suggestions{border-color:var(--notice-color)}.banner-suggestions h2,.banner-suggestions svg{color:var(--notice-color)}.gridy{display:grid;gap:50px;grid-template-columns:40% auto;margin-top:20px;}@media(max-width: 1050px){.gridy{grid-template-columns:1fr}}.diag{display:flex;flex-direction:column;gap:20px}.diag-list>h2{margin:6px 0}.diag-list>ul>li{padding:2px 0}.diag-list>ul>li svg{position:relative;top:3px;flex-basis:14px;width:14px;height:14px}.diag-list>ul>li h3{padding:5px 0 10px 0;margin:0}.diag-list>ul>li>ul:not(.notices)>li{padding:2px 0}.diag-list>ul>li>ul:not(.notices)>li:last-child{margin-bottom:10px}.diag-list>ul>li ul.notices>li{font-style:italic;font-size:12px}.diag-list>ul>li ul.notices>li.suggestionvalidator{color:var(--notice-color)}.diag-list>ul>li ul.notices>li.warningvalidator{color:var(--warning-color)}.diag-list>ul>li ul.notices>li.warningvalidator>a{color:var(--warning-color);text-decoration:underline}.items{display:flex;gap:5px}.items>.item{display:flex;gap:5px}.items>.item svg{position:relative;top:3px;flex-basis:14px;width:14px;height:14px}.items>.item-warnings{color:var(--warning-color)}.items>.item-warnings svg{color:var(--warning-color)}.items>.item-suggestions{color:var(--notice-color)}.items>.item-suggestions svg{color:var(--notice-color)} diff --git a/packages/plugin/src/Services/DiagnosticsService.php b/packages/plugin/src/Services/DiagnosticsService.php index 10167d172..9a6d4031f 100644 --- a/packages/plugin/src/Services/DiagnosticsService.php +++ b/packages/plugin/src/Services/DiagnosticsService.php @@ -138,10 +138,10 @@ function ($value) { } $bytes = $number * $multiplier; - $min256M = 512 * 1024 ** 2; // 256M in bytes + $min512M = 512 * 1024 ** 2; // 512M in bytes - if ($bytes >= $min256M) { - return true; // At least 256M + if ($bytes >= $min512M) { + return true; // At least 512M } return false; @@ -303,7 +303,7 @@ public function getFreeformIntegrations() $count = $integration['count']; $plural = 1 != $count ? 's' : ''; - $label = "{$name}{$version} : {$count} form{$plural}"; + $label = "{$name}{$version}: {$count} form{$plural}"; $diagnosticItems[] = new DiagnosticItem($label, ['value' => $integration]); } @@ -319,11 +319,11 @@ public function getFreeformFormType() if ($freeform->isPro()) { return [ new DiagnosticItem( - 'Regular: {{ value }} form{{ value != 1 ? "s" : "" }}', + 'Regular: {{ value }} form{{ value != 1 ? "s" : "" }}', $statistics->totals->regularForm ), new DiagnosticItem( - 'Payments: {{ value }} form{{ value != 1 ? "s" : "" }}', + 'Payments: {{ value }} form{{ value != 1 ? "s" : "" }}', $statistics->totals->payment ), ]; @@ -495,7 +495,7 @@ function ($value) { return !$value; }, '{{ extra.count }} Errors logged in the Freeform Error Log', - 'Please check the error log to see if there any serious issues.', + 'Please check the error log to see if there are any serious issues.', [ 'url' => UrlHelper::cpUrl('freeform/settings/error-log'), 'count' => Freeform::getInstance()->logger->getLogReader()->count(), diff --git a/packages/plugin/src/templates/settings/_diagnostics.twig b/packages/plugin/src/templates/settings/_diagnostics.twig index 613eca40d..b9712cb67 100644 --- a/packages/plugin/src/templates/settings/_diagnostics.twig +++ b/packages/plugin/src/templates/settings/_diagnostics.twig @@ -68,7 +68,6 @@ {% endmacro %} {% block content %} -

{{ "Diagnostics"|t('freeform') }}

{% if not warnings|length %}