Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/download template redesign #342

Open
wants to merge 8 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
31 changes: 17 additions & 14 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: 2024-12-17T16:04:30.663Z\n"
"PO-Revision-Date: 2024-12-17T16:04:30.663Z\n"
"POT-Creation-Date: 2025-01-27T03:20:13.064Z\n"
"PO-Revision-Date: 2025-01-27T03:20:13.064Z\n"

msgid "Events - Create/update"
msgstr ""
Expand Down Expand Up @@ -752,40 +752,43 @@ msgstr ""
msgid "User does not have any capture organisations units"
msgstr ""

msgid "Advanced template properties"
msgid "Populate"
msgstr ""

msgid "Language"
msgid "Populate template with data"
msgstr ""

msgid "Split data entry tabs by section"
msgid "Also filter TEI and relationships by their enrollment date"
msgstr ""

msgid "Theme"
msgid "TEI and relationships enrollment by organisation unit type"
msgstr ""

msgid "<No value>"
msgid "Current user organisation units (data capture)"
msgstr ""

msgid "Populate template with data"
msgid "Selected organisation units with their descendants"
msgstr ""

msgid "Also filter TEI and relationships by their enrollment date"
msgid "Only selected organisation units"
msgstr ""

msgid "TEI and relationships enrollment by organisation unit type"
msgid "Include relationships"
msgstr ""

msgid "Current user organisation units (data capture)"
msgid "Advanced template properties"
msgstr ""

msgid "Selected organisation units with their descendants"
msgid "Language"
msgstr ""

msgid "Only selected organisation units"
msgid "Theme"
msgstr ""

msgid "Include relationships"
msgid "<No value>"
msgstr ""

msgid "Split data entry tabs by section"
msgstr ""

msgid "Use metadata codes (organisation units, data elements and options)"
Expand Down
34 changes: 19 additions & 15 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: 2024-12-17T16:04:30.663Z\n"
"POT-Creation-Date: 2025-01-27T03:20:13.064Z\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -785,20 +785,9 @@ msgstr "Seleccione las unidades organizativas para añadir a la plantilla"
msgid "User does not have any capture organisations units"
msgstr "El usuario no tiene unidades organizativas asociadas"

msgid "Advanced template properties"
msgstr "Propiedades avanzadas de la plantilla"

msgid "Language"
msgstr "Idioma"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Theme"
msgstr "Tema"

msgid "<No value>"
msgstr "<Sin valor>"
#, fuzzy
msgid "Populate"
msgstr "Plantilla"
Copy link

@tokland tokland Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically check fuzzy tags in PO files (gettext adds them, meaning: "I think this is the translation for a new literal I found, which is very similar to another existing, but I am not sure"). We review if correct and the remove the line "#, fuzzy".

BUT, as all the po files already contain fuzzy tags (a lot), you may leave this task to another "cleaning" PR, not in this feature. Confirm with your PM.


msgid "Populate template with data"
msgstr "Rellenar la plantilla con datos"
Expand All @@ -821,6 +810,21 @@ msgstr ""
msgid "Include relationships"
msgstr ""

msgid "Advanced template properties"
msgstr "Propiedades avanzadas de la plantilla"

msgid "Language"
msgstr "Idioma"

msgid "Theme"
msgstr "Tema"

msgid "<No value>"
msgstr "<Sin valor>"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Use metadata codes (organisation units, data elements and options)"
msgstr ""

Expand Down
34 changes: 19 additions & 15 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: 2024-12-17T16:04:30.663Z\n"
"POT-Creation-Date: 2025-01-27T03:20:13.064Z\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -807,20 +807,9 @@ msgstr ""
"L'utilisateur n'a pas accès à aucune unité d'organisation por la saisie de "
"données"

msgid "Advanced template properties"
msgstr "Propriétés avancées du modèle"

msgid "Language"
msgstr "Langue"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Theme"
msgstr "Thème"

msgid "<No value>"
msgstr "<Aucune valeur>"
#, fuzzy
msgid "Populate"
msgstr "Modèle"

msgid "Populate template with data"
msgstr "Remplir le modèle avec des données"
Expand All @@ -843,6 +832,21 @@ msgstr ""
msgid "Include relationships"
msgstr ""

msgid "Advanced template properties"
msgstr "Propriétés avancées du modèle"

msgid "Language"
msgstr "Langue"

msgid "Theme"
msgstr "Thème"

msgid "<No value>"
msgstr "<Aucune valeur>"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Use metadata codes (organisation units, data elements and options)"
msgstr ""

Expand Down
34 changes: 19 additions & 15 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: 2024-12-17T16:04:30.663Z\n"
"POT-Creation-Date: 2025-01-27T03:20:13.064Z\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -840,20 +840,9 @@ msgstr "Selecione as unidades organizacionais para incluir na planilha"
msgid "User does not have any capture organisations units"
msgstr "O usuário não tem accesso a nenhuma unidade organizacional"

