Skip to content
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

Fix push buttons and remove Push to Github flow #5720

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

Conversation

mamoodi
Copy link
Collaborator

@mamoodi mamoodi commented Dec 20, 2024

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Fix push buttons and remove Push to Github flow


Give a summary of what the PR does, explaining any non-trivial design decisions

This fixes two bugs:

  • When a repository is selected, it will show properly in the bottom right box
  • The Push to Branch and Push & Create PRs will only show up if you have connected to github and have a repository selected

This also removes:

  • The Push to Github button which was just an additional workflow but not necessary?

I'm not a react expert but I did test these scenarios:

  • User connected and repository selected -> Push buttons
  • User connected and no repository selected -> Download files
  • User disconnected -> Download files

Link of any specific issues this addresses
#5112

@mamoodi mamoodi requested a review from amanape December 20, 2024 20:54
@@ -27,7 +32,7 @@ export function ActionSuggestions({
onClose={handleDownloadClose}
isOpen={isDownloading}
/>
{gitHubToken ? (
{gitHubToken && selectedRepository ? (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change that fixes the push buttons

@@ -34,26 +30,6 @@ export function ProjectMenuCard({
setContextMenuIsOpen((prev) => !prev);
};

const handlePushToGitHub = () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the "Push to Github" button which was not necessary I don't think.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would show up after you already pushed and created a PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Don't believe so but not 100% sure. Originally this only showed up on local setup only...And it seems unnecessary. I'll wait for Stephan to comment.

Copy link
Member

Choose a reason for hiding this comment

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

This is found in the bottom right project card, after clicking the three dots. The options are "push to github" or "download zip"

It makes sense to remove it if we already display it in the chat interface

@@ -31,11 +29,6 @@ export function ProjectMenuCardContextMenu({
{t(I18nKey.PROJECT_MENU_CARD_CONTEXT_MENU$CONNECT_TO_GITHUB_LABEL)}
</ContextMenuListItem>
)}
{isConnectedToGitHub && (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also the "Push to github" button.

@@ -51,7 +47,6 @@ export const useWSStatusChange = () => {
let additionalInfo = "";

if (gitHubToken && selectedRepository) {
dispatch(clearSelectedRepository());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This here was clearing the selected repository. That's why the bottom right it was not showing the repository correctly. Is removing this okay? I tested it but don't know all the impacts.

I also needed to remove this because otherwise "selectedRepository" would be null and so the "Push" buttons would not show up correctly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ugh I was just hitting this too!

@@ -34,26 +30,6 @@ export function ProjectMenuCard({
setContextMenuIsOpen((prev) => !prev);
};

const handlePushToGitHub = () => {
Copy link
Member

Choose a reason for hiding this comment

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

This is found in the bottom right project card, after clicking the three dots. The options are "push to github" or "download zip"

It makes sense to remove it if we already display it in the chat interface

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