invoiceninja / ui

Invoice Ninja: Web admin portal built with React
https://app.invoicing.co
Other
57 stars 49 forks source link

create task: filter project list when client is selected #2060

Closed CooperatusTeam closed 1 month ago

CooperatusTeam commented 1 month ago

(Filing this task based on the suggestions here: https://forum.invoiceninja.com/t/creating-task-client-has-no-connection-with-projects/16955)

When using the deprecated Flutter UI to add a new task, the projects list is filtered by the selected client. This doesn't happen in the React UI, which leads to confusion when a project associated with a different client is accidentally selected.

In my test data below, the projects have been named in such a way that demonstrates which client they are associated with, but in production this is almost never the case. Often there are even projects with the exact same name associated with different clients, making it impossible to determine which one to select when creating a task.

Old (Flutter) behavior

To illustrate how it worked under Flutter, when no client is selected, all projects show in the dropdown:

image

When a client is selected, the projects shown are limited to those associated with that client:

image

New (React) behavior

With React, the project list is unfiltered when no client is selected, matching the Flutter behavior (aside from sorting):

image

However, when a client is selected, the project list is still unfiltered:

image

Request

If possible, it would be ideal if the available projects were filtered to only show the ones associated with the selected client.

turbo124 commented 1 month ago

@Civolilah IF a client is selected, we'll need to ensure that the ?client_id=XXXXX is pass into to the URL for project list to ensure the list is correct.

We'd also need to invalidate the project query if the client is removed to ensure the project list always matches the client selected.