Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2026-03-11T19:21:15.859Z\n"
"PO-Revision-Date: 2026-03-11T19:21:15.859Z\n"
"POT-Creation-Date: 2026-03-17T18:02:29.553Z\n"
"PO-Revision-Date: 2026-03-17T18:02:29.553Z\n"

msgid "Events - Create/update"
msgstr ""
Expand Down Expand Up @@ -230,6 +230,21 @@ msgstr ""
msgid "All"
msgstr ""

msgid "Import successful"
msgstr ""

msgid "Import with warnings"
msgstr ""

msgid "Import with errors"
msgstr ""

msgid "Network error"
msgstr ""

msgid "Import pending"
msgstr ""

msgid ""
"There has been an error. You can either retry or contact your administrator "
"if you think there has been an un recoverable error"
Expand Down
26 changes: 22 additions & 4 deletions i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Bulk Load\n"
"POT-Creation-Date: 2026-03-11T19:21:15.859Z\n"
"POT-Creation-Date: 2026-03-17T18:02:29.553Z\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -258,6 +258,24 @@ msgstr ""
msgid "All"
msgstr "Todos"

#, fuzzy
msgid "Import successful"
msgstr "Importar datos"

msgid "Import with warnings"
msgstr ""

#, fuzzy
msgid "Import with errors"
msgstr "Importar solo los datos nuevos"

msgid "Network error"
msgstr ""

#, fuzzy
msgid "Import pending"
msgstr "Importados"

msgid ""
"There has been an error. You can either retry or contact your administrator "
"if you think there has been an un recoverable error"
Expand Down Expand Up @@ -1290,9 +1308,9 @@ msgid ""
"Samaritan’s Purse, Medecins Sans Frontières (MSF), the the Norwegian Refugee "
"Council (NRC) and the Clinton Health Access Initiative (CHAI) to support "
"countries in strengthening the collection and use of health data by using "
"DHIS2. The application has been developed by [EyeSeeTea SL](http://eyeseetea."
"com). Source code, documentation and release notes can be found at the "
"[EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"DHIS2. The application has been developed by [EyeSeeTea SL](http://"
"eyeseetea.com). Source code, documentation and release notes can be found at "
"the [EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"blessed/)."
msgstr ""

Expand Down
26 changes: 22 additions & 4 deletions i18n/fr.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Bulk Load App\n"
"POT-Creation-Date: 2026-03-11T19:21:15.859Z\n"
"POT-Creation-Date: 2026-03-17T18:02:29.553Z\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -252,6 +252,24 @@ msgstr ""
msgid "All"
msgstr "Tout"

#, fuzzy
msgid "Import successful"
msgstr "Importer des données"

msgid "Import with warnings"
msgstr ""

#, fuzzy
msgid "Import with errors"
msgstr "Importez quand même toutes les données"

msgid "Network error"
msgstr ""

#, fuzzy
msgid "Import pending"
msgstr "Importé"

msgid ""
"There has been an error. You can either retry or contact your administrator "
"if you think there has been an un recoverable error"
Expand Down Expand Up @@ -1309,9 +1327,9 @@ msgid ""
"Samaritan’s Purse, Medecins Sans Frontières (MSF), the the Norwegian Refugee "
"Council (NRC) and the Clinton Health Access Initiative (CHAI) to support "
"countries in strengthening the collection and use of health data by using "
"DHIS2. The application has been developed by [EyeSeeTea SL](http://eyeseetea."
"com). Source code, documentation and release notes can be found at the "
"[EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"DHIS2. The application has been developed by [EyeSeeTea SL](http://"
"eyeseetea.com). Source code, documentation and release notes can be found at "
"the [EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"blessed/)."
msgstr ""

Expand Down
26 changes: 22 additions & 4 deletions i18n/pt.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Bulk Load\n"
"POT-Creation-Date: 2026-03-11T19:21:15.859Z\n"
"POT-Creation-Date: 2026-03-17T18:02:29.553Z\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -260,6 +260,24 @@ msgstr ""
msgid "All"
msgstr "Tudo"

#, fuzzy
msgid "Import successful"
msgstr "Importar dados"

msgid "Import with warnings"
msgstr ""

#, fuzzy
msgid "Import with errors"
msgstr "Importar apenas novos registros"

msgid "Network error"
msgstr ""

#, fuzzy
msgid "Import pending"
msgstr "Importado"

msgid ""
"There has been an error. You can either retry or contact your administrator "
"if you think there has been an un recoverable error"
Expand Down Expand Up @@ -1345,9 +1363,9 @@ msgid ""
"Samaritan’s Purse, Medecins Sans Frontières (MSF), the the Norwegian Refugee "
"Council (NRC) and the Clinton Health Access Initiative (CHAI) to support "
"countries in strengthening the collection and use of health data by using "
"DHIS2. The application has been developed by [EyeSeeTea SL](http://eyeseetea."
"com). Source code, documentation and release notes can be found at the "
"[EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"DHIS2. The application has been developed by [EyeSeeTea SL](http://"
"eyeseetea.com). Source code, documentation and release notes can be found at "
"the [EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"blessed/)."
msgstr ""

Expand Down
26 changes: 22 additions & 4 deletions i18n/ru.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Bulk Load\n"
"POT-Creation-Date: 2026-03-11T19:21:15.859Z\n"
"POT-Creation-Date: 2026-03-17T18:02:29.553Z\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -261,6 +261,24 @@ msgstr ""
msgid "All"
msgstr "Все"

