Skip to content

fix: save workflow button not visible on dev env#14910

Merged
CarinaWolli merged 5 commits intocalcom:mainfrom
mhetreayush:save-workflow-button-not-visible-on-dev-env
May 9, 2024
Merged

fix: save workflow button not visible on dev env#14910
CarinaWolli merged 5 commits intocalcom:mainfrom
mhetreayush:save-workflow-button-not-visible-on-dev-env

Conversation

@mhetreayush
Copy link
Contributor

@mhetreayush mhetreayush commented May 7, 2024

What does this PR do?

This PR renders the "Save" button in edit/create-workflow flow on the development environment.

Fixes #14909

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  1. Click on "Workflows" in the sidebar
  2. Click "+ Create a workflow" or edit a workflow.
  3. On the top right corner, the "Save" button should be visible.
image

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@vercel
Copy link

vercel bot commented May 7, 2024

@mhetreayush is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot requested a review from a team May 7, 2024 06:13
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label May 7, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@dosubot dosubot bot added workflows area: workflows, automations 🐛 bug Something isn't working labels May 7, 2024
@graphite-app
Copy link

graphite-app bot commented May 7, 2024

Graphite Automations

"Add community label" took an action on this PR • (05/07/24)

1 label was added to this PR based on Keith Williams's automation.

"Add consumer team as reviewer" took an action on this PR • (05/07/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@CLAassistant
Copy link

CLAassistant commented May 7, 2024

CLA assistant check
All committers have signed the CLA.

hideHeadingOnMobile
heading={
session.data?.hasValidLicense &&
(IS_DEV || session.data?.hasValidLicense) &&
Copy link
Member

Choose a reason for hiding this comment

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

We don't need the IS_DEV check. We an always show the save button, all we need is the banner

Copy link
Contributor Author

@mhetreayush mhetreayush May 7, 2024

Choose a reason for hiding this comment

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

This was added because:

  1. On the local environment, session.data?.hasValidLicense evaluates to false, hence making the heading prop undefined.
  2. The shell component only renders the CTA if the heading is defined.
  3. Hence, in order to pass in the heading, this check was added.

reference: https://github.com/mhetreayush/cal.com/blob/22ccb69c6e5ba5d6ea24b24bd2535b2677abe8d9/packages/features/shell/Shell.tsx#L1030-L1066

And wrapping the complete component inside the changes the UI, making it look like this:
image

If this is okay, we can remove the complete check: IS_DEV || session.data?.hasValidLicense and render the save button regardless of the validLicense

Or

We can just remove the hasValidLicense check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CarinaWolli Let me know what you think about this.

Copy link
Member

Choose a reason for hiding this comment

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

we can remove the complete IS_DEV || session.data?.hasValidLicense check. I'd love to make it look the same as for routing forms:
Screenshot 2024-05-08 at 10 57 16 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing

@keithwillcode keithwillcode added this to the v4.1 milestone May 8, 2024
@mhetreayush
Copy link
Contributor Author

mhetreayush commented May 8, 2024

@CarinaWolli Fixed with 557ae4c

image

Also fixed it on the /workflows page:

  • Initial:
image
  • With fix:
image

@mhetreayush mhetreayush requested a review from CarinaWolli May 8, 2024 16:07
@mhetreayush
Copy link
Contributor Author

Let me know if the changes look good @CarinaWolli

Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

Changes look good now, thank you 🙏

@CarinaWolli CarinaWolli enabled auto-merge (squash) May 9, 2024 17:28
@CarinaWolli CarinaWolli merged commit 097a69d into calcom:main May 9, 2024
@mhetreayush mhetreayush deleted the save-workflow-button-not-visible-on-dev-env branch May 10, 2024 03:04
p6l-richard pushed a commit to p6l-richard/cal.com-fork that referenced this pull request Jul 22, 2024
* fix: save workflow button not visible on dev env

* refactor: use the CALCOM_ENV constant

* fix: ui fix for header on workspace pages

* refactor: remove unused variable

---------

Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync workflows area: workflows, automations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "Save Workflow" button is not visible on development environment

4 participants