Scope parks and downstream investment requests to the treated opportunity
This commit is contained in:
@@ -234,13 +234,16 @@ export function NavigationContextSummary() {
|
||||
return null;
|
||||
const saved = view?.investment_context;
|
||||
const ref = saved?.selection;
|
||||
const params = new URLSearchParams(url.split('?')[1] ?? '');
|
||||
const scopedChoice = saved?.opportunity_choices?.find(c=>c.opportunity.key===params.get('opportunity'));
|
||||
const multiple = (saved?.opportunity_choices?.length ?? 0)>1;
|
||||
const currentStep = view?.steps.find((s) => s.code === step);
|
||||
const sector =
|
||||
const sector = scopedChoice ? scopedChoice.opportunity.fields.sector || 'Não indicado' :
|
||||
ref?.sector?.title ||
|
||||
saved?.fields.sector ||
|
||||
view?.sector_contexts.map((s) => s.name).join(' · ') ||
|
||||
'Não indicado';
|
||||
const location =
|
||||
const location = scopedChoice ? scopedChoice.territory?.title || 'Por definir' : multiple ? 'Consulte a localização de cada oportunidade' :
|
||||
saved?.fields.location ||
|
||||
ref?.territory?.title ||
|
||||
ref?.park?.title ||
|
||||
@@ -260,7 +263,7 @@ export function NavigationContextSummary() {
|
||||
view?.case.title ||
|
||||
'Selecione um dossier',
|
||||
Oportunidade:
|
||||
ref?.opportunity?.title || 'Sem oportunidade associada',
|
||||
scopedChoice?.opportunity.title || (multiple ? 'Várias — oportunidade em tratamento no formulário' : ref?.opportunity?.title || 'Sem oportunidade associada'),
|
||||
Sector: sector,
|
||||
Localização: location,
|
||||
'Etapa atual': currentStep
|
||||
|
||||
Reference in New Issue
Block a user