Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 16 additions & 3 deletions web/client/plugins/Timeline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ import withResizeSpy from '../components/misc/enhancers/withResizeSpy';
import Toolbar from '../components/misc/toolbar/Toolbar';
import InlineDateTimeSelector from '../components/time/InlineDateTimeSelector';
import { currentTimeSelector, offsetEnabledSelector } from '../selectors/dimension';
import { getEffectivelyVisibleLayers } from '../selectors/layers';
import { playbackRangeSelector, statusSelector } from '../selectors/playback';
import {
currentTimeRangeSelector,
isMapSync,
isVisible,
rangeSelector,
selectedLayerData,
selectedLayerSelector,
timelineLayersSelector
} from '../selectors/timeline';
Expand Down Expand Up @@ -103,7 +105,9 @@ const TimelinePlugin = compose(
rangeSelector,
(state) => state.timeline?.loader !== undefined,
selectedLayerSelector,
(visible, layers, currentTime, currentTimeRange, offsetEnabled, playbackRange, status, viewRange, timelineIsReady, selectedLayer) => ({
selectedLayerData,
getEffectivelyVisibleLayers,
(visible, layers, currentTime, currentTimeRange, offsetEnabled, playbackRange, status, viewRange, timelineIsReady, selectedLayer, selectedLayerObject, effectivelyVisibleLayers) => ({
visible,
layers,
currentTime,
Expand All @@ -113,7 +117,9 @@ const TimelinePlugin = compose(
status,
viewRange,
timelineIsReady,
selectedLayer
selectedLayer,
selectedLayerIsHidden: !!selectedLayerObject
&& !effectivelyVisibleLayers.some(({ id }) => id === selectedLayer)
})
), {
setCurrentTime: selectTime,
Expand Down Expand Up @@ -200,7 +206,8 @@ const TimelinePlugin = compose(
initialSnap = 'now',
resetButton,
reset = () => {},
selectedLayer
selectedLayer,
selectedLayerIsHidden
}) => {
useEffect(()=>{
// update state with configs coming from configuration file like localConfig.json so that can be used as props initializer
Expand Down Expand Up @@ -328,6 +335,12 @@ const TimelinePlugin = compose(
tooltip={<Message msgId= {collapsed ? "timeline.expand" : "timeline.collapse"}/>}>
<Glyphicon glyph={collapsed ? 'resize-full' : 'resize-small'}/>
</Button>
{selectedLayerIsHidden && <Button
className="square-button ms-timeline-visibility-warning"
bsStyle="warning"
tooltip={<Message msgId="timeline.hiddenGuideLayerWarning"/>}>
<Glyphicon glyph="warning-sign"/>
</Button>}
</div>
</div>
{!timelineIsReady && <div className="timeline-loader">
Expand Down
16 changes: 16 additions & 0 deletions web/client/plugins/__tests__/Timeline-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ describe('Timeline Plugin', () => {
ReactDOM.render(<Plugin />, document.getElementById("container"));
expect(document.querySelector('.timeline-plugin.hidden')).toBeTruthy();
});
it('shows the warning when the hidden selected layer is not displayed in the timeline', () => {
const state = {
...FALSY_STATE,
layers: {
...FALSY_STATE.layers,
flat: FALSY_STATE.layers.flat.map(layer =>
layer.id === 'TEST_LAYER_2' ? { ...layer, visibility: true } : layer
)
}
};
const { Plugin } = getPluginForTest(TimelinePlugin, state);
ReactDOM.render(<Plugin />, document.getElementById("container"));

const warning = document.querySelector('.ms-timeline-visibility-warning');
expect(warning).toBeTruthy();
});
it('Timeline plugin is not visible when there are no layers with dimension data', ()=>{
const { Plugin } = getPluginForTest(TimelinePlugin, {});
ReactDOM.render(<Plugin />, document.getElementById("container"));
Expand Down
4 changes: 3 additions & 1 deletion web/client/themes/default/less/timeline.less
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,13 @@
font-weight: bold;
}
}
.ms-timeline-expand {
.ms-timeline-expand,
.ms-timeline-visibility-warning {
flex-shrink: 0;
border-radius: 4px;
height: 30px;
width: 30px;
margin-right: 4px;
}

/* local mixin to highlight handlers on timeline, used on active and over */
Expand Down
1 change: 1 addition & 0 deletions web/client/translations/data.de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3181,6 +3181,7 @@
"disableRange": "Zeitbereich deaktivieren",
"enablePlayBack": "Aktivieren Sie die Wiedergabesteuerung",
"disablePlayBack": "Deaktivieren Sie die Wiedergabesteuerung",
"hiddenGuideLayerWarning": "Die Führungslayer ist im Inhaltsverzeichnis und auf der Karte ausgeblendet, steuert aber weiterhin das Einrasten der Zeitleiste.",
"expand": "Erweitern Sie den Zeitschieberegler",
"collapse": "Schieberegler für die Zeitspanne reduzieren",
"reset": {
Expand Down
1 change: 1 addition & 0 deletions web/client/translations/data.en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3150,6 +3150,7 @@
"disableRange": "Disable time range",
"enablePlayBack": "Enable playback controls",
"disablePlayBack": "Disable playback controls",
"hiddenGuideLayerWarning": "The guide layer is hidden in the TOC and on the map, but continues to control timeline snapping.",
"expand": "Expand time slider",
"collapse": "Collapse time slider",
"reset": {
Expand Down
1 change: 1 addition & 0 deletions web/client/translations/data.es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -3138,6 +3138,7 @@
"disableRange": "Desactivar intervalo de tiempo",
"enablePlayBack": "Habilitar controles de reproducción",
"disablePlayBack": "Deshabilitar los controles de reproducción",
"hiddenGuideLayerWarning": "La capa guía está oculta en la TOC y en el mapa, pero sigue controlando el ajuste de la línea de tiempo.",
"expand": "Expandir el control deslizante de tiempo",
"collapse": "Minimizar el control deslizante de tiempo",
"reset": {
Expand Down
1 change: 1 addition & 0 deletions web/client/translations/data.fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3142,6 +3142,7 @@
"disableRange": "Désactiver la plage de temps",
"enablePlayBack": "Activer les contrôles de lecture",
"disablePlayBack": "Désactiver les contrôles de lecture",
"hiddenGuideLayerWarning": "Le couche de référence est masquée dans la TOC et sur la carte, mais continue de contrôler l'accrochage de la chronologie.",
"expand": "Développer le curseur temporel",
"collapse": "Réduire le curseur temporel",
"reset": {
Expand Down
1 change: 1 addition & 0 deletions web/client/translations/data.it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3142,6 +3142,7 @@
"disableRange": "Disabilita intervallo",
"enablePlayBack": "Abilita i controlli di riproduzione",
"disablePlayBack": "Disabilita i controlli di riproduzione",
"hiddenGuideLayerWarning": "Il layer guida è nascosto nel TOC e sulla mappa, ma continua a controllare l'aggancio della timeline.",
"expand": "Espandi",
"collapse": "Riduci",
"reset": {
Expand Down
Loading