Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Conversation

@ocket8888
Copy link
Contributor

This adds some linting rules for templates in TPv2. Right now, it's spitting out a bunch of warnings, which might be disabled entirely in the future (each one has an accompanying rationale in the configuration file). It also makes the code compliant with the linting rules. The biggest change is just that all buttons now must have an explicit type attribute - even when using the implicit default submit type. That helps catch buttons that shouldn't be submit type, but also buttons incorrectly used as links etc.


Which Traffic Control components are affected by this PR?

  • Traffic Portal (experimental v2)

What is the best way to verify this PR?

Make sure the code passes the new linting rules (albeit with warnings)

PR submission checklist

  • This PR has tests
  • This PR doesn't need documentation
  • This PR doesn't need a CHANGELOG.md entry
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY

@ocket8888 ocket8888 added low impact affects only a small portion of a CDN, and cannot itself break one tech debt rework due to choosing easy/limited solution Traffic Portal v2 Related to the experimental Traffic Portal version 2 labels Apr 24, 2023
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #7462 (f393269) into master (6d6876c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master    #7462   +/-   ##
=========================================
  Coverage     65.43%   65.44%           
  Complexity       98       98           
=========================================
  Files           305      305           
  Lines         11616    11621    +5     
  Branches        788      790    +2     
=========================================
+ Hits           7601     7605    +4     
- Misses         3667     3669    +2     
+ Partials        348      347    -1     
Flag Coverage Δ
traffic_portal_v2 76.42% <100.00%> (+<0.01%) ⬆️
unit_tests 76.42% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../src/app/core/currentuser/currentuser.component.ts 96.92% <100.00%> (+0.25%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@rimashah25 rimashah25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change looks good to me.
I tried to test the changes on local to ensure buttons and anchors are still doing what they are supposed to and I am unable to login since login button is not working. So, I can't test any other buttons.

@ocket8888 ocket8888 force-pushed the tpv2/template-lint branch 2 times, most recently from 664561c to ce3946e Compare April 28, 2023 18:07
@ocket8888 ocket8888 force-pushed the tpv2/template-lint branch from ce3946e to f393269 Compare May 2, 2023 16:13
Copy link
Contributor

@rimashah25 rimashah25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested locally button/link changes for login/users/physicalLocations/server/cachegroup. Unable to test deliveryservice or anything related to it.

@rimashah25 rimashah25 merged commit b96f7d3 into apache:master May 3, 2023
@ocket8888 ocket8888 deleted the tpv2/template-lint branch May 3, 2023 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

low impact affects only a small portion of a CDN, and cannot itself break one tech debt rework due to choosing easy/limited solution Traffic Portal v2 Related to the experimental Traffic Portal version 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants