Skip to content

Commit

Permalink
Merge pull request #44 from NEONScience/gcs
Browse files Browse the repository at this point in the history
Citations, GCS Migration, prepare v1.11.0
  • Loading branch information
sampsonj authored Mar 18, 2022
2 parents 80a3a62 + 4b14c0a commit 4998ab2
Show file tree
Hide file tree
Showing 103 changed files with 6,987 additions and 413 deletions.
2 changes: 2 additions & 0 deletions lib/components/Card/BaseCard.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface BaseCardProps {
title?: string;
titleContent?: React.ReactNode;
message?: string;
actionLabel?: string;
onActionClick?: () => void;
}
declare const BaseCard: React.FC<BaseCardProps>;
export default BaseCard;
21 changes: 19 additions & 2 deletions lib/components/Card/BaseCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ exports.default = exports.CardType = void 0;

var _react = _interopRequireDefault(require("react"));

var _Button = _interopRequireDefault(require("@material-ui/core/Button"));

var _Card = _interopRequireDefault(require("@material-ui/core/Card"));

var _CardContent = _interopRequireDefault(require("@material-ui/core/CardContent"));
Expand All @@ -23,6 +25,8 @@ var _Warning = _interopRequireDefault(require("@material-ui/icons/Warning"));

var _Error = _interopRequireDefault(require("@material-ui/icons/Error"));

var _Autorenew = _interopRequireDefault(require("@material-ui/icons/Autorenew"));

var _Theme = _interopRequireDefault(require("../Theme/Theme"));

var _typeUtil = require("../../util/typeUtil");
Expand Down Expand Up @@ -61,7 +65,9 @@ var BaseCard = function BaseCard(props) {
title = props.title,
calloutClasses = props.calloutClasses,
message = props.message,
titleContent = props.titleContent;
titleContent = props.titleContent,
actionLabel = props.actionLabel,
onActionClick = props.onActionClick;

var iconContent = /*#__PURE__*/_react.default.createElement(_Info.default, {
fontSize: "large",
Expand Down Expand Up @@ -110,7 +116,18 @@ var BaseCard = function BaseCard(props) {
}, titleContent);
}

return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent);
var action;
var appliedLabel = (0, _typeUtil.isStringNonEmpty)(actionLabel) ? actionLabel : 'Reset';

if ((0, _typeUtil.exists)(onActionClick)) {
action = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, {
variant: "outlined",
onClick: onActionClick,
startIcon: /*#__PURE__*/_react.default.createElement(_Autorenew.default, null)
}, appliedLabel));
}

return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent, action);
};

