MCPcopy Create free account
hub / github.com/SethGammon/Citadel / phaseSummary

Function phaseSummary

scripts/dashboard.js:171–190  ·  view source on GitHub ↗
(campaign)

Source from the content-addressed store, hash-verified

169 return status;
170}
171
172function phaseSummary(campaign) {
173 const phases = campaign.phases || [];
174 if (phases.length > 0) {
175 const incomplete = phases.find((phase) => !/^(complete|completed|done)$/i.test(phase.status));
176 const current = incomplete ? incomplete.number : phases.length;
177 return {
178 current,
179 total: phases.length,
180 label: `Phase ${current}/${phases.length}`,
181 };
182 }
183
184 const total = Number(campaign.frontmatter.phase_count || 0);
185 const current = Number(campaign.frontmatter.current_phase || 0);
186 if (total > 0 && current > 0) {
187 return { current, total, label: `Phase ${current}/${total}` };
188 }
189
190 return { current: 0, total: 0, label: 'No phase table' };
191}
192
193function lastDecision(content) {

Callers 1

readCampaignsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected