mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
fix(recent-imagery): address dateline review (halves availability, voice guard, export, renderer fallback)
This commit is contained in:
1 parent
9a34d63f1d
commit
d60f2420f4
9 files changed
+209
-54
No files matched your search
+10
-4
@@ -523,6 +523,10 @@ export function createRecentImageryPanel({
|
||||
|
||||
function exportsView() {
|
||||
const ab = snapshot.mode === 'ab';
|
||||
// Worldview Snapshots rejects a crossing BBOX: say so up front.
|
||||
const crossing = Boolean(
|
||||
snapshot.box && snapshot.box.west > snapshot.box.east,
|
||||
);
|
||||
return [
|
||||
{
|
||||
id: 'export',
|
||||
@@ -532,10 +536,12 @@ export function createRecentImageryPanel({
|
||||
label: ab
|
||||
? t('EXPORT {slot}', { slot: slotId.toUpperCase() })
|
||||
: t('EXPORT'),
|
||||
title: ab
|
||||
? t('Download {slot} as a PNG', { slot: slotId.toUpperCase() })
|
||||
: t('Download the image as a PNG'),
|
||||
disabled: !exportTarget(slotId) || exporting.has(slotId),
|
||||
title: crossing
|
||||
? t('Select one side of the dateline')
|
||||
: ab
|
||||
? t('Download {slot} as a PNG', { slot: slotId.toUpperCase() })
|
||||
: t('Download the image as a PNG'),
|
||||
disabled: crossing || !exportTarget(slotId) || exporting.has(slotId),
|
||||
reserved: slotId === 'b' ? !ab : undefined,
|
||||
onClick: () => void exportImage(slotId),
|
||||
})),
|
||||
|
||||
@@ -978,6 +978,10 @@ test('opacity drives both images; EXPORT downloads the pin or the preview and EX
|
||||
'Select one side of the dateline',
|
||||
'the drawn box is not a warning until an export is tried',
|
||||
);
|
||||
const crossingExport = f.byAction('export-a');
|
||||
assert.equal(crossingExport.disabled, true, 'EXPORT is off up front');
|
||||
assert.equal(crossingExport.title, 'Select one side of the dateline');
|
||||
// The exportImage guard stays as a backstop.
|
||||
assert.equal(await f.readout.exportImage('a'), false);
|
||||
assert.equal(
|
||||
f.byId('ri-notice-text').textContent,
|
||||
|
||||
Reference in new issue
Block a user