Skip to content

Hide cloud edit entries without access#9617

Open
nishantmonu51 wants to merge 1 commit into
mainfrom
edit_button_hide
Open

Hide cloud edit entries without access#9617
nishantmonu51 wants to merge 1 commit into
mainfrom
edit_button_hide

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

Summary

  • Hide the org-home project card Edit action unless cloud editing is enabled for that project and the user can manage dev deployments
  • Avoid mounting the edit branch dialog when editing is unavailable
  • Hide branch Open editor actions without the same cloud-editing/manage-dev access

Testing

  • npx prettier --check web-admin/src/features/projects/ProjectCard.svelte web-admin/src/features/projects/ProjectCardActions.svelte web-admin/src/features/branches/BranchesSection.svelte
  • git diff --check
  • npx svelte-check --workspace web-admin --tsconfig ./tsconfig.json --output machine 2>&1 | rg 'ProjectCard\.svelte|ProjectCardActions\.svelte|BranchesSection\.svelte'\n- npm run check -w web-admin (fails on existing repo-wide diagnostics unrelated to these files: 594 errors in 151 files)

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 tightens UI gating around cloud editing actions so that edit-related controls only appear (and related dialogs only mount) when cloud editing is enabled and the user has manageDev permissions for the project.

Changes:

  • Hide the Project Card “Edit” dropdown item unless cloud editing is enabled for the project and the user can manage dev deployments.
  • Prevent the edit-branch dialog from mounting when editing is not allowed.
  • Restrict branch “Open editor” actions to the same cloud-editing + manageDev permission checks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
web-admin/src/features/projects/ProjectCardActions.svelte Adds a canEdit gate to conditionally render the Edit dropdown item.
web-admin/src/features/projects/ProjectCard.svelte Computes per-project cloud-editing eligibility and avoids mounting the edit dialog when ineligible.
web-admin/src/features/branches/BranchesSection.svelte Gates “Open editor” actions behind cloud-editing + manageDev and hardens transitory-status polling against undefined statuses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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