Skip to content

Commit 4998ab2

Browse files
authored
Merge pull request NEONScience#44 from NEONScience/gcs
Citations, GCS Migration, prepare v1.11.0
2 parents 80a3a62 + 4b14c0a commit 4998ab2

File tree

103 files changed

+6987
-413
lines changed

Some content is hidden

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

103 files changed

+6987
-413
lines changed

lib/components/Card/BaseCard.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export interface BaseCardProps {
1414
title?: string;
1515
titleContent?: React.ReactNode;
1616
message?: string;
17+
actionLabel?: string;
18+
onActionClick?: () => void;
1719
}
1820
declare const BaseCard: React.FC<BaseCardProps>;
1921
export default BaseCard;

lib/components/Card/BaseCard.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ exports.default = exports.CardType = void 0;
77

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

10+
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
11+
1012
var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
1113

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

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

28+
var _Autorenew = _interopRequireDefault(require("@material-ui/icons/Autorenew"));
29+
2630
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
2731

2832
var _typeUtil = require("../../util/typeUtil");
@@ -61,7 +65,9 @@ var BaseCard = function BaseCard(props) {
6165
title = props.title,
6266
calloutClasses = props.calloutClasses,
6367
message = props.message,
64-
titleContent = props.titleContent;
68+
titleContent = props.titleContent,
69+
actionLabel = props.actionLabel,
70+
onActionClick = props.onActionClick;
6571

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

113-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent);
119+
var action;
120+
var appliedLabel = (0, _typeUtil.isStringNonEmpty)(actionLabel) ? actionLabel : 'Reset';
121+
122+
if ((0, _typeUtil.exists)(onActionClick)) {
123+
action = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, {
124+
variant: "outlined",
125+
onClick: onActionClick,
126+
startIcon: /*#__PURE__*/_react.default.createElement(_Autorenew.default, null)
127+
}, appliedLabel));
128+
}
129+
130+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent, action);
114131
};
115132