var content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, {
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Citation/DataProductCitation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const WrappedDataProductCitation: any;
export default WrappedDataProductCitation;
58 changes: 58 additions & 0 deletions lib/components/Citation/DataProductCitation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _ComponentErrorBoundary = _interopRequireDefault(require("../Error/ComponentErrorBoundary"));

var _Context = _interopRequireDefault(require("./DataProductCitation/Context"));

var _View = _interopRequireDefault(require("./DataProductCitation/View"));

var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext"));

var _Theme = _interopRequireDefault(require("../Theme/Theme"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DataProductCitation = function DataProductCitation(props) {
var productCode = props.productCode,
release = props.release,
showQuoteIcon = props.showQuoteIcon,
disableConditional = props.disableConditional,
disableSkeleton = props.disableSkeleton,
showTextOnly = props.showTextOnly,
textOnlyProps = props.textOnlyProps;
return /*#__PURE__*/_react.default.createElement(_ComponentErrorBoundary.default, {
onReset: function onReset() {
/* noop for boundary reset */
}
}, /*#__PURE__*/_react.default.createElement(_Context.default.Provider, {
productCode: productCode,
release: release
}, /*#__PURE__*/_react.default.createElement(_View.default, {
showQuoteIcon: showQuoteIcon,
disableConditional: disableConditional,
disableSkeleton: disableSkeleton,
showTextOnly: showTextOnly,
textOnlyProps: textOnlyProps
})));
};

DataProductCitation.defaultProps = {
release: undefined,
showQuoteIcon: false,
disableConditional: false,
disableSkeleton: false,
showTextOnly: false,
textOnlyProps: undefined
};

var WrappedDataProductCitation = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(DataProductCitation));

var _default = WrappedDataProductCitation;
exports.default = _default;
153 changes: 153 additions & 0 deletions lib/components/Citation/DataProductCitation/Actions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import { AjaxResponse } from 'rxjs/ajax';
import { AnyAction, Nullable, UnknownRecord } from '../../../types/core';
import { ContextDataProduct } from './State';
export declare enum ActionTypes {
REINITIALIZE = "REINITIALIZE",
ERROR = "ERROR",
SET_PRODUCT_CODE = "SET_PRODUCT_CODE",
SET_RELEASE = "SET_RELEASE",
SET_PARAMS = "SET_PARAMS",
STORE_FINALIZED_NEON_CONTEXT_STATE = "STORE_FINALIZED_NEON_CONTEXT_STATE",
FETCH_PRODUCT_STARTED = "FETCH_PRODUCT_STARTED",
FETCH_PRODUCT_FAILED = "FETCH_PRODUCT_FAILED",
FETCH_PRODUCT_SUCCEEDED = "FETCH_PRODUCT_SUCCEEDED",
FETCH_PRODUCT_RELEASE_STARTED = "FETCH_PRODUCT_RELEASE_STARTED",
FETCH_PRODUCT_RELEASE_FAILED = "FETCH_PRODUCT_RELEASE_FAILED",
FETCH_PRODUCT_RELEASE_SUCCEEDED = "FETCH_PRODUCT_RELEASE_SUCCEEDED",
FETCH_BUNDLE_PARENT_STARTED = "FETCH_BUNDLE_PARENT_STARTED",
FETCH_BUNDLE_PARENT_FAILED = "FETCH_BUNDLE_PARENT_FAILED",
FETCH_BUNDLE_PARENT_SUCCEEDED = "FETCH_BUNDLE_PARENT_SUCCEEDED",
FETCH_BUNDLE_PARENT_RELEASE_STARTED = "FETCH_BUNDLE_PARENT_RELEASE_STARTED",
FETCH_BUNDLE_PARENT_RELEASE_FAILED = "FETCH_BUNDLE_PARENT_RELEASE_FAILED",
FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED = "FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED",
FETCH_CITATION_DOWNLOAD_STARTED = "FETCH_CITATION_DOWNLOAD_STARTED",
FETCH_CITATION_DOWNLOAD_FAILED = "FETCH_CITATION_DOWNLOAD_FAILED",
FETCH_CITATION_DOWNLOAD_SUCCEEDED = "FETCH_CITATION_DOWNLOAD_SUCCEEDED",
FETCH_CITATION_DOWNLOAD_RESET = "FETCH_CITATION_DOWNLOAD_RESET"
}
export interface ReinitializeAction extends AnyAction {
type: typeof ActionTypes.REINITIALIZE;
productCode: string;
release?: Nullable<string>;
}
export interface ErrorAction extends AnyAction {
type: typeof ActionTypes.ERROR;
error: Nullable<UnknownRecord | string>;
}
export interface SetProductCodeAction extends AnyAction {
type: typeof ActionTypes.SET_PRODUCT_CODE;
productCode: Nullable<string>;
}
export interface SetReleaseAction extends AnyAction {
type: typeof ActionTypes.SET_RELEASE;
release: Nullable<string>;
}
export interface SetParamsAction extends AnyAction {
type: typeof ActionTypes.SET_PARAMS;
productCode: Nullable<string>;
release: Nullable<string>;
}
export interface StoreFinalizedNeonContextStateAction extends AnyAction {
type: typeof ActionTypes.STORE_FINALIZED_NEON_CONTEXT_STATE;
neonContextState: UnknownRecord;
}
export interface FetchProductStartedAction extends AnyAction {
type: typeof ActionTypes.FETCH_PRODUCT_STARTED;
}
export interface FetchProductFailedAction extends AnyAction {
type: typeof ActionTypes.FETCH_PRODUCT_FAILED;
error: Nullable<AjaxResponse | string>;
}
export interface FetchProductSucceededAction extends AnyAction {
type: typeof ActionTypes.FETCH_PRODUCT_SUCCEEDED;
data: ContextDataProduct;
}
export interface FetchProductReleaseStartedAction extends AnyAction {
type: typeof ActionTypes.FETCH_PRODUCT_RELEASE_STARTED;
release: string;
}
export interface FetchProductReleaseFailedAction extends AnyAction {
type: typeof ActionTypes.FETCH_PRODUCT_RELEASE_FAILED;
release: string;
error: Nullable<AjaxResponse | string>;
}
export interface FetchProductReleaseSucceededAction extends AnyAction {
type: typeof ActionTypes.FETCH_PRODUCT_RELEASE_SUCCEEDED;
release: string;
data: ContextDataProduct;
}
export interface FetchBundleParentStartedAction extends AnyAction {
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_STARTED;
bundleParent: string;
}
export interface FetchBundleParentFailedAction extends AnyAction {
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_FAILED;
bundleParent: string;
error: Nullable<AjaxResponse | string>;
}
export interface FetchBundleParentSucceededAction extends AnyAction {
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_SUCCEEDED;
bundleParent: string;
data: ContextDataProduct;
}
export interface FetchBundleParentReleaseStartedAction extends AnyAction {
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_STARTED;
bundleParent: string;
release: string;
}
export interface FetchBundleParentReleaseFailedAction extends AnyAction {
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_FAILED;
bundleParent: string;
release: string;
error: Nullable<AjaxResponse | string>;
}
export interface FetchBundleParentReleaseSucceededAction extends AnyAction {
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED;
bundleParent: string;
release: string;
data: ContextDataProduct;
}
export interface FetchCitationDownloadStartedAction extends AnyAction {
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_STARTED;
key: string;
}
export interface FetchCitationDownloadFailedAction extends AnyAction {
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_FAILED;
key: string;
error: Nullable<string>;
}
export interface FetchCitationDownloadSucceededAction extends AnyAction {
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_SUCCEEDED;
key: string;
}
export interface FetchCitationDownloadResetAction extends AnyAction {
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_RESET;
key: string;
}
export declare type DataProducCitationActionTypes = (ReinitializeAction | ErrorAction | SetProductCodeAction | SetReleaseAction | SetParamsAction | StoreFinalizedNeonContextStateAction | FetchProductStartedAction | FetchProductFailedAction | FetchProductSucceededAction | FetchProductReleaseStartedAction | FetchProductReleaseFailedAction | FetchProductReleaseSucceededAction | FetchBundleParentStartedAction | FetchBundleParentFailedAction | FetchBundleParentSucceededAction | FetchBundleParentReleaseStartedAction | FetchBundleParentReleaseFailedAction | FetchBundleParentReleaseSucceededAction | FetchCitationDownloadStartedAction | FetchCitationDownloadFailedAction | FetchCitationDownloadSucceededAction | FetchCitationDownloadResetAction | AnyAction);
export declare type ErrorActionTypes = (ErrorAction | FetchProductFailedAction | FetchProductReleaseFailedAction | FetchBundleParentFailedAction | FetchBundleParentReleaseFailedAction | FetchCitationDownloadFailedAction);
declare const ActionCreator: {
reinitialize: (productCode: string, release?: Nullable<string>) => ReinitializeAction;
error: (error: Nullable<UnknownRecord | string>) => ErrorAction;
setProductCode: (productCode: Nullable<string>) => SetProductCodeAction;
setRelease: (release: Nullable<string>) => SetReleaseAction;
setParams: (productCode: Nullable<string>, release: Nullable<string>) => SetParamsAction;
storeFinalizedNeonContextState: (neonContextState: UnknownRecord) => StoreFinalizedNeonContextStateAction;
fetchProductStarted: () => FetchProductStartedAction;
fetchProductFailed: (error: Nullable<AjaxResponse | string>) => FetchProductFailedAction;
fetchProductSucceeded: (data: ContextDataProduct) => FetchProductSucceededAction;
fetchProductReleaseStarted: (release: string) => FetchProductReleaseStartedAction;
fetchProductReleaseFailed: (release: string, error: Nullable<AjaxResponse | string>) => FetchProductReleaseFailedAction;
fetchProductReleaseSucceeded: (release: string, data: ContextDataProduct) => FetchProductReleaseSucceededAction;
fetchBundleParentStarted: (bundleParent: string) => FetchBundleParentStartedAction;
fetchBundleParentFailed: (bundleParent: string, error: Nullable<AjaxResponse | string>) => FetchBundleParentFailedAction;
fetchBundleParentSucceeded: (bundleParent: string, data: ContextDataProduct) => FetchBundleParentSucceededAction;
fetchBundleParentReleaseStarted: (bundleParent: string, release: string) => FetchBundleParentReleaseStartedAction;
fetchBundleParentReleaseFailed: (bundleParent: string, release: string, error: Nullable<AjaxResponse | string>) => FetchBundleParentReleaseFailedAction;
fetchBundleParentReleaseSucceeded: (bundleParent: string, release: string, data: ContextDataProduct) => FetchBundleParentReleaseSucceededAction;
fetchCitationDownloadStarted: (key: string) => FetchCitationDownloadStartedAction;
fetchCitationDownloadFailed: (key: string, error: Nullable<string>) => FetchCitationDownloadFailedAction;
fetchCitationDownloadSucceeded: (key: string) => FetchCitationDownloadSucceededAction;
fetchCitationDownloadReset: (key: string) => FetchCitationDownloadResetAction;
};
export default ActionCreator;
Loading

0 comments on commit 4998ab2

Please sign in to comment.