Skip to content

Commit f00b095

Browse files
Rename binary data type labels
1 parent 4ac9f0f commit f00b095

File tree

4 files changed

+58
-60
lines changed

4 files changed

+58
-60
lines changed

public/locales/en/translation.json

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"Boolean": "Boolean",
132132
"a data type where the data only has two possible variables: true or false": "a data type where the data only has two possible variables: true or false",
133133
"Binary": "Binary",
134+
"Binaryfile": "Binaryfile",
134135
"a data type that defines a binary code signal": "a data type that defines a binary code signal",
135136
"DateTime": "DateTime",
136137
"a data type that defines dates. Common formats include dates ...": "a data type that defines dates. Common formats include dates (e.g., YYYY-MM-DD), times (e.g., hh:mm:ss), dates and times concatenated (e.g., YYYY-MM-DDThh:mm:ss.sss+zz:zz), and durations (e.g., PnYnMnD)",
@@ -170,6 +171,7 @@
170171
"This is a language specific description of the attribute...": "This is a language specific description of the attribute and should contain information that will help dataset users understand necessary details about each attribute.",
171172
"Toggles between the one or more languages used in the schema": "Toggles between the one or more languages used in the schema.",
172173
"Array[Binary]": "Array[Binary]",
174+
"Array[Binaryfile]": "Array[Binaryfile]",
173175
"Array[Boolean]": "Array[Boolean]",
174176
"Array[DateTime]": "Array[DateTime]",
175177
"Array[Numeric]": "Array[Numeric]",

public/locales/fr/translation.json

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
"Boolean": "Booléen",
131131
"a data type where the data only has two possible variables: true or false": "un type de données où les données n'ont que deux variables possibles : vrai ou faux",
132132
"Binary": "Binaire",
133+
"Binaryfile": "Fichier binaire",
133134
"a data type that defines a binary code signal": "un type de données qui définit un signal de code binaire",
134135
"DateTime": "DateHeure",
135136
"a data type that defines dates. Common formats include dates ...": "un type de données qui définit les dates. Les formats courants incluent les dates (par exemple, AAAA-MM-JJ), les heures (par exemple, hh:mm:ss), les dates et les heures concaténées (par exemple, AAAA-MM-JJThh:mm:ss.sss+zz:zz) et durées (par exemple, PnYnMnD)",
@@ -169,6 +170,7 @@
169170
"This is a language specific description of the attribute...": "Il s'agit d'une description spécifique à la langue de l'attribut et doit contenir des informations qui aideront les utilisateurs de l'ensemble de données à comprendre les détails nécessaires sur chaque attribut.",
170171
"Toggles between the one or more languages used in the schema": "Bascule entre une ou plusieurs langues utilisées dans le schéma.",
171172
"Array[Binary]": "Tableau[Binaire]",
173+
"Array[Binaryfile]": "Tableau[Fichier binaire]",
172174
"Array[Boolean]": "Tableau[Booléen]",
173175
"Array[DateTime]": "Tableau[DateHeure]",
174176
"Array[Numeric]": "Tableau[Numérique]",