116133
var content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const WrappedDataProductCitation: any;
2+
export default WrappedDataProductCitation;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
"use strict";
2+
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
exports.default = void 0;
7+
8+
var _react = _interopRequireDefault(require("react"));
9+
10+
var _ComponentErrorBoundary = _interopRequireDefault(require("../Error/ComponentErrorBoundary"));
11+
12+
var _Context = _interopRequireDefault(require("./DataProductCitation/Context"));
13+
14+
var _View = _interopRequireDefault(require("./DataProductCitation/View"));
15+
16+
var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext"));
17+
18+
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
19+
20+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21+
22+
var DataProductCitation = function DataProductCitation(props) {
23+
var productCode = props.productCode,
24+
release = props.release,
25+
showQuoteIcon = props.showQuoteIcon,
26+
disableConditional = props.disableConditional,
27+
disableSkeleton = props.disableSkeleton,
28+
showTextOnly = props.showTextOnly,
29+
textOnlyProps = props.textOnlyProps;
30+
return /*#__PURE__*/_react.default.createElement(_ComponentErrorBoundary.default, {
31+
onReset: function onReset() {
32+
/* noop for boundary reset */
33+
}
34+
}, /*#__PURE__*/_react.default.createElement(_Context.default.Provider, {
35+
productCode: productCode,
36+
release: release
37+
}, /*#__PURE__*/_react.default.createElement(_View.default, {
38+
showQuoteIcon: showQuoteIcon,
39+
disableConditional: disableConditional,
40+
disableSkeleton: disableSkeleton,
41+
showTextOnly: showTextOnly,
42+
textOnlyProps: textOnlyProps
43+
})));
44+
};
45+
46+
DataProductCitation.defaultProps = {
47+
release: undefined,
48+
showQuoteIcon: false,
49+
disableConditional: false,
50+
disableSkeleton: false,
51+
showTextOnly: false,
52+
textOnlyProps: undefined
53+
};
54+
55+
var WrappedDataProductCitation = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(DataProductCitation));
56+
57+
var _default = WrappedDataProductCitation;
58+
exports.default = _default;
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
import { AjaxResponse } from 'rxjs/ajax';
2+
import { AnyAction, Nullable, UnknownRecord } from '../../../types/core';
3+
import { ContextDataProduct } from './State';
4+
export declare enum ActionTypes {
5+
REINITIALIZE = "REINITIALIZE",
6+
ERROR = "ERROR",
7+
SET_PRODUCT_CODE = "SET_PRODUCT_CODE",
8+
SET_RELEASE = "SET_RELEASE",
9+
SET_PARAMS = "SET_PARAMS",
10+
STORE_FINALIZED_NEON_CONTEXT_STATE = "STORE_FINALIZED_NEON_CONTEXT_STATE",
11+
FETCH_PRODUCT_STARTED = "FETCH_PRODUCT_STARTED",
12+
FETCH_PRODUCT_FAILED = "FETCH_PRODUCT_FAILED",
13+
FETCH_PRODUCT_SUCCEEDED = "FETCH_PRODUCT_SUCCEEDED",
14+
FETCH_PRODUCT_RELEASE_STARTED = "FETCH_PRODUCT_RELEASE_STARTED",
15+
FETCH_PRODUCT_RELEASE_FAILED = "FETCH_PRODUCT_RELEASE_FAILED",
16+
FETCH_PRODUCT_RELEASE_SUCCEEDED = "FETCH_PRODUCT_RELEASE_SUCCEEDED",
17+
FETCH_BUNDLE_PARENT_STARTED = "FETCH_BUNDLE_PARENT_STARTED",
18+
FETCH_BUNDLE_PARENT_FAILED = "FETCH_BUNDLE_PARENT_FAILED",
19+
FETCH_BUNDLE_PARENT_SUCCEEDED = "FETCH_BUNDLE_PARENT_SUCCEEDED",
20+
FETCH_BUNDLE_PARENT_RELEASE_STARTED = "FETCH_BUNDLE_PARENT_RELEASE_STARTED",
21+
FETCH_BUNDLE_PARENT_RELEASE_FAILED = "FETCH_BUNDLE_PARENT_RELEASE_FAILED",
22+
FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED = "FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED",
23+
FETCH_CITATION_DOWNLOAD_STARTED = "FETCH_CITATION_DOWNLOAD_STARTED",
24+
FETCH_CITATION_DOWNLOAD_FAILED = "FETCH_CITATION_DOWNLOAD_FAILED",
25+
FETCH_CITATION_DOWNLOAD_SUCCEEDED = "FETCH_CITATION_DOWNLOAD_SUCCEEDED",
26+
FETCH_CITATION_DOWNLOAD_RESET = "FETCH_CITATION_DOWNLOAD_RESET"
27+
}
28+
export interface ReinitializeAction extends AnyAction {
29+
type: typeof ActionTypes.REINITIALIZE;
30+
productCode: string;
31+
release?: Nullable<string>;
32+
}
33+
export interface ErrorAction extends AnyAction {
34+
type: typeof ActionTypes.ERROR;
35+
error: Nullable<UnknownRecord | string>;
36+
}
37+
export interface SetProductCodeAction extends AnyAction {
38+
type: typeof ActionTypes.SET_PRODUCT_CODE;
39+
productCode: Nullable<string>;
40+
}
41+
export interface SetReleaseAction extends AnyAction {
42+
type: typeof ActionTypes.SET_RELEASE;
43+
release: Nullable<string>;
44+
}
45+
export interface SetParamsAction extends AnyAction {
46+
type: typeof ActionTypes.SET_PARAMS;
47+
productCode: Nullable<string>;
48+
release: Nullable<string>;
49+
}
50+
export interface StoreFinalizedNeonContextStateAction extends AnyAction {
51+
type: typeof ActionTypes.STORE_FINALIZED_NEON_CONTEXT_STATE;
52+
neonContextState: UnknownRecord;
53+
}
54+
export interface FetchProductStartedAction extends AnyAction {
55+
type: typeof ActionTypes.FETCH_PRODUCT_STARTED;
56+
}
57+
export interface FetchProductFailedAction extends AnyAction {
58+
type: typeof ActionTypes.FETCH_PRODUCT_FAILED;
59+
error: Nullable<AjaxResponse | string>;
60+
}
61+
export interface FetchProductSucceededAction extends AnyAction {
62+
type: typeof ActionTypes.FETCH_PRODUCT_SUCCEEDED;
63+
data: ContextDataProduct;
64+
}
65+
export interface FetchProductReleaseStartedAction extends AnyAction {
66+
type: typeof ActionTypes.FETCH_PRODUCT_RELEASE_STARTED;
67+
release: string;
68+
}
69+
export interface FetchProductReleaseFailedAction extends AnyAction {
70+
type: typeof ActionTypes.FETCH_PRODUCT_RELEASE_FAILED;
71+
release: string;
72+
error: Nullable<AjaxResponse | string>;
73+
}
74+
export interface FetchProductReleaseSucceededAction extends AnyAction {
75+
type: typeof ActionTypes.FETCH_PRODUCT_RELEASE_SUCCEEDED;
76+
release: string;
77+
data: ContextDataProduct;
78+
}
79+
export interface FetchBundleParentStartedAction extends AnyAction {
80+
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_STARTED;
81+
bundleParent: string;
82+
}
83+
export interface FetchBundleParentFailedAction extends AnyAction {
84+
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_FAILED;
85+
bundleParent: string;
86+
error: Nullable<AjaxResponse | string>;
87+
}
88+
export interface FetchBundleParentSucceededAction extends AnyAction {
89+
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_SUCCEEDED;
90+
bundleParent: string;
91+
data: ContextDataProduct;
92+
}
93+
export interface FetchBundleParentReleaseStartedAction extends AnyAction {
94+
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_STARTED;
95+
bundleParent: string;
96+
release: string;
97+
}
98+
export interface FetchBundleParentReleaseFailedAction extends AnyAction {
99+
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_FAILED;
100+
bundleParent: string;
101+
release: string;
102+
error: Nullable<AjaxResponse | string>;
103+
}
104+
export interface FetchBundleParentReleaseSucceededAction extends AnyAction {
105+
type: typeof ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED;
106+
bundleParent: string;
107+
release: string;
108+
data: ContextDataProduct;
109+
}
110+
export interface FetchCitationDownloadStartedAction extends AnyAction {
111+
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_STARTED;
112+
key: string;
113+
}
114+
export interface FetchCitationDownloadFailedAction extends AnyAction {
115+
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_FAILED;
116+
key: string;
117+
error: Nullable<string>;
118+
}
119+
export interface FetchCitationDownloadSucceededAction extends AnyAction {
120+
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_SUCCEEDED;
121+
key: string;
122+
}
123+
export interface FetchCitationDownloadResetAction extends AnyAction {
124+
type: typeof ActionTypes.FETCH_CITATION_DOWNLOAD_RESET;
125+
key: string;
126+
}
127+
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);
128+
export declare type ErrorActionTypes = (ErrorAction | FetchProductFailedAction | FetchProductReleaseFailedAction | FetchBundleParentFailedAction | FetchBundleParentReleaseFailedAction | FetchCitationDownloadFailedAction);
129+
declare const ActionCreator: {
130+
reinitialize: (productCode: string, release?: Nullable<string>) => ReinitializeAction;
131+
error: (error: Nullable<UnknownRecord | string>) => ErrorAction;
132+
setProductCode: (productCode: Nullable<string>) => SetProductCodeAction;
133+
setRelease: (release: Nullable<string>) => SetReleaseAction;
134+
setParams: (productCode: Nullable<string>, release: Nullable<string>) => SetParamsAction;
135+
storeFinalizedNeonContextState: (neonContextState: UnknownRecord) => StoreFinalizedNeonContextStateAction;
136+
fetchProductStarted: () => FetchProductStartedAction;
137+
fetchProductFailed: (error: Nullable<AjaxResponse | string>) => FetchProductFailedAction;
138+
fetchProductSucceeded: (data: ContextDataProduct) => FetchProductSucceededAction;
139+
fetchProductReleaseStarted: (release: string) => FetchProductReleaseStartedAction;
140+
fetchProductReleaseFailed: (release: string, error: Nullable<AjaxResponse | string>) => FetchProductReleaseFailedAction;
141+
fetchProductReleaseSucceeded: (release: string, data: ContextDataProduct) => FetchProductReleaseSucceededAction;
142+
fetchBundleParentStarted: (bundleParent: string) => FetchBundleParentStartedAction;
143+
fetchBundleParentFailed: (bundleParent: string, error: Nullable<AjaxResponse | string>) => FetchBundleParentFailedAction;
144+
fetchBundleParentSucceeded: (bundleParent: string, data: ContextDataProduct) => FetchBundleParentSucceededAction;
145+
fetchBundleParentReleaseStarted: (bundleParent: string, release: string) => FetchBundleParentReleaseStartedAction;
146+
fetchBundleParentReleaseFailed: (bundleParent: string, release: string, error: Nullable<AjaxResponse | string>) => FetchBundleParentReleaseFailedAction;
147+
fetchBundleParentReleaseSucceeded: (bundleParent: string, release: string, data: ContextDataProduct) => FetchBundleParentReleaseSucceededAction;
148+
fetchCitationDownloadStarted: (key: string) => FetchCitationDownloadStartedAction;
149+
fetchCitationDownloadFailed: (key: string, error: Nullable<string>) => FetchCitationDownloadFailedAction;
150+
fetchCitationDownloadSucceeded: (key: string) => FetchCitationDownloadSucceededAction;
151+
fetchCitationDownloadReset: (key: string) => FetchCitationDownloadResetAction;
152+
};
153+
export default ActionCreator;

0 commit comments

Comments
 (0)