Skip to content

Commit

Permalink
[frontend] Fix date attribute for list and timeLine widgets (#6145)
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact committed Mar 28, 2024
1 parent c08cb0e commit 9ea9e0b
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ const WidgetConfig = ({ workspace, widget, onComplete, closeMenu }) => {
const getCurrentIsRelationships = () => {
return indexedVisualizationTypes[type]?.isRelationships ?? false;
};
const isWidgetListOrTimeline = () => {
return indexedVisualizationTypes[type]?.key === 'list' || indexedVisualizationTypes[type]?.key === 'timeline';
};
const getCurrentIsEntities = () => {
return indexedVisualizationTypes[type]?.isEntities ?? false;
};
Expand Down Expand Up @@ -928,15 +931,8 @@ const WidgetConfig = ({ workspace, widget, onComplete, closeMenu }) => {
labelId="relative"
size="small"
fullWidth={true}
value={
dataSelection[i].date_attribute ?? 'created_at'
}
onChange={(event) => handleChangeDataValidationParameter(
i,
'date_attribute',
event.target.value,
)
}
value={dataSelection[i].date_attribute ?? 'created_at'}
onChange={(event) => handleChangeDataValidationParameter(i, 'date_attribute', event.target.value)}
>
<MenuItem value="created_at">
created_at ({t_i18n('Technical date')})
Expand All @@ -960,12 +956,12 @@ const WidgetConfig = ({ workspace, widget, onComplete, closeMenu }) => {
stop_time ({t_i18n('Functional date')})
</MenuItem>
)}
{getCurrentIsRelationships() && (
{getCurrentIsRelationships() && !isWidgetListOrTimeline() && (
<MenuItem value="first_seen">
first_seen ({t_i18n('Functional date')})
</MenuItem>
)}
{getCurrentIsRelationships() && (
{getCurrentIsRelationships() && !isWidgetListOrTimeline() && (
<MenuItem value="last_seen">
last_seen ({t_i18n('Functional date')})
</MenuItem>
Expand Down

0 comments on commit 9ea9e0b

Please sign in to comment.