[2.x] Conditions Builder query ignores categories with the same name
hapoza opened this issue · 2 comments
Expected Behavior
When using a condition like "user is/is not visiting a page of category x", it should show all categories of the Catalog as options.
Current Behavior
If two or more categories have the same name, only one of them is returned by the query thus making it impossible to create a condition with the other category(ies) with the same name.
Possible Solution
N/A
Steps to Reproduce (for bugs)
- Create two categories in catalog with exactly the same name
- In conditions builder, create a condition with the block "user is visiting a page of category"
- When searching the category, try searching it by name, only one will appear. Same thing when searching by ID, only one ID is available.
Context
We can see on this store that both the categories with ID's 10 and 80 have the same name.
Searching for categories with conditions builder, only one of them shows up as an option (it's the one with ID 80. Searching for 10, the other ID that exists, yields nothing):
Inspecting the network tab on the categoryList
GraphQL query, it can be seen that the category with ID 10 is not available, only the one with ID 80:
{
"data":{
"categoryList":[
{
"id":"1",
"name":"Maquiagem",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"2",
"name":"Rosto",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"3",
"name":"Pré-Maquiagem",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"4",
"name":"Base",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"5",
"name":"Corretivo",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"6",
"name":"Tratamento",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"7",
"name":"Perfumaria",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"8",
"name":"Homem",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"9",
"name":"Olhos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"12",
"name":"Sobrancelhas",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"13",
"name":"Bochechas",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"14",
"name":"Lábios",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"15",
"name":"Acessórios",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"16",
"name":"Iluminador Corretivo",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"17",
"name":"Pó",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"18",
"name":"Rosto",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"19",
"name":"Limpeza",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"20",
"name":"Booster",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"21",
"name":"Hidratação 24hs e Redução de Linhas",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"22",
"name":"Sombra",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"23",
"name":"Blush",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"24",
"name":"Lápis Para Olhos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"25",
"name":"Paleta",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"27",
"name":"Máscara Para Cílios",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"28",
"name":"Lápis Retrátil",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"29",
"name":"Batom",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"30",
"name":"Pincéis",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"31",
"name":"Estojos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"32",
"name":"Iluminador para Face",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"33",
"name":"Fixador",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"34",
"name":"Matificante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"35",
"name":"Demaquilante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"36",
"name":"Glitter",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"37",
"name":"Delineador",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"38",
"name":"Fixador",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"39",
"name":"Brilho Labial",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"40",
"name":"Limpador",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"44",
"name":"Necessaire",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"45",
"name":"Paleta",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"46",
"name":"Corpo",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"47",
"name":"Iluminador",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"48",
"name":"Olhos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"49",
"name":"Corpo",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"50",
"name":"Pink",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"51",
"name":"Feminina",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"53",
"name":"Rosto",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"54",
"name":"Olhos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"55",
"name":"Corpo",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"57",
"name":"Hidratação 24hs e Redução de Linhas",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"58",
"name":"Redutor de Medidas e Celulite",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"59",
"name":"Hidratante Perfumado Desodorante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"60",
"name":"Creme para as mãos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"61",
"name":"Colônia Desodorante Contém1g Fragrance",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"62",
"name":"Body Splash Desodorante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"63",
"name":"Kit",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"64",
"name":"Colônia Desodorante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"65",
"name":"Body Splash Desodorante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"66",
"name":"Hidratante Perfumado Desodorante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"67",
"name":"Masculina",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"77",
"name":"Barba",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"78",
"name":"Após Barba",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"79",
"name":"Esfoliante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"80",
"name":"Hidratante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"81",
"name":"Hidratante e Refrescante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"82",
"name":"Matificante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"83",
"name":"Corretivo",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"84",
"name":"Creme Hidratante",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"85",
"name":"Hidratante Corporal",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"86",
"name":"Creme para os Pés",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"87",
"name":"Creme para as Mãos",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"94",
"name":"Perfumaria",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"95",
"name":"Unhas",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"96",
"name":"Esmalte",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"97",
"name":"Brilho",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
},
{
"id":"98",
"name":"Kit Look",
"__typename":"vtex_conditionsbuilder_1_6_4_Category"
}
]
}
}
Your Environment
- Version used: 2.x
- Environment name and version (e.g. Chrome 39, node.js 5.4): Chrome @ latest
- Operating System and version (desktop or mobile): macOs High Sierra
- Link to your project: https://contemmakeup.myvtex.com/admin/conditions-builder/pages
Hey, @hapoza! Sorry for the late reply.
I was trying to reproduce that issue, but I couldn't find the "user is visiting [...]" condition; has anything changed since then?
@alcar This is what I was referring to
But as of right now, I checked the catalog configuration of that store and it changed, I tried to reproduce with categories named "Olhos" (which there are 3 of), and it only showed 2 (ID 9 and ID 106), and the one with ID 51 did not show up. So probably there is something in the category configuration that is missing for it to show up on the GraphQL query, and not an issue of multiple categories having the same name.
We're also planing to migrate this store to store-theme and the latest version of admin-pages, which doesn't even have Conditions Builder, so I'll close this issue, thank you!