Repository navigation
chore: miscellaneous updates and improvements - #4530
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughSmall UI and template tweaks: explicit input types/constraints and phone/tel types, header meta and theme loading refactor, minor template spacing and locale tag changes, one-line license title capitalization fix, changelog update, and build task + dependency version bumps. ChangesSystem Modernization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
app/Views/configs/tax_config.php (1)
53-63:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMissing
stepattribute will block decimal tax rates.
type="number"has a step size of 1 by default; if a user tries to enter a decimal value (e.g.,8.25), it will be considered invalid by browser constraint validation. Tax rates like 8.25 %, 6.875 %, etc. are common, andto_tax_decimals()already signals that decimal values are expected. Withoutstep, the browser will reject decimal submissions before jQuery Validate even runs, breaking the form for any installation with a fractional tax rate.Add
'step' => 'any'(or a precision like'step' => '0.001') to both inputs:🐛 Proposed fix
<?= form_input([ 'type' => 'number', + 'step' => 'any', 'min' => '0', 'max' => '100', 'name' => 'default_tax_1_rate', ... ]) ?> ... <?= form_input([ 'type' => 'number', + 'step' => 'any', 'min' => '0', 'max' => '100', 'name' => 'default_tax_2_rate', ... ]) ?>Also applies to: 77-87
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/Views/configs/tax_config.php` around lines 53 - 63, The number inputs for tax rates (the form_input calls rendering 'default_tax_1_rate' and the similar 'default_tax_2_rate') lack a step attribute, which prevents entering decimal percentages; update both form_input configurations to include a 'step' key (e.g., 'step' => 'any' or a fixed precision like '0.001') so browsers accept fractional tax rates and match the to_tax_decimals() behavior.app/Views/configs/barcode_config.php (1)
206-213:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
barcode_num_in_rowis missingmin="1".Without a lower bound, the browser accepts 0 or negative values. The existing JS rule is
number: truewhich also doesn't enforce a minimum, so0barcodes-per-row could reach the server and produce a broken layout. Other numeric inputs in this form (e.g.,barcode_width,barcode_height) all carry explicitminconstraints — this one should too.🐛 Proposed fix
<?= form_input([ 'type' => 'number', + 'min' => '1', 'name' => 'barcode_num_in_row', ... ]) ?>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/Views/configs/barcode_config.php` around lines 206 - 213, The number input for barcode_num_in_row lacks a minimum constraint, allowing 0 or negative values; update the form_input call for 'barcode_num_in_row' (the input with name/id 'barcode_num_in_row' and class 'form-control input-sm required') to include a min="1" attribute so the browser enforces at least one barcode per row (and mirror any server-side validation as needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Views/login.php`:
- Line 14: The view uses $request (e.g., in the <html lang="<?=
$request->getLocale() ?>"> tag) before it is initialized, causing an undefined
variable error; move the $request initialization block (the code that
creates/assigns $request) from its duplicate location later in the file to
immediately after the file docblock/top of the view (following the pattern in
partial/header.php), and remove the duplicate initialization further down (lines
where $request is re-created) so $request is defined before any usage like
$request->getLocale().
---
Outside diff comments:
In `@app/Views/configs/barcode_config.php`:
- Around line 206-213: The number input for barcode_num_in_row lacks a minimum
constraint, allowing 0 or negative values; update the form_input call for
'barcode_num_in_row' (the input with name/id 'barcode_num_in_row' and class
'form-control input-sm required') to include a min="1" attribute so the browser
enforces at least one barcode per row (and mirror any server-side validation as
needed).
In `@app/Views/configs/tax_config.php`:
- Around line 53-63: The number inputs for tax rates (the form_input calls
rendering 'default_tax_1_rate' and the similar 'default_tax_2_rate') lack a step
attribute, which prevents entering decimal percentages; update both form_input
configurations to include a 'step' key (e.g., 'step' => 'any' or a fixed
precision like '0.001') so browsers accept fractional tax rates and match the
to_tax_decimals() behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2d1f40be-e086-4e08-97f0-7342e7cc7a5d
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
app/Controllers/Config.phpapp/Views/configs/barcode_config.phpapp/Views/configs/email_config.phpapp/Views/configs/info_config.phpapp/Views/configs/system_info.phpapp/Views/configs/tax_config.phpapp/Views/login.phpapp/Views/partial/header.phpgulpfile.jspackage.json
6c2b440 to
c1fa9db
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/Views/configs/email_config.php (1)
58-63:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winConstrain numeric inputs to valid integer ranges.
At Line 58 and Line 87,
type="number"is a good start, but it still permits invalid values (e.g., decimals/negatives). Please add integer/range constraints for SMTP semantics (especially port).Suggested patch
<?= form_input([ 'type' => 'number', + 'min' => '1', + 'max' => '65535', + 'step' => '1', 'name' => 'smtp_port', 'id' => 'smtp_port', 'class' => 'form-control input-sm', 'value' => $config['smtp_port'] ]) ?> @@ <?= form_input([ 'type' => 'number', + 'min' => '1', + 'step' => '1', 'name' => 'smtp_timeout', 'id' => 'smtp_timeout', 'class' => 'form-control input-sm', 'value' => $config['smtp_timeout'] ]) ?>Also applies to: 87-92
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/Views/configs/email_config.php` around lines 58 - 63, Add integer/range constraints to the numeric SMTP inputs (e.g., the 'smtp_port' form field and the similar block at lines 87-92) so the browser prevents decimals/negatives and enforces valid port semantics: update the form input attribute arrays for 'smtp_port' to include 'step' => '1', 'min' => '1', 'max' => '65535' and ensure the 'value' uses an integer cast (e.g., intval($config['smtp_port'])); apply the same changes to the other numeric SMTP field(s) referenced in the second block (add 'step', 'min', 'max' and integer-cast the value).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@app/Views/configs/email_config.php`:
- Around line 58-63: Add integer/range constraints to the numeric SMTP inputs
(e.g., the 'smtp_port' form field and the similar block at lines 87-92) so the
browser prevents decimals/negatives and enforces valid port semantics: update
the form input attribute arrays for 'smtp_port' to include 'step' => '1', 'min'
=> '1', 'max' => '65535' and ensure the 'value' uses an integer cast (e.g.,
intval($config['smtp_port'])); apply the same changes to the other numeric SMTP
field(s) referenced in the second block (add 'step', 'min', 'max' and
integer-cast the value).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a499c7e9-5a02-4a4d-91c8-44a2a6c912f8
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
app/Controllers/Config.phpapp/Views/configs/barcode_config.phpapp/Views/configs/email_config.phpapp/Views/configs/info_config.phpapp/Views/configs/system_info.phpapp/Views/configs/tax_config.phpapp/Views/login.phpapp/Views/partial/header.phpgulpfile.jspackage.json
✅ Files skipped from review due to trivial changes (3)
- gulpfile.js
- app/Controllers/Config.php
- app/Views/configs/info_config.php
🚧 Files skipped from review as they are similar to previous changes (5)
- package.json
- app/Views/partial/header.php
- app/Views/configs/barcode_config.php
- app/Views/login.php
- app/Views/configs/tax_config.php
objecttothis
left a comment
There was a problem hiding this comment.
Great work. Just the one change.
c1fa9db to
1271cd5
Compare
|
@BudsieBuds I think you just need to click "Resolve conversation" once you decide what you want to do with the getLocale() call in the view and it should unblock the merge. |
1271cd5 to
4242424
Compare
@objecttothis After looking into it a bit more, I decided to switch to |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Views/configs/tax_config.php`:
- Around line 54-57: postSaveTax() currently relies on client-side min/max and
parse_tax() but lacks server-side bounds checks; after calling parse_tax() for
default_tax_1_rate and default_tax_2_rate validate that each value is numeric
and within the inclusive range 0..100 (e.g., is_numeric/floatval and value >= 0
&& value <= 100), and if not return/raise a validation error (or add an error to
the existing validation flow) instead of saving; update the handler that
persists the taxes to reject out-of-range inputs and include a clear error
message mentioning the specific field names default_tax_1_rate and
default_tax_2_rate so invalid values are not stored.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cba95c79-df72-46db-9329-73614ff77bf7
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (13)
app/Controllers/Config.phpapp/Views/barcodes/barcode_sheet.phpapp/Views/configs/barcode_config.phpapp/Views/configs/email_config.phpapp/Views/configs/info_config.phpapp/Views/configs/system_info.phpapp/Views/configs/tax_config.phpapp/Views/login.phpapp/Views/partial/header.phpapp/Views/sales/quote_email.phpapp/Views/sales/work_order_email.phpgulpfile.jspackage.json
✅ Files skipped from review due to trivial changes (3)
- app/Views/sales/work_order_email.php
- app/Views/configs/info_config.php
- app/Views/barcodes/barcode_sheet.php
🚧 Files skipped from review as they are similar to previous changes (9)
- app/Views/sales/quote_email.php
- gulpfile.js
- app/Views/configs/system_info.php
- app/Views/login.php
- app/Views/configs/barcode_config.php
- app/Controllers/Config.php
- app/Views/configs/email_config.php
- app/Views/partial/header.php
- package.json
- reinstated 'update-licenses' task in gulp (accidentally removed in 3e844f2) - updated bootstrap, bootswatch, and various dev dependencies - refinded text across UI - applied consistency fixes - added 'number' and 'tel' input types to relevant settings - improved system info layout (still room for improvement, but better) - updated and fixed changelog
4242424 to
b7ce6d1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Views/sales/quote_email.php`:
- Line 18: The lang attribute uses unescaped output from
current_language_code(); update the template to pass that value through the
esc() output-escaping helper so the attribute becomes lang="<?=
esc(current_language_code()) ?>". Modify the HTML in quote_email.php by wrapping
the current_language_code() call with esc() (use the esc() helper around the
current_language_code() invocation) to ensure all output is escaped per project
guidelines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 36f16185-afc2-4c9d-b0d2-a13df6f15ece
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (14)
CHANGELOG.mdapp/Controllers/Config.phpapp/Views/barcodes/barcode_sheet.phpapp/Views/configs/barcode_config.phpapp/Views/configs/email_config.phpapp/Views/configs/info_config.phpapp/Views/configs/system_info.phpapp/Views/configs/tax_config.phpapp/Views/login.phpapp/Views/partial/header.phpapp/Views/sales/quote_email.phpapp/Views/sales/work_order_email.phpgulpfile.jspackage.json
✅ Files skipped from review due to trivial changes (7)
- app/Views/sales/work_order_email.php
- app/Controllers/Config.php
- app/Views/configs/barcode_config.php
- app/Views/configs/info_config.php
- app/Views/configs/email_config.php
- app/Views/barcodes/barcode_sheet.php
- package.json
🚧 Files skipped from review as they are similar to previous changes (5)
- app/Views/login.php
- app/Views/configs/tax_config.php
- app/Views/configs/system_info.php
- app/Views/partial/header.php
- gulpfile.js
|
@jekkos @objecttothis Could someone with admin access update the branch protection rules? The PR can’t be merged because Travis CI is still listed as a required check, but Travis is no longer running for this repository. GitHub is waiting for a status that will never be reported. Thanks! |
|
@BudsieBuds i have changed the protection rules and merged your changes. Btw I continued your work on bootstrap 5 in a new branch, but have not taken it further for now. I ran it through coderabbit and the agents fixed any issue they found. But no further validation was done |
Summary by CodeRabbit
New Features
Improvements
Chores
Documentation