Skip to content

fix: Unify version display for public and private designs #1081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zihanKuang
Copy link

Notes for Reviewers

This PR fixes: https://github.com/layer5io/meshery-cloud/issues/3585

Reason

There are three relevant states for a design: private, public, and published. The private and public states should both reflect the current draft's version number, which is stored in the version field. Only a published design should display the published_version.

The bug was that the UI was incorrectly displaying the published_version for designs that were set to public. This created problems:

  1. Inconsistent Versions: If a public design had no published_version, the UI would show an incorrect fallback value (like 0.0.0 or "").
  2. Wrong Versions: If a public design has a published_version, the UI would show an incorrect value.

Fix

20250617_200454.mp4

Signed-off-by: Zihan Kuang <zihan_kuang@outlook.com>
@zihanKuang zihanKuang requested a review from FaheemOnHub June 17, 2025 20:26
@@ -61,7 +61,7 @@ export const handleImage = async ({
export const DEFAULT_DESIGN_VERSION = '0.0.0';

export const getVersion = (design: Pattern) => {
if (design.visibility === 'public') {
if (design.visibility === 'published') {
Copy link
Member

Choose a reason for hiding this comment

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

In the event that the design is "public", what happens? @zihanKuang

Copy link
Member

Choose a reason for hiding this comment

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

Where is "private" handled?

Copy link
Author

Choose a reason for hiding this comment

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

Previously, if the design was public, it would display the published_version. After the changes, only published designs will show published_version. Public designs will now display their regular version

For private designs, they were already displaying the correct version. With the new logic, they now fall through the if condition and also display their version from within the try block.

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.

2 participants