Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color range slider revert correction #1278

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
e85ea31
Add ADR about design system change
j08lue Mar 15, 2024
4cfe488
Add first test to the aoi specification
AliceR Oct 24, 2024
3b41dad
Add instructions to the setup documentation
AliceR Oct 24, 2024
86e83fa
Handle empty source parameters
hanbyul-here Oct 25, 2024
1ee6025
Use more specific locator, using test id
AliceR Oct 28, 2024
15636b8
Improve aoi tests
AliceR Oct 28, 2024
c83bce5
Release v5.9.0
hanbyul-here Oct 29, 2024
ebcaff6
Revert "Color maps range slider implementation (#1190)"
snmln Oct 29, 2024
1046666
Handle the case when source parameters + render parameters are both e…
hanbyul-here Oct 30, 2024
7301b3c
Update STYLE_GUIDE.md
AliceR Oct 30, 2024
4d53f73
Update condition to run playwright tests on release branches
dzole0311 Oct 30, 2024
179976e
[Release] v5.9.0 (#1224)
snmln Oct 30, 2024
d7cc874
Add paragraph on design system TBD
j08lue Oct 30, 2024
ac43f28
Add ADR about design system change (#890)
j08lue Oct 31, 2024
da6c562
Enable prettier for .ts/.tsx files, but only warn
AliceR Oct 28, 2024
b1f14cc
Update condition to run playwright tests on release branches (#1228)
dzole0311 Oct 31, 2024
dcb5fdf
Hotfix to hide the external link badge from cards
dzole0311 Oct 31, 2024
668ab66
Keep prettier rules in a single location
AliceR Oct 31, 2024
b8b3f95
Update STYLE_GUIDE.md (#1227)
AliceR Oct 31, 2024
80ea196
Add another scenario to the AOI test
AliceR Oct 31, 2024
d4de243
Fix lint configuration (#1219)
AliceR Oct 31, 2024
2e42222
Bump package json version
dzole0311 Oct 31, 2024
e9b231b
Merge branch 'main' into hotfix/external-link-badge
dzole0311 Oct 31, 2024
973aadd
Add tests for the AOI feature specification (#1216)
AliceR Nov 4, 2024
10a0aa3
removing fucntionality from layout
snmln Oct 17, 2024
9cd0700
implementing session item
snmln Oct 18, 2024
dea2183
banner adjustments
snmln Oct 22, 2024
d4d715e
updating test and cookie fucntionality
snmln Oct 22, 2024
d99af1f
updating test and close consent functionality
snmln Oct 23, 2024
eb4b0ff
addressing lint errors.
snmln Oct 23, 2024
d89d3ba
correcting cookie rerender on page reload.
snmln Oct 24, 2024
5138220
implementing review feedback.
snmln Oct 28, 2024
87161fd
updating tests and implementing feedback
snmln Oct 29, 2024
85742bc
updating cookie consent documentation
snmln Oct 30, 2024
a8022c5
Fix utility function for cookie
hanbyul-here Nov 4, 2024
7061657
Move up path name logic, add cookie util test
hanbyul-here Nov 4, 2024
0b1a732
Cookie consent render logic (#1240)
snmln Nov 4, 2024
6d5ad43
Do not use session
hanbyul-here Nov 4, 2024
368c2be
Use debounced function
hanbyul-here Nov 4, 2024
2682238
Fix test
hanbyul-here Nov 5, 2024
4d4b9b4
Hotfix to hide the external link badge from cards (#1231)
dzole0311 Nov 5, 2024
117db83
Data catalog filters default to closed
vgeorge Nov 5, 2024
572459e
Set data catalog filters to be closed by default (#1243)
vgeorge Nov 5, 2024
598ac2a
Simplify logic for cookie consent (#1241)
snmln Nov 5, 2024
d2bc0e5
1171 cookie consent clean up (#1199)
snmln Nov 6, 2024
db3b502
Add ability to configure the card image/description separately from t…
dzole0311 Nov 6, 2024
8200621
update tsconfig and update type imports
sandrahoang686 Oct 29, 2024
0839c98
change nav file type
sandrahoang686 Nov 4, 2024
0438c6b
expose NavItemType
sandrahoang686 Nov 7, 2024
adb8741
Update tsconfig and make nav interfaces exposable for consumption (#1…
sandrahoang686 Nov 7, 2024
842216d
Re-factor utils, add unit tests
dzole0311 Nov 8, 2024
2c7561f
Card image/description independent of hero image/description (#1244)
dzole0311 Nov 11, 2024
ea91981
Bump version in package.json
AliceR Nov 11, 2024
7ffa351
Expose ExplorationAndAnalysis component, update date-fns for building…
sandrahoang686 Sep 10, 2024
7061c7f
Comment out analysis message for now
sandrahoang686 Sep 16, 2024
a6dfab5
Decouple datasets selector modal from E&A
sandrahoang686 Sep 16, 2024
ef45523
fix datepicker and abandom modal version
sandrahoang686 Sep 17, 2024
11eb134
clean some things up and uncomment things out
sandrahoang686 Sep 17, 2024
a31fc6d
Uncomment and comment out source of breakage for analysis-message-con…
sandrahoang686 Sep 17, 2024
bcbf657
add comment
sandrahoang686 Sep 17, 2024
ad732f7
Fix draw controls and analysis message
dzole0311 Oct 21, 2024
9f4e65c
Fix lint
dzole0311 Oct 22, 2024
9afeaaa
Fix unmount error
dzole0311 Oct 22, 2024
af34511
Clean up
dzole0311 Oct 23, 2024
39dfb20
Switch to non-ref object usage
dzole0311 Oct 24, 2024
df5da6c
Remove obsolete code and add a comment
dzole0311 Oct 25, 2024
1a6cff1
Make dataselectormodal exportable
hanbyul-here Oct 22, 2024
0c08048
Put onClick props directly
hanbyul-here Oct 23, 2024
db9e3c1
Consolidate onLinkClick and onClick into onClick
hanbyul-here Oct 24, 2024
103b3f6
Revert fix attempt
dzole0311 Oct 29, 2024
20ac2a9
Fix imports
dzole0311 Oct 29, 2024
165906e
Add missing import
dzole0311 Oct 29, 2024
6d6047e
Export useAtom, Remove any react router related components
hanbyul-here Oct 30, 2024
a538d20
Use a when opening a tab in a new window
hanbyul-here Oct 30, 2024
fb09159
Use linkproperties for sources (but is this necessary?)
hanbyul-here Oct 30, 2024
fb269d0
Flag the problem - 1
hanbyul-here Oct 30, 2024
3d89476
Edit date atom (workaround)
hanbyul-here Oct 30, 2024
acafa2e
Make a comment where it uses data faux module datasetLayers
hanbyul-here Oct 30, 2024
090c256
Put Try Catch block for drawcontrol function
hanbyul-here Oct 31, 2024
86c90c3
Add last array method
hanbyul-here Nov 1, 2024
529d6aa
Revert temporary work around
hanbyul-here Nov 1, 2024
6107a3c
Get rid of the line that is not necessary
hanbyul-here Nov 6, 2024
e130a6a
Resolved all conflicts
sandrahoang686 Nov 11, 2024
f23dac9
Fix import to fix buildlib error
sandrahoang686 Nov 11, 2024
de31403
Add is LinkExternal back that was removed from conflict resolution
sandrahoang686 Nov 11, 2024
4b59fd6
Remove onClick from linkProps, Remove linkProps req from card, Fix to…
sandrahoang686 Nov 11, 2024
8321a12
remove try/catch around area/point selection logic into useEffect
sandrahoang686 Nov 11, 2024
c502224
Fix to linter and ts error
sandrahoang686 Nov 11, 2024
0ec5744
fix lint error..
sandrahoang686 Nov 11, 2024
bee9d96
Fix lint error again.. ugh
sandrahoang686 Nov 11, 2024
6e929e8
[RELEASE] v5.10.0 (#1250)
AliceR Nov 12, 2024
1ab1a3f
add updated state to aoi use effect dep array
sandrahoang686 Nov 12, 2024
23abc94
Introduce and export a VedauiConfigProvider that handles env variables
dzole0311 Nov 13, 2024
387401f
Various cleanup on EA breakout feature branch (#1251)
sandrahoang686 Nov 13, 2024
a8311c2
[FEATURE BRANCH] 902 E&A breakout (#1154)
sandrahoang686 Nov 14, 2024
35d405c
Destructuring, address review comments
dzole0311 Nov 18, 2024
ba98c4a
Fix naming
dzole0311 Nov 18, 2024
0b13f55
Update naming
dzole0311 Nov 18, 2024
ad47c20
[1156] Expose a Veda UI EnvConfigProvider for providing env variables…
dzole0311 Nov 19, 2024
97f4ad9
Remove prop
dzole0311 Nov 20, 2024
4f9c679
Update styles and mocks
dzole0311 Nov 20, 2024
a5c2b3c
Create a derived atom for dataset hydration from Next.js, expose it i…
dzole0311 Nov 20, 2024
14fc8ea
Remove minHeight prop (#1265)
dzole0311 Nov 21, 2024
41a3a48
Hydrate the new atom for backwards compatibility in the VEDA UI as well
dzole0311 Nov 21, 2024
3543334
Format files, no functionality changes
vgeorge Nov 21, 2024
32bbf8c
Avoid using useNavigate of react-router
vgeorge Nov 21, 2024
903807f
Format changed files
vgeorge Nov 21, 2024
34d878f
Add custom function to commit search params using API that also works…
vgeorge Nov 21, 2024
edc5d9e
Remove React Router's useNavigate dependency (#1270)
vgeorge Nov 25, 2024
b4556ef
Bump minor to 5.11.0
dzole0311 Nov 25, 2024
f31f4be
[#1238] Create a derived atom for dataset hydration from Next.js (#1266)
dzole0311 Nov 25, 2024
9132e6d
[RELEASE] Bump minor to v5.11.0 (#1274)
dzole0311 Nov 26, 2024
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
17 changes: 7 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@
"sourceType": "module" // Allows for the use of imports
},
"rules": {
"prettier/prettier": [
2,
{
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"parser": "flow"
}
],
"prettier/prettier": 2,
"inclusive-language/use-inclusive-words": 2,
"semi": [2, "always"],
"jsx-quotes": [2, "prefer-single"],
Expand Down Expand Up @@ -99,7 +91,12 @@
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["@typescript-eslint"],
"rules": {
"prettier/prettier": 0,
"prettier/prettier": [
1,
{
"parser": "typescript"
}
],
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-non-null-assertion": 0
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
timeout-minutes: 60
needs: prep
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/release')
if: startsWith(github.head_ref, 'release')

steps:
- name: Checkout
Expand Down
66 changes: 40 additions & 26 deletions app/scripts/components/common/banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React, { useState } from "react";
import { Icon } from "@trussworks/react-uswds";
import { USWDSBanner, USWDSBannerContent } from "$components/common/uswds/banner";
import React, { useState } from 'react';
import { Icon } from '@trussworks/react-uswds';
import {
USWDSBanner,
USWDSBannerContent
} from '$components/common/uswds/banner';

const BANNER_KEY = 'dismissedBannerUrl';

Expand All @@ -12,53 +15,64 @@

enum BannerType {
info = 'info',
warning ='warning'
warning = 'warning'
}

const infoTypeFlag = BannerType.info;
interface BannerProps {
appTitle: string,
expires: Date,
url: string,
text: string,
type?: BannerType
appTitle: string;
expires: Date;
url: string;
text: string;
type?: BannerType;
}

export default function Banner({appTitle, expires, url, text, type = infoTypeFlag }: BannerProps) {
export default function Banner({
appTitle,
expires,
url,
text,
type = infoTypeFlag
}: BannerProps) {

Check warning on line 37 in app/scripts/components/common/banner/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎`
const showBanner = localStorage.getItem(BANNER_KEY) !== url;
const [isOpen, setIsOpen] = useState(showBanner && !(hasExpired(expires)));
const [isOpen, setIsOpen] = useState(showBanner && !hasExpired(expires));

function onClose () {
localStorage.setItem(
BANNER_KEY,
url
);
function onClose() {
localStorage.setItem(BANNER_KEY, url);
setIsOpen(false);
}

return (
<div>
{isOpen &&
(<div className='position-relative'>
<USWDSBanner aria-label={appTitle} className={type !== infoTypeFlag? 'bg-secondary-lighter': ''}>
{isOpen && (
<div className='position-relative'>
<USWDSBanner
aria-label={appTitle}
className={type !== infoTypeFlag ? 'bg-secondary-lighter' : ''}
>
<a href={url} target='_blank' rel='noreferrer'>
<USWDSBannerContent className='padding-top-1 padding-bottom-1' isOpen={true}>
<p dangerouslySetInnerHTML={{ __html: text }} />
<USWDSBannerContent
className='padding-top-1 padding-bottom-1'
isOpen={true}
>
<div dangerouslySetInnerHTML={{ __html: text }} />

Check warning on line 59 in app/scripts/components/common/banner/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎`

</USWDSBannerContent>
</a>
</USWDSBanner>
<div className='position-absolute top-0 right-0 margin-right-3 height-full display-flex'>
<button
<button
className='usa-button usa-button--unstyled'
type='button'
aria-label='Close Banner'
onClick={onClose}
>
<Icon.Close />
</button>
>
<Icon.Close />
</button>
</div>
</div>)}
</div>
)}
</div>
);
}
65 changes: 42 additions & 23 deletions app/scripts/components/common/blocks/block-map.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useState, useEffect } from 'react';
import React, { useMemo, useState, useEffect, useContext } from 'react';
import styled from 'styled-components';
import { MapboxOptions } from 'mapbox-gl';
import * as dateFns from 'date-fns';
Expand All @@ -11,10 +11,7 @@
import { LayerLegend, LayerLegendContainer } from '../map/layer-legend';
import MapCoordsControl from '../map/controls/coords';
import MapMessage from '../map/map-message';
import {
formatCompareDate,
formatSingleDate,
} from '../map/utils';
import { formatCompareDate, formatSingleDate } from '../map/utils';
import {
BasemapId,
DEFAULT_MAP_STYLE_URL
Expand All @@ -34,9 +31,13 @@
DatasetStatus
} from '$components/exploration/types.d.ts';

import { reconcileDatasets, getDatasetLayers } from '$components/exploration/data-utils-no-faux-module';
import {
reconcileDatasets,
getDatasetLayers
} from '$components/exploration/data-utils-no-faux-module';
import { useReconcileWithStacMetadata } from '$components/exploration/hooks/use-stac-metadata-datasets';
import { ProjectionOptions, VedaDatum, DatasetData } from '$types/veda';
import { EnvConfigContext } from '$context/env-config';

export const mapHeight = '32rem';
const Carto = styled.div`
Expand Down Expand Up @@ -125,7 +126,10 @@
layerId: string;
}

const getDataLayer = (layerIndex: number, layers: VizDataset[] | undefined): (VizDatasetSuccess | null) => {
const getDataLayer = (
layerIndex: number,
layers: VizDataset[] | undefined
): VizDatasetSuccess | null => {
if (!layers || layers.length <= layerIndex) return null;
const layer = layers[layerIndex];
// @NOTE: What to do when data returns ERROR
Expand Down Expand Up @@ -177,16 +181,18 @@
totalLayers = [...totalLayers, compareMapStaticData];
}
return totalLayers;
},[layerId]);
}, [layerId]);

Check warning on line 184 in app/scripts/components/common/blocks/block-map.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useMemo has a missing dependency: 'datasetLayers'. Either include it or remove the dependency array

const [layers, setLayers] = useState<VizDataset[]>(layersToFetch);

useReconcileWithStacMetadata(layers, setLayers);
const { envApiStacEndpoint } = useContext(EnvConfigContext);

useReconcileWithStacMetadata(layers, setLayers, envApiStacEndpoint);

const selectedDatetime: (Date | undefined) = dateTime
const selectedDatetime: Date | undefined = dateTime
? utcString2userTzDate(dateTime)
: undefined;
const selectedCompareDatetime: (Date | undefined) = compareDateTime
const selectedCompareDatetime: Date | undefined = compareDateTime
? utcString2userTzDate(compareDateTime)
: undefined;

Expand All @@ -210,8 +216,14 @@

const [, setProjection] = useState(projectionStart);

const baseDataLayer: (VizDatasetSuccess | null) = useMemo(() => getDataLayer(0, layers), [layers]);
const compareDataLayer: (VizDatasetSuccess | null) = useMemo(() => getDataLayer(1, layers), [layers]);
const baseDataLayer: VizDatasetSuccess | null = useMemo(
() => getDataLayer(0, layers),
[layers]
);
const compareDataLayer: VizDatasetSuccess | null = useMemo(
() => getDataLayer(1, layers),
[layers]
);

const baseTimeDensity = baseDataLayer?.data.timeDensity;
const compareTimeDensity = compareDataLayer?.data.timeDensity;
Expand Down Expand Up @@ -262,9 +274,16 @@
if (compareLabel) return compareLabel as string;
// Use label function from originalData.Compare
else if (baseDataLayer?.data.compare?.mapLabel) {
if (typeof baseDataLayer.data.compare.mapLabel === 'string') return baseDataLayer.data.compare.mapLabel;
const labelFn = baseDataLayer.data.compare.mapLabel as (unknown) => string;
return labelFn({dateFns, datetime: selectedDatetime, compareDatetime: compareToDate });
if (typeof baseDataLayer.data.compare.mapLabel === 'string')
return baseDataLayer.data.compare.mapLabel;
const labelFn = baseDataLayer.data.compare.mapLabel as (
unknown
) => string;
return labelFn({
dateFns,
datetime: selectedDatetime,
compareDatetime: compareToDate
});
}

// Default to date comparison.
Expand Down Expand Up @@ -356,13 +375,13 @@
<Compare>
<Basemap basemapStyleId={mapBasemapId} />
{compareDataLayer && (
<Layer
key={compareDataLayer.data.id}
id={`compare-${compareDataLayer.data.id}`}
dataset={compareDataLayer}
selectedDay={selectedCompareDatetime}
/>
)}
<Layer
key={compareDataLayer.data.id}
id={`compare-${compareDataLayer.data.id}`}
dataset={compareDataLayer}
selectedDay={selectedCompareDatetime}
/>
)}
</Compare>
)}
</Map>
Expand Down
Loading
Loading