diff --git a/app/assets/javascripts/discourse/app/lib/load-script.js b/app/assets/javascripts/discourse/app/lib/load-script.js index 2eb5a52c096..5acbbceac46 100644 --- a/app/assets/javascripts/discourse/app/lib/load-script.js +++ b/app/assets/javascripts/discourse/app/lib/load-script.js @@ -119,7 +119,7 @@ export function cacheBuster(url) { if (PUBLIC_JS_VERSIONS) { let [folder, ...lib] = url.split("/").filter(Boolean); if (folder === "javascripts") { - lib = lib.join("/"); + lib = lib.join("/").toLowerCase(); const versionedPath = PUBLIC_JS_VERSIONS[lib]; if (versionedPath) { return `/javascripts/${versionedPath}`; diff --git a/app/assets/javascripts/discourse/app/lib/public-js-versions.js b/app/assets/javascripts/discourse/app/lib/public-js-versions.js index 393052736cf..a8ced62efaa 100644 --- a/app/assets/javascripts/discourse/app/lib/public-js-versions.js +++ b/app/assets/javascripts/discourse/app/lib/public-js-versions.js @@ -4,7 +4,7 @@ export const PUBLIC_JS_VERSIONS = { "ace/ace.js": "ace.js/1.4.13/ace.js", "jsoneditor.js": "@json-editor/json-editor/2.6.1/jsoneditor.js", - "Chart.min.js": "chart.js/3.5.1/Chart.min.js", + "chart.min.js": "chart.js/3.5.1/chart.min.js", "chartjs-plugin-datalabels.min.js": "chartjs-plugin-datalabels/2.0.0/chartjs-plugin-datalabels.min.js", "diffhtml.min.js": "diffhtml/1.0.0-beta.20/diffhtml.min.js", diff --git a/app/assets/javascripts/discourse/tests/unit/lib/load-script-test.js b/app/assets/javascripts/discourse/tests/unit/lib/load-script-test.js index fe48fbc8584..609b6a931fc 100644 --- a/app/assets/javascripts/discourse/tests/unit/lib/load-script-test.js +++ b/app/assets/javascripts/discourse/tests/unit/lib/load-script-test.js @@ -24,4 +24,15 @@ module("Unit | Utility | load-script", function () { `/javascripts/${jsVersions["ace/ace.js"]}` ); }); + + test("lookups are case-insensitive", (assert) => { + assert.strictEqual( + cacheBuster("/javascripts/Chart.min.js"), + `/javascripts/${jsVersions["chart.min.js"]}` + ); + assert.strictEqual( + cacheBuster("/javascripts/chart.min.js"), + `/javascripts/${jsVersions["chart.min.js"]}` + ); + }); }); diff --git a/app/assets/stylesheets/vendor/svg-arrow.css b/app/assets/stylesheets/vendor/svg-arrow.css index 5e5b389c63c..c2a61ad7ae3 100644 --- a/app/assets/stylesheets/vendor/svg-arrow.css +++ b/app/assets/stylesheets/vendor/svg-arrow.css @@ -1 +1 @@ -.tippy-box[data-placement^=top]>.tippy-svg-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-svg-arrow:after,.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg{top:16px;transform:rotate(180deg)}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:16px}.tippy-box[data-placement^=left]>.tippy-svg-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-svg-arrow:after,.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg{transform:rotate(90deg);top:calc(50% - 3px);left:11px}.tippy-box[data-placement^=right]>.tippy-svg-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-svg-arrow:after,.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg{transform:rotate(-90deg);top:calc(50% - 3px);right:11px}.tippy-svg-arrow{width:16px;height:16px;fill:#333;text-align:initial}.tippy-svg-arrow,.tippy-svg-arrow>svg{position:absolute} +.tippy-box[data-placement^=top]>.tippy-svg-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-svg-arrow:after,.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg{top:16px;transform:rotate(180deg)}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:16px}.tippy-box[data-placement^=left]>.tippy-svg-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-svg-arrow:after,.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg{transform:rotate(90deg);top:calc(50% - 3px);left:11px}.tippy-box[data-placement^=right]>.tippy-svg-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-svg-arrow:after,.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg{transform:rotate(-90deg);top:calc(50% - 3px);right:11px}.tippy-svg-arrow{width:16px;height:16px;fill:#333;text-align:initial}.tippy-svg-arrow,.tippy-svg-arrow>svg{position:absolute} \ No newline at end of file diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake index 7f2ceb59059..b632a401b9d 100644 --- a/lib/tasks/javascript.rake +++ b/lib/tasks/javascript.rake @@ -75,7 +75,7 @@ def dependencies package_name: '@json-editor/json-editor', public: true }, { - source: 'chart.js/dist/Chart.min.js', + source: 'chart.js/dist/chart.min.js', public: true }, { source: 'chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.min.js', @@ -310,7 +310,7 @@ task 'javascript:update' => 'clean_up' do else package_dir_name = public_path_name(f) package_version = JSON.parse(File.read("#{library_src}/#{node_package_name(f)}/package.json"))["version"] - versions[filename] = "#{package_dir_name}/#{package_version}/#{filename}" + versions[filename.downcase] = "#{package_dir_name}/#{package_version}/#{filename}" path = "#{public_js}/#{package_dir_name}/#{package_version}" dest = "#{path}/#{filename}" diff --git a/public/javascripts/chart.js/3.5.1/Chart.min.js b/public/javascripts/chart.js/3.5.1/chart.min.js similarity index 100% rename from public/javascripts/chart.js/3.5.1/Chart.min.js rename to public/javascripts/chart.js/3.5.1/chart.min.js