Skip to content

Commit bd50abd

Browse files
Merge pull request #206 from 4dn-dcic/custom-auth0-fix
Custom auth0 ui fix
2 parents b3ddf17 + 630f5f9 commit bd50abd

File tree

79 files changed

+22513
-20551
lines changed

Some content is hidden

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

79 files changed

+22513
-20551
lines changed

es/components/browse/EmbeddedSearchView.js

Lines changed: 60 additions & 66 deletions
Large diffs are not rendered by default.

es/components/browse/SearchView.js

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3-
import _createClass from "@babel/runtime/helpers/createClass";
4-
import _inherits from "@babel/runtime/helpers/inherits";
5-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
81
var _excluded = ["href", "context", "showClearFiltersButton", "schemas", "currentAction", "facets", "navigate", "columns", "columnExtensionMap", "placeholderReplacementFxn", "keepSelectionInStorage", "windowWidth"];
9-
2+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
103
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11-
124
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13-
5+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
11+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1412
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15-
13+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
14+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1615
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17-
16+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
17+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1820
import React from 'react';
1921
import PropTypes from 'prop-types';
2022
import _ from 'underscore';
@@ -28,21 +30,18 @@ import { CustomColumnController } from './components/CustomColumnController';
2830
import { SortController } from './components/SortController';
2931
import { SelectedItemsController } from './components/SelectedItemsController';
3032
import { WindowNavigationController } from './components/WindowNavigationController';
31-
import { ControlsAndResults } from './components/ControlsAndResults'; // eslint-disable-next-line no-unused-vars
33+
import { ControlsAndResults } from './components/ControlsAndResults';
3234

