Skip to content

Commit a480641

Browse files
Update Vite to 8.3.5 and the admin panels' jQuery to 3.7.1 (#980)
1 parent 2d51bd1 commit a480641

12 files changed

Lines changed: 225 additions & 204 deletions

File tree

‎src/Web/Grand.SharedUIResources/adminapp/README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ npm run lint
238238
npm test
239239
```
240240

241-
The serializer tests compare against `jQuery.param` from jQuery 2.2.4, a dev dependency
242-
only (the panels load their own copy).
241+
The serializer tests compare against `jQuery.param` from jQuery 3.7.1, a dev dependency
242+
only (the panels load their own copy). The serializer keeps writing a space as `+`, as
243+
jQuery 2 and the Kendo transports did; jQuery 3 writes `%20`, and the tests treat the two
244+
as equal because the model binders decode both the same.
243245

244246
## End-to-end smoke tests
245247

‎src/Web/Grand.SharedUIResources/adminapp/package-lock.json‎

Lines changed: 86 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Web/Grand.SharedUIResources/adminapp/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"acorn": "^8.18.0",
2727
"eslint": "^10.11.0",
2828
"globals": "^17.13.0",
29-
"jquery": "^2.2.4",
29+
"jquery": "^3.7.1",
3030
"jsdom": "^30.1.1",
3131
"rtlcss": "^4.3.0",
3232
"sass": "^1.105.1",
33-
"vite": "^8.3.2",
33+
"vite": "^8.3.5",
3434
"vitest": "^5.0.3"
3535
},
3636
"browserslist": [

‎src/Web/Grand.SharedUIResources/adminapp/src/grid/param.test.js‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ const require = createRequire(import.meta.url)
77
let $
88

99
beforeAll(() => {
10-
//jquery 2.2.4, the version the panels load; with a global document the module is
10+
//jquery 3.7.1, the version the panels load; with a global document the module is
1111
//jQuery itself, without one it is a factory taking a window
1212
const jquery = require('jquery')
1313
$ = typeof jquery.param === 'function' ? jquery : jquery(window)
1414
})
1515

16+
//jQuery 3 writes a space as %20, jQuery 2 and the Kendo transports wrote '+', which param
17+
//keeps; the model binders decode both the same
18+
const jqueryParam = data => $.param(data).replace(/%20/g, '+')
19+
1620
const cases = {
1721
'read request with paging and additional data': {
1822
take: 15, skip: 15, page: 2, pageSize: 15,
@@ -43,13 +47,13 @@ const cases = {
4347
describe('param', () => {
4448
for (const [name, data] of Object.entries(cases)) {
4549
it(`matches jQuery.param: ${name}`, () => {
46-
expect(param(data)).toBe($.param(data))
50+
expect(param(data)).toBe(jqueryParam(data))
4751
})
4852
}
4953

5054
it('serializes an array of name/value pairs like jQuery', () => {
5155
const fields = [{ name: 'a', value: '1' }, { name: 'a', value: '2 3' }, { name: 'b', value: null }]
52-
expect(param(fields)).toBe($.param(fields))
56+
expect(param(fields)).toBe(jqueryParam(fields))
5357
})
5458

5559
it('returns an empty string for null', () => {

‎src/Web/Grand.SharedUIResources/wwwroot/administration/build/js/custom.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ if (typeof NProgress != 'undefined') {
494494
NProgress.start();
495495
});
496496

497-
$(window).load(function () {
497+
$(window).on('load', function () {
498498
NProgress.done();
499499
});
500500
}

‎src/Web/Grand.SharedUIResources/wwwroot/administration/build/js/jquery.min.js‎

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Web/Grand.SharedUIResources/wwwroot/administration/bundles/admin.bootstrap.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Web/Grand.SharedUIResources/wwwroot/administration/bundles/admin.grid.js‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Web/Grand.SharedUIResources/wwwroot/administration/bundles/admin.ui.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)