@fayz-ai/plugin-crm 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -3969,6 +3969,8 @@ function LeadListView({ onNew, onEdit }) {
|
|
|
3969
3969
|
const [statusFilter, setStatusFilter] = useState([]);
|
|
3970
3970
|
const [sourceFilter, setSourceFilter] = useState();
|
|
3971
3971
|
const [tagFilter, setTagFilter] = useState([]);
|
|
3972
|
+
const [team, setTeam] = useState(null);
|
|
3973
|
+
const [myUserId, setMyUserId] = useState(null);
|
|
3972
3974
|
const [ownerFilter, setOwnerFilter] = useState();
|
|
3973
3975
|
const [reachFilter, setReachFilter] = useState();
|
|
3974
3976
|
const [companyFilter, setCompanyFilter] = useState();
|
|
@@ -4166,16 +4168,37 @@ function LeadListView({ onNew, onEdit }) {
|
|
|
4166
4168
|
() => leadSources.map((o) => ({ value: o.id, label: o.name })),
|
|
4167
4169
|
[leadSources]
|
|
4168
4170
|
);
|
|
4171
|
+
useEffect(() => {
|
|
4172
|
+
let vivo = true;
|
|
4173
|
+
void loadTeamOrNull().then((t3) => {
|
|
4174
|
+
if (vivo) setTeam(t3);
|
|
4175
|
+
});
|
|
4176
|
+
void loadMyUserId().then((id) => {
|
|
4177
|
+
if (vivo) setMyUserId(id);
|
|
4178
|
+
});
|
|
4179
|
+
return () => {
|
|
4180
|
+
vivo = false;
|
|
4181
|
+
};
|
|
4182
|
+
}, []);
|
|
4169
4183
|
const ownerOptions = useMemo(() => {
|
|
4170
4184
|
const vistos = /* @__PURE__ */ new Map();
|
|
4171
|
-
for (const
|
|
4185
|
+
for (const m of team ?? []) vistos.set(m.userId, m.name);
|
|
4186
|
+
if (!team) {
|
|
4187
|
+
for (const l of leads2) if (l.assignedToId) vistos.set(l.assignedToId, l.assignedToName ?? l.assignedToId);
|
|
4188
|
+
}
|
|
4172
4189
|
return [
|
|
4173
|
-
// "
|
|
4174
|
-
//
|
|
4190
|
+
// "Meus" primeiro, e antes de "Ninguém": é o recorte que quem trabalha a
|
|
4191
|
+
// fila faz todos os dias, e obriga-lo a achar o PRÓPRIO nome numa lista
|
|
4192
|
+
// de nove é a única escolha dele que nunca tem dúvida. Só aparece quando
|
|
4193
|
+
// há carteira para recortar — para um gestor sem leads seus, é uma opção
|
|
4194
|
+
// que devolve zero.
|
|
4195
|
+
...myUserId && vistos.has(myUserId) ? [{ value: myUserId, label: t2("crm.leads.filters.mine") }] : [],
|
|
4196
|
+
// "Ninguém": é a pergunta que se faz antes de distribuir a carteira, e a
|
|
4197
|
+
// que a lista sozinha não responde.
|
|
4175
4198
|
{ value: "none", label: t2("crm.leads.filters.unassigned") },
|
|
4176
|
-
...[...vistos].map(([id, nome]) => ({ value: id, label: nome }))
|
|
4199
|
+
...[...vistos].filter(([id]) => id !== myUserId).map(([id, nome]) => ({ value: id, label: nome }))
|
|
4177
4200
|
];
|
|
4178
|
-
}, [leads2, t2]);
|
|
4201
|
+
}, [team, leads2, myUserId, t2]);
|
|
4179
4202
|
const activeFilterCount = (statusFilter.length ? 1 : 0) + (sourceFilter ? 1 : 0) + (tagFilter.length ? 1 : 0) + (ownerFilter ? 1 : 0) + (companyFilter ? 1 : 0) + (reachFilter ? 1 : 0);
|
|
4180
4203
|
const clearFilters = () => {
|
|
4181
4204
|
setStatusFilter([]);
|
|
@@ -25296,23 +25319,24 @@ var en = {
|
|
|
25296
25319
|
"crm.leadDetail.notes": "Notes",
|
|
25297
25320
|
"crm.leadDetail.phone": "Phone",
|
|
25298
25321
|
"crm.leads.filters.allStatuses": "Any status",
|
|
25299
|
-
"crm.leads.filters.allSources": "
|
|
25322
|
+
"crm.leads.filters.allSources": "All sources",
|
|
25300
25323
|
"crm.leads.filters.searchTag": "Search tag",
|
|
25301
25324
|
"crm.leads.filters.noTag": "No tag found",
|
|
25302
|
-
"crm.leads.filters.tag": "
|
|
25303
|
-
"crm.leads.filters.allTags": "
|
|
25304
|
-
"crm.leads.filters.owner": "
|
|
25305
|
-
"crm.leads.filters.allOwners": "
|
|
25306
|
-
"crm.leads.filters.
|
|
25307
|
-
"crm.leads.filters.
|
|
25308
|
-
"crm.leads.filters.
|
|
25309
|
-
"crm.leads.filters.
|
|
25310
|
-
"crm.leads.filters.
|
|
25311
|
-
"crm.leads.filters.
|
|
25312
|
-
"crm.leads.filters.
|
|
25313
|
-
"crm.leads.filters.
|
|
25314
|
-
"crm.leads.filters.
|
|
25315
|
-
"crm.leads.filters.
|
|
25325
|
+
"crm.leads.filters.tag": "Tag",
|
|
25326
|
+
"crm.leads.filters.allTags": "All tags",
|
|
25327
|
+
"crm.leads.filters.owner": "Owner",
|
|
25328
|
+
"crm.leads.filters.allOwners": "Any owner",
|
|
25329
|
+
"crm.leads.filters.mine": "My leads",
|
|
25330
|
+
"crm.leads.filters.unassigned": "Unassigned",
|
|
25331
|
+
"crm.leads.filters.reach": "Reachable by",
|
|
25332
|
+
"crm.leads.filters.anyReach": "Any channel",
|
|
25333
|
+
"crm.leads.filters.hasPhone": "Has phone",
|
|
25334
|
+
"crm.leads.filters.hasEmail": "Has e-mail",
|
|
25335
|
+
"crm.leads.filters.noPhone": "No phone",
|
|
25336
|
+
"crm.leads.filters.anyCompany": "With or without company",
|
|
25337
|
+
"crm.leads.filters.withCompany": "With company",
|
|
25338
|
+
"crm.leads.filters.withoutCompany": "Without company",
|
|
25339
|
+
"crm.leads.filters.clear": "Clear",
|
|
25316
25340
|
"crm.leadDetail.pipeline": "Pipeline",
|
|
25317
25341
|
"crm.leadDetail.openDeal": "Open in pipeline",
|
|
25318
25342
|
"crm.leadDetail.probability": "Probability",
|
|
@@ -26092,6 +26116,7 @@ var ptBR = {
|
|
|
26092
26116
|
"crm.leads.filters.allTags": "Todas as etiquetas",
|
|
26093
26117
|
"crm.leads.filters.owner": "Respons\xE1vel",
|
|
26094
26118
|
"crm.leads.filters.allOwners": "Qualquer respons\xE1vel",
|
|
26119
|
+
"crm.leads.filters.mine": "Meus leads",
|
|
26095
26120
|
"crm.leads.filters.unassigned": "Sem respons\xE1vel",
|
|
26096
26121
|
"crm.leads.filters.reach": "Contat\xE1vel por",
|
|
26097
26122
|
"crm.leads.filters.anyReach": "Qualquer canal",
|