35+
// eslint-disable-next-line no-unused-vars
3336
import { SearchResponse, Item, ColumnDefinition, URLParts } from './../util/typedefs';
3437
export { SortController, SelectedItemsController, ColumnCombiner, CustomColumnController };
3538
export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
3639
_inherits(SearchView, _React$PureComponent);
37-
3840
var _super = _createSuper(SearchView);
39-
4041
function SearchView() {
4142
_classCallCheck(this, SearchView);
42-
4343
return _super.apply(this, arguments);
4444
}
45-
4645
_createClass(SearchView, [{
4746
key: "componentDidMount",
4847
value:
@@ -52,38 +51,40 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
5251
* @property {Object.<ColumnDefinition>} columnExtensionMap - Object keyed by field name with overrides for column definition.
5352
* @property {boolean} separateSingleTermFacets - If true, will push facets w/ only 1 term available to bottom of FacetList.
5453
*/
54+
5555
function componentDidMount() {
5656
ReactTooltip.rebuild();
5757
}
58+
5859
/**
5960
* TODO once we have @type : [..more stuff..], change to use instead of `getSchemaTypeFromSearchContext`.
6061
* For custom styling from CSS stylesheet (e.g. to sync override of rowHeight in both CSS and in props here)
6162
*/
62-
6363
}, {
6464
key: "render",
6565
value: function render() {
6666
var _this$props = this.props,
67-
href = _this$props.href,
68-
context = _this$props.context,
69-
showClearFiltersButton = _this$props.showClearFiltersButton,
70-
_this$props$schemas = _this$props.schemas,
71-
schemas = _this$props$schemas === void 0 ? null : _this$props$schemas,
72-
_this$props$currentAc = _this$props.currentAction,
73-
currentAction = _this$props$currentAc === void 0 ? null : _this$props$currentAc,
74-
propFacets = _this$props.facets,
75-
_this$props$navigate = _this$props.navigate,
76-
propNavigate = _this$props$navigate === void 0 ? navigate : _this$props$navigate,
77-
_this$props$columns = _this$props.columns,
78-
columns = _this$props$columns === void 0 ? null : _this$props$columns,
79-
_this$props$columnExt = _this$props.columnExtensionMap,
80-
columnExtensionMap = _this$props$columnExt === void 0 ? basicColumnExtensionMap : _this$props$columnExt,
81-
placeholderReplacementFxn = _this$props.placeholderReplacementFxn,
82-
keepSelectionInStorage = _this$props.keepSelectionInStorage,
83-
windowWidth = _this$props.windowWidth,
84-
passProps = _objectWithoutProperties(_this$props, _excluded);
85-
86-
var contextFacets = context.facets; // All these controllers pass props down to their children.
67+
href = _this$props.href,
68+
context = _this$props.context,
69+
showClearFiltersButton = _this$props.showClearFiltersButton,
70+
_this$props$schemas = _this$props.schemas,
71+
schemas = _this$props$schemas === void 0 ? null : _this$props$schemas,
72+
_this$props$currentAc = _this$props.currentAction,
73+
currentAction = _this$props$currentAc === void 0 ? null : _this$props$currentAc,
74+
propFacets = _this$props.facets,
75+
_this$props$navigate = _this$props.navigate,
76+
propNavigate = _this$props$navigate === void 0 ? navigate : _this$props$navigate,
77+
_this$props$columns = _this$props.columns,
78+
columns = _this$props$columns === void 0 ? null : _this$props$columns,
79+
_this$props$columnExt = _this$props.columnExtensionMap,
80+
columnExtensionMap = _this$props$columnExt === void 0 ? basicColumnExtensionMap : _this$props$columnExt,
81+
placeholderReplacementFxn = _this$props.placeholderReplacementFxn,
82+
keepSelectionInStorage = _this$props.keepSelectionInStorage,
83+
windowWidth = _this$props.windowWidth,
84+
passProps = _objectWithoutProperties(_this$props, _excluded);
85+
var contextFacets = context.facets;
86+
87+
// All these controllers pass props down to their children.
8788
// So we don't need to be repetitive here; i.e. may assume 'context' is available
8889
// in each controller that's child of <ColumnCombiner {...{ context, columns, columnExtensionMap }}>.
8990
// As well as in ControlsAndResults.
@@ -97,7 +98,6 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
9798
isOwnPage: true,
9899
facets: propFacets || contextFacets
99100
});
100-
101101
var controllersAndView = /*#__PURE__*/React.createElement(WindowNavigationController, {
102102
href: href,
103103
context: context,
@@ -107,7 +107,6 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
107107
columns: columns,
108108
columnExtensionMap: columnExtensionMap
109109
}, /*#__PURE__*/React.createElement(CustomColumnController, null, /*#__PURE__*/React.createElement(SortController, null, /*#__PURE__*/React.createElement(ControlsAndResults, childViewProps)))));
110-
111110
if (isSelectAction(currentAction)) {
112111
// We don't allow "SelectionMode" unless is own page.
113112
// Could consider changing later once a use case exists.
@@ -122,7 +121,6 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
122121
keepSelectionInStorage: keepSelectionInStorage
123122
}, controllersAndView);
124123
}
125-
126124
return /*#__PURE__*/React.createElement("div", {
127125
className: "search-page-container"
128126
}, /*#__PURE__*/React.createElement(AboveSearchTablePanel, {
@@ -131,10 +129,8 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
131129
}), controllersAndView);
132130
}
133131
}]);
134-
135132
return SearchView;
136133
}(React.PureComponent);
137-
138134
_defineProperty(SearchView, "propTypes", {
139135
'context': PropTypes.object.isRequired,
140136
'columns': PropTypes.object,
@@ -156,7 +152,6 @@ _defineProperty(SearchView, "propTypes", {
156152
// Passed down to AboveSearchTablePanel StaticSection
157153
'keepSelectionInStorage': PropTypes.bool
158154
});
159-
160155
_defineProperty(SearchView, "defaultProps", {
161156
'href': null,
162157
// `props.context.columns` is used in place of `props.columns` if `props.columns` is falsy.

es/components/browse/components/AboveSearchTablePanel.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import _extends from "@babel/runtime/helpers/extends";
1+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
import React from 'react';
33
import PropTypes from 'prop-types';
44
import _ from 'underscore';
55
import { patchedConsoleInstance as console } from './../../util/patched-console';
66
import { BasicStaticSectionBody } from './../../static-pages/BasicStaticSectionBody';
77
export var AboveSearchTablePanel = /*#__PURE__*/React.memo(function (_ref) {
88
var context = _ref.context,
9-
placeholderReplacementFxn = _ref.placeholderReplacementFxn;
9+
placeholderReplacementFxn = _ref.placeholderReplacementFxn;
1010
var search_header = context.search_header;
11-
if (!search_header) return null; // TODO: Add in custom front-end controls if/when applicable.
11+
if (!search_header) return null;
12+
13+
// TODO: Add in custom front-end controls if/when applicable.
1214
// If we migrate 'full screen', 'select x for download' etc buttons/controls here (desireable) we need to make sure it communicates with external state container for the SearchResultTable.
1315
// SearchResultTable would likely need to expose some functions which would be accessible via instance reference to SearchResultTable and passed up as callback props into this one.
1416

@@ -23,12 +25,11 @@ AboveSearchTablePanel.propTypes = {
2325
'context': PropTypes.object.isRequired,
2426
'placeholderReplacementFxn': PropTypes.func
2527
};
26-
2728
function SearchHeaderSection(_ref2) {
2829
var propTitle = _ref2.title,
29-
propContent = _ref2.content,
30-
filetype = _ref2.filetype,
31-
placeholderReplacementFxn = _ref2.placeholderReplacementFxn;
30+
propContent = _ref2.content,
31+
filetype = _ref2.filetype,
32+
placeholderReplacementFxn = _ref2.placeholderReplacementFxn;
3233
var title = propTitle ? /*#__PURE__*/React.createElement("h4", {
3334
className: "text-300"
3435
}, propTitle) : null;

0 commit comments

Comments
 (0)