Skip to content

Refactor var to const/let in admin/system + log search multi-term (4/4)#3303

Merged
Mips2648 merged 2 commits intojeedom:developfrom
limad:refactor/var-to-const-admin
May 6, 2026
Merged

Refactor var to const/let in admin/system + log search multi-term (4/4)#3303
Mips2648 merged 2 commits intojeedom:developfrom
limad:refactor/var-to-const-admin

Conversation

@limad
Copy link
Copy Markdown
Contributor

@limad limad commented Apr 28, 2026

Summary

Fourth of four migration PRs splitting #3297 by functional domain. This batch covers 12 admin/system files plus the multi-term log search refactor from #3270:

user.class.js     plugin.class.js   log.class.js
config.class.js   cron.class.js     backup.class.js
update.class.js   recovery.class.js report.class.js
note.class.js     interact.class.js appMobile.class.js
desktop/js/log.js  (incorporates #3270)

Log search multi-term (#3270)

desktop/js/log.js adopts the multi-term search refactor proposed in #3270, but with const/let rather than var. The search input now accepts comma-separated terms with per-term :not() exclusion:

  • error — single term (unchanged behavior)
  • error,warning — match any of the terms
  • :not(debug) — exclude single term
  • error,:not(daemon) — match error OR exclude daemon

No incidental fixes in this batch

All files in this batch follow the uniform AJAX boilerplate pattern, so the migration is purely mechanical (varconst for never-reassigned, let for the rest).

Test plan

  • Open the Logs page — verify the log list and selection works
  • Search a log file using the new multi-term syntax (error,warning, :not(debug)) — verify highlighting
  • Open Administration → Backup, Cron, Update, Health — verify each tab loads
  • Open the User management page — verify user list and edit modal
  • Open the Interactions page — type a query — verify response
  • Open the Plugin marketplace — install/update flow remains functional
  • Verify in mobile mode (?v=m) that the dashboard still renders (appMobile.class.js)

Part of the split following #3297 discussion. After this PR lands, all core/js/*.js files use const/let exclusively, and the ESLint workflow from #3299 can be tightened to enforce no-var and prefer-const permanently.

Migration of `var` declarations to `const`/`let` in 12 files handling
admin/system flows: user, plugin, log, config, cron, backup, update,
recovery, report, note, interact, appMobile.

Also incorporates the multi-term log search refactor proposed in jeedom#3270
(desktop/js/log.js), with `const`/`let` instead of `var`. Search now
supports comma-separated terms with per-term `:not()` exclusion, e.g.
`error,warning` or `error,:not(daemon)`.
@Mips2648 Mips2648 added the changelog-dev Use to generate release notes / changelog To be apply on PR label May 5, 2026
@Mips2648 Mips2648 requested review from Salvialf and zoic21 May 5, 2026 13:05
Comment thread desktop/js/log.js Outdated
@Mips2648 Mips2648 added this to the 4.6 milestone May 5, 2026
Extract multi-term search feature from this refactoring PR.
Keep only the mechanical var→const/let migration for log.js:
- var logfile → const logfile
- var log → const log
- var search → let search (reassigned)
- var not → const not
- var match, text → let match / const text (block-scoped in forEach)
- var _target → let _target

The multi-term comma-separated search with :not() exclusion
will be proposed in a dedicated feature PR.
@Mips2648 Mips2648 merged commit e1aa292 into jeedom:develop May 6, 2026
9 checks passed
@Mips2648 Mips2648 added changelog-other Use to generate release notes and removed Ready to merge Need review changelog-dev Use to generate release notes / changelog To be apply on PR labels May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-other Use to generate release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants