rlei-odes opened a new pull request, #44024:
URL: https://github.com/apache/superset/pull/44024
### SUMMARY
Follow-up to #44020, which corrected the Handlebars helper reference on the
`Next` docs. The same page is versioned for 6.1.0 at
`docs/user_docs_versioned_docs/version-6.1.0/using-superset/handlebars-chart.mdx`,
and that copy was byte-identical to the pre-fix version — so it still lists
the
nine helpers that are not registered, and 6.1.0 is the version most readers
are
currently on.
The change is the same fix applied to the versioned copy. The diff is
identical
to the one merged in #44020, line for line.
The fix is valid for 6.1.0 rather than merely copied forward: the helper set
comes from the plugin's dependencies, and those are unchanged between the
6.1.0
tag and master —
```
$ git show
6.1.0:superset-frontend/plugins/plugin-chart-handlebars/package.json
"handlebars-group-by": "^1.0.1",
"just-handlebars-helpers": "^1.0.19"
```
`HandlebarsViewer.tsx` at the 6.1.0 tag registers the same custom helpers the
page documents (`dateFormat`, `stringify`, `formatNumber`, `parseJson`) and
calls
`HandlebarsGroupBy.register`, so the `groupBy` → `group` correction and the
`by="..."` hash-argument syntax apply there too.
`version-6.0.0` has no `handlebars-chart` page, so nothing is needed there.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable — documentation only.
### TESTING INSTRUCTIONS
The corrected names were checked against the registry the plugin actually
builds,
at the dependency versions 6.1.0 ships:
```bash
cd superset-frontend/plugins/plugin-chart-handlebars
node -e "
const hb = require('handlebars');
require('just-handlebars-helpers').registerHelpers(hb);
require('handlebars-group-by').register(hb);
for (const n of
['add','subtract','multiply','divide','round','capitalize','truncate','contains','groupBy'])
{
console.log((n in hb.helpers ? 'YES ' : 'NO ') + n);
}
for (const n of
['sum','difference','multiplication','division','capitalizeFirst','capitalizeEach','excerpt','includes','group'])
{
console.log((n in hb.helpers ? 'YES ' : 'NO ') + n);
}
"
```
The first list prints `NO` for all nine; the second prints `YES` for all
nine.
To confirm this PR carries exactly the merged change and nothing else:
```bash
git show <merge-commit-of-44020> --
docs/docs/using-superset/handlebars-chart.mdx \
| grep -E '^[+-]' | grep -v '^[+-][+-]' | md5sum
git show HEAD --
docs/user_docs_versioned_docs/version-6.1.0/using-superset/handlebars-chart.mdx
\
| grep -E '^[+-]' | grep -v '^[+-][+-]' | md5sum
```
Both print the same hash.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]