src/AttributeDetails/TypeRenderer.jsx

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ const TypeRenderer = ({ data, attributeRowData, typesObjectRef, dropRefs }) => {
77
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
88
const { t } = useTranslation();
99
const displayValues = [
10-
"",
11-
"Binary",
12-
"Boolean",
13-
"DateTime",
14-
"Numeric",
15-
// "Reference",
16-
"Text",
17-
"Array[Binary]",
18-
"Array[Boolean]",
19-
"Array[DateTime]",
20-
"Array[Numeric]",
21-
// "Array[Reference]",
22-
"Array[Text]"
10+
{ value: "", label: "" },
11+
{ value: "Binary", label: "Binaryfile" },
12+
{ value: "Boolean", label: "Boolean" },
13+
{ value: "DateTime", label: "DateTime" },
14+
{ value: "Numeric", label: "Numeric" },
15+
// { value: "Reference", label: "Reference" },
16+
{ value: "Text", label: "Text" },
17+
{ value: "Array[Binary]", label: "Array[Binaryfile]" },
18+
{ value: "Array[Boolean]", label: "Array[Boolean]" },
19+
{ value: "Array[DateTime]", label: "Array[DateTime]" },
20+
{ value: "Array[Numeric]", label: "Array[Numeric]" },
21+
// { value: "Array[Reference]", label: "Array[Reference]" },
22+
{ value: "Array[Text]", label: "Array[Text]" }
2323
];
2424

2525
const attributeName = data.Attribute;
@@ -29,16 +29,16 @@ const TypeRenderer = ({ data, attributeRowData, typesObjectRef, dropRefs }) => {
2929

3030
const index = attributeRowData.findIndex((item) => item.Attribute === attributeName);
3131
const [type, setType] = useState(
32-
(currentAttribute && currentAttribute.Type) || displayValues[0]
32+
(currentAttribute && currentAttribute.Type) || displayValues[0].value
3333
);
3434

3535
const typesDisplay = displayValues.map((value) => (
3636
<MenuItem
37-
key={value}
38-
value={value}
37+
key={value.value}
38+
value={value.value}
3939
sx={{ border: "none", height: "2rem", fontSize: "small" }}
4040
>
41-
{t(value)}
41+
{t(value.label)}
4242
</MenuItem>
4343
));
4444

src/AttributeDetails/TypeTooltip.js

+37-43
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,61 @@ import React from "react";
22
import { Typography } from "@mui/material";
33
import { useTranslation } from "react-i18next";
44

5+
const BulletDot = () => (
6+
<div
7+
style={{
8+
width: "4px",
9+
height: "4px",
10+
borderRadius: "50%",
11+
backgroundColor: "white",
12+
display: "inline-block",
13+
verticalAlign: "middle",
14+
marginRight: "5px",
15+
marginBottom: "2px"
16+
}}
17+
/>
18+
);
19+
520
export default function TypeTooltip() {
621
const { t } = useTranslation();
722

8-
const BulletDot = () => {
9-
return (
10-
<div
11-
style={{
12-
width: "4px",
13-
height: "4px",
14-
borderRadius: "50%",
15-
backgroundColor: "white",
16-
display: "inline-block",
17-
verticalAlign: "middle",
18-
marginRight: "5px",
19-
marginBottom: "2px",
20-
}}
21-
/>
22-
);
23-
};
24-
2523
const listArray = [
2624
{ name: t("Text"), content: t("text, mixed text and numbers") },
2725
{ name: t("Numeric"), content: t("only numbers") },
2826
{
2927
name: t("Boolean"),
30-
content:
31-
t("a data type where the data only has two possible variables: true or false"),
28+
content: t(
29+
"a data type where the data only has two possible variables: true or false"
30+
)
3231
},
3332
{
34-
name: t("Binary"),
35-
content: t("a data type that defines a binary code signal"),
33+
name: t("Binaryfile"),
34+
content: t("a data type that defines a binary code signal")
3635
},
3736
{
3837
name: t("DateTime"),
39-
content:
40-
t("a data type that defines dates. Common formats include dates ..."),
38+
content: t("a data type that defines dates. Common formats include dates ...")
4139
},
4240
{
4341
name: t("Array [attribute type]"),
44-
content:
45-
t("a data type that defines a structure that holds several data items or elements of the same data type"),
46-
},
42+
content: t(
43+
"a data type that defines a structure that holds several data items or elements of the same data type"
44+
)
45+
}
4746
];
4847

49-
const tooltipDisplay = listArray.map((item) => {
50-
return (
51-
<div sx={{ p: 0 }} key={item.name}>
52-
<BulletDot />
53-
<Typography
54-
variant="caption"
55-
sx={{ display: "inline", fontWeight: "bold" }}
56-
>
57-
{item.name}:
58-
</Typography>
59-
<Typography variant="caption">
60-
&nbsp;
61-
{item.content}
62-
</Typography>
63-
</div>
64-
);
65-
});
48+
const tooltipDisplay = listArray.map((item) => (
49+
<div key={item.name}>
50+
<BulletDot />
51+
<Typography variant="caption" sx={{ display: "inline", fontWeight: "bold" }}>
52+
{item.name}:
53+
</Typography>
54+
<Typography variant="caption">
55+
&nbsp;
56+
{item.content}
57+
</Typography>
58+
</div>
59+
));
6660

6761
return <div>{tooltipDisplay}</div>;
6862
}

0 commit comments

Comments
 (0)