Skip to content

Allow renaming project #18630

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 1 commit into from
Sep 4, 2023
Merged

Allow renaming project #18630

merged 1 commit into from
Sep 4, 2023

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Aug 31, 2023

Description

Allows to rename a project in the prject settings.
Removes the obsolete Project#slug property

Summary generated by Copilot

🤖 Generated by Copilot at 94c9882

This pull request removes the slug field from the project and team objects and protocols, and replaces it with the name field as the primary identifier. This simplifies the project and team models and avoids potential conflicts or inconsistencies with the slug field. It also adds a feature to the dashboard that allows users to change the project name. It affects several files in the components directory, including TypeScript, Go, and proto files.

Related Issue(s)

Fixes EXP-529

How to test

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

@gtsiolis
Copy link
Contributor

gtsiolis commented Sep 1, 2023

Looking at UX changes now! 👀

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Flawless. 💯

It's nice to see how easy we can reuse existing patterns like this one. 😃

Looks shippable! :shipit:

<TextInputField
hint="The name can be up to 32 characters long."
value={projectName}
error={badProjectName}
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Thanks for adding the validation here! 🐈

<Heading2>Project Name</Heading2>
<form onSubmit={updateProjectName}>
<TextInputField
hint="The name can be up to 32 characters long."
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Help text look useful, but is needed here all the time? Since we catch this with the validation anyway, thoughts on dropping the help text all together?

@@ -34,10 +38,30 @@ export default function ProjectSettingsView() {
const { setProject } = useContext(ProjectContext);
const { project } = useCurrentProject();
const [showRemoveModal, setShowRemoveModal] = useState(false);
const [projectName, setProjectName] = useState(project?.name || "");
let badProjectName = projectName.length > 0 ? undefined : "Project name can not be blank.";
if (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.

Should not we have it rather on server that it is aligned among all clients? Is it enforced by DB?

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

I did not try, code wise looks good. Not sure about 32 limit, it is 255 in DB, and we don't enforce it server-sider.

remove project#slug
@roboquat roboquat merged commit 71912f7 into main Sep 4, 2023
@roboquat roboquat deleted the se/rename-project branch September 4, 2023 07:42
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.

4 participants