Skip to content

Commit 7b0b5e6

Browse files
v1.8.0 (#40)
* Added Neon public API host variable with value pulled from server data. * Fixed function name. * Updates for setting public API host through server data. * Updated valid hosts regex pattern. * Reset NEON_SERVER_DATA * Minor cleanup. * Update for web socket host determination. * Added prototype typescript environment module. * Cleanup. * Fixed test and cleanup. * Removed unused variable. * Removed file. * site map: handle maxZoom property propagation * site map: update mapZoom initialization to include bounds * NeonContext final state when core auth, TS context include release * resolve authentication state when silent SSO disabled * pull out route handling to dedicated service * fix host regex validation, update routes * reduce .env usage * fix account route * fix logout redirect path handling * improve auth logout redirection * update login redirect path handling * handle fallback cases for auth redirects * bump typescript, use npx for script execution * prepare v1.8.0 * clean up package, tsconfig * update lib with latest tsc Co-authored-by: Robert Markel <[email protected]>
1 parent 3f32ce8 commit 7b0b5e6

File tree

104 files changed

+4117
-1921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+4117
-1921
lines changed

.env.development

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,53 @@
11
PORT=3010
22
REACT_APP_VERSION=$npm_package_version
3-
REACT_APP_NEON_API_NAME="api"
4-
REACT_APP_NEON_API_VERSION="v0"
53

4+
#-------------------------------------------------------------------------------
5+
# NEON API root routes
6+
#-------------------------------------------------------------------------------
7+
8+
REACT_APP_NEON_PATH_API="/api/v0"
9+
REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
610
REACT_APP_NEON_PATH_LD_API="/ld"
7-
REACT_APP_NEON_PATH_LD_REPO_API="/repository"
8-
REACT_APP_NEON_PATH_MENU_API="/menu"
9-
REACT_APP_NEON_PATH_PRODUCTS_API="/products"
10-
REACT_APP_NEON_PATH_RELEASES_API="/releases"
11-
REACT_APP_NEON_PATH_DOCUMENTS_API="/documents"
12-
REACT_APP_NEON_PATH_SITES_API="/sites"
13-
REACT_APP_NEON_PATH_LOCATIONS_API="/locations"
14-
REACT_APP_NEON_PATH_MANIFEST_API="/api/download/v0"
11+
REACT_APP_NEON_PATH_AUTH_API="/api/auth/v0"
12+
REACT_APP_NEON_PATH_AUTH0_API="/auth0"
1513
REACT_APP_NEON_PATH_DOWNLOAD_API="/api/download/v0"
16-
REACT_APP_NEON_PATH_AOP_DOWNLOAD_API="/browse-data"
17-
REACT_APP_NEON_PATH_DATA_API="/data"
18-
REACT_APP_NEON_PATH_PROTOTYPE_DATA_API="/prototype"
19-
REACT_APP_NEON_PATH_FILE_NAMING_CONVENTIONS="/file-naming-conventions"
2014

21-
REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
22-
REACT_APP_NEON_USE_GRAPHQL="true"
15+
#-------------------------------------------------------------------------------
16+
# Application routes
17+
#-------------------------------------------------------------------------------
2318

24-
REACT_APP_NEON_ROUTER_NEON_HOME="/home"
25-
REACT_APP_NEON_ROUTER_NEON_MYACCOUNT="/myaccount"
2619
REACT_APP_NEON_ROUTER_BASE=""
2720
REACT_APP_NEON_ROUTER_BASE_HOME="/core-components"
2821

29-
REACT_APP_NEON_AUTH_API="/api/auth/v0"
30-
REACT_APP_NEON_AUTH_WS_API="/ws"
31-
REACT_APP_NEON_AUTH_WS_TOPIC_AUTH0_API="/consumer/topic/auth0"
32-
REACT_APP_NEON_AUTH_LOGIN="/auth0/login"
33-
REACT_APP_NEON_AUTH_LOGOUT="/auth0/logout"
34-
REACT_APP_NEON_AUTH_USERINFO="/auth0/userinfo"
22+
#-------------------------------------------------------------------------------
23+
# Feature options
24+
#-------------------------------------------------------------------------------
3525

3626
# Option to disable attempting to connect to the WS
3727
# Disabled by default in development as to prevent incessant reconnect attempts
3828
REACT_APP_NEON_AUTH_DISABLE_WS="true"
39-
29+
REACT_APP_NEON_USE_GRAPHQL="true"
4030
REACT_APP_NEON_SHOW_AOP_VIEWER="true"
31+
32+
#-------------------------------------------------------------------------------
33+
# Third party APIs and options
34+
#-------------------------------------------------------------------------------
35+
4136
REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL="https://neon.visus.org/neonapi/products/"
4237
REACT_APP_NEON_VISUS_IFRAME_BASE_URL="https://neon.visus.org/visus-frame.html"
38+
REACT_APP_NEON_DEFAULT_DATA_CITE_API_HOST="https://api.datacite.org"
4339

44-
# API ROOT
45-
#
46-
# By default API calls made by core components use window.location.host for the root.
47-
#
48-
# This can be overridden using REACT_APP_NEON_HOST_OVERRIDE. Note that the override will
49-
# only be applied in a dev environment. To also apply override in production environments
50-
# set REACT_APP_FOREIGN_LOCATION to "true".
40+
#-------------------------------------------------------------------------------
41+
# Host overrides
42+
#-------------------------------------------------------------------------------
43+
44+
# The API host can be overridden using REACT_APP_NEON_API_HOST_OVERRIDE.
45+
# Note that the override will only be applied in a dev environment.
5146
#
5247
# Using portal-core-components as a dependency hosted outside of data.neonscience.org:
5348
# * Set REACT_APP_NEON_HOST_OVERRIDE to "https://data.neonscience.org"
54-
# * Set REACT_APP_FOREIGN_LOCATION to "true"
55-
# Rate limiting may apply. See https://data.neonscience.org/data-api/rate-limiting/ for details.
49+
# Rate limiting may apply.
50+
# See https://data.neonscience.org/data-api/rate-limiting/ for details.
5651

57-
REACT_APP_NEON_HOST_OVERRIDE="https://int-data.neonscience.org"
58-
# REACT_APP_FOREIGN_LOCATION="true"
52+
REACT_APP_NEON_API_HOST_OVERRIDE="https://int-data.neonscience.org"
53+
REACT_APP_NEON_WEB_HOST_OVERRIDE="https://www.neonscience.org"

.env.production

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11
REACT_APP_VERSION=$npm_package_version
2-
REACT_APP_NEON_API_NAME="api"
3-
REACT_APP_NEON_API_VERSION="v0"
42

3+
#-------------------------------------------------------------------------------
4+
# NEON API root routes
5+
#-------------------------------------------------------------------------------
6+
7+
REACT_APP_NEON_PATH_API="/api/v0"
8+
REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
59
REACT_APP_NEON_PATH_LD_API="/ld"
6-
REACT_APP_NEON_PATH_LD_REPO_API="/repository"
7-
REACT_APP_NEON_PATH_MENU_API="/menu"
8-
REACT_APP_NEON_PATH_PRODUCTS_API="/products"
9-
REACT_APP_NEON_PATH_RELEASES_API="/releases"
10-
REACT_APP_NEON_PATH_DOCUMENTS_API="/documents"
11-
REACT_APP_NEON_PATH_SITES_API="/sites"
12-
REACT_APP_NEON_PATH_LOCATIONS_API="/locations"
13-
REACT_APP_NEON_PATH_MANIFEST_API="/api/download/v0"
10+
REACT_APP_NEON_PATH_AUTH_API="/api/auth/v0"
11+
REACT_APP_NEON_PATH_AUTH0_API="/auth0"
1412
REACT_APP_NEON_PATH_DOWNLOAD_API="/api/download/v0"
15-
REACT_APP_NEON_PATH_AOP_DOWNLOAD_API="/browse-data"
16-
REACT_APP_NEON_PATH_DATA_API="/data"
17-
REACT_APP_NEON_PATH_PROTOTYPE_DATA_API="/prototype"
18-
REACT_APP_NEON_PATH_FILE_NAMING_CONVENTIONS="/file-naming-conventions"
1913

20-
REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
21-
REACT_APP_NEON_USE_GRAPHQL="true"
14+
#-------------------------------------------------------------------------------
15+
# Application routes
16+
#-------------------------------------------------------------------------------
2217

23-
REACT_APP_NEON_ROUTER_NEON_HOME="/home"
24-
REACT_APP_NEON_ROUTER_NEON_MYACCOUNT="/myaccount"
2518
REACT_APP_NEON_ROUTER_BASE=""
2619
REACT_APP_NEON_ROUTER_BASE_HOME="/core-components"
2720

28-
REACT_APP_NEON_AUTH_API="/api/auth/v0"
29-
REACT_APP_NEON_AUTH_WS_API="/ws"
30-
REACT_APP_NEON_AUTH_WS_TOPIC_AUTH0_API="/consumer/topic/auth0"
31-
REACT_APP_NEON_AUTH_LOGIN="/auth0/login"
32-
REACT_APP_NEON_AUTH_LOGOUT="/auth0/logout"
33-
REACT_APP_NEON_AUTH_USERINFO="/auth0/userinfo"
21+
#-------------------------------------------------------------------------------
22+
# Feature options
23+
#-------------------------------------------------------------------------------
3424

25+
REACT_APP_NEON_USE_GRAPHQL="true"
3526
REACT_APP_NEON_SHOW_AOP_VIEWER="true"
27+
28+
#-------------------------------------------------------------------------------
29+
# Third party APIs and options
30+
#-------------------------------------------------------------------------------
31+
3632
REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL="https://neon.visus.org/neonapi/products/"
3733
REACT_APP_NEON_VISUS_IFRAME_BASE_URL="https://neon.visus.org/visus-frame.html"
34+
REACT_APP_NEON_DEFAULT_DATA_CITE_API_HOST="https://api.datacite.org"

lib/components/DataProductAvailability/AvailabilityContext.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ declare namespace AvailabilityContext {
3737
*/
3838
declare function Provider(props: any): JSX.Element;
3939
declare namespace Provider {
40-
export namespace propTypes {
41-
export const sites: PropTypes.Requireable<(PropTypes.InferProps<{
40+
namespace propTypes {
41+
const sites: PropTypes.Requireable<(PropTypes.InferProps<{
4242
siteCode: PropTypes.Validator<string>;
4343
tables: PropTypes.Validator<(PropTypes.InferProps<{
4444
name: PropTypes.Validator<string>;
4545
description: PropTypes.Validator<string>;
4646
waitInterval: PropTypes.Validator<string>;
4747
months: PropTypes.Validator<{
48-
[x: string]: import("../../types/core").Nullable<string>;
48+
[x: string]: string | null | undefined;
4949
}>;
5050
}> | null | undefined)[]>;
5151
}> | null | undefined)[]>;
52-
export const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
52+
const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
5353
}
54-
export namespace defaultProps {
54+
namespace defaultProps {
5555
const sites_1: never[];
5656
export { sites_1 as sites };
5757
}
@@ -73,7 +73,7 @@ declare function useAvailabilityState(): any[] | {
7373
};
7474
};
7575
declare namespace SORT_DIRECTIONS {
76-
export const ASC: string;
77-
export const DESC: string;
76+
const ASC: string;
77+
const DESC: string;
7878
}
7979
import PropTypes from "prop-types";

lib/components/DataProductAvailability/AvailabilityPending.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
declare function AvailabilityPending(props: any): JSX.Element | null;
22
declare namespace AvailabilityPending {
3-
export namespace propTypes {
4-
export const message: PropTypes.Requireable<string>;
3+
namespace propTypes {
4+
const message: PropTypes.Requireable<string>;
55
}
6-
export namespace defaultProps {
6+
namespace defaultProps {
77
const message_1: string;
88
export { message_1 as message };
99
}

lib/components/DataProductAvailability/AvailabilitySvgComponents.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ export const CELL_ATTRS: {
102102
};
103103
export function JsxCell(props: any): JSX.Element;
104104
export namespace JsxCell {
105-
export namespace propTypes {
106-
export const status: PropTypes.Validator<string>;
107-
export const x: PropTypes.Requireable<number>;
108-
export const y: PropTypes.Requireable<number>;
105+
namespace propTypes {
106+
const status: PropTypes.Validator<string>;
107+
const x: PropTypes.Requireable<number>;
108+
const y: PropTypes.Requireable<number>;
109109
}
110-
export namespace defaultProps {
110+
namespace defaultProps {
111111
const x_1: number;
112112
export { x_1 as x };
113113
const y_1: number;

lib/components/DataProductAvailability/AvailabilityUtils.d.ts

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,51 +49,63 @@ export const VALID_ENHANCED_STATUSES: {
4949
};
5050
export function calcRollupStatus(statuses?: any[]): any;
5151
export namespace AvailabilityPropTypes {
52-
export const basicSiteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
52+
const basicSiteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
5353
siteCode: PropTypes.Validator<string>;
54-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
54+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
5555
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
5656
release: PropTypes.Validator<string>;
57-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
57+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
5858
}> | null | undefined)[]>;
5959
}> | null | undefined)[]>;
60-
export const enhancedSites: PropTypes.Requireable<(PropTypes.InferProps<{
60+
const enhancedSites: PropTypes.Requireable<(PropTypes.InferProps<{
6161
siteCode: PropTypes.Validator<string>;
6262
tables: PropTypes.Validator<(PropTypes.InferProps<{
6363
name: PropTypes.Validator<string>;
6464
description: PropTypes.Validator<string>;
6565
waitInterval: PropTypes.Validator<string>;
6666
months: PropTypes.Validator<{
67-
[x: string]: import("../../types/core").Nullable<string>;
67+
[x: string]: string | null | undefined;
6868
}>;
6969
}> | null | undefined)[]>;
7070
}> | null | undefined)[]>;
71-
export const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
71+
const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
7272
dataProductCode: PropTypes.Validator<string>;
7373
dataProductTitle: PropTypes.Validator<string>;
74-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
74+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
7575
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
7676
release: PropTypes.Validator<string>;
77-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
77+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
7878
}> | null | undefined)[]>;
7979
}> | null | undefined)[]>;
8080
}
8181
export namespace SVG {
82-
export const MIN_WIDTH: number;
83-
export const MIN_HEIGHT: number;
84-
export const YEAR_MONTH_WIDTH: number;
85-
export const YEAR_WIDTH: number;
86-
export const ABS_MAX_DATA_WIDTH: number;
82+
const MIN_WIDTH: number;
83+
const MIN_HEIGHT: number;
84+
const YEAR_MONTH_WIDTH: number;
85+
const YEAR_WIDTH: number;
86+
const ABS_MAX_DATA_WIDTH: number;
8787
}
8888
export namespace TIME {
89-
export const MIN_YEAR_MONTH: string;
90-
export const MAX_YEAR_MONTH: string;
91-
export const YEARS: number[];
92-
export const MONTHS: string[];
93-
export const YEAR_MONTHS: any;
89+
const MIN_YEAR_MONTH: string;
90+
const MAX_YEAR_MONTH: string;
91+
const YEARS: number[];
92+
const MONTHS: string[];
93+
const YEAR_MONTHS: any;
9494
}
9595
export namespace SVG_STYLES {
96-
export function apply(node: any, styleName: any): void;
97-
export function touchRipple(selection: any, duration?: number): void;
96+
/**
97+
Function: apply
98+
Parse an object literal style definition into d3 selection.style()
99+
calls to apply styles defined in the styles object literal to a node
100+
*/
101+
function apply(node: any, styleName: any): void;
102+
/**
103+
Function: touchRipple
104+
For click interactions pass a d3 selection in and the fill will transition
105+
from an "active" semi-transparent orange color to near-transparent. We don't go
106+
full transparent as the ripple is typically followed by a delayed state update
107+
that will trigger a rerender and thus a full style reset.
108+
*/
109+
function touchRipple(selection: any, duration?: number): void;
98110
}
99111
import PropTypes from "prop-types";

lib/components/DataProductAvailability/BasicAvailabilityInterface.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ export default BasicAvailabilityInterface;
44
*/
55
declare function BasicAvailabilityInterface(props: any): JSX.Element;
66
declare namespace BasicAvailabilityInterface {
7-
export namespace propTypes {
8-
export const siteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
7+
namespace propTypes {
8+
const siteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
99
siteCode: PropTypes.Validator<string>;
10-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
10+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
1111
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
1212
release: PropTypes.Validator<string>;
13-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
13+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
1414
}> | null | undefined)[]>;
1515
}> | null | undefined)[]>;
16-
export const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
16+
const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
1717
dataProductCode: PropTypes.Validator<string>;
1818
dataProductTitle: PropTypes.Validator<string>;
19-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
19+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
2020
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
2121
release: PropTypes.Validator<string>;
22-
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
22+
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
2323
}> | null | undefined)[]>;
2424
}> | null | undefined)[]>;
25-
export const view: PropTypes.Requireable<string>;
26-
export const sortMethod: PropTypes.Requireable<string>;
27-
export const sortDirection: PropTypes.Requireable<string>;
28-
export const disableSelection: PropTypes.Requireable<boolean>;
29-
export const delineateRelease: PropTypes.Requireable<boolean>;
25+
const view: PropTypes.Requireable<string>;
26+
const sortMethod: PropTypes.Requireable<string>;
27+
const sortDirection: PropTypes.Requireable<string>;
28+
const disableSelection: PropTypes.Requireable<boolean>;
29+
const delineateRelease: PropTypes.Requireable<boolean>;
3030
}
31-
export namespace defaultProps {
31+
namespace defaultProps {
3232
const siteCodes_1: never[];
3333
export { siteCodes_1 as siteCodes };
3434
const dataProducts_1: never[];

lib/components/DataProductAvailability/BasicAvailabilityKey.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
*/
44
declare function BasicAvailabilityKey(props: any): JSX.Element;
55
declare namespace BasicAvailabilityKey {
6-
export namespace propTypes {
7-
export const orientation: PropTypes.Requireable<string>;
8-
export const selectionEnabled: PropTypes.Requireable<boolean>;
9-
export const delineateRelease: PropTypes.Requireable<boolean>;
6+
namespace propTypes {
7+
const orientation: PropTypes.Requireable<string>;
8+
const selectionEnabled: PropTypes.Requireable<boolean>;
9+
const delineateRelease: PropTypes.Requireable<boolean>;
1010
}
11-
export namespace defaultProps {
11+
namespace defaultProps {
1212
const orientation_1: string;
1313
export { orientation_1 as orientation };
1414
const selectionEnabled_1: boolean;

lib/components/DataProductAvailability/EnhancedAvailabilityInterface.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export default EnhancedAvailabilityInterface;
22
declare function EnhancedAvailabilityInterface(props: any): JSX.Element;
33
declare namespace EnhancedAvailabilityInterface {
4-
export namespace propTypes {
5-
export const sites: PropTypes.Requireable<(PropTypes.InferProps<{
4+
namespace propTypes {
5+
const sites: PropTypes.Requireable<(PropTypes.InferProps<{
66
siteCode: PropTypes.Validator<string>;
77
tables: PropTypes.Validator<(PropTypes.InferProps<{
88
name: PropTypes.Validator<string>;
@@ -11,17 +11,17 @@ declare namespace EnhancedAvailabilityInterface {
1111
*/
1212
waitInterval: PropTypes.Validator<string>;
1313
months: PropTypes.Validator<{
14-
[x: string]: import("../../types/core").Nullable<string>;
14+
[x: string]: string | null | undefined;
1515
}>;
1616
}> | null | undefined)[]>;
1717
}> | null | undefined)[]>;
18-
export const view: PropTypes.Requireable<string>;
19-
export const table: PropTypes.Requireable<string>;
20-
export const sortMethod: PropTypes.Requireable<string>;
21-
export const sortDirection: PropTypes.Requireable<string>;
22-
export const disableSelection: PropTypes.Requireable<boolean>;
18+
const view: PropTypes.Requireable<string>;
19+
const table: PropTypes.Requireable<string>;
20+
const sortMethod: PropTypes.Requireable<string>;
21+
const sortDirection: PropTypes.Requireable<string>;
22+
const disableSelection: PropTypes.Requireable<boolean>;
2323
}
24-
export namespace defaultProps {
24+
namespace defaultProps {
2525
const sites_1: never[];
2626
export { sites_1 as sites };
2727
const view_1: null;

0 commit comments

Comments
 (0)