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

Renaming project in GUI #10243

Merged
merged 14 commits into from
Jun 21, 2024
Merged

Renaming project in GUI #10243

merged 14 commits into from
Jun 21, 2024

Conversation

farmaazon
Copy link
Contributor

Pull Request Description

Fixes #10073

Screencast.from.2024-06-11.13-01-10.webm

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@farmaazon farmaazon force-pushed the wip/farmaazon/renaming-project-in-gui branch from 4ec5ff5 to 1c57dba Compare June 11, 2024 11:03
@farmaazon
Copy link
Contributor Author

@somebody1234 @MrFlashAccount Please, review my changes in dashboard. Also, I don't know how to properly update the name in project list after changing it in project view. Any hints?

@@ -38,6 +39,7 @@ export default function Editor(props: EditorProps) {
const gtagEvent = gtagHooks.useGtagEvent()
const gtagEventRef = React.useRef(gtagEvent)
const remoteBackend = remoteBackendProvider.useRemoteBackend()
const { backend } = backendProvider.useStrictBackend()
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure this works - it's possible to have a Local project opened while the Cloud Backend is being used for the Drive view.

unfortunately i can't think of an easy fix... might need to add backend to projectStartupInfo (or perhaps lift the entire renameProject function into projectStartupInfo - although given that it is potentially set from multiple places it's probably unnecessarily duplicating the logic)

@somebody1234
Copy link
Contributor

as for changing the project name - there is a setProjectAsset function in the projectStartupInfo - you can use it something like this

projectStartupInfo.setProjectAsset(asset => ({ ...asset, title: newName })))

or this, with the appropriate import (auto-import + change {} import to * import should work, or copy-paste from somewhere else with object.merger as a last resort)

projectStartupInfo.setProjectAsset(object.merger({ title: newName }))

@farmaazon farmaazon force-pushed the wip/farmaazon/renaming-project-in-gui branch from 006392e to e2044ec Compare June 17, 2024 11:16
@farmaazon
Copy link
Contributor Author

@somebody1234 I came back to this one; applied your review with the suggestion: it works, but only when I open the project in given session; if the project is automatically opened, setProjectAsset is undefined.

@farmaazon
Copy link
Contributor Author

We decided to merge this PR with the above issue. Still requires review, though.

@farmaazon farmaazon marked this pull request as ready for review June 20, 2024 10:29
Comment on lines 20 to 22
v-model.lazy="model"
:autoSelect="true"
@change="emit('renamed', $event ?? '')"
Copy link
Contributor

Choose a reason for hiding this comment

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

When the AutoSizedInput changes, this component emits both update:modelValue and renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the renamed event is redundant, removed.

@farmaazon farmaazon added the CI: Ready to merge This PR is eligible for automatic merge label Jun 21, 2024
@mergify mergify bot merged commit 4164277 into develop Jun 21, 2024
34 checks passed
@mergify mergify bot deleted the wip/farmaazon/renaming-project-in-gui branch June 21, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-gui CI: Ready to merge This PR is eligible for automatic merge x-new-feature Type: new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to rename a project from inside the graph editor
3 participants