Skip to content

Commit

Permalink
[frontend] Fix wrong 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 26, 2024
1 parent 008b6b7 commit 44e6084
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ const WidgetConfig = ({ workspace, widget, onComplete, closeMenu }) => {
const getCurrentIsRelationships = () => {
return indexedVisualizationTypes[type]?.isRelationships ?? false;
};
const isWidgetListOrTimeline = () => {
return widget.type === 'list' || 'timeline';
};
const getCurrentIsEntities = () => {
return indexedVisualizationTypes[type]?.isEntities ?? false;
};
Expand Down Expand Up @@ -916,15 +919,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 @@ -948,12 +944,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 44e6084

Please sign in to comment.