Skip to content

Adding name form to repository config detail page #18943

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

Merged
merged 8 commits into from
Oct 19, 2023

Conversation

selfcontained
Copy link
Contributor

@selfcontained selfcontained commented Oct 17, 2023

Description

Getting some foundation pieces in there for the repository config detail page. We need to build a get project by id api endpoint, so I have this stubbed in an innefficient way that loads all projects and finds the match from there to temporarily unblock building out some of this UI.

I've added the form to update the name as well to get some functionality stubbed out as well there.

image

Summary generated by Copilot

🤖 Generated by Copilot at 3ea4b4f

This pull request introduces projects as a new concept for configuring repositories in teams or organizations. It adds custom hooks and form components to fetch and update project data from the public API, and improves the UI of the RepositoryDetail component.

Related Issue(s)

How to test

  • Until Setup data loading for repos list #18935 is merged you'll need to create a new Project with the existing Projects view.
    • Once it's merged you can use the Repositories link in the org menu and create a new project from there.
  • Load the detail view by adjusting the URL to be /repositories/:id
  • You should see the name and be able to update it.
  • For now that's all that needs to be verified here.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@selfcontained
Copy link
Contributor Author

/unhold

@selfcontained selfcontained force-pushed the brad/repository-detail-name branch from e1026d5 to dc9b33f Compare October 17, 2023 23:18
@selfcontained
Copy link
Contributor Author

/hold

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved this into the project-queries file - feels kind nice having related queries co-located so thought I’d give it a try.

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

const updateProject = useUpdateProject();
const [projectName, setProjectName] = useState(project.name);

const nameError = useOnBlurError("Sorry, this name is too long.", projectName.length <= 32);
Copy link
Member

Choose a reason for hiding this comment

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

It may be good to trim the name here to make sure we are not counting trailing or leading white spaces as part of the limit. I think we should do this in the mutation too – there is another bug in there with these pesky characters.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ll plan on handling this in a follow up (or feel free to while I’m out).

@selfcontained
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 1cdab1b into main Oct 19, 2023
@roboquat roboquat deleted the brad/repository-detail-name branch October 19, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants