Consolidate refill store details output with first-win logic#418
Open
Consolidate refill store details output with first-win logic#418
Conversation
… logic Extract PlaceNotes component to unify the what3words URL-to-display round-trip that was duplicated across two pages. Simplify getNotes regex handling with replaceAll to fix a latent global regex lastIndex bug. Add getRefillPlaceDetails which takes the first available value for each detail type (phone, website, notes, opening hours) instead of aggregating all sub-locations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tors Refill places only ever show one note, so use `note: string | undefined` instead of `notes: string[]` to express this in the type. Fix E2E mock telephone numbers to use digit-only format matching getPhoneNumbers output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ EDITORCONFIG | editorconfig-checker | 8 | 0 | 0 | 0.04s | |
| ✅ REPOSITORY | checkov | yes | no | no | 28.69s | |
| gitleaks | yes | 6 | no | 6.35s | ||
| ✅ REPOSITORY | git_diff | yes | no | no | 0.04s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 3.35s | |
| ✅ REPOSITORY | syft | yes | no | no | 9.29s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 5.59s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 105.73s | |
| ✅ TSX | eslint | 3 | 0 | 0 | 7.42s | |
| ✅ TYPESCRIPT | eslint | 5 | 0 | 0 | 12.03s |
Detailed Issues
⚠️ REPOSITORY / gitleaks - 6 errors
○
│╲
│ ○
○ ░
░ gitleaks
Finding: VITE_MARKER_KEY: REDACTED
Secret: REDACTED
RuleID: generic-api-key
Entropy: 3.553509
File: .github/workflows/deploy.yml
Line: 37
Commit: HIDDEN_BY_MEGALINTERAuthor: Dan Webb
Email: dan@etch.co
Date: 2024-04-24T11:48:15Z
Fingerprint: 2c76e7174c25cd560f5bceb4c095e253417e0634:.github/workflows/deploy.yml:generic-api-key:37
Link: https://github.com/etchteam/recycling-locator/blob/2c76e7174c25cd560f5bceb4c095e253417e0634/.github/workflows/deploy.yml#L37
Finding: VITE_MARKER_KEY: REDACTED
Secret: REDACTED
RuleID: generic-api-key
Entropy: 3.553509
File: .github/workflows/deploy.yml
Line: 39
Commit: HIDDEN_BY_MEGALINTERAuthor: Dan Webb
Email: dan@etch.co
Date: 2024-03-16T16:55:19Z
Fingerprint: 1556c5d76bf2feb9f1745484fa07fae4ea6fac75:.github/workflows/deploy.yml:generic-api-key:39
Link: https://github.com/etchteam/recycling-locator/blob/1556c5d76bf2feb9f1745484fa07fae4ea6fac75/.github/workflows/deploy.yml#L39
Finding: MARKER_KEY: REDACTED
Secret: REDACTED
RuleID: generic-api-key
Entropy: 3.553509
File: .github/workflows/deploy.yml
Line: 37
Commit: HIDDEN_BY_MEGALINTERAuthor: Dan Webb
Email: dan@etch.co
Date: 2024-03-12T05:46:34Z
Fingerprint: edb2bd3b00e33ba9eef6326d3c8cd6a657649c68:.github/workflows/deploy.yml:generic-api-key:37
Link: https://github.com/etchteam/recycling-locator/blob/edb2bd3b00e33ba9eef6326d3c8cd6a657649c68/.github/workflows/deploy.yml#L37
Finding: ...E_PACKAGE_VERSION=1 VITE_HERE_MAPS_PLACES_KEY=REDACTED npm run build
Secret: REDACTED
RuleID: generic-api-key
Entropy: 4.693479
File: .github/workflows/ci.yml
Line: 69
Commit: HIDDEN_BY_MEGALINTERAuthor: Dan Webb
Email: dan@etch.co
Date: 2024-02-24T21:21:34Z
Fingerprint: 80649ba25c2a8f92eb7825b81355d08292efa0c8:.github/workflows/ci.yml:generic-api-key:69
Link: https://github.com/etchteam/recycling-locator/blob/80649ba25c2a8f92eb7825b81355d08292efa0c8/.github/workflows/ci.yml#L69
Finding: ...E_PACKAGE_VERSION=1 VITE_HERE_MAPS_PLACES_KEY=REDACTED npm test
Secret: REDACTED
RuleID: generic-api-key
Entropy: 4.693479
File: .github/workflows/ci.yml
Line: 73
Commit: HIDDEN_BY_MEGALINTERAuthor: Dan Webb
Email: dan@etch.co
Date: 2024-02-24T12:01:19Z
Fingerprint: 82ebd091a8e8fd8e381d88003189fff7c22f8555:.github/workflows/ci.yml:generic-api-key:73
Link: https://github.com/etchteam/recycling-locator/blob/82ebd091a8e8fd8e381d88003189fff7c22f8555/.github/workflows/ci.yml#L73
Finding: ...E_PACKAGE_VERSION=1 VITE_HERE_MAPS_PLACES_KEY=REDACTED npm test
Secret: REDACTED
RuleID: generic-api-key
Entropy: 4.693479
File: .github/workflows/ci.yml
Line: 73
Commit: HIDDEN_BY_MEGALINTERAuthor: Dan Webb
Email: dan@etch.co
Date: 2024-02-24T11:56:43Z
Fingerprint: 219c47440fa90bc250dcb661929edcaf69f8c33b:.github/workflows/ci.yml:generic-api-key:73
Link: https://github.com/etchteam/recycling-locator/blob/219c47440fa90bc250dcb661929edcaf69f8c33b/.github/workflows/ci.yml#L73
4:14PM INF 1321 commits scanned.
4:14PM INF scanned ~8012667 bytes (8.01 MB) in 5.85s
4:14PM WRN leaks found: 6
See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

Show us your support by starring ⭐ the repository
Use startsWith for stricter what3words URL matching to satisfy CodeQL, replace non-literal RegExp with stringContaining, and fix prettier formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The refill data comes from suppliers who stock the same store, so the store details like the website will always be the same. In the admin any of the locations within the property could contain the info we need or in the spreadsheet any one of the suppliers could have provided the info. So getRefillPlaceDetails takes the first available value for each detail type (phone, website, notes, opening hours) instead of aggregating all sub-locations.
This also extracts a PlaceNotes component to unify the what3words URL-to-display round-trip that was duplicated across two pages and simplifies getNotes regex handling with replaceAll to fix a global regex lastIndex bug. Add getRefillPlaceDetails which takes the first available value for each detail type (phone, website, notes, opening hours) instead of aggregating all sub-locations.