Conversation
Mirrors da-live's da-title.js filterActions(): fetches org/site DA config docs on hash change, ORs any editor.hidePublish rows, and drops publish from the Send button's menu items when the current document's fullpath starts with a configured prefix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
getFirstSheet grabs whichever sheet is positionally first, which silently breaks if a config doc has multiple sheets and "data" isn't first. Look up the "data" sheet by name and only fall back to positional lookup if it doesn't exist. Co-Authored-By: Claude <noreply@anthropic.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
|
…ublish Reverts the getSheetByName fallback back to plain getFirstSheet; better multi-sheet config lookup will be tackled separately. The editor.hidePublish feature itself is unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
||
| update(changed) { | ||
| super.update(changed); | ||
| if (changed.has('_hashState') && this._hashState) this._filterHidePublish(); |
There was a problem hiding this comment.
_filterHidePublish is fired from update() without a catch, so a config fetch failure is an unhandled rejection. please wrap it and default _hidePublish to false on error
| const configs = await Promise.all(fetchDaConfigs({ org, site })); | ||
| const configTab = configs.flatMap((config) => getFirstSheet(config) || []); | ||
| const publishConfigs = configTab.filter((c) => c.key === 'editor.hidePublish'); | ||
| this._hidePublish = publishConfigs.some((c) => fullpath.startsWith(c.value)); |
There was a problem hiding this comment.
should we guard against an empty editor.hidePublish value? right now a blank row hides publish everywhere via startsWith('').
| const configs = await Promise.all(fetchDaConfigs({ org, site })); | ||
| const configTab = configs.flatMap((config) => getFirstSheet(config) || []); | ||
| const publishConfigs = configTab.filter((c) => c.key === 'editor.hidePublish'); | ||
| this._hidePublish = publishConfigs.some((c) => fullpath.startsWith(c.value)); |
There was a problem hiding this comment.
nit: _shouldHidePublish reads truer to a boolean (it mirrors the config key, so up to you).
Wrap config fetch in try/catch, exclude empty editor.hidePublish values, and extract a pure shouldHidePublish helper. Co-Authored-By: Claude <noreply@anthropic.com>
|
@anfibiacreativa appreciate the review. Agree that changing name from filter->should is better, but I don't like Other updates made to handle errors and empty values. |
Mirrors da-live's da-title.js filterActions(): fetches org/site DA config docs on hash change, ORs any editor.hidePublish rows, and drops publish from the Send button's menu items when the current document's fullpath starts with a configured prefix.
Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):
Fix #664
https://feature-ew-actions-hide-publish--da-nx--adobe.aem.live/
should merge with adobe/da-live#1245