Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fixed some bugs with projects #7577

Merged
merged 1 commit into from
Feb 14, 2023
Merged

Fixed some bugs with projects #7577

merged 1 commit into from
Feb 14, 2023

Conversation

barankyle
Copy link
Member

@barankyle barankyle commented Feb 14, 2023

Summary

Some projects were not showing up as pushable even if the user had GH access to them. This was caused by not being the owner of the project and the project being saved with the '.git' suffix on the URL; the check for whether a user had push access solely through GH was not checking for projects that had the '.git' suffix on them. Made allowedRepos add a copy of the URL with the '.git' suffix before doing the findAll on projects.

Updated GITHUB_URL_REGEX to include a signature on the URL. This only really came up with projects that were present locally after a database reset, but it was breaking in that case. Since the signature is a capture group, everything that uses this regex now looks for data on index '2' from the exec instead of '1'.

Fixed an inconsistency in project patching return data. Client-side listener now expects params to be the project data, instead of an object with a 'project' child.

Fixed a bug with input text controlled by service state data. React's behavior is to set the selector to the end of an input if its value changes. This was causing some instances, like in project updating, to be very annoying to update through manual typing, since every character typed or deleted would jump to the end. Updated InputText to use a useEffect to reset the selector back to where it started.

A summary of changes being made in this PR

References

closes #insert number here

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewer

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Copy link
Member

@HexaField HexaField left a comment

Choose a reason for hiding this comment

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

Nice fixes.

Some projects were not showing up as pushable even if the user had GH access to them. This was caused by
not being the owner of the project and the project being saved with the '.git' suffix on the URL; the
check for whether a user had push access solely through GH was not checking for projects that had the
'.git' suffix on them. Made allowedRepos add a copy of the URL with the '.git' suffix before doing
the findAll on projects.

Updated GITHUB_URL_REGEX to include a signature on the URL. This only really came up with projects that
were present locally after a database reset, but it was breaking in that case. Since the signature is
a capture group, everything that uses this regex now looks for data on index '2' from the exec instead
of '1'.

Fixed an inconsistency in project patching return data. Client-side listener now expects params to
be the project data, instead of an object with a 'project' child.

Fixed a bug with input text controlled by service state data. React's behavior is to set the selector
to the end of an input if its value changes. This was causing some instances, like in project updating,
to be very annoying to update through manual typing, since every character typed or deleted would jump
to the end. Updated InputText to use a useEffect to reset the selector back to where it started.
@barankyle barankyle added this pull request to the merge queue Feb 14, 2023
Merged via the queue into dev with commit 7449c8b Feb 14, 2023
@barankyle barankyle deleted the 7530-admin-project-push branch February 14, 2023 19:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Admins cannot push project to GitHub if they are not the owner
2 participants