Skip to content

DYN-6107: Disable publish online option for non package owner#17200

Merged
jasonstratton merged 3 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-6107-Disable-publish-online-option-for-non-package-owner
Jun 30, 2026
Merged

DYN-6107: Disable publish online option for non package owner#17200
jasonstratton merged 3 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-6107-Disable-publish-online-option-for-non-package-owner

Conversation

@ivaylo-matov

@ivaylo-matov ivaylo-matov commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Purpose

Blocked by PackagePublishWizard#75 - the @dynamods/dynamo-pm-wizard@0.0.28 npm package must be published before this PR can build successfully.

This PR aims to address DYN-6107: Pass package maintainers list to the Package Manager Wizard frontend so it can disable the "Publish Online" option for users who are not owners of the package.

Previously, when a non-owner opened the Publish Package dialog for a locally installed package, the "Publish Online" button was active but would error on click. The backend had no way to communicate ownership to the wizard frontend.

Key changes:

  • SendPackageUpdates in PackageManagerWizard.xaml.cs now includes a maintainers array (objects with _id and username) in the receiveUpdatedPackageDetails payload. The data comes from the PackageHeader already fetched by TryGetPackageHeaderAsync - no additional network call.
  • Bumped PackageManagerWizard npm package version in DynamoCoreWpf.csproj to pick up the frontend changes that consume the new field.
DYN-6107-Fix

Declarations

Check these if you believe they are true

Release Notes

The Publish Online button in Package Manager is now disabled for non package owners(maintainers).

Reviewers

@DynamoDS/eidos
@jasonstratton
@johnpierson

FYIs

@dnenov

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-6107

Copilot AI left a comment

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.

Pull request overview

This PR updates the Package Manager Wizard bridge layer so the wizard frontend can determine whether the current user is a package owner/maintainer and disable the Publish Online action accordingly, avoiding an error-only-on-click experience.

Changes:

  • Adds maintainers to the receiveUpdatedPackageDetails payload built in SendPackageUpdates.
  • Bumps the PackageManagerWizard npm package version to pull in the corresponding frontend behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/DynamoCoreWpf/Views/PackageManager/Components/PackageManagerWizard/PackageManagerWizard.xaml.cs Extends the JSON payload sent to the wizard WebView to include maintainers from the package header.
src/DynamoCoreWpf/DynamoCoreWpf.csproj Updates the wizard frontend package version to consume the new payload field.

Comment on lines +557 to +559
payloadObj["maintainers"] = header.maintainers != null
? JToken.FromObject(header.maintainers, jsonSerializer)
: new JArray();

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.

Addressed in 90de88f

@jasonstratton jasonstratton self-requested a review June 30, 2026 16:51
Ensure safe payload defaults so the frontend always has a consistent shape
@sonarqubecloud

Copy link
Copy Markdown

@jasonstratton jasonstratton left a comment

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.

LGTM — the Copilot fix lands correctly. Minor cosmetic notes (the pattern-match is always true given how is built, and there's a small indentation inconsistency on the ternary), but nothing that affects correctness. Ship it.

@jasonstratton jasonstratton left a comment

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.

LGTM — the Copilot fix lands correctly. Minor cosmetic notes (the payloadObj pattern-match is always true given how rootObj is built, and there is a small indentation inconsistency on the versions ternary), but nothing that affects correctness. Ship it.

@jasonstratton

Copy link
Copy Markdown
Contributor

Ha! Claude approved and added that last comment. It does not sound like me at all.

Still, approved! Merging now.

@jasonstratton jasonstratton merged commit f1fade9 into DynamoDS:master Jun 30, 2026
25 of 30 checks passed
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.

3 participants