#, fuzzy
msgid "Import successful"
msgstr "Импортные данные"

msgid "Import with warnings"
msgstr ""

#, fuzzy
msgid "Import with errors"
msgstr "Импортировать только новые записи"

msgid "Network error"
msgstr ""

#, fuzzy
msgid "Import pending"
msgstr "Импортировано"

msgid ""
"There has been an error. You can either retry or contact your administrator "
"if you think there has been an un recoverable error"
Expand Down Expand Up @@ -1349,9 +1367,9 @@ msgid ""
"Samaritan’s Purse, Medecins Sans Frontières (MSF), the the Norwegian Refugee "
"Council (NRC) and the Clinton Health Access Initiative (CHAI) to support "
"countries in strengthening the collection and use of health data by using "
"DHIS2. The application has been developed by [EyeSeeTea SL](http://eyeseetea."
"com). Source code, documentation and release notes can be found at the "
"[EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"DHIS2. The application has been developed by [EyeSeeTea SL](http://"
"eyeseetea.com). Source code, documentation and release notes can be found at "
"the [EyeSeetea GitHub Project Page](https://eyeseetea.github.io/Bulk-Load-"
"blessed/)."
msgstr ""

Expand Down
15 changes: 3 additions & 12 deletions src/domain/entities/HistoryEntry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Id } from "./ReferenceObject";
import { generateUid } from "d2/uid";
import { SynchronizationResult } from "./SynchronizationResult";
import { SynchronizationResult, computeOverallSyncStatus } from "./SynchronizationResult";
import { Maybe } from "../../types/utils";
import { ImportTemplateError } from "../usecases/ImportTemplateUseCase";
import { isAdmin, User } from "./User";
Expand Down Expand Up @@ -117,17 +117,8 @@ export class HistoryEntry {
if (!this.syncResults || this.syncResults.length === 0) {
return "ERROR";
}
const hasError = this.syncResults.some(
result => result.status === "ERROR" || result.status === "NETWORK ERROR"
);
if (hasError) {
return "ERROR";
}
const hasWarning = this.syncResults.some(result => result.status === "WARNING");
if (hasWarning) {
return "WARNING";
}
return "SUCCESS";
const status = computeOverallSyncStatus(this.syncResults);
return status === "NETWORK ERROR" || status === "PENDING" ? "ERROR" : status;
}

public toDetails(): HistoryEntryDetails {
Expand Down
8 changes: 8 additions & 0 deletions src/domain/entities/SynchronizationResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ export interface SynchronizationResult {
errors?: ErrorMessage[];
rawResponse: object;
}

export function computeOverallSyncStatus(results: Pick<SynchronizationResult, "status">[]): SynchronizationStatus {
const priority: SynchronizationStatus[] = ["NETWORK ERROR", "ERROR", "WARNING", "SUCCESS"];
for (const status of priority) {
if (results.some(r => r.status === status)) return status;
}
return "PENDING";
}
2 changes: 2 additions & 0 deletions src/webapp/components/app/themes/dhis2.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const colors = {
warning: "#F19C02",
positive: "#3D9305",
info: "#EAF4FF",
defaultStatus: "#3e2723",
};

export const palette = {
Expand Down Expand Up @@ -63,6 +64,7 @@ export const palette = {
warning: colors.warning,
positive: colors.positive,
info: colors.info,
default: colors.defaultStatus,
},
background: {
paper: colors.white,
Expand Down
36 changes: 11 additions & 25 deletions src/webapp/components/history/HistoryStatusIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,35 @@ import React from "react";
import { Icon } from "@material-ui/core";
import { HistoryEntryStatus } from "../../../domain/entities/HistoryEntry";
import i18n from "../../../utils/i18n";
import { getStatusConfig } from "../../utils/statusConfig";

interface HistoryStatusIndicatorProps {
status: HistoryEntryStatus;
style?: React.CSSProperties;
iconStyle?: React.CSSProperties;
}

function getStatusConfig(status: HistoryEntryStatus) {
function getHistoryStatusConfig(status: HistoryEntryStatus) {
const base = getStatusConfig(status);
switch (status) {
case "SUCCESS":
return {
icon: "check_circle",
label: i18n.t("Success"),
color: "#4caf50",
};
return { ...base, label: i18n.t("Success") };
case "ERROR":
return {
icon: "error",
label: i18n.t("Error"),
color: "#f44336",
};
return { ...base, label: i18n.t("Error") };
case "WARNING":
return {
icon: "warning",
label: i18n.t("Warning"),
color: "#ff9800",
};
return { ...base, label: i18n.t("Warning") };
default:
return {
icon: "help",
label: status,
color: "#666",
};
return { ...base, label: status };
}
}

export function HistoryStatusIndicator({ status, style, iconStyle }: HistoryStatusIndicatorProps) {
const statusConfig = getStatusConfig(status);
const config = getHistoryStatusConfig(status);

return (
<span
style={{
color: statusConfig.color,
color: config.color,
display: "flex",
alignItems: "center",
...style,
Expand All @@ -57,9 +43,9 @@ export function HistoryStatusIndicator({ status, style, iconStyle }: HistoryStat
...iconStyle,
}}
>
{statusConfig.icon}
{config.icon}
</Icon>
{statusConfig.label}
{config.label}
</span>
);
}
Loading
Loading