Merge dashboard-test: the CaMa dashboard's presentation over the FHIR measures, with TEA's history and summary kept
This commit is contained in:
@@ -96,6 +96,16 @@ export class IndicadoresMemory {
|
||||
applied: { tipo: 'semestre', selection: { mode: 'todos' }, revision: 0 },
|
||||
};
|
||||
for (const tipo of types) state.editors[tipo] ??= newEditor(tipo, 'semestre');
|
||||
// Legacy CaMa selections can contain several periods although its editor now shows one.
|
||||
if (domain === 'cama' && stored) {
|
||||
for (const editor of Object.values(state.editors)) {
|
||||
if (editor?.draft.mode === 'explicit' && editor.draft.periodos.length > 1)
|
||||
editor.draft = { mode: 'explicit', periodos: [editor.draft.periodos[0]] };
|
||||
}
|
||||
const selection = state.applied.selection;
|
||||
if (selection.mode === 'explicit' && selection.periodos.length > 1)
|
||||
state.applied = { ...state.applied, selection: { mode: 'explicit', periodos: [selection.periodos[0]] }, revision: state.applied.revision + 1 };
|
||||
}
|
||||
// Preserve an application whose capabilities changed: consumers explain incompatibility,
|
||||
// rather than silently replacing or trimming the user's temporal selection.
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user