msgid "Advanced template properties"
msgstr "Propriedades avançadas da planilha"

msgid "Language"
msgstr "Língua"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Theme"
msgstr "Tema"

msgid "<No value>"
msgstr "<Sem valor>"
#, fuzzy
msgid "Populate"
msgstr "Modelo"

msgid "Populate template with data"
msgstr "Preencher a planilha com dados"
Expand All @@ -876,6 +865,21 @@ msgstr ""
msgid "Include relationships"
msgstr ""

msgid "Advanced template properties"
msgstr "Propriedades avançadas da planilha"

msgid "Language"
msgstr "Língua"

msgid "Theme"
msgstr "Tema"

msgid "<No value>"
msgstr "<Sem valor>"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Use metadata codes (organisation units, data elements and options)"
msgstr ""

Expand Down
34 changes: 19 additions & 15 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: 2024-12-17T16:04:30.663Z\n"
"POT-Creation-Date: 2025-01-27T03:20:13.064Z\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -842,20 +842,9 @@ msgstr "Выберите доступные подразделения орга
msgid "User does not have any capture organisations units"
msgstr "У пользователя нет подразделений организаций захвата"

msgid "Advanced template properties"
msgstr "Расширенные свойства шаблона"

msgid "Language"
msgstr "Язык"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Theme"
msgstr "Тема"

msgid "<No value>"
msgstr "<Нет значения>"
#, fuzzy
msgid "Populate"
msgstr "Шаблон"

msgid "Populate template with data"
msgstr "Заполнение шаблона данными"
Expand All @@ -878,6 +867,21 @@ msgstr ""
msgid "Include relationships"
msgstr ""

msgid "Advanced template properties"
msgstr "Расширенные свойства шаблона"

msgid "Language"
msgstr "Язык"

msgid "Theme"
msgstr "Тема"

msgid "<No value>"
msgstr "<Нет значения>"

msgid "Split data entry tabs by section"
msgstr ""

msgid "Use metadata codes (organisation units, data elements and options)"
msgstr ""

Expand Down
98 changes: 98 additions & 0 deletions src/webapp/components/collapsible-section/Section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import { Icon, IconButton, makeStyles, Paper } from "@material-ui/core";
import React from "react";
import { buildClassName } from "../../utils/reactHelpers";

type IconPosition = "left" | "right";
type ArrowStyle = "up_down" | "right_left" | "down_right";

interface SectionProps {
isOpen?: boolean;
setOpen?: (open: boolean) => void;
children: React.ReactNode;
title: React.ReactNode;
collapsible?: boolean;
elevation?: number;
iconPos?: IconPosition;
classProps?: {
sectionPaper?: string;
sectionHeader?: string;
sectionContent?: string;
};
arrowStyle?: ArrowStyle;
}

export const Section = (props: SectionProps) => {
const {
children,
title,
collapsible,
isOpen = true,
setOpen = () => {},
elevation = 1,
iconPos = "right",
classProps = {},
arrowStyle = "up_down",
} = props;
const classes = useStyles();
const leftIcon = iconPos === "left" ? classes.leftIcon : null;
const toggle = () => setOpen(!isOpen);

return (
<Paper elevation={elevation} className={buildClassName([classes.paper, classProps.sectionPaper])}>
<div
className={buildClassName([
classes.header,
leftIcon,
classProps.sectionHeader,
isOpen ? null : classes.noBorder,
])}
onClick={toggle}
>
{collapsible && leftIcon && <CollapsibleToggle isOpen={isOpen} arrowStyle={arrowStyle} />}
{title}
{collapsible && !leftIcon && <CollapsibleToggle isOpen={isOpen} arrowStyle={arrowStyle} />}
</div>
<div className={buildClassName([classProps.sectionContent, isOpen ? null : classes.hidden])}>
{children}
</div>
</Paper>
);
};

interface CollapsibleToggleProps {
tokland marked this conversation as resolved.
Show resolved Hide resolved
isOpen: boolean;
arrowStyle: ArrowStyle;
}

const CollapsibleToggle = (props: CollapsibleToggleProps) => {
const { isOpen, arrowStyle } = props;
const classes = useStyles();
const [open, close] = arrowStyle.split("_");

return (
<IconButton disableTouchRipple={true} style={isOpen ? {} : { left: 0 }} className={classes.button}>
<Icon>{isOpen ? `keyboard_arrow_${open}` : `keyboard_arrow_${close}`}</Icon>
</IconButton>
);
};

const useStyles = makeStyles({
header: {
margin: 0,
padding: "1em",
paddingLeft: 0,
display: "flex",
justifyContent: "space-between",
alignItems: "center",
borderBottom: "solid 1px #e8edf2",
cursor: "pointer",
},
noBorder: { border: "none" },
leftIcon: {
justifyContent: "normal",
gap: 10,
},
paper: { padding: "1em", paddingTop: "0.5em", marginBottom: "1em" },
button: { padding: 0 },
hidden: { display: "none" },
});
Loading