Skip to content

fix(browse): when editor.hide publish is set, also hide publish for browse toolbar - #1245

Open
shsteimer wants to merge 14 commits into
mainfrom
hidepub
Open

fix(browse): when editor.hide publish is set, also hide publish for browse toolbar#1245
shsteimer wants to merge 14 commits into
mainfrom
hidepub

Conversation

@shsteimer

@shsteimer shsteimer commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

editor.hidePublish should work everywhere.

Related Issue

adobe/da-nx#664

should merge with adobe/da-nx#666

Motivation and Context

working with a customer who wants to globally disable publish and force everything through request publish. If we are gonna have the setting, should work everywhere. Eventually, in hlx6, we should probably deprecate the setting and rely on permissions to hide or disable the button.

How Has This Been Tested?

ran locally with aem sandbox.
With the related da-nx pr it hides for edit, canvas, and browse.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

shsteimer and others added 2 commits August 13, 2026 10:38
The bulk Publish action in the browse view's action bar had no
awareness of the editor.hidePublish org/site config, unlike the
edit view's da-title.js. Also switches editor.hidePublish/editor.path
reads to look up the config sheet by name ("data") first, falling
back to positional lookup, since getFirstSheet silently picks the
wrong sheet when the data rows aren't the first key in a multi-sheet
config.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tionbar

Co-Authored-By: Claude <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Aug 13, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@shsteimer shsteimer changed the title fix(browse): when editor.hide publish is set, also hide publish for browse toolbat. fix(browse): when editor.hide publish is set, also hide publish for browse toolbar Aug 13, 2026
Comment thread blocks/browse/da-browse/da-browse.js Outdated
const configs = await Promise.all(fetchDaConfigs({ org, site }));
const rows = configs.filter(Boolean).reverse().flatMap((c) => getFirstSheet(c) || []);
const rows = configs.filter(Boolean).reverse()
.flatMap((c) => getSheetByName(c, 'data') ?? getFirstSheet(c) ?? []);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

looks for data sheet first, falls back to first sheet if it doesn't exist. This was added because when testing against /aem-sandbox/block-collection there were already many config sheets, but no data sheet to add this to. so had to create the sheet and couldn't re-order.

Open to feedback if any issues anticipated with this change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

data It's pretty generic, but it's also there usually as the first one or the only one. For other configs flags we started using flags sheet. Maybe we check for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yea, mixed feelings on this. I needed it to test the feature because on http://localhost:3000/config#/aem-sandbox/block-collection/ there was no data sheet yet, but there were other sheets, and sheet editor doesn't allow re-ordering. The first sheet was actually the library sheet. Perhaps we revert this change, update sheets editor to allow sheet re-ordering, and (medium term) consider which configs should migrate to flags?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

data sheet becomes the new /etc/...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I decided to just revert this change for now. did some magic to re-order those sheet tabs so I could verify.

I know this was previously approved, but needs a new approve so I can merge with new changes (both here and da-nx pr, adobe/da-nx#666)

Comment thread blocks/edit/da-title/da-title.js Outdated
const configs = await Promise.all(fetchDaConfigs({ org, site }));
const configTab = configs.flatMap((config) => getFirstSheet(config) || []);
const configTab = configs.filter(Boolean)
.flatMap((config) => getSheetByName(config, 'data') ?? getFirstSheet(config) ?? []);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same here as above in terms of sheet resolution

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts:
#	blocks/browse/da-actionbar/da-actionbar.js
sharanyavinod
sharanyavinod previously approved these changes Aug 20, 2026
mockSiteConfig returned a headers-less plain object for every request,
including the HLX_ADMIN ping isHlx6() makes before the config fetch;
its headers.get() call then threw. mockConfig already special-cased
this ping URL — apply the same fix to mockSiteConfig.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
shsteimer and others added 2 commits September 1, 2026 10:54
…Publish

Reverts the getSheetByName fallback in da-browse.js/da-title.js 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>
createConnection opened a real y-websocket connection to admin.da.live,
letting the real socket's own close race the test's synthetic
connection-close emit and double-count refreshToken calls — flaky on
CI. Stub WebSocket like the rapid-reconnect describe block already does.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants