mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-10-23 03:37:01 +09:00
Refresh default branding and migrate legacy asset paths (#4527)
* Refresh default branding assets Add updated light and dark logos plus an SVG favicon, and point installer and default company branding settings to the new assets. Update shared theme tests to use the renamed light logo. * Complete default branding asset migration * Preserve branding assets still referenced by settings
This commit is contained in:
1 parent
a2444cc02d
commit
6b18ba6a23
11 files changed
+106
-18
No files matched your search
@@ -263,8 +263,8 @@
|
||||
<ul>
|
||||
<li>
|
||||
<a href="./install.php" title="FOSSBilling">
|
||||
<img class="installer-logo-light" src="../public/branding/logo.svg" alt="FOSSBilling logo" height="50" width="238">
|
||||
<img class="installer-logo-dark" src="../public/branding/logo-dark.svg" alt="FOSSBilling logo" height="50" width="238">
|
||||
<img class="installer-logo-light" src="../public/branding/logo-light.svg" alt="FOSSBilling logo" height="54" width="266">
|
||||
<img class="installer-logo-dark" src="../public/branding/logo-dark.svg" alt="FOSSBilling logo" height="54" width="266">
|
||||
</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
@@ -304,11 +304,11 @@ LOCK TABLES `setting` WRITE;
|
||||
|
||||
INSERT INTO `setting` (`id`, `param`, `value`, `public`, `category`, `hash`, `created_at`, `updated_at`)
|
||||
VALUES
|
||||
(1,'last_patch','129',0,NULL,NULL,NOW(),NOW()),
|
||||
(1,'last_patch','130',0,NULL,NULL,NOW(),NOW()),
|
||||
(2,'company_name','Company Name',0,NULL,NULL,NOW(),NOW()),
|
||||
(3,'company_email','support@yourcompany.com',0,NULL,NULL,NOW(),NOW()),
|
||||
(4,'company_signature','FOSSBilling.org - Client Management, Invoicing and Support Software',0,NULL,NULL,NOW(),NOW()),
|
||||
(5,'company_logo','public/branding/logo.svg',0,NULL,NULL,NOW(),NOW()),
|
||||
(5,'company_logo','public/branding/logo-light.svg',0,NULL,NULL,NOW(),NOW()),
|
||||
(6,'company_logo_dark','public/branding/logo-dark.svg',0,NULL,NULL,NOW(),NOW()),
|
||||
(7,'company_address_1','Demo address line 1',0,NULL,NULL,NOW(),NOW()),
|
||||
(8,'company_address_2','Demo address line 2',0,NULL,NULL,NOW(),NOW()),
|
||||
@@ -335,7 +335,7 @@ VALUES
|
||||
(29,'nameserver_4',NULL,0,NULL,NULL,NOW(),NOW()),
|
||||
(30,'funds_min_amount','10',0,NULL,NULL,NOW(),NOW()),
|
||||
(31,'funds_max_amount','200',0,NULL,NULL,NOW(),NOW()),
|
||||
(32,'company_favicon','public/branding/favicon.ico',0,NULL,NULL,NOW(),NOW()),
|
||||
(32,'company_favicon','public/branding/favicon.svg',0,NULL,NULL,NOW(),NOW()),
|
||||
(33,'hide_company_public','1',0,NULL,NULL,NOW(),NOW()),
|
||||
(34,'invoice_hash_lifetime_days','90',0,NULL,NULL,NOW(),NOW());
|
||||
|
||||
|
||||
@@ -240,6 +240,9 @@ class UpdatePatcher implements InjectionAwareInterface
|
||||
// forever.
|
||||
$this->migrateThemePackageLayout();
|
||||
|
||||
// Branding paths and obsolete files need migrating on every database driver.
|
||||
$this->migrateDefaultBrandingAssetsToPublicDirectory();
|
||||
|
||||
// Retired hook packages and listener registrations have no runtime consumer. Remove
|
||||
// their records on every driver so old installs do not retain invisible extensions.
|
||||
$this->removeRetiredHookData();
|
||||
@@ -1493,6 +1496,7 @@ class UpdatePatcher implements InjectionAwareInterface
|
||||
127 => 'patch127',
|
||||
128 => 'patch128',
|
||||
129 => 'patch129',
|
||||
130 => 'patch130',
|
||||
];
|
||||
ksort($patches, SORT_NATURAL);
|
||||
|
||||
@@ -4108,6 +4112,7 @@ class UpdatePatcher implements InjectionAwareInterface
|
||||
{
|
||||
$settings = [
|
||||
'company_logo' => [
|
||||
'public/branding/logo-light.svg',
|
||||
'public/branding/logo.svg',
|
||||
'themes/huraga/assets/img/logo.svg',
|
||||
'themes/huraga/assets/build/img/logo.svg',
|
||||
@@ -4118,6 +4123,7 @@ class UpdatePatcher implements InjectionAwareInterface
|
||||
'themes/huraga/assets/build/img/logo_white.svg',
|
||||
],
|
||||
'company_favicon' => [
|
||||
'public/branding/favicon.svg',
|
||||
'public/branding/favicon.ico',
|
||||
'themes/huraga/assets/favicon.ico',
|
||||
'themes/huraga/assets/build/favicon.ico',
|
||||
@@ -4136,6 +4142,15 @@ class UpdatePatcher implements InjectionAwareInterface
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (['public/branding/logo.svg', 'public/branding/favicon.ico'] as $path) {
|
||||
// A custom setting may still use an old asset, such as the light logo in dark mode.
|
||||
if ($this->fetchOne('SELECT value FROM setting WHERE value = :value LIMIT 1', ['value' => $path]) !== false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->executeFileActions([Path::join(PATH_ROOT, $path) => 'unlink']);
|
||||
}
|
||||
}
|
||||
|
||||
private function migrateGatewayAssetsToPublicDirectory(): void
|
||||
@@ -4795,6 +4810,11 @@ class UpdatePatcher implements InjectionAwareInterface
|
||||
}
|
||||
}
|
||||
|
||||
private function patch130(): void
|
||||
{
|
||||
$this->migrateDefaultBrandingAssetsToPublicDirectory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a database-collision-free slug derived from $base for reconciliation.
|
||||
*
|
||||
|
||||
@@ -87,7 +87,7 @@ test('PDF logo rejects unsafe response content', function (string $body, string
|
||||
|
||||
test('PDF logo preserves the shipped local SVG without network access', function (): void {
|
||||
$client = new MockHttpClient(static fn () => throw new LogicException('Network must not be reached'));
|
||||
[$source, $remote] = pdfLogoService($client)->logo('https://billing.example/public/branding/logo.svg');
|
||||
[$source, $remote] = pdfLogoService($client)->logo('https://billing.example/public/branding/logo-light.svg');
|
||||
expect($source)->toStartWith('data:image/svg+xml;base64,')->and($remote)->toBeFalse();
|
||||
});
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="svg1" version="1.1" width="330" height="330" viewBox="-5 0 330 330"><defs id="defs1"><clipPath id="clipPath4" clipPathUnits="userSpaceOnUse"><path id="path4" d="m 1670.53,2020.5901 263.08,60.74 c 40.36,9.32 80.6301,-15.85 89.9501,-56.2 l 37.12,-160.7701 c 9.31,-40.36 -15.85,-80.64 -56.21,-89.95 L 1741.39,1713.67 c -40.36,-9.32 -80.63,15.85 -89.95,56.21 l -37.12,160.76 c -9.31,40.36 15.85,80.6401 56.21,89.9501 z"/></clipPath></defs><g id="g1"><path id="path1" fill="#0785bc" fill-opacity="1" fill-rule="nonzero" stroke="none" d="M 202.5,2025 1980,2460 c 112.5,30 195,-45 217.5,-172.5 L 2325,1545 H 127.5 l -45,285 c -22.5,90 30,165 120,195" transform="matrix(0.13333333,0,0,-0.13333333,0,330)"/><path id="path2" fill="#fac965" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 1670.53,2020.59 263.08,60.74 c 40.4,9.33 80.62,-15.81 89.95,-56.2 l 37.12,-160.77 c 9.32,-40.4 -15.81,-80.63 -56.21,-89.95 l -263.08,-60.74 c -40.4,-9.33 -80.62,15.81 -89.95,56.21 l -37.12,160.76 c -9.32,40.4 15.81,80.63 56.21,89.95" transform="matrix(0.13333333,0,0,-0.13333333,0,330)"/><path id="path3" fill="none" stroke="#94712d" stroke-dasharray="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-opacity="1" stroke-width="19.5" d="m 1718.32,1946.96 52.3,-226.54 m -154.61,202.92 285.01,65.8 c 29.23,6.74 46.65,-2.06 52.28,-26.42 5.62,-24.36 -6.18,-39.91 -35.41,-46.66 l -182.7,-42.18 m 81.5,180.46 53.99,-233.85 65.77,15.18 c 34.1,7.88 48.05,25.21 41.87,52.01 -6.19,26.79 -26.33,36.25 -60.43,28.38 m 35.41,46.66 80.38,18.56 m -54.52,-97.26 73.08,16.87 m -181.56,-80.4 16.87,-73.08" clip-path="url(#clipPath4)" transform="matrix(0.13333333,0,0,-0.13333333,0,330)"/><path id="path5" fill="#000" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 180,1635 h 2040 c 99.41,0 180,-80.59 180,-180 v -352.5 h -495 c -132.55,0 -240,-107.453 -240,-240 v -75 c 0,-132.547 107.45,-240 240,-240 h 495 V 180 C 2400,80.5898 2319.41,0 2220,0 H 180 C 80.5898,0 0,80.5898 0,180 v 1275 c 0,99.41 80.5898,180 180,180 z m 1725,-622.5 h 495 v -375 h -495 c -82.84,0 -150,67.156 -150,150 v 75 c 0,82.844 67.16,150 150,150" transform="matrix(0.13333333,0,0,-0.13333333,0,330)"/><path id="path6" fill="#fff" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 2400,1102.5 h -495 c -132.55,0 -240,-107.453 -240,-240 v -75 c 0,-132.547 107.45,-240 240,-240 h 495 v 90 h -495 c -82.84,0 -150,67.156 -150,150 v 75 c 0,82.844 67.16,150 150,150 h 495 v 90" transform="matrix(0.13333333,0,0,-0.13333333,0,330)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_2" viewBox="0 0 322.52 68.7"><defs><style>.cls-1{fill:#0081c5}.cls-2{fill:#fff}.cls-3{fill:#fac965}.cls-4,.cls-5{fill:#050407;stroke:#fff;stroke-miterlimit:10}.cls-5{fill:#1a110f}</style></defs><g id="Layer_1-2"><g><g><path d="M9.84,37.86c-1.37,0-2.51-1.35-2.58-3.08L5.99,6.56c-.08-1.79,1.01-3.32,2.44-3.41L51.23,.5h.13c1.37,0,2.51,1.35,2.58,3.07l1.26,28.23c.08,1.79-1.01,3.32-2.44,3.41l-42.8,2.65h-.13Z" class="cls-1"/><path d="M51.36,1c1.09,0,2.02,1.17,2.08,2.6l1.26,28.23c.07,1.49-.84,2.82-1.97,2.89l-42.8,2.65s-.07,0-.1,0c-1.09,0-2.02-1.17-2.08-2.6L6.49,6.54c-.07-1.49,.84-2.82,1.97-2.89L51.27,1s.07,0,.1,0M51.36,0C51.31,0,51.26,0,51.2,0L8.4,2.65c-1.7,.11-3,1.86-2.91,3.93l1.26,28.23c.09,2,1.45,3.55,3.08,3.55,.05,0,.11,0,.16,0l42.8-2.65c1.7-.11,3-1.86,2.91-3.93l-1.26-28.23C54.36,1.55,52.99,0,51.36,0h0Z" class="cls-2"/></g><path d="M46.57,21.91l-6.57,.34c-1.46,.08-2.71-1.01-2.79-2.42l-.14-2.59c-.08-1.41,1.05-2.62,2.51-2.69l6.57-.34c1.46-.08,2.71,1.01,2.79,2.42l.14,2.59c.08,1.41-1.05,2.62-2.51,2.69Z" class="cls-3"/><rect width="56" height="38" x="1.72" y="28.16" class="cls-4" rx="4" ry="4" transform="translate(4.22 -2.41) rotate(5)"/><path d="M47.63,45.08h10v8h-10c-1.1,0-2-.9-2-2v-4c0-1.1,.9-2,2-2Z" class="cls-5" transform="translate(4.47 -4.31) rotate(5)"/><g><path d="M90.87,18.84h21.19v5.58h-14.42v7.62h13.02v5.58h-13.02v13.22h-6.77V18.84Z" class="cls-2"/><path d="M129.92,51.28c-8.53,0-14.98-6.02-14.98-16.44s6.45-16.44,14.98-16.44,14.98,5.97,14.98,16.44-6.5,16.44-14.98,16.44Zm0-26.89c-4.92,0-8.12,3.67-8.12,10.45s3.2,10.45,8.12,10.45,8.12-3.67,8.12-10.45-3.22-10.45-8.12-10.45Z" class="cls-2"/><path d="M160.7,24.06c-3.31,0-5.14,1.52-5.14,3.58-.05,2.3,2.28,3.33,5.06,3.97l2.88,.69c5.56,1.25,9.58,4.08,9.59,9.41-.02,5.86-4.61,9.59-12.42,9.59s-12.72-3.58-12.89-10.5h6.55c.22,3.2,2.75,4.83,6.27,4.83s5.66-1.59,5.67-3.94c-.02-2.16-1.95-3.16-5.44-4l-3.48-.88c-5.41-1.3-8.73-4-8.72-8.72-.03-5.81,5.11-9.69,12.12-9.69s11.81,3.94,11.91,9.64h-6.48c-.25-2.52-2.23-3.98-5.47-3.98Z" class="cls-2"/><path d="M188.41,24.06c-3.31,0-5.14,1.52-5.14,3.58-.05,2.3,2.28,3.33,5.06,3.97l2.88,.69c5.56,1.25,9.58,4.08,9.59,9.41-.02,5.86-4.61,9.59-12.42,9.59s-12.72-3.58-12.89-10.5h6.55c.22,3.2,2.75,4.83,6.27,4.83s5.66-1.59,5.67-3.94c-.02-2.16-1.95-3.16-5.44-4l-3.48-.88c-5.41-1.3-8.73-4-8.72-8.72-.03-5.81,5.11-9.69,12.12-9.69s11.81,3.94,11.91,9.64h-6.48c-.25-2.52-2.23-3.98-5.47-3.98Z" class="cls-2"/><path d="M205.7,18.84h10.8c6.25,0,9.39,3.56,9.39,8.38,0,4-2.22,6.22-5.08,6.98v.25c3.11,.22,6.33,3.14,6.33,8s-3.17,8.39-10.05,8.39h-11.39V18.84Zm11.06,14.45c3.78,0,6.33-2.56,6.33-6.08s-2.22-5.75-6.59-5.75h-7.88v11.83h8.14Zm.33,14.92c4.94,0,7.25-2.45,7.25-5.77,0-3.66-2.83-6.56-7.12-6.56h-8.59v12.33h8.47Z" class="cls-2"/><path d="M232.98,20.72c0-1.09,.94-2,2.08-2s2.09,.91,2.09,2-.95,2-2.09,2-2.08-.91-2.08-2Zm.66,6.12h2.8v24h-2.8V26.84Z" class="cls-2"/><path d="M246.59,50.84h-2.78V18.84h2.78V50.84Z" class="cls-2"/><path d="M256.71,50.84h-2.78V18.84h2.78V50.84Z" class="cls-2"/><path d="M263.43,20.72c0-1.09,.94-2,2.08-2s2.09,.91,2.09,2-.95,2-2.09,2-2.08-.91-2.08-2Zm.66,6.12h2.8v24h-2.8V26.84Z" class="cls-2"/><path d="M277.04,50.84h-2.78V26.84h2.7v3.77h.25c1.12-2.45,3.55-4.08,7.06-4.08,4.84,0,8.14,3.08,8.14,8.77v15.55h-2.78v-15.38c0-3.92-2.38-6.39-6.06-6.39s-6.53,2.58-6.53,6.77v15Z" class="cls-2"/><path d="M299.54,55.53l2.28-1.5c1.02,1.83,2.98,3.81,7.09,3.81s7.11-2.08,7.11-6.55v-5.41h-.25c-.95,2.2-3.06,4.7-7.38,4.7-5.75,0-9.88-4.45-9.88-11.81s3.98-12.27,9.92-12.27c4.41,0,6.39,2.75,7.38,4.91h.28v-4.58h2.72v24.62c0,6.09-4.22,8.88-9.91,8.88-4.91,0-7.97-2.06-9.38-4.81Zm16.53-16.8c0-5.62-2.64-9.69-7.34-9.69s-7.41,4.28-7.41,9.69,2.64,9.31,7.41,9.31,7.34-3.52,7.34-9.31Z" class="cls-2"/></g></g></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="svg1" width="266.29333" height="54" version="1.1" viewBox="0 0 266.29333 54"><defs id="defs1"><clipPath id="clipPath4" clipPathUnits="userSpaceOnUse"><path id="path4" d="m 273.35901,330.64501 43.047,9.937 c 6.606,1.523 13.196,-2.594 14.723,-9.199 l 6.07,-26.305 c 1.528,-6.605 -2.59,-13.195 -9.195,-14.719 l -43.051,-9.941 c -6.601,-1.523 -13.191,2.594 -14.719,9.199 l -6.074,26.309 c -1.523,6.601 2.594,13.191 9.199,14.719 z"/></clipPath></defs><g id="g1"><path id="path1" fill="#0785bc" fill-opacity="1" fill-rule="nonzero" stroke="none" d="M 33.1367,331.363 324,402.547 c 18.41,4.906 31.91,-7.363 35.59,-28.231 L 380.453,252.82 H 20.8633 L 13.5,299.453 c -3.68359,14.731 4.9102,27 19.6367,31.91" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path2" fill="#fac965" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 273.359,330.645 43.047,9.937 c 6.614,1.527 13.196,-2.586 14.723,-9.199 l 6.07,-26.305 c 1.528,-6.613 -2.586,-13.195 -9.195,-14.719 l -43.051,-9.941 c -6.609,-1.523 -13.191,2.586 -14.719,9.199 l -6.074,26.309 c -1.523,6.609 2.59,13.191 9.199,14.719" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path3" fill="none" stroke="#94712d" stroke-dasharray="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-opacity="1" stroke-width="3.1909" d="m 281.18,318.594 8.558,-37.071 m -25.3,33.204 46.636,10.769 c 4.785,1.102 7.637,-0.336 8.555,-4.324 0.922,-3.984 -1.012,-6.531 -5.793,-7.637 l -29.895,-6.898 m 13.332,29.527 8.836,-38.266 10.762,2.485 c 5.582,1.289 7.867,4.125 6.852,8.512 -1.012,4.382 -4.309,5.929 -9.887,4.64 m 5.793,7.637 13.156,3.039 m -8.922,-15.918 11.957,2.762 m -29.711,-13.157 2.762,-11.957" clip-path="url(#clipPath4)" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path5" fill="#000" fill-opacity="1" fill-rule="nonzero" stroke="none" d="M 29.4531,267.547 H 363.273 c 16.266,0 29.454,-13.188 29.454,-29.457 v -57.68 h -81 c -21.692,0 -39.274,-17.582 -39.274,-39.273 v -12.274 c 0,-21.687 17.582,-39.2732 39.274,-39.2732 h 81 V 29.457 C 392.727,13.1875 379.539,0 363.273,0 H 29.4531 C 13.1875,0 0,13.1875 0,29.457 V 238.09 c 0,16.269 13.1875,29.457 29.4531,29.457 z M 311.727,165.684 h 81 V 104.32 h -81 c -13.555,0 -24.547,10.989 -24.547,24.543 v 12.274 c 0,13.554 10.992,24.547 24.547,24.547" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path6" fill="#fff" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 392.727,180.41 h -81 c -21.692,0 -39.274,-17.582 -39.274,-39.273 v -12.274 c 0,-21.687 17.582,-39.2732 39.274,-39.2732 h 81 V 104.32 h -81 c -13.555,0 -24.547,10.989 -24.547,24.543 v 12.274 c 0,13.554 10.992,24.547 24.547,24.547 h 81 v 14.726" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path7" fill="none" stroke="#83909e" stroke-dasharray="none" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-opacity="1" stroke-width="4.90908" d="m 2.45313,180.41 v 57.68 c 0,14.914 12.08987,27 26.99997,27 H 363.273 c 14.911,0 27,-12.086 27,-27 v -57.68 m 0,-90.8202 V 29.457 c 0,-14.914 -12.089,-26.99997 -27,-26.99997 H 29.4531 C 14.543,2.45703 2.45313,14.543 2.45313,29.457 V 180.41 M 390.273,165.684 V 104.32" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path8" fill="#fff" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 532.016,100.488 v 198.719 h 119.597 v -33.211 h -86.386 v -49.543 h 69.828 v -33.211 h -69.828 v -82.754 h -33.211" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path9" fill="#fff" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 760.59,96.3477 c -19.856,0 -36.887,4.3403 -51.082,13.0193 -14.199,8.68 -25.09,20.793 -32.672,36.34 -7.582,15.547 -11.375,33.594 -11.375,54.141 0,20.547 3.793,38.593 11.375,54.144 7.582,15.547 18.473,27.66 32.672,36.34 14.195,8.676 31.226,13.016 51.082,13.016 19.855,0 36.883,-4.34 51.082,-13.016 14.199,-8.68 25.09,-20.793 32.672,-36.34 7.582,-15.551 11.375,-33.597 11.375,-54.144 0,-20.547 -3.793,-38.594 -11.375,-54.141 -7.582,-15.547 -18.473,-27.66 -32.672,-36.34 -14.199,-8.679 -31.227,-13.0193 -51.082,-13.0193 z m 0,31.3713 c 13.34,-0.153 24.445,2.765 33.316,8.754 8.867,5.988 15.524,14.422 19.965,25.308 4.438,10.887 6.656,23.578 6.656,38.067 0,14.492 -2.218,27.105 -6.656,37.847 -4.441,10.743 -11.098,19.102 -19.965,25.082 -8.871,5.981 -19.976,9.047 -33.316,9.2 -13.34,0.152 -24.438,-2.762 -33.293,-8.739 -8.856,-5.98 -15.504,-14.418 -19.942,-25.312 -4.437,-10.895 -6.675,-23.586 -6.703,-38.078 -0.031,-14.489 2.172,-27.102 6.61,-37.836 4.441,-10.731 11.101,-19.094 19.988,-25.082 8.887,-5.985 20,-9.055 33.34,-9.211" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path10" fill="#fff" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 956.918,96.3477 c -14.508,0 -27.578,2.5312 -39.215,7.5903 -11.637,5.062 -21.207,12.3 -28.703,21.722 -7.5,9.426 -12.293,20.645 -14.379,33.66 l 34.594,5.2 c 2.898,-11.778 8.926,-20.891 18.078,-27.348 Line truncated
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="svg1" width="266.29333" height="54" version="1.1" viewBox="0 0 266.29333 54"><defs id="defs1"><clipPath id="clipPath4" clipPathUnits="userSpaceOnUse"><path id="path4" d="m 273.35901,330.64501 43.047,9.937 c 6.606,1.523 13.196,-2.594 14.723,-9.199 l 6.07,-26.305 c 1.528,-6.605 -2.59,-13.195 -9.195,-14.719 l -43.051,-9.941 c -6.601,-1.523 -13.191,2.594 -14.719,9.199 l -6.074,26.309 c -1.523,6.601 2.594,13.191 9.199,14.719 z"/></clipPath></defs><g id="g1"><path id="path1" fill="#0785bc" fill-opacity="1" fill-rule="nonzero" stroke="none" d="M 33.1367,331.363 324,402.547 c 18.41,4.906 31.91,-7.363 35.59,-28.231 L 380.453,252.82 H 20.8633 L 13.5,299.453 c -3.68359,14.731 4.9102,27 19.6367,31.91" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path2" fill="#fac965" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 273.359,330.645 43.047,9.937 c 6.614,1.527 13.196,-2.586 14.723,-9.199 l 6.07,-26.305 c 1.528,-6.613 -2.586,-13.195 -9.195,-14.719 l -43.051,-9.941 c -6.609,-1.523 -13.191,2.586 -14.719,9.199 l -6.074,26.309 c -1.523,6.609 2.59,13.191 9.199,14.719" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path3" fill="none" stroke="#94712d" stroke-dasharray="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-opacity="1" stroke-width="3.1909" d="m 281.18,318.594 8.558,-37.071 m -25.3,33.204 46.636,10.769 c 4.785,1.102 7.637,-0.336 8.555,-4.324 0.922,-3.984 -1.012,-6.531 -5.793,-7.637 l -29.895,-6.898 m 13.332,29.527 8.836,-38.266 10.762,2.485 c 5.582,1.289 7.867,4.125 6.852,8.512 -1.012,4.382 -4.309,5.929 -9.887,4.64 m 5.793,7.637 13.156,3.039 m -8.922,-15.918 11.957,2.762 m -29.711,-13.157 2.762,-11.957" clip-path="url(#clipPath4)" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path5" fill="#000" fill-opacity="1" fill-rule="nonzero" stroke="none" d="M 29.4531,267.547 H 363.273 c 16.266,0 29.454,-13.188 29.454,-29.457 v -57.68 h -81 c -21.692,0 -39.274,-17.582 -39.274,-39.273 v -12.274 c 0,-21.687 17.582,-39.2732 39.274,-39.2732 h 81 V 29.457 C 392.727,13.1875 379.539,0 363.273,0 H 29.4531 C 13.1875,0 0,13.1875 0,29.457 V 238.09 c 0,16.269 13.1875,29.457 29.4531,29.457 z M 311.727,165.684 h 81 V 104.32 h -81 c -13.555,0 -24.547,10.989 -24.547,24.543 v 12.274 c 0,13.554 10.992,24.547 24.547,24.547" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path6" fill="#fff" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 392.727,180.41 h -81 c -21.692,0 -39.274,-17.582 -39.274,-39.273 v -12.274 c 0,-21.687 17.582,-39.2732 39.274,-39.2732 h 81 V 104.32 h -81 c -13.555,0 -24.547,10.989 -24.547,24.543 v 12.274 c 0,13.554 10.992,24.547 24.547,24.547 h 81 v 14.726" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path7" fill="#000" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 532.016,100.488 v 198.719 h 119.597 v -33.211 h -86.386 v -49.543 h 69.828 v -33.211 h -69.828 v -82.754 h -33.211" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path8" fill="#000" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 760.59,96.3477 c -19.856,0 -36.887,4.3403 -51.082,13.0193 -14.199,8.68 -25.09,20.793 -32.672,36.34 -7.582,15.547 -11.375,33.594 -11.375,54.141 0,20.547 3.793,38.593 11.375,54.144 7.582,15.547 18.473,27.66 32.672,36.34 14.195,8.676 31.226,13.016 51.082,13.016 19.855,0 36.883,-4.34 51.082,-13.016 14.199,-8.68 25.09,-20.793 32.672,-36.34 7.582,-15.551 11.375,-33.597 11.375,-54.144 0,-20.547 -3.793,-38.594 -11.375,-54.141 -7.582,-15.547 -18.473,-27.66 -32.672,-36.34 -14.199,-8.679 -31.227,-13.0193 -51.082,-13.0193 z m 0,31.3713 c 13.34,-0.153 24.445,2.765 33.316,8.754 8.867,5.988 15.524,14.422 19.965,25.308 4.438,10.887 6.656,23.578 6.656,38.067 0,14.492 -2.218,27.105 -6.656,37.847 -4.441,10.743 -11.098,19.102 -19.965,25.082 -8.871,5.981 -19.976,9.047 -33.316,9.2 -13.34,0.152 -24.438,-2.762 -33.293,-8.739 -8.856,-5.98 -15.504,-14.418 -19.942,-25.312 -4.437,-10.895 -6.675,-23.586 -6.703,-38.078 -0.031,-14.489 2.172,-27.102 6.61,-37.836 4.441,-10.731 11.101,-19.094 19.988,-25.082 8.887,-5.985 20,-9.055 33.34,-9.211" transform="matrix(0.13333333,0,0,-0.13333333,0,54)"/><path id="path9" fill="#000" fill-opacity="1" fill-rule="nonzero" stroke="none" d="m 956.918,96.3477 c -14.508,0 -27.578,2.5312 -39.215,7.5903 -11.637,5.062 -21.207,12.3 -28.703,21.722 -7.5,9.426 -12.293,20.645 -14.379,33.66 l 34.594,5.2 c 2.898,-11.778 8.926,-20.891 18.078,-27.348 9.152,-6.453 19.719,-9.684 31.695,-9.684 7.067,0 13.739,1.114 20.008,3.336 6.274,2.223 11.359,5.465 15.262,9.719 3.902,4.254 5.852,9.426 5.852,15.512 0,2.808 -0.454,5.371 -1.368,7.695 -0.91,2.324 -2.262,4.41 -4.047,6.258 -1.785,1.847 -4.078,3.519 -6.879,5.023 -2.796,1.504 -6.074,2.828 -9.832,3.981 l -51.289,15.133 c -4.418,1.273 -9.183,3.003 -14.304,5.199 -5.125,2.191 -9.953,5.179 -14.493,8.969 -4.539,3.789 -8.265,8.652 -11.175,14.593 -2.914,5.942 -4.371,13.297 -4.371,22.067 0,12.804 3.253,23.543 9.76Line truncated
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_2" viewBox="0 0 322.52 68.7"><defs><style>.cls-1{fill:#0081c5}.cls-2{fill:#fff}.cls-3{fill:#fac965}.cls-4,.cls-5{fill:#050407;stroke:#fff;stroke-miterlimit:10}.cls-5{fill:#1a110f}</style></defs><g id="Layer_1-2"><g><g><g><path d="M9.84,37.86c-1.37,0-2.51-1.35-2.58-3.08L5.99,6.56c-.08-1.79,1.01-3.32,2.44-3.41L51.23,.5h.13c1.37,0,2.51,1.35,2.58,3.07l1.26,28.23c.08,1.79-1.01,3.32-2.44,3.41l-42.8,2.65h-.13Z" class="cls-1"/><path d="M51.36,1c1.09,0,2.02,1.17,2.08,2.6l1.26,28.23c.07,1.49-.84,2.82-1.97,2.89l-42.8,2.65s-.07,0-.1,0c-1.09,0-2.02-1.17-2.08-2.6L6.49,6.54c-.07-1.49,.84-2.82,1.97-2.89L51.27,1s.07,0,.1,0M51.36,0C51.31,0,51.26,0,51.2,0L8.4,2.65c-1.7,.11-3,1.86-2.91,3.93l1.26,28.23c.09,2,1.45,3.55,3.08,3.55,.05,0,.11,0,.16,0l42.8-2.65c1.7-.11,3-1.86,2.91-3.93l-1.26-28.23C54.36,1.55,52.99,0,51.36,0h0Z" class="cls-2"/></g><path d="M46.57,21.91l-6.57,.34c-1.46,.08-2.71-1.01-2.79-2.42l-.14-2.59c-.08-1.41,1.05-2.62,2.51-2.69l6.57-.34c1.46-.08,2.71,1.01,2.79,2.42l.14,2.59c.08,1.41-1.05,2.62-2.51,2.69Z" class="cls-3"/><rect width="56" height="38" x="1.72" y="28.16" class="cls-4" rx="4" ry="4" transform="translate(4.22 -2.41) rotate(5)"/><path d="M47.63,45.08h10v8h-10c-1.1,0-2-.9-2-2v-4c0-1.1,.9-2,2-2Z" class="cls-5" transform="translate(4.47 -4.31) rotate(5)"/></g><g><path d="M90.87,18.85h21.19v5.58h-14.42v7.62h13.02v5.58h-13.02v13.22h-6.77V18.85Z"/><path d="M129.92,51.28c-8.53,0-14.98-6.02-14.98-16.44s6.45-16.44,14.98-16.44,14.98,5.97,14.98,16.44-6.5,16.44-14.98,16.44Zm0-26.89c-4.92,0-8.12,3.67-8.12,10.45s3.2,10.45,8.12,10.45,8.12-3.67,8.12-10.45-3.22-10.45-8.12-10.45Z"/><path d="M160.7,24.06c-3.31,0-5.14,1.52-5.14,3.58-.05,2.3,2.28,3.33,5.06,3.97l2.88,.69c5.56,1.25,9.58,4.08,9.59,9.41-.02,5.86-4.61,9.59-12.42,9.59s-12.72-3.58-12.89-10.5h6.55c.22,3.2,2.75,4.83,6.27,4.83s5.66-1.59,5.67-3.94c-.02-2.16-1.95-3.16-5.44-4l-3.48-.88c-5.41-1.3-8.73-4-8.72-8.72-.03-5.81,5.11-9.69,12.12-9.69s11.81,3.94,11.91,9.64h-6.48c-.25-2.52-2.23-3.98-5.47-3.98Z"/><path d="M188.41,24.06c-3.31,0-5.14,1.52-5.14,3.58-.05,2.3,2.28,3.33,5.06,3.97l2.88,.69c5.56,1.25,9.58,4.08,9.59,9.41-.02,5.86-4.61,9.59-12.42,9.59s-12.72-3.58-12.89-10.5h6.55c.22,3.2,2.75,4.83,6.27,4.83s5.66-1.59,5.67-3.94c-.02-2.16-1.95-3.16-5.44-4l-3.48-.88c-5.41-1.3-8.73-4-8.72-8.72-.03-5.81,5.11-9.69,12.12-9.69s11.81,3.94,11.91,9.64h-6.48c-.25-2.52-2.23-3.98-5.47-3.98Z"/><path d="M205.7,18.85h10.8c6.25,0,9.39,3.56,9.39,8.38,0,4-2.22,6.22-5.08,6.98v.25c3.11,.22,6.33,3.14,6.33,8s-3.17,8.39-10.05,8.39h-11.39V18.85Zm11.06,14.45c3.78,0,6.33-2.56,6.33-6.08s-2.22-5.75-6.59-5.75h-7.88v11.83h8.14Zm.33,14.92c4.94,0,7.25-2.45,7.25-5.77,0-3.66-2.83-6.56-7.12-6.56h-8.59v12.33h8.47Z"/><path d="M232.98,20.72c0-1.09,.94-2,2.08-2s2.09,.91,2.09,2-.95,2-2.09,2-2.08-.91-2.08-2Zm.66,6.12h2.8v24h-2.8V26.85Z"/><path d="M246.59,50.85h-2.78V18.85h2.78V50.85Z"/><path d="M256.71,50.85h-2.78V18.85h2.78V50.85Z"/><path d="M263.43,20.72c0-1.09,.94-2,2.08-2s2.09,.91,2.09,2-.95,2-2.09,2-2.08-.91-2.08-2Zm.66,6.12h2.8v24h-2.8V26.85Z"/><path d="M277.04,50.85h-2.78V26.85h2.7v3.77h.25c1.12-2.45,3.55-4.08,7.06-4.08,4.84,0,8.14,3.08,8.14,8.77v15.55h-2.78v-15.38c0-3.92-2.38-6.39-6.06-6.39s-6.53,2.58-6.53,6.77v15Z"/><path d="M299.54,55.53l2.28-1.5c1.02,1.83,2.98,3.81,7.09,3.81s7.11-2.08,7.11-6.55v-5.41h-.25c-.95,2.2-3.06,4.7-7.38,4.7-5.75,0-9.88-4.45-9.88-11.81s3.98-12.27,9.92-12.27c4.41,0,6.39,2.75,7.38,4.91h.28v-4.58h2.72v24.62c0,6.09-4.22,8.88-9.91,8.88-4.91,0-7.97-2.06-9.38-4.81Zm16.53-16.8c0-5.62-2.64-9.69-7.34-9.69s-7.41,4.28-7.41,9.69,2.64,9.31,7.41,9.31,7.34-3.52,7.34-9.31Z"/></g></g></g></svg>
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -134,7 +134,7 @@ test('shared company logo partial renders admin-style params: no height, inline
|
||||
PATH_THEMES . '/default/shared/html/partial_company_logo.html.twig',
|
||||
[
|
||||
'company' => new Tests\Support\PermissiveStub(['name' => 'Acme Hosting']),
|
||||
'logo_url' => 'https://example.com/logo.png',
|
||||
'logo_url' => 'https://example.com/logo-light.png',
|
||||
'dark_logo_url' => 'https://example.com/logo-dark.png',
|
||||
'link_url' => '/',
|
||||
'image_style' => 'height: 60px; width: auto;',
|
||||
@@ -176,7 +176,7 @@ test('shared company logo partial renders client-style params: height, target, r
|
||||
PATH_THEMES . '/default/shared/html/partial_company_logo.html.twig',
|
||||
[
|
||||
'company' => new Tests\Support\PermissiveStub(['name' => 'Acme Hosting']),
|
||||
'logo_url' => 'https://example.com/logo.png',
|
||||
'logo_url' => 'https://example.com/logo-light.png',
|
||||
'dark_logo_url' => 'https://example.com/logo-dark.png',
|
||||
'link_url' => '/',
|
||||
'link_target' => '_blank',
|
||||
@@ -197,7 +197,7 @@ test('shared company logo partial renders the mobile name span only when show_mo
|
||||
PATH_THEMES . '/default/shared/html/partial_company_logo.html.twig',
|
||||
[
|
||||
'company' => new Tests\Support\PermissiveStub(['name' => 'Acme Hosting']),
|
||||
'logo_url' => 'https://example.com/logo.png',
|
||||
'logo_url' => 'https://example.com/logo-light.png',
|
||||
'dark_logo_url' => 'https://example.com/logo-dark.png',
|
||||
'link_url' => '/',
|
||||
'show_mobile_name' => true,
|
||||
|
||||
@@ -23,6 +23,72 @@ test('currency formatting patch follows the client balance gateway repair', func
|
||||
->and($patches[93][1])->toBe('patch93');
|
||||
});
|
||||
|
||||
test('branding filename migration runs for installs past the original branding patch', function (): void {
|
||||
$patches = (new ReflectionMethod(UpdatePatcher::class, 'getPatches'))->invoke(new UpdatePatcher(), 129);
|
||||
|
||||
expect($patches)->toHaveKey(130)->and($patches[130][1])->toBe('patch130');
|
||||
});
|
||||
|
||||
test('branding migration updates default paths and preserves custom settings on repeated upgrades', function (string $param, string $oldValue, string $expected): void {
|
||||
$pdo = new PDO('sqlite::memory:');
|
||||
$pdo->exec('CREATE TABLE setting (param TEXT PRIMARY KEY, value TEXT)');
|
||||
$pdo->prepare('INSERT INTO setting (param, value) VALUES (?, ?)')->execute([$param, $oldValue]);
|
||||
$filesystem = Mockery::mock(Filesystem::class);
|
||||
foreach (['logo.svg', 'favicon.ico'] as $filename) {
|
||||
$path = Path::join(PATH_ROOT, 'public', 'branding', $filename);
|
||||
if ($expected === 'public/branding/' . $filename) {
|
||||
$filesystem->shouldNotReceive('exists')->with($path);
|
||||
$filesystem->shouldNotReceive('remove')->with($path);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$filesystem->shouldReceive('exists')->with($path)->andReturn(true, false);
|
||||
$filesystem->expects('remove')->with($path)->once();
|
||||
}
|
||||
$patcher = new UpdatePatcher();
|
||||
$patcher->setDi(new Pimple\Container(['pdo' => $pdo, 'filesystem' => $filesystem]));
|
||||
|
||||
for ($run = 0; $run < 2; ++$run) {
|
||||
(new ReflectionMethod($patcher, 'patch130'))->invoke($patcher);
|
||||
expect($pdo->query('SELECT value FROM setting')->fetchColumn())->toBe($expected);
|
||||
}
|
||||
})->with([
|
||||
'public logo' => ['company_logo', 'public/branding/logo.svg', 'public/branding/logo-light.svg'],
|
||||
'legacy logo' => ['company_logo', 'themes/huraga/assets/img/logo.svg', 'public/branding/logo-light.svg'],
|
||||
'built legacy logo' => ['company_logo', 'themes/huraga/assets/build/img/logo.svg', 'public/branding/logo-light.svg'],
|
||||
'public favicon' => ['company_favicon', 'public/branding/favicon.ico', 'public/branding/favicon.svg'],
|
||||
'legacy favicon' => ['company_favicon', 'themes/huraga/assets/favicon.ico', 'public/branding/favicon.svg'],
|
||||
'built legacy favicon' => ['company_favicon', 'themes/huraga/assets/build/favicon.ico', 'public/branding/favicon.svg'],
|
||||
'current logo' => ['company_logo', 'public/branding/logo-light.svg', 'public/branding/logo-light.svg'],
|
||||
'current favicon' => ['company_favicon', 'public/branding/favicon.svg', 'public/branding/favicon.svg'],
|
||||
'dark logo' => ['company_logo_dark', 'public/branding/logo-dark.svg', 'public/branding/logo-dark.svg'],
|
||||
'old logo used in dark mode' => ['company_logo_dark', 'public/branding/logo.svg', 'public/branding/logo.svg'],
|
||||
'old favicon used as a logo' => ['company_logo_dark', 'public/branding/favicon.ico', 'public/branding/favicon.ico'],
|
||||
'custom logo' => ['company_logo', 'data/uploads/logo.svg', 'data/uploads/logo.svg'],
|
||||
'custom favicon' => ['company_favicon', 'https://example.com/favicon.ico', 'https://example.com/favicon.ico'],
|
||||
'unrelated setting' => ['custom_asset', 'public/branding/logo.svg', 'public/branding/logo.svg'],
|
||||
]);
|
||||
|
||||
test('branding migration runs during non-MySQL update finalization', function (): void {
|
||||
withNonMysqlDbDriver(function (): void {
|
||||
$pdo = new PDO('sqlite::memory:');
|
||||
$pdo->exec('CREATE TABLE setting (param TEXT PRIMARY KEY, value TEXT, public INTEGER, created_at TEXT, updated_at TEXT)');
|
||||
$pdo->exec('CREATE TABLE extension_meta (extension TEXT, rel_type TEXT, rel_id TEXT, meta_key TEXT)');
|
||||
$pdo->exec('CREATE TABLE extension (type TEXT)');
|
||||
$pdo->exec("INSERT INTO setting (param, value) VALUES ('company_logo', 'public/branding/logo.svg'), ('company_favicon', 'public/branding/favicon.ico')");
|
||||
$filesystem = Mockery::mock(Filesystem::class);
|
||||
$filesystem->shouldReceive('exists')->andReturn(false);
|
||||
$patcher = new UpdatePatcher();
|
||||
$patcher->setDi(new Pimple\Container(['pdo' => $pdo, 'filesystem' => $filesystem]));
|
||||
|
||||
$patcher->applyCorePatches(force: true);
|
||||
|
||||
expect($pdo->query("SELECT value FROM setting WHERE param = 'company_logo'")->fetchColumn())->toBe('public/branding/logo-light.svg')
|
||||
->and($pdo->query("SELECT value FROM setting WHERE param = 'company_favicon'")->fetchColumn())->toBe('public/branding/favicon.svg');
|
||||
});
|
||||
});
|
||||
|
||||
test('upgrade checks report invalid invoice counters without changing stored values', function (?string $counter, bool $warning): void {
|
||||
$pdo = new PDO('sqlite::memory:');
|
||||
$pdo->exec('CREATE TABLE setting (param TEXT PRIMARY KEY, value TEXT)');
|
||||
@@ -1933,22 +1999,23 @@ test('migrateThemePackageLayout does nothing on a fresh install where neither ol
|
||||
|
||||
test('applyCorePatches migrates the theme setting values on a non-MySQL driver, since patch115 never runs there', function (): void {
|
||||
withNonMysqlDbDriver(function (): void {
|
||||
$adminThemeStatement = Mockery::mock(PDOStatement::class);
|
||||
$adminThemeStatement->expects('execute')
|
||||
$settingStatement = Mockery::mock(PDOStatement::class);
|
||||
$settingStatement->expects('execute')
|
||||
->with(['new_value' => 'default/admin', 'param' => 'admin_theme', 'old_value' => 'admin_default'])
|
||||
->andReturnTrue();
|
||||
$clientThemeStatement = Mockery::mock(PDOStatement::class);
|
||||
$clientThemeStatement->expects('execute')
|
||||
$settingStatement->expects('execute')
|
||||
->with(['new_value' => 'default/client', 'param' => 'theme', 'old_value' => 'huraga'])
|
||||
->andReturnTrue();
|
||||
$settingStatement->shouldReceive('execute')
|
||||
->with(Mockery::on(fn (array $params): bool => in_array($params['param'], ['company_logo', 'company_logo_dark', 'company_favicon'], true)))
|
||||
->andReturnTrue();
|
||||
$extensionMetaStatement = Mockery::mock(PDOStatement::class);
|
||||
$extensionMetaStatement->shouldReceive('execute')->andReturnTrue();
|
||||
|
||||
$pdo = Mockery::mock(PDO::class);
|
||||
$pdo->expects('prepare')
|
||||
$pdo->shouldReceive('prepare')
|
||||
->with('UPDATE setting SET value = :new_value WHERE param = :param AND value = :old_value')
|
||||
->twice()
|
||||
->andReturn($adminThemeStatement, $clientThemeStatement);
|
||||
->andReturn($settingStatement);
|
||||
$pdo->shouldReceive('prepare')
|
||||
->with(Mockery::on(fn (string $sql): bool => str_starts_with($sql, 'UPDATE extension_meta')))
|
||||
->andReturn($extensionMetaStatement);
|
||||
|
||||
Reference in new issue
Block a user