Skip to content

Commit

Permalink
v1.8.0 (#40)
Browse files Browse the repository at this point in the history
* 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 <rmarkel@battelleecology.org>
  • Loading branch information
sampsonj and rmarkel-neon authored Jul 16, 2021
1 parent 3f32ce8 commit 7b0b5e6
Show file tree
Hide file tree
Showing 104 changed files with 4,117 additions and 1,921 deletions.
67 changes: 31 additions & 36 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,58 +1,53 @@
PORT=3010
REACT_APP_VERSION=$npm_package_version
REACT_APP_NEON_API_NAME="api"
REACT_APP_NEON_API_VERSION="v0"

#-------------------------------------------------------------------------------
# NEON API root routes
#-------------------------------------------------------------------------------

REACT_APP_NEON_PATH_API="/api/v0"
REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
REACT_APP_NEON_PATH_LD_API="/ld"
REACT_APP_NEON_PATH_LD_REPO_API="/repository"
REACT_APP_NEON_PATH_MENU_API="/menu"
REACT_APP_NEON_PATH_PRODUCTS_API="/products"
REACT_APP_NEON_PATH_RELEASES_API="/releases"
REACT_APP_NEON_PATH_DOCUMENTS_API="/documents"
REACT_APP_NEON_PATH_SITES_API="/sites"
REACT_APP_NEON_PATH_LOCATIONS_API="/locations"
REACT_APP_NEON_PATH_MANIFEST_API="/api/download/v0"
REACT_APP_NEON_PATH_AUTH_API="/api/auth/v0"
REACT_APP_NEON_PATH_AUTH0_API="/auth0"
REACT_APP_NEON_PATH_DOWNLOAD_API="/api/download/v0"
REACT_APP_NEON_PATH_AOP_DOWNLOAD_API="/browse-data"
REACT_APP_NEON_PATH_DATA_API="/data"
REACT_APP_NEON_PATH_PROTOTYPE_DATA_API="/prototype"
REACT_APP_NEON_PATH_FILE_NAMING_CONVENTIONS="/file-naming-conventions"

REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
REACT_APP_NEON_USE_GRAPHQL="true"
#-------------------------------------------------------------------------------
# Application routes
#-------------------------------------------------------------------------------

REACT_APP_NEON_ROUTER_NEON_HOME="/home"
REACT_APP_NEON_ROUTER_NEON_MYACCOUNT="/myaccount"
REACT_APP_NEON_ROUTER_BASE=""
REACT_APP_NEON_ROUTER_BASE_HOME="/core-components"

REACT_APP_NEON_AUTH_API="/api/auth/v0"
REACT_APP_NEON_AUTH_WS_API="/ws"
REACT_APP_NEON_AUTH_WS_TOPIC_AUTH0_API="/consumer/topic/auth0"
REACT_APP_NEON_AUTH_LOGIN="/auth0/login"
REACT_APP_NEON_AUTH_LOGOUT="/auth0/logout"
REACT_APP_NEON_AUTH_USERINFO="/auth0/userinfo"
#-------------------------------------------------------------------------------
# Feature options
#-------------------------------------------------------------------------------

# Option to disable attempting to connect to the WS
# Disabled by default in development as to prevent incessant reconnect attempts
REACT_APP_NEON_AUTH_DISABLE_WS="true"

REACT_APP_NEON_USE_GRAPHQL="true"
REACT_APP_NEON_SHOW_AOP_VIEWER="true"

#-------------------------------------------------------------------------------
# Third party APIs and options
#-------------------------------------------------------------------------------

REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL="https://neon.visus.org/neonapi/products/"
REACT_APP_NEON_VISUS_IFRAME_BASE_URL="https://neon.visus.org/visus-frame.html"
REACT_APP_NEON_DEFAULT_DATA_CITE_API_HOST="https://api.datacite.org"

# API ROOT
#
# By default API calls made by core components use window.location.host for the root.
#
# This can be overridden using REACT_APP_NEON_HOST_OVERRIDE. Note that the override will
# only be applied in a dev environment. To also apply override in production environments
# set REACT_APP_FOREIGN_LOCATION to "true".
#-------------------------------------------------------------------------------
# Host overrides
#-------------------------------------------------------------------------------

# The API host can be overridden using REACT_APP_NEON_API_HOST_OVERRIDE.
# Note that the override will only be applied in a dev environment.
#
# Using portal-core-components as a dependency hosted outside of data.neonscience.org:
# * Set REACT_APP_NEON_HOST_OVERRIDE to "https://data.neonscience.org"
# * Set REACT_APP_FOREIGN_LOCATION to "true"
# Rate limiting may apply. See https://data.neonscience.org/data-api/rate-limiting/ for details.
# Rate limiting may apply.
# See https://data.neonscience.org/data-api/rate-limiting/ for details.

REACT_APP_NEON_HOST_OVERRIDE="https://int-data.neonscience.org"
# REACT_APP_FOREIGN_LOCATION="true"
REACT_APP_NEON_API_HOST_OVERRIDE="https://int-data.neonscience.org"
REACT_APP_NEON_WEB_HOST_OVERRIDE="https://www.neonscience.org"
45 changes: 21 additions & 24 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
REACT_APP_VERSION=$npm_package_version
REACT_APP_NEON_API_NAME="api"
REACT_APP_NEON_API_VERSION="v0"

#-------------------------------------------------------------------------------
# NEON API root routes
#-------------------------------------------------------------------------------

REACT_APP_NEON_PATH_API="/api/v0"
REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
REACT_APP_NEON_PATH_LD_API="/ld"
REACT_APP_NEON_PATH_LD_REPO_API="/repository"
REACT_APP_NEON_PATH_MENU_API="/menu"
REACT_APP_NEON_PATH_PRODUCTS_API="/products"
REACT_APP_NEON_PATH_RELEASES_API="/releases"
REACT_APP_NEON_PATH_DOCUMENTS_API="/documents"
REACT_APP_NEON_PATH_SITES_API="/sites"
REACT_APP_NEON_PATH_LOCATIONS_API="/locations"
REACT_APP_NEON_PATH_MANIFEST_API="/api/download/v0"
REACT_APP_NEON_PATH_AUTH_API="/api/auth/v0"
REACT_APP_NEON_PATH_AUTH0_API="/auth0"
REACT_APP_NEON_PATH_DOWNLOAD_API="/api/download/v0"
REACT_APP_NEON_PATH_AOP_DOWNLOAD_API="/browse-data"
REACT_APP_NEON_PATH_DATA_API="/data"
REACT_APP_NEON_PATH_PROTOTYPE_DATA_API="/prototype"
REACT_APP_NEON_PATH_FILE_NAMING_CONVENTIONS="/file-naming-conventions"

REACT_APP_NEON_PATH_PUBLIC_GRAPHQL="/graphql"
REACT_APP_NEON_USE_GRAPHQL="true"
#-------------------------------------------------------------------------------
# Application routes
#-------------------------------------------------------------------------------

REACT_APP_NEON_ROUTER_NEON_HOME="/home"
REACT_APP_NEON_ROUTER_NEON_MYACCOUNT="/myaccount"
REACT_APP_NEON_ROUTER_BASE=""
REACT_APP_NEON_ROUTER_BASE_HOME="/core-components"

REACT_APP_NEON_AUTH_API="/api/auth/v0"
REACT_APP_NEON_AUTH_WS_API="/ws"
REACT_APP_NEON_AUTH_WS_TOPIC_AUTH0_API="/consumer/topic/auth0"
REACT_APP_NEON_AUTH_LOGIN="/auth0/login"
REACT_APP_NEON_AUTH_LOGOUT="/auth0/logout"
REACT_APP_NEON_AUTH_USERINFO="/auth0/userinfo"
#-------------------------------------------------------------------------------
# Feature options
#-------------------------------------------------------------------------------

REACT_APP_NEON_USE_GRAPHQL="true"
REACT_APP_NEON_SHOW_AOP_VIEWER="true"

#-------------------------------------------------------------------------------
# Third party APIs and options
#-------------------------------------------------------------------------------

REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL="https://neon.visus.org/neonapi/products/"
REACT_APP_NEON_VISUS_IFRAME_BASE_URL="https://neon.visus.org/visus-frame.html"
REACT_APP_NEON_DEFAULT_DATA_CITE_API_HOST="https://api.datacite.org"
14 changes: 7 additions & 7 deletions lib/components/DataProductAvailability/AvailabilityContext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ declare namespace AvailabilityContext {
*/
declare function Provider(props: any): JSX.Element;
declare namespace Provider {
export namespace propTypes {
export const sites: PropTypes.Requireable<(PropTypes.InferProps<{
namespace propTypes {
const sites: PropTypes.Requireable<(PropTypes.InferProps<{
siteCode: PropTypes.Validator<string>;
tables: PropTypes.Validator<(PropTypes.InferProps<{
name: PropTypes.Validator<string>;
description: PropTypes.Validator<string>;
waitInterval: PropTypes.Validator<string>;
months: PropTypes.Validator<{
[x: string]: import("../../types/core").Nullable<string>;
[x: string]: string | null | undefined;
}>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
export const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
}
export namespace defaultProps {
namespace defaultProps {
const sites_1: never[];
export { sites_1 as sites };
}
Expand All @@ -73,7 +73,7 @@ declare function useAvailabilityState(): any[] | {
};
};
declare namespace SORT_DIRECTIONS {
export const ASC: string;
export const DESC: string;
const ASC: string;
const DESC: string;
}
import PropTypes from "prop-types";
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
declare function AvailabilityPending(props: any): JSX.Element | null;
declare namespace AvailabilityPending {
export namespace propTypes {
export const message: PropTypes.Requireable<string>;
namespace propTypes {
const message: PropTypes.Requireable<string>;
}
export namespace defaultProps {
namespace defaultProps {
const message_1: string;
export { message_1 as message };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ export const CELL_ATTRS: {
};
export function JsxCell(props: any): JSX.Element;
export namespace JsxCell {
export namespace propTypes {
export const status: PropTypes.Validator<string>;
export const x: PropTypes.Requireable<number>;
export const y: PropTypes.Requireable<number>;
namespace propTypes {
const status: PropTypes.Validator<string>;
const x: PropTypes.Requireable<number>;
const y: PropTypes.Requireable<number>;
}
export namespace defaultProps {
namespace defaultProps {
const x_1: number;
export { x_1 as x };
const y_1: number;
Expand Down
52 changes: 32 additions & 20 deletions lib/components/DataProductAvailability/AvailabilityUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,51 +49,63 @@ export const VALID_ENHANCED_STATUSES: {
};
export function calcRollupStatus(statuses?: any[]): any;
export namespace AvailabilityPropTypes {
export const basicSiteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
const basicSiteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
siteCode: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
release: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
export const enhancedSites: PropTypes.Requireable<(PropTypes.InferProps<{
const enhancedSites: PropTypes.Requireable<(PropTypes.InferProps<{
siteCode: PropTypes.Validator<string>;
tables: PropTypes.Validator<(PropTypes.InferProps<{
name: PropTypes.Validator<string>;
description: PropTypes.Validator<string>;
waitInterval: PropTypes.Validator<string>;
months: PropTypes.Validator<{
[x: string]: import("../../types/core").Nullable<string>;
[x: string]: string | null | undefined;
}>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
export const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
dataProductCode: PropTypes.Validator<string>;
dataProductTitle: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
release: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
}
export namespace SVG {
export const MIN_WIDTH: number;
export const MIN_HEIGHT: number;
export const YEAR_MONTH_WIDTH: number;
export const YEAR_WIDTH: number;
export const ABS_MAX_DATA_WIDTH: number;
const MIN_WIDTH: number;
const MIN_HEIGHT: number;
const YEAR_MONTH_WIDTH: number;
const YEAR_WIDTH: number;
const ABS_MAX_DATA_WIDTH: number;
}
export namespace TIME {
export const MIN_YEAR_MONTH: string;
export const MAX_YEAR_MONTH: string;
export const YEARS: number[];
export const MONTHS: string[];
export const YEAR_MONTHS: any;
const MIN_YEAR_MONTH: string;
const MAX_YEAR_MONTH: string;
const YEARS: number[];
const MONTHS: string[];
const YEAR_MONTHS: any;
}
export namespace SVG_STYLES {
export function apply(node: any, styleName: any): void;
export function touchRipple(selection: any, duration?: number): void;
/**
Function: apply
Parse an object literal style definition into d3 selection.style()
calls to apply styles defined in the styles object literal to a node
*/
function apply(node: any, styleName: any): void;
/**
Function: touchRipple
For click interactions pass a d3 selection in and the fill will transition
from an "active" semi-transparent orange color to near-transparent. We don't go
full transparent as the ripple is typically followed by a delayed state update
that will trigger a rerender and thus a full style reset.
*/
function touchRipple(selection: any, duration?: number): void;
}
import PropTypes from "prop-types";
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ export default BasicAvailabilityInterface;
*/
declare function BasicAvailabilityInterface(props: any): JSX.Element;
declare namespace BasicAvailabilityInterface {
export namespace propTypes {
export const siteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
namespace propTypes {
const siteCodes: PropTypes.Requireable<(PropTypes.InferProps<{
siteCode: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
release: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
export const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
const dataProducts: PropTypes.Requireable<(PropTypes.InferProps<{
dataProductCode: PropTypes.Validator<string>;
dataProductTitle: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
availableReleases: PropTypes.Requireable<(PropTypes.InferProps<{
release: PropTypes.Validator<string>;
availableMonths: PropTypes.Validator<import("../../types/core").Nullable<string>[]>;
availableMonths: PropTypes.Validator<(string | null | undefined)[]>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
export const view: PropTypes.Requireable<string>;
export const sortMethod: PropTypes.Requireable<string>;
export const sortDirection: PropTypes.Requireable<string>;
export const disableSelection: PropTypes.Requireable<boolean>;
export const delineateRelease: PropTypes.Requireable<boolean>;
const view: PropTypes.Requireable<string>;
const sortMethod: PropTypes.Requireable<string>;
const sortDirection: PropTypes.Requireable<string>;
const disableSelection: PropTypes.Requireable<boolean>;
const delineateRelease: PropTypes.Requireable<boolean>;
}
export namespace defaultProps {
namespace defaultProps {
const siteCodes_1: never[];
export { siteCodes_1 as siteCodes };
const dataProducts_1: never[];
Expand Down
10 changes: 5 additions & 5 deletions lib/components/DataProductAvailability/BasicAvailabilityKey.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*/
declare function BasicAvailabilityKey(props: any): JSX.Element;
declare namespace BasicAvailabilityKey {
export namespace propTypes {
export const orientation: PropTypes.Requireable<string>;
export const selectionEnabled: PropTypes.Requireable<boolean>;
export const delineateRelease: PropTypes.Requireable<boolean>;
namespace propTypes {
const orientation: PropTypes.Requireable<string>;
const selectionEnabled: PropTypes.Requireable<boolean>;
const delineateRelease: PropTypes.Requireable<boolean>;
}
export namespace defaultProps {
namespace defaultProps {
const orientation_1: string;
export { orientation_1 as orientation };
const selectionEnabled_1: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default EnhancedAvailabilityInterface;
declare function EnhancedAvailabilityInterface(props: any): JSX.Element;
declare namespace EnhancedAvailabilityInterface {
export namespace propTypes {
export const sites: PropTypes.Requireable<(PropTypes.InferProps<{
namespace propTypes {
const sites: PropTypes.Requireable<(PropTypes.InferProps<{
siteCode: PropTypes.Validator<string>;
tables: PropTypes.Validator<(PropTypes.InferProps<{
name: PropTypes.Validator<string>;
Expand All @@ -11,17 +11,17 @@ declare namespace EnhancedAvailabilityInterface {
*/
waitInterval: PropTypes.Validator<string>;
months: PropTypes.Validator<{
[x: string]: import("../../types/core").Nullable<string>;
[x: string]: string | null | undefined;
}>;
}> | null | undefined)[]>;
}> | null | undefined)[]>;
export const view: PropTypes.Requireable<string>;
export const table: PropTypes.Requireable<string>;
export const sortMethod: PropTypes.Requireable<string>;
export const sortDirection: PropTypes.Requireable<string>;
export const disableSelection: PropTypes.Requireable<boolean>;
const view: PropTypes.Requireable<string>;
const table: PropTypes.Requireable<string>;
const sortMethod: PropTypes.Requireable<string>;
const sortDirection: PropTypes.Requireable<string>;
const disableSelection: PropTypes.Requireable<boolean>;
}
export namespace defaultProps {
namespace defaultProps {
const sites_1: never[];
export { sites_1 as sites };
const view_1: null;
Expand Down
Loading

0 comments on commit 7b0b5e6

Please sign in to comment.