mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-25 18:40:06 -04:00
Solar: drop the data source line under the location
The attribution at the bottom of the page is enough. The line under the location now only appears to report the data's state: loading, failed to load, or replaced by the user's own values. Bumps wrolpi-help for the refreshed screenshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a51b15bf4f
commit
bbd2e42715
4 changed files with 6 additions and 9 deletions
|
|
@ -41,7 +41,6 @@ import {
|
|||
CLIMATOLOGY_CHANGES,
|
||||
CLIMATOLOGY_DATA_REFERENCE,
|
||||
CLIMATOLOGY_LICENSE,
|
||||
CLIMATOLOGY_SOURCE,
|
||||
lookupClimatology,
|
||||
useClimatology,
|
||||
} from "./solarData";
|
||||
|
|
@ -247,7 +246,8 @@ function LocationSection({get, set, s, climatology}) {
|
|||
);
|
||||
};
|
||||
|
||||
let source;
|
||||
// The data's attribution is at the bottom of the page; this line only reports the data's state.
|
||||
let source = null;
|
||||
if (s.ownData) {
|
||||
source = 'Using your own sunlight data.';
|
||||
} else if (climatology.loading) {
|
||||
|
|
@ -256,8 +256,6 @@ function LocationSection({get, set, s, climatology}) {
|
|||
source = <Message kind='warning' title='Sunlight data could not be loaded'>
|
||||
Enter your own monthly sunlight under "Use my own sunlight data" below.
|
||||
</Message>;
|
||||
} else {
|
||||
source = `Sunlight and temperature: ${CLIMATOLOGY_SOURCE}; see Data attribution at the bottom of the page.`;
|
||||
}
|
||||
|
||||
return <>
|
||||
|
|
@ -279,7 +277,7 @@ function LocationSection({get, set, s, climatology}) {
|
|||
</Grid.Col>
|
||||
</Grid>
|
||||
{geoError && <Message kind='warning' title='Could not get your location'>{geoError}</Message>}
|
||||
<div style={{fontSize: '0.85em', opacity: 0.75, marginTop: '0.5em'}}>{source}</div>
|
||||
{source && <div style={{fontSize: '0.85em', opacity: 0.75, marginTop: '0.5em'}}>{source}</div>}
|
||||
</>;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ describe('SolarCalculator', () => {
|
|||
renderWithProviders(<SolarCalculator/>, {route: DENVER});
|
||||
expect(await findEstimate()).toBeInTheDocument();
|
||||
expect(screen.getByText(`${roundDigits(expectedAnnual(), 0)}`)).toBeInTheDocument();
|
||||
expect(screen.getByText(/Sunlight and temperature: NASA POWER/)).toBeInTheDocument();
|
||||
// The attribution is only at the bottom of the page.
|
||||
expect(screen.queryByText(/Sunlight and temperature/)).not.toBeInTheDocument();
|
||||
expect(global.fetch).toHaveBeenCalledWith(expect.stringMatching(/\/data\/solar-climatology\.bin$/));
|
||||
});
|
||||
|
||||
|
|
@ -133,7 +134,6 @@ describe('SolarCalculator', () => {
|
|||
// After everything else, including the last Fine-tune section.
|
||||
const lastControl = screen.getByText('Use my own sunlight data: off');
|
||||
expect(lastControl.compareDocumentPosition(heading) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
||||
expect(screen.getByText(/see Data attribution at the bottom of the page/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('typing writes the URL and leaves defaults out', async () => {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import React from "react";
|
|||
// must match PARAMETERS below. The file is only fetched when the calculator opens.
|
||||
|
||||
export const CLIMATOLOGY_URL = `${process.env.PUBLIC_URL || ''}/data/solar-climatology.bin`;
|
||||
export const CLIMATOLOGY_SOURCE = 'NASA POWER 2001–2020 monthly averages (CC BY 4.0)';
|
||||
|
||||
// Attribution, as NASA asks (https://power.larc.nasa.gov/docs/referencing/) and CC BY 4.0 requires. The
|
||||
// build script writes the same text, with the API version and download date, to
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e118fe46c94a0f5f371b009ccc9d7fd14ca979df
|
||||
Subproject commit b61bae309cf253e080824ac12eb8b4fb690b8456
|
||||
Loading…
Add table
Add a link
Reference in a new issue