-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: update project creation #3399
base: main
Are you sure you want to change the base?
Conversation
You can access the deployment of this PR at https://renku-ci-ui-3399.dev.renku.ch |
client/src/features/ProjectPageV2/ProjectPageContent/Settings/ProjectSettings.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments here 👇 .
The PR is overall good, but form code needs to be improved.
@leafty thank you for the review! I either updated the code as suggested or dropped an inline content. Most points are solved or trivial to solve after a confirmation (E.G: |
* use hashes to store the open state * drop the projectV2 slice
client/src/features/ProjectPageV2/ProjectPageContent/Settings/ProjectSettings.tsx
Outdated
Show resolved
Hide resolved
client/src/features/ProjectPageV2/ProjectPageContent/Settings/ProjectSettings.tsx
Outdated
Show resolved
Hide resolved
client/src/features/projectsV2/fields/ProjectNamespaceFormField.tsx
Outdated
Show resolved
Hide resolved
client/src/features/projectsV2/fields/ProjectVisibilityFormField.tsx
Outdated
Show resolved
Hide resolved
export interface SlugFormFieldProps<T extends FieldValues> | ||
extends GenericFormFieldProps<T> { | ||
compact?: boolean; | ||
countAsDirty?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is countAsDirty
? It looks like a hack because react-hook-form is being mis-used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mis-used?
The UX has been optimized to avoid showing useless interactions; on some pages, it's easier to integrate this component seamlessly by considering other component's states. I don't think that logic should be embedded here.
control={control} | ||
entityName="group" | ||
errors={errors} | ||
countAsDirty={dirtyFields.slug && dirtyFields.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is not working at the moment on the deployment: the reset button does not appear when it I type a custom slug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the name wasn't filled in?
I updated the logic a little to make it more consistent. The button should show when:
- The URL is invalid
- The name isn't blank
and in no other case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: the modals with useLocationHash are broken on the search page. Let's make an issue for this. The useSearchParams
hook may be interfering with it on the search page.
@leafty Should we use a query parameter instead of the hash? We would have an additional useless network request, which isn't a big deal, and it should work fine on the search page. If you prefer the hash solution (I agree it's really neat) and already have an idea of what could be the conflict, I can either open the issue or, if it's quick enough, try to fix it in this PR. |
I highly suspect it would not work, given how the search page works. That's why fixing it later is probably fine, because creating a new project or group from the search page is not the biggest use case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be the last small things to fix.
<FormText id={`${entityName}NameHelp`} className="input-hint"> | ||
The name you will use to refer to the {entityName}. | ||
</FormText> | ||
{helpText} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should keep the <FormText>
component here, otherwise the association with the input field is broken.
{helpText} | |
{helpText && <FormText id={`${entityName}-help`}>{helpText}</FormText>} |
This PR updates the project and group creation pages, which are now available as modals.
The settings pages have been updated accordingly, but they will undergo further updates in another pitch.
Reference: https://www.notion.so/renku/Clean-up-Project-Group-Creation-0bee33f12b624525a100df79327eb5e7
/deploy