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

Redirect to New Field Page for Kanban Setup #5661

Open
Bonapara opened this issue May 29, 2024 · 8 comments · May be fixed by #6128
Open

Redirect to New Field Page for Kanban Setup #5661

Bonapara opened this issue May 29, 2024 · 8 comments · May be fixed by #6128
Assignees
Labels
good first issue Good for newcomers scope: front Issues that are affecting the frontend side only size: hours size: minutes

Comments

@Bonapara
Copy link
Member

Current Behavior

Kanban boards are based on Select fields. When I try to create a Kanban board for an object without a Select field, I receive an informative message with a redirection to the object settings page.

CleanShot 2024-05-29 at 18 11 53

Goes to https://app.twenty.com/settings/objects/companies

Desired Behavior

Instead of being redirected to the object settings page, users should be redirected to the new field creation page, ideally with the Select field pre-selected.

Should redirect to https://app.twenty.com/settings/objects/companies/new-field/step-2

@Bonapara Bonapara added good first issue Good for newcomers scope: front Issues that are affecting the frontend side only size: minutes size: hours labels May 29, 2024
Copy link

greptile-apps bot commented May 29, 2024

Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).

To redirect users to the new field creation page with the Select field pre-selected, update the redirection logic in the Kanban setup. Modify the navigateToSelectSettings function in /packages/twenty-front/src/modules/views/view-picker/hooks/useGetAvailableFieldsForKanban.ts to point to the new field creation page.

const navigateToSelectSettings = useCallback(() => {
  navigate(`/settings/objects/${objectSlug}/new-field/step-2`);
}, [navigate, objectSlug]);

Ensure the objectSlug is correctly passed to the hook and used in the URL.

References

/packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep2.tsx
/packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx
/packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetail.tsx
/packages/twenty-front/src/modules/views/view-picker/hooks/useGetAvailableFieldsForKanban.ts

Ask Greptile

@Us3r-gitHub
Copy link
Contributor

Hi, I would like to handle this.
I believe the previous PR needs improvement. Should I continue working on that one or create a new PR?

After researching, it can be improved by implementing state on useNavigate hooks

@Bonapara
Copy link
Member Author

Hi @Us3r-gitHub! I'll let @ijreilly tell you.

@ijreilly
Copy link
Contributor

ijreilly commented Jul 4, 2024

Hi @Us3r-gitHub and @AdvaitChandorkar07, sorry for the delay!
Advait has the right approach in his PR, no need to complicate things further.
Advait has deleted the repo in the meantime so I don't think he is interested in working on this anymore. I will copy the PR! @Us3r-gitHub feel free to find another issue to work on :) thank you for your interest in twenty

@ijreilly ijreilly linked a pull request Jul 4, 2024 that will close this issue
@ijreilly ijreilly self-assigned this Jul 4, 2024
@Us3r-gitHub
Copy link
Contributor

Yup, it's completely functional for navigation. However, it can be improved to suit the desired behavior

ideally with the Select field pre-selected.

@ijreilly
Copy link
Contributor

ijreilly commented Jul 4, 2024

@Us3r-gitHub oh right ! did not see that specification.
Would you like to work on this then? I think a good approach could be to add an optional type query parameter in settings/objects/companies/new-field/step-2

@Us3r-gitHub
Copy link
Contributor

Us3r-gitHub commented Jul 4, 2024

Should I create a new branch in my repository or continue working in him branch?

I'm new to the Open Source Community and still getting familiar with everything. Any advice you can offer would be greatly appreciated!
Thanks :)

@ijreilly
Copy link
Contributor

ijreilly commented Jul 5, 2024

@Us3r-gitHub You can create a branch in your repository :) thank you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers scope: front Issues that are affecting the frontend side only size: hours size: minutes
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

3 participants