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

Search parcels by lot : numbered tabs #93

Open
MaelREBOUX opened this issue Feb 24, 2021 · 4 comments
Open

Search parcels by lot : numbered tabs #93

MaelREBOUX opened this issue Feb 24, 2021 · 4 comments

Comments

@MaelREBOUX
Copy link
Member

image

Adding several tabs by selection => selection 1 | selection 2
Adding several tabs by lot => lot | lot

Possible to number the second kindsof tabs ?

@tdipisa
Copy link
Collaborator

tdipisa commented Feb 25, 2021

@MaelREBOUX I will ask developers for a check. I think it is an easy fix to do.

@tdipisa tdipisa added this to the VA MS2 milestone Feb 25, 2021
@offtherailz
Copy link
Collaborator

offtherailz commented Feb 26, 2021

Actually the titles for result tabs from various search types are defined by this function

function getTitle(searchType, rawParams) {
switch (searchType) {
case SEARCH_TYPES.REFERENCE:
return rawParams?.commune?.label;
case SEARCH_TYPES.ADDRESS:
return rawParams?.commune?.label;
case SEARCH_TYPES.LOT:
return "Lot";
case SEARCH_TYPES.ID:
return "Id(s)";
case SEARCH_TYPES.OWNER_ID:
return rawParams?.commune?.label;
case SEARCH_TYPES.COMPTE_COMMUNAL:
return rawParams?.comptecommunal;
case SEARCH_TYPES.OWNER_LOT:
return "By file";
default:
return null;
}
}

The current numbering system is implemented to provide a title to a tab that has not a specific title.
If "no title" is provided the title is assigned as an incremental `Selection where number is the index of the tab.

const getPlotTitle = (plot, index) => {
return plot?.title ?? ("Selection " + (index + 1).toString());
};

So you will have

"Selection 1", "Lot", "Selection 3"...

So applying strictly this logic is not optimal, generating titles like:
"Selection 1", "Lot 2", "Selection 3", "Lot 4", ...

I think there is a mismatch of meaning between "Selection" as a "generic selection" of parcelles, or "Selection" as "selected on map". The application now want to express the first meaning.

I think there are 2 ways to do this.

  1. Use "Selection" for all the selections on map, as in the original application.
  2. Something more complicated like:
"Selection 1", "Lot 1", Selection 2, "Lot 3", Rennes (....) 1", "Rennes (....) // <-- there are also the other titles.

To do this we need to remove the current logic and add counter for each type when generating the titles, and removing the default case with no-title.

@tdipisa what's your opinion ?

@MaelREBOUX
Copy link
Member Author

Hello @offtherailz my opinion : I agree with your proposition. The important is to not have identical tab title

@MaelREBOUX
Copy link
Member Author

warning : interaction with discussion in #115 (comment)

@tdipisa tdipisa self-assigned this May 17, 2021
@tdipisa tdipisa removed this from the VA MS2 milestone May 18, 2021
@tdipisa tdipisa removed their assignment May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants