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
1 change: 0 additions & 1 deletion web/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"no-nested-ternary": "off", // 164 errors across 40 files
"no-shadow": "warn", // 110 errors across 40 files
"max-len": "error",
"consistent-return": "off", // 95 errors across 58 files
"no-underscore-dangle": "error",
"no-param-reassign": [ // 198 errors across 46 files
"warn",
Expand Down
14 changes: 7 additions & 7 deletions web/js/components/animation-widget/play-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
/**
* Gets the last date that should be added to the queue
*/
getLastInQueue = function() {

Check warning on line 140 in web/js/components/animation-widget/play-queue.js

View workflow job for this annotation

GitHub Actions / windows-latest, Node 24

Unexpected unnamed method 'getLastInQueue'
const { isLoopActive, startDate, endDate } = this.props;
let currentDate = toDate(this.playingDate);
const currentBufferSize = util.objectLength(this.bufferObject);
Expand Down Expand Up @@ -207,15 +207,15 @@
const restartLoop = loopStart && currentDate.getTime() === startDate.getTime();

if ((isAnimating || this.hasPlayStarted) && !loopStart) {
return;
return true;
}
if (this.isPreloadSufficient() || restartLoop) {
if (this.isBetweenSteps) return;
if (this.isBetweenSteps) return true;
// console.debug('Started: ', Date.now());
this.hasPlayStarted = true;
return this.play();
}
this.checkQueue();
return this.checkQueue();
};

checkShouldLoop() {
Expand Down Expand Up @@ -313,7 +313,7 @@
this.fetchTimes.push(fetchTime);
this.setState({ loadedItems: loadedItems += 1 });

if (!this.mounted) return;
if (!this.mounted) return true;
this.bufferObject[strDate] = strDate;
delete this.inQueueObject[strDate];
const currentBufferSize = util.objectLength(this.bufferObject);
Expand Down Expand Up @@ -401,19 +401,19 @@
if (nextDate > endDate) {
this.abortController.abort();
this.checkShouldLoop();
return;
return true;
}

// Playback caught up with buffer :(
if (!this.bufferObject[nextDateStr]) {
this.stopPlaying();
this.checkQueue();
return;
return true;
}
if (!isPlaying || !this.mounted) {
this.stopPlaying();
}
this.checkQueue();
return this.checkQueue();
};
const animIntervalMS = speed === 0.5 ? 2000 : 1000 / speed;
this.animationInterval(animIntervalMS, player);
Expand Down
1 change: 1 addition & 0 deletions web/js/components/compare/pick.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Pick extends React.Component {
</text>
);
}
return false;
}

render() {
Expand Down
4 changes: 2 additions & 2 deletions web/js/components/context-menu/context-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function RightClickMenu(props) {
return onToggleUnits(oppositeUnit);
}
setShow(false);
events.trigger(`measure:${action}`);
return events.trigger(`measure:${action}`);
}

function addPlaceMarkerHandler(coords, olMap, crs) {
Expand All @@ -79,7 +79,7 @@ function RightClickMenu(props) {
};

useEffect(() => {
if (isCoordinateSearchActive) return;
if (isCoordinateSearchActive) return false;
events.on(MAP_SINGLE_CLICK, handleClick);
events.on(MAP_CONTEXT_MENU, handleContextEvent);
return () => {
Expand Down
2 changes: 1 addition & 1 deletion web/js/components/dateline/datelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function DateLines(props) {

useEffect(() => {
if (proj.id !== 'geographic' || !mapIsRendered) {
return;
return undefined;
}
map.on('movestart', () => {
setHideLines(true);
Expand Down
1 change: 1 addition & 0 deletions web/js/components/dateline/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default function Line (props) {
toggleTextActive(false);
}
if (overlay !== '') return overlay.setPosition([lineX, lineY]);
return undefined;
});

const mouseOver = () => {
Expand Down
2 changes: 2 additions & 0 deletions web/js/components/image-download/image-download-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function ImageDownloadPanel(props) {
</div>
);
}
return false;
};

const renderWorldfileSelect = () => {
Expand All @@ -169,6 +170,7 @@ function ImageDownloadPanel(props) {
</div>
);
}
return false;
};

const crossesDatelineAlert = () => datelineMessage && (
Expand Down
6 changes: 3 additions & 3 deletions web/js/components/layer/info/date-ranges.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function DateRanges ({ layer }) {
const { ongoing } = layer;

const getDateRanges = async () => {
if (dateRanges.length) return;
if (dateRanges.length) return undefined;
if (!ongoing) return setDateRanges(formatDateRanges(layer.dateRanges));
const worker = new Worker('js/workers/describe-domains.worker.js');
worker.onmessage = (event) => {
Expand All @@ -31,7 +31,7 @@ export default function DateRanges ({ layer }) {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(event.data, 'text/xml');
const domains = xmlDoc.querySelector('Domain')?.textContent || '';
worker.postMessage({ operation: 'mergeDomains', args: [domains, 0] });
return worker.postMessage({ operation: 'mergeDomains', args: [domains, 0] });
};
worker.onerror = () => {
worker.terminate();
Expand All @@ -48,7 +48,7 @@ export default function DateRanges ({ layer }) {
id: layer.id,
proj: 'EPSG:4326',
};
worker.postMessage({ operation: 'requestDescribeDomains', args: [params] });
return worker.postMessage({ operation: 'requestDescribeDomains', args: [params] });
};

const renderListItem = () => dateRanges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function BrowseLayerList (props) {
/>
);
}
return undefined;
})
}
</div>
Expand Down
2 changes: 2 additions & 0 deletions web/js/components/layer/settings/palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ function PaletteSelect (props) {
activePalette === target.id,
);
}
return undefined;
};

const recommended = layer.palette.recommended || [];
Expand All @@ -180,6 +181,7 @@ function PaletteSelect (props) {
return item;
}
}
return undefined;
})
}
</Scrollbar>
Expand Down
1 change: 1 addition & 0 deletions web/js/components/layer/settings/vector-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class VectorStyleSelect extends React.Component {
const item = this.customLegend(styleLayerObject);
return item;
}
return false;
})
}
</Scrollbar>
Expand Down
3 changes: 3 additions & 0 deletions web/js/components/measure-tool/measure-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default function MeasureTooltip(props) {
? `${roundAndLocale(imperialLength, ftPerMile)} mi`
: `${roundAndLocale(imperialLength)} ft`;
}
return undefined;
};

/**
Expand All @@ -91,6 +92,7 @@ export default function MeasureTooltip(props) {
? `${roundAndLocale(imperialArea, sqFtPerSqMile)} mi<sup>2</sup>`
: `${roundAndLocale(imperialArea)} ft<sup>2</sup>`;
}
return undefined;
};

const getMeasurementValue = () => {
Expand All @@ -103,6 +105,7 @@ export default function MeasureTooltip(props) {
if (geometry instanceof OlLineString) {
return getFormattedLength(geometry);
}
return undefined;
};

const checkGeographicCoordValidity = (val) => val.indexOf('NaN') < 0;
Expand Down
1 change: 1 addition & 0 deletions web/js/components/range-selection/dragger.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class TimelineDragger extends PureComponent {
</text>
);
}
return undefined;
}

/*
Expand Down
4 changes: 3 additions & 1 deletion web/js/components/sidebar/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function Event (props) {
* @returns Magnitude data output
*/
function magnitudeOutput({ magnitudeUnit, magnitudeValue }) {
if (!magnitudeUnit || !magnitudeValue) return;
if (!magnitudeUnit || !magnitudeValue) return undefined;
const formattedunit = magnitudeUnit === 'kts' ? ' kts' : ' NM';
return (
<p className="magnitude">
Expand Down Expand Up @@ -143,6 +143,7 @@ function Event (props) {
</ul>
);
}
return undefined;
}

/**
Expand Down Expand Up @@ -177,6 +178,7 @@ function Event (props) {
return `${source.title} `;
});
}
return undefined;
}

return (
Expand Down
3 changes: 2 additions & 1 deletion web/js/components/sidebar/paletteLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ class PaletteLegend extends React.Component {
} if (colorMap.type === 'classification') {
return this.renderClasses(colorMap, index);
}
return undefined;
});
}

Expand All @@ -463,7 +464,7 @@ class PaletteLegend extends React.Component {
} = this.props;
const { isHoveringLegend } = this.state;
const customClass = (showingVectorHand && layer.id.includes('AERONET')) || showingChartingIcon ? ' bottomspace-palette' : isCustomPalette ? ' is_custom' : '';
if (!layer.palette) return;
if (!layer.palette) return undefined;
return (
<div
className={
Expand Down
2 changes: 1 addition & 1 deletion web/js/components/timeline/timeline-axis/timeline-axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ class TimelineAxis extends Component {
const xmlDoc = parser.parseFromString(event.data, 'text/xml');
const domains = xmlDoc.querySelector('Domain')?.textContent;
if (!domains) worker.terminate();
worker.postMessage({ operation: 'mergeDomains', args: [domains, 60_000] });
return worker.postMessage({ operation: 'mergeDomains', args: [domains, 60_000] });
};
worker.onerror = () => worker.terminate();
let startDate = new Date(def.startDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function AnimationButton(props) {
} if (isMobileTablet && isLandscape) {
return `tablet-landscape${subdailyID}`;
}
return undefined;
};

const buttonClass = getButtonClassName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class TimelineLayerCoveragePanel extends Component {
return granuleDateRanges.map(([start, end]) => ({ startDate: start, endDate: end }));
});
}
return undefined;
};

stopPropagation = (e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ class DraggerContainer extends PureComponent {
null,
true,
);
return;
return true;
}
return false;
}

// update parent dragger positioning
updateDraggerDatePosition(
return updateDraggerDatePosition(
newDraggerTime,
draggerSelected,
newDraggerPosition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Dragger extends PureComponent {
} if (deltaX > 0 && draggerAtEnd) {
return false;
}
handleDragDragger(e, d);
return handleDragDragger(e, d);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion web/js/components/tour/widget-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Steps(props) {
};

useEffect(() => {
if (!isKioskModeActive) return;
if (!isKioskModeActive) return undefined;

document.addEventListener('keydown', handleKeyDown);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function CollapsedAnimationWidget (props) {
} if (isMobileTablet && isLandscape) {
return `-tablet-landscape${subdailyID}`;
}
return undefined;
};

const widgetIDs = getWidgetIDs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function MobileAnimationWidget (props) {
} if (isMobileTablet || screenWidth <= breakpoints.small) {
return 'tablet';
}
return undefined;
};

const mobileID = getMobileIDs();
Expand Down
1 change: 1 addition & 0 deletions web/js/containers/sidebar/layer-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ function LayerRow (props) {
/>
);
}
return undefined;
};

useEffect(() => {
Expand Down
3 changes: 2 additions & 1 deletion web/js/containers/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Sidebar extends React.Component {
});
const storageValue = isNowCollapsed ? 'collapsed' : 'expanded';
safeLocalStorage.setItem(SIDEBAR_COLLAPSED, storageValue);
collapseExpandToggle();
return collapseExpandToggle();
}

getProductsToRender(activeTab, isCompareMode, isChartMode) {
Expand Down Expand Up @@ -189,6 +189,7 @@ class Sidebar extends React.Component {
/>
);
}
return undefined;
}

handleWorldviewLogoClick(e, permalink) {
Expand Down
2 changes: 1 addition & 1 deletion web/js/containers/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ class Timeline extends React.Component {
if (!userIsInteracting && !isAnimationPlaying) {
return resolve();
}
setTimeout(waitForSafeUpdate, 1000);
return setTimeout(waitForSafeUpdate, 1000);
}());
});
};
Expand Down
2 changes: 1 addition & 1 deletion web/js/map/granule/granule-layer-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
* @returns {boolean} - true if date is within a range
*/
const isWithinRanges = (date, ranges) => {
if (!ranges) return;
if (!ranges) return undefined;

return ranges.some(([start, end]) => date >= new Date(start) && date <= new Date(end));
};
Expand Down
2 changes: 2 additions & 0 deletions web/js/map/granule/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const isWithinBounds = (crs, granule) => {
if (crs === CRS.ARCTIC) {
return granule.polygon.every(([lat, lon]) => lon > 40);
}
return undefined;
};

export const getGranuleFootprints = (layer) => {
Expand Down Expand Up @@ -186,6 +187,7 @@ export const getParamsForGranuleRequest = (def, date, crs) => {
} catch (e) {
console.error(`Could not get shortName for a collection associated with layer ${def.id}`);
}
return undefined;
};

if (def.conceptIds[0].type === 'NRT') {
Expand Down
1 change: 1 addition & 0 deletions web/js/map/layerbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ export default function mapLayerBuilder(config, cache, store) {
url.replace('/VectorTileServer', '/VectorTileServer/'),
);
}
return undefined;
},
});
await applyBackground(layer, vectorStyle.url);
Expand Down
Loading
Loading