Skip to content

Commit 0d1cd42

Browse files
committed
add validity tooltype
Signed-off-by: David BRAQUART <[email protected]>
1 parent e898f46 commit 0d1cd42

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

src/pages/profiles/profiles-table.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ import { useIntl } from 'react-intl';
1010
import { Cancel, CheckCircle, ManageAccounts, RadioButtonUnchecked } from '@mui/icons-material';
1111
import { GridButton, GridButtonDelete, GridTable, GridTableRef } from '../../components/Grid';
1212
import { UserAdminSrv, UserProfile } from '../../services';
13-
import { ColDef, GetRowIdParams, RowClickedEvent, SelectionChangedEvent, TextFilterParams } from 'ag-grid-community';
13+
import {
14+
ColDef,
15+
GetRowIdParams,
16+
ITooltipParams,
17+
RowClickedEvent,
18+
SelectionChangedEvent,
19+
TextFilterParams
20+
} from 'ag-grid-community';
1421
import { useSnackMessage } from '@gridsuite/commons-ui';
1522
import DeleteConfirmationDialog from '../common/delete-confirmation-dialog';
1623
import { defaultColDef, defaultRowSelection } from '../common/table-config';
@@ -92,6 +99,21 @@ const ProfilesTable: FunctionComponent<ProfilesTableProps> = (props) => {
9299
return <Cancel fontSize="small" color="error" />;
93100
}
94101
},
102+
tooltipValueGetter: (p: ITooltipParams) => {
103+
if (p.value == null) {
104+
return intl.formatMessage({
105+
id: 'profiles.table.validity.tooltip.none',
106+
});
107+
} else if (p.value) {
108+
return intl.formatMessage({
109+
id: 'profiles.table.validity.tooltip.ok',
110+
});
111+
} else {
112+
return intl.formatMessage({
113+
id: 'profiles.table.validity.tooltip.ko',
114+
});
115+
}
116+
},
95117
flex: 1,
96118
headerName: intl.formatMessage({
97119
id: 'profiles.table.validity',

src/translations/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
"profiles.table.id.description": "Profile name",
6767
"profiles.table.validity": "Configurations links validity",
6868
"profiles.table.validity.description": "Are all configurations links valid ?",
69+
"profiles.table.validity.tooltip.none": "No configuration link defined",
70+
"profiles.table.validity.tooltip.ok": "All configurations links are valid",
71+
"profiles.table.validity.tooltip.ko": "At least one configuration link is invalid",
6972
"profiles.table.error.add": "Error while adding profile {profile} : A profile with the same name already exists.",
7073
"profiles.table.error.delete": "Error while deleting profile",
7174
"profiles.table.integrity.error.delete": "Error while deleting profile : a profile is still referenced by users",
@@ -89,7 +92,7 @@
8992
"profiles.form.modification.readError": "Error while reading the profile",
9093
"profiles.form.modification.updateError": "Error while updating the profile",
9194

92-
"groups.table.id": "ID",
95+
"groups.table.id": "Name",
9396
"groups.table.id.description": "Group identifier",
9497
"groups.table.users": "Users",
9598
"groups.table.users.description": "The group's users",

src/translations/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
"profiles.table.id.description": "Nom du profil",
6868
"profiles.table.validity": "Validité des liens vers les configurations",
6969
"profiles.table.validity.description": "Tous les liens vers les configurations sont-ils valides ?",
70+
"profiles.table.validity.tooltip.none": "Aucun lien vers une configuration n'est défini",
71+
"profiles.table.validity.tooltip.ok": "Tous les liens vers les configurations sont valides",
72+
"profiles.table.validity.tooltip.ko": "Au moins un lien vers les configurations est invalide",
7073
"profiles.table.error.add": "Erreur pendant l'ajout du profil {profile} : Un profil du même nom existe déjà.",
7174
"profiles.table.error.delete": "Erreur pendant la suppression de profil",
7275
"profiles.table.integrity.error.delete": "Erreur pendant la suppression de profil: un profil est toujours référencé par des utilisateurs",

0 commit comments

Comments
 (0)