From 0fc766020c1f970c42a173016b98e7dc865516aa Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Mon, 9 Jul 2018 16:03:50 +1200 Subject: [PATCH 01/44] NEW Add diff view form transform for comparisons In order to compare two form fields, there needs to be a way to load data in such a way that it will allow comparison between two values. To achieve this a form transformation has been added to faciliatate both loading two sets of data values, and rendering a differential of those values in a read only field. --- src/Forms/DiffTransformation.php | 119 ++++++++++++++++++ tests/Forms/DiffTransformationTest.php | 161 +++++++++++++++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 src/Forms/DiffTransformation.php create mode 100644 tests/Forms/DiffTransformationTest.php diff --git a/src/Forms/DiffTransformation.php b/src/Forms/DiffTransformation.php new file mode 100644 index 00000000..1d00c0d1 --- /dev/null +++ b/src/Forms/DiffTransformation.php @@ -0,0 +1,119 @@ +setComparisonData($comparisonData); + } + } + + /** + * Overrides the comparison data with a new set. + * + * @param DataObject|ArrayData|array $comparisonData + * @param bool $merge true to merge field values with existing data + * @throws InvalidArgumentException + * @return $this + */ + public function setComparisonData($comparisonData, $merge = false) + { + if (!is_array($comparisonData) + && !($comparisonData instanceof DataObject) + && !($comparisonData instanceof ArrayData) + ) { + throw new InvalidArgumentException( + 'comparisonData is not an array, nor an instance of DataObject or ArrayData' + ); + } + + $comparisonData = is_array($comparisonData) ? $comparisonData : $comparisonData->toMap(); + + $this->data = $merge ? array_merge($this->data, $comparisonData) : $comparisonData; + + return $this; + } + + /** + * @return array + */ + public function getComparisonData() + { + return $this->data; + } + + public function transform(FormField $field) + { + if ($field->isComposite()) { + /** @var CompositeField $field */ + // There isn't an interface for child fields so this is unfortunately just a best guess. + $newKids = $field->getChildren()->transform($this); + $newField = clone $field; + $newField->setChildren($newKids); + return $newField; + } + + if (!$field->hasData()) { + // No data; no value. + return clone $field; + } + + $data = $this->getComparisonData(); + $name = $field->getName(); + + // Do not compare generated security data + if (!isset($data[$name]) + && ($form = $field->getForm()) + && ($securityToken = $form->getSecurityToken()) + && ($securityTokenName = $securityToken->getName()) + && $securityTokenName === $name + ) { + return LiteralField::create($name, ''); + } + + // Do not "compare apples with oranges" + if (!isset($data[$name])) { + throw new LogicException("No comparison information set for field \"$name\""); + } + + try { + // First check if a field implements performDiffTransformation() + parent::transform($field); + } catch (BadMethodCallException $e) { + $diffField = HTMLReadonlyField::create( + $name, + $field->Title(), + Diff::compareHTML($field->Value(), isset($this->data[$name]) ? $this->data[$name] : '') + ); + + $diffField->addExtraClass($field->extraClass()); + $diffField->setDescription($field->getDescription()); + + return $diffField; + } + } +} diff --git a/tests/Forms/DiffTransformationTest.php b/tests/Forms/DiffTransformationTest.php new file mode 100644 index 00000000..84e44d8a --- /dev/null +++ b/tests/Forms/DiffTransformationTest.php @@ -0,0 +1,161 @@ + 'One', + 'Second' => 'Two', + 'Third' => 'Three', + ]; + + /** + * @var Form + */ + private $testForm; + + protected function setUp() + { + parent::setUp(); + + $fields = FieldList::create(); + foreach ($this->testData as $fieldName => $fieldValue) { + $fields->push(TextField::create($fieldName)->setValue($fieldValue)); + } + + $this->testForm = Form::create( + Controller::create(), + 'TestForm', + $fields, + FieldList::create() + ); + + // Don't go injecting an extra field to the $fields FieldList + $this->testForm->disableSecurityToken(); + } + + public function testSetComparisonData() + { + $transformation = new DiffTransformation(); + $transformation->setComparisonData($this->testData); + $this->assertEquals($this->testData, $transformation->getComparisonData(), 'Arrays are accepted'); + + $transformation->setComparisonData(DataObject::create($this->testData)); + $this->assertEquals($this->testData, $transformation->getComparisonData(), 'DataObjects are accepted'); + + $transformation->setComparisonData(ArrayData::create($this->testData)); + $this->assertEquals($this->testData, $transformation->getComparisonData(), 'ArrayDatas are accepted'); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testSetComparisonDataThrowsExceptionWithInvalidArgument() + { + $transformation = new DiffTransformation(); + $transformation->setComparisonData('First', '1st'); + } + + public function testSetComparisonDataMerge() + { + $transformation = new DiffTransformation([ + 'First' => 'Once', + 'Second' => '2nd', + ]); + + $transformation->setComparisonData([ + 'Second' => 'Twice', + 'Third' => 'Thrice', + ], $merge = true); + + // will throw an exception if not enough data is set + $this->testForm->transform($transformation); + } + + public function testTransform() + { + $form = $this->testForm; + $update = [ + 'First' => '1st', + 'Second' => '2nd', + 'Third' => '3rd', + ]; + + $expected = $this->getExpected($update); + $transformation = DiffTransformation::create($update); + $form->transform($transformation); + + foreach ($form->Fields() as $index => $field) { + $this->assertContains($expected[$index]['before'], $field->Value(), 'Value before is shown'); + $this->assertContains($expected[$index]['after'], $field->Value(), 'Value after is shown'); + } + } + + /** + * @expectedException LogicException + */ + public function testTransformWithNotEnoughData() + { + $form = $this->testForm; + $transformation = DiffTransformation::create([ + 'First' => '1st', + ]); + $form->transform($transformation); + } + + public function testTransformWithCompositeFields() + { + $form = $this->testForm; + $form->setFields( + FieldList::create( + CompositeField::create($form->Fields()) + ) + ); + $update = [ + 'First' => 'Uno', + 'Second' => 'Dos', + 'Third' => 'Tres', + ]; + + $expected = $this->getExpected($update); + $transformation = DiffTransformation::create($update); + $form->transform($transformation); + + foreach (array_values($form->Fields()->dataFields()) as $index => $field) { + $this->assertContains($expected[$index]['before'], $field->Value(), 'Value before is shown'); + $this->assertContains($expected[$index]['after'], $field->Value(), 'Value after is shown'); + } + } + + /** + * Helper method for generating the expected result for diff views between fields + * + * @param array $update + * @return array + */ + private function getExpected($update) + { + $expected = []; + $original = $this->testData; + foreach (array_combine(array_values($update), array_values($original)) as $now => $was) { + $expected[] = [ + 'before' => "$now", + 'after' => "$was", + ]; + } + return $expected; + } +} From e025e91d4d803287211fd60eac58237ce30f8f52 Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Wed, 18 Jul 2018 12:01:16 +1200 Subject: [PATCH 02/44] Add redux support for comparison view --- .../historyviewer/HistoryViewerActionTypes.js | 3 ++ .../historyviewer/HistoryViewerActions.js | 45 +++++++++++++++++++ .../historyviewer/HistoryViewerReducer.js | 24 ++++++++++ 3 files changed, 72 insertions(+) diff --git a/client/src/state/historyviewer/HistoryViewerActionTypes.js b/client/src/state/historyviewer/HistoryViewerActionTypes.js index 4617f841..115916b6 100644 --- a/client/src/state/historyviewer/HistoryViewerActionTypes.js +++ b/client/src/state/historyviewer/HistoryViewerActionTypes.js @@ -7,4 +7,7 @@ export default [ 'SET_CURRENT_PAGE', 'ADD_MESSAGE', 'CLEAR_MESSAGES', + 'SET_COMPARE_MODE', + 'SET_COMPARE_FROM', + 'SET_COMPARE_TO', ].reduce((obj, item) => Object.assign(obj, { [item]: `HISTORY_VIEWER.${item}` }), {}); diff --git a/client/src/state/historyviewer/HistoryViewerActions.js b/client/src/state/historyviewer/HistoryViewerActions.js index c9630e2c..2260c583 100644 --- a/client/src/state/historyviewer/HistoryViewerActions.js +++ b/client/src/state/historyviewer/HistoryViewerActions.js @@ -76,3 +76,48 @@ export function clearMessages() { }); }; } + +/** + * Enables or disables the comparison mode + * + * @param {boolean} enabled + * @returns {function} + */ +export function setCompareMode(enabled) { + return (dispatch) => { + dispatch({ + type: HISTORY_VIEWER.SET_COMPARISON_MODE, + payload: { enabled }, + }); + }; +} + +/** + * Sets the comparison mode 'from' a version + * + * @param {int} version + * @returns {function} + */ +export function setCompareFrom(version) { + return (dispatch) => { + dispatch({ + type: HISTORY_VIEWER.SET_COMPARE_FROM, + payload: { version }, + }); + }; +} + +/** + * Sets the comparison mode 'to' a version + * + * @param {int} version + * @returns {function} + */ +export function setCompareTo(version) { + return (dispatch) => { + dispatch({ + type: HISTORY_VIEWER.SET_COMPARE_TO, + payload: { version }, + }); + }; +} diff --git a/client/src/state/historyviewer/HistoryViewerReducer.js b/client/src/state/historyviewer/HistoryViewerReducer.js index 3dfe10ec..d7e5f9b8 100644 --- a/client/src/state/historyviewer/HistoryViewerReducer.js +++ b/client/src/state/historyviewer/HistoryViewerReducer.js @@ -3,6 +3,9 @@ import HISTORY_VIEWER from './HistoryViewerActionTypes'; const initialState = { currentPage: 1, currentVersion: 0, + compareFrom: 0, + compareTo: 0, + compareMode: false, loading: false, messages: [], }; @@ -59,6 +62,27 @@ export default function historyViewerReducer(state = initialState, { type, paylo return state; } + case HISTORY_VIEWER.SET_COMPARE_MODE: { + return { + ...state, + compareMode: payload.enabled, + }; + } + + case HISTORY_VIEWER.SET_COMPARE_FROM: { + return { + ...state, + compareFrom: payload.version, + }; + } + + case HISTORY_VIEWER.SET_COMPARE_TO: { + return { + ...state, + compareTo: payload.version, + }; + } + default: return state; } From 2a45f25e3c2f370636f69e104856ed6fcd064d73 Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Wed, 18 Jul 2018 15:37:15 +1200 Subject: [PATCH 03/44] Add compare button on active version view --- .../HistoryViewer/HistoryViewer.scss | 7 ++++ .../HistoryViewer/HistoryViewerVersion.js | 36 +++++++++++++++++-- .../historyviewer/HistoryViewerActions.js | 2 +- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index 5e9403d6..a26b2cf5 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -41,6 +41,7 @@ text-align: right; width: 1%; vertical-align: middle; + white-space: nowrap; } // Bring any CMS tabs in the detail view closer to the table above it @@ -50,6 +51,12 @@ } } +.history-viewer__compare-button { + border: 1px solid $white; + color: $white; + margin-right: 1rem; +} + .history-viewer__close-button { background: transparent; border: 1px solid $white; diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index 74567e81..82642082 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -3,7 +3,8 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { inject } from 'lib/Injector'; import { versionType, defaultVersion } from 'types/versionType'; -import { showVersion } from 'state/historyviewer/HistoryViewerActions'; +import { showVersion, setCompareMode, setCompareFrom } from 'state/historyviewer/HistoryViewerActions'; +import i18n from 'i18n'; class HistoryViewerVersion extends Component { constructor(props) { @@ -11,6 +12,7 @@ class HistoryViewerVersion extends Component { this.handleClick = this.handleClick.bind(this); this.handleClose = this.handleClose.bind(this); + this.handleCompare = this.handleCompare.bind(this); } /** @@ -54,6 +56,11 @@ class HistoryViewerVersion extends Component { onSelect(0); } + handleCompare() { + const { onCompare, version } = this.props; + onCompare(version.Version); + } + /** * Return a "clear" button to close the version, for example when used in a "detail view" * context. This is shown when this version is "active", displayed with a blue background. @@ -61,13 +68,24 @@ class HistoryViewerVersion extends Component { * @returns {FormAction|null} */ renderClearButton() { - const { isActive, FormActionComponent } = this.props; + const { isActive, showCompareButton, FormActionComponent } = this.props; if (!isActive) { return null; } + const compareButton = showCompareButton ? + ( + {i18n._t('HistoryViewerVersion.COMPARE', 'Compare')} + ) + : null; + return ( + {compareButton} ({ diff --git a/client/src/state/historyviewer/HistoryViewerActions.js b/client/src/state/historyviewer/HistoryViewerActions.js index 2260c583..9812a6b9 100644 --- a/client/src/state/historyviewer/HistoryViewerActions.js +++ b/client/src/state/historyviewer/HistoryViewerActions.js @@ -86,7 +86,7 @@ export function clearMessages() { export function setCompareMode(enabled) { return (dispatch) => { dispatch({ - type: HISTORY_VIEWER.SET_COMPARISON_MODE, + type: HISTORY_VIEWER.SET_COMPARE_MODE, payload: { enabled }, }); }; From 11ea083ba1749722e3fb76685e602e23f7f301ad Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Wed, 18 Jul 2018 17:38:59 +1200 Subject: [PATCH 04/44] NEW Adding a compare mode active notice to the history viewer In order to inform a user that they are in compare mode, and are either viewing the difference between two versions, or are required to select two version to compare. The notice includes a handy exit button to leave compare mode. --- .../components/HistoryViewer/HistoryViewer.js | 38 ++++++++++++++++++- .../HistoryViewer/HistoryViewer.scss | 28 ++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index 7f1b2ec7..80041ae5 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -8,7 +8,7 @@ import historyViewerConfig from 'containers/HistoryViewer/HistoryViewerConfig'; import i18n from 'i18n'; import { inject } from 'lib/Injector'; import Loading from 'components/Loading/Loading'; -import { setCurrentPage, showVersion } from 'state/historyviewer/HistoryViewerActions'; +import { setCurrentPage, showVersion, setCompareMode } from 'state/historyviewer/HistoryViewerActions'; import { versionType } from 'types/versionType'; /** @@ -23,6 +23,7 @@ class HistoryViewer extends Component { this.handleSetPage = this.handleSetPage.bind(this); this.handleNextPage = this.handleNextPage.bind(this); this.handlePrevPage = this.handlePrevPage.bind(this); + this.handleDismissCompare = this.handleDismissCompare.bind(this); } /** @@ -123,6 +124,33 @@ class HistoryViewer extends Component { this.handleSetPage(currentPage - 1); } + handleDismissCompare() { + this.props.onDismissCompare(); + } + + /** + * Renders a notice indicating the user is in compare mode (iff compare mode is active) + * + * @returns {string} + */ + renderCompareWarning() { + if (!this.props.compareMode) { + return ''; + } + + return ( +
+ + {i18n._t('HistoryViewer.COMPARE_MODE', 'Compare mode')}: + {i18n._t('HistoryViewer.SELECT_PROMPT', 'Select two versions')} + + +
+ ); + } + /** * Renders the detail form for a selected version * @@ -217,6 +245,7 @@ class HistoryViewer extends Component { return (
+ {this.renderCompareWarning()}
Date: Thu, 19 Jul 2018 09:40:19 +1200 Subject: [PATCH 05/44] NEW Dropdown atop history viewer for holding actions In order to allow a user to enter or exit compare mode there is a button on the heading row that will reveal more actions when clicked. At current the only action present is a toggle to enter or exit compare mode, and reflect the state (check means compare mode is active). --- .../HistoryViewer/HistoryViewer.scss | 35 ++++++ .../HistoryViewer/HistoryViewerHeading.js | 104 ++++++++++++++++-- 2 files changed, 128 insertions(+), 11 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index 7a9424f5..664e6709 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -117,6 +117,41 @@ } } +.history-viewer__heading { + + .author-compare-toggle__container { + display: flex; + + .author-span { + align-self: flex-end; + } + + .compare-dropdown { + margin-left: auto; + + button { + &::before { + margin-right: 0; + } + } + + &.show { + .dropdown-menu { + min-width: 14rem; + } + } + + .form-check { + margin-top: .5rem; + } + } + .form-check-label { + text-transform: none; + } + + } +} + // Hide preview on small devices. @todo replace this with a view toggle component @include media-breakpoint-down(md) { .history-viewer__preview { diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index 69a68d6f..49aedbf1 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -1,21 +1,103 @@ import i18n from 'i18n'; -import React from 'react'; +import React, { PropTypes, Component } from 'react'; +import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; +import { setCompareMode } from 'state/historyviewer/HistoryViewerActions'; +import { compose } from "redux"; +import { connect } from "react-redux"; -const HistoryViewerHeading = (props) => ( - - # - {i18n._t('HistoryViewer.Record', 'Record')} - {i18n._t('HistoryViewer.Author', 'Author')} - {props.hasActions ? : null} - -); +class HistoryViewerHeading extends Component { + constructor(props) { + super(props); + + this.toggle = this.toggle.bind(this); + this.handleCompareModeChange = this.handleCompareModeChange.bind(this); + + this.state = { + dropdownOpen: false, + }; + } + + toggle() { + this.setState(prevState => ({ + dropdownOpen: !prevState.dropdownOpen + })); + } + + handleCompareModeChange(event) { + const checkbox = event.target; + if (checkbox.checked) { + this.props.onCompareModeSelect(); + } else { + this.props.onCompareModeUnSelect(); + } + } + + render() { + const { compareModeSelected, hasActions } = this.props; + const { dropdownOpen } = this.state; + + return ( + + # + {i18n._t('HistoryViewer.Record', 'Record')} + + {i18n._t('HistoryViewer.Author', 'Author')} + + + +
+ + +
+
+
+ + {hasActions ? : null} + + ); + } +} HistoryViewerHeading.propTypes = { - hasActions: React.PropTypes.bool, + hasActions: PropTypes.bool, + compareModeSelected: PropTypes.bool, }; HistoryViewerHeading.defaultProps = { hasActions: false, }; -export default HistoryViewerHeading; +function mapStateToProps(state) { + return { + compareModeSelected: state.versionedAdmin.historyViewer.compareMode, + }; +} + +function mapDispatchToProps(dispatch) { + return { + onCompareModeSelect() { + dispatch(setCompareMode(true)); + }, + onCompareModeUnSelect() { + dispatch(setCompareMode(false)); + } + } +} + +export { HistoryViewerHeading as Component }; + +export default compose( + connect(mapStateToProps, mapDispatchToProps), +)(HistoryViewerHeading); From db72f6d1149eabbc902f0725a75c38858e464210 Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Thu, 19 Jul 2018 09:44:54 +1200 Subject: [PATCH 06/44] NEW Adjust history viewer to allow for compare mode History viewer is the parent of all fields related to comparison mode viewing, and begins the process by deciding whether to render a detail view or a list of versions. It now must also factor comparison mode into this, and so alter the way it handles the list or the detail view. --- .../components/HistoryViewer/HistoryViewer.js | 18 ++++++++-- .../historyviewer/HistoryViewerReducer.js | 35 +++++++++++++++++-- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index 80041ae5..b0c12c99 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -259,13 +259,25 @@ class HistoryViewer extends Component {
); } + + renderCompareMode() { + const { compareFrom, compareTo } = this.props; + if (compareFrom && compareTo) { + return this.renderVersionDetail(); + } + return this.renderVersionList(); + } render() { - const { loading, currentVersion } = this.props; + const { loading, compareMode, currentVersion } = this.props; if (loading) { return ; } + + if (compareMode) { + return this.renderCompareMode(); + } if (currentVersion) { return this.renderVersionDetail(); @@ -319,12 +331,14 @@ HistoryViewer.defaultProps = { function mapStateToProps(state) { - const { currentPage, currentVersion, compareMode } = state.versionedAdmin.historyViewer; + const { currentPage, currentVersion, compareMode, compareFrom, compareTo } = state.versionedAdmin.historyViewer; return { page: currentPage, currentVersion, compareMode, + compareFrom, + compareTo, }; } diff --git a/client/src/state/historyviewer/HistoryViewerReducer.js b/client/src/state/historyviewer/HistoryViewerReducer.js index d7e5f9b8..890da4cc 100644 --- a/client/src/state/historyviewer/HistoryViewerReducer.js +++ b/client/src/state/historyviewer/HistoryViewerReducer.js @@ -63,23 +63,52 @@ export default function historyViewerReducer(state = initialState, { type, paylo } case HISTORY_VIEWER.SET_COMPARE_MODE: { + const updateState = { + compareMode: payload.enabled, + } + + if (!updateState.compareMode) { + updateState.compareFrom = 0; + updateState.compareTo = 0; + } + return { ...state, - compareMode: payload.enabled, + ...updateState, }; } case HISTORY_VIEWER.SET_COMPARE_FROM: { + let { compareFrom, compareTo } = state; + compareFrom = payload.version; + + if (!payload.version) { + compareFrom = compareTo; + compareTo = 0; + } + return { ...state, - compareFrom: payload.version, + compareFrom, + compareTo, }; } case HISTORY_VIEWER.SET_COMPARE_TO: { + let { compareFrom, compareTo } = state; + compareTo = payload.version; + + // Comparisons are always oldest to newest version, version IDs are always positive and in creation order. + // Different from a normal `diff` which is always what it takes turn FROM into TO + if (compareFrom && compareTo < compareFrom) { + compareFrom = compareTo; + compareTo = state.compareFrom; + } + return { ...state, - compareTo: payload.version, + compareFrom, + compareTo, }; } From fb28afaf095daa5fcfb59614d61350bddc704a55 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 19 Jul 2018 13:46:37 +1200 Subject: [PATCH 07/44] Refactor history viewer components to be more maintainable --- .../components/HistoryViewer/HistoryViewer.js | 12 +++- .../HistoryViewer/HistoryViewerHeading.js | 16 ++--- .../HistoryViewer/HistoryViewerVersion.js | 65 ++++++++++++++----- .../tests/HistoryViewerHeading-test.js | 2 +- .../historyviewer/HistoryViewerReducer.js | 17 ++--- package.json | 1 + yarn.lock | 55 ++++++++++++++++ 7 files changed, 132 insertions(+), 36 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index b0c12c99..c31dfae2 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -259,7 +259,7 @@ class HistoryViewer extends Component {
); } - + renderCompareMode() { const { compareFrom, compareTo } = this.props; if (compareFrom && compareTo) { @@ -274,7 +274,7 @@ class HistoryViewer extends Component { if (loading) { return ; } - + if (compareMode) { return this.renderCompareMode(); } @@ -331,7 +331,13 @@ HistoryViewer.defaultProps = { function mapStateToProps(state) { - const { currentPage, currentVersion, compareMode, compareFrom, compareTo } = state.versionedAdmin.historyViewer; + const { + currentPage, + currentVersion, + compareMode, + compareFrom, + compareTo + } = state.versionedAdmin.historyViewer; return { page: currentPage, diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index 49aedbf1..6866e082 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -1,9 +1,9 @@ import i18n from 'i18n'; import React, { PropTypes, Component } from 'react'; -import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; +import { Dropdown, DropdownToggle, DropdownMenu } from 'reactstrap'; import { setCompareMode } from 'state/historyviewer/HistoryViewerActions'; -import { compose } from "redux"; -import { connect } from "react-redux"; +import { compose } from 'redux'; +import { connect } from 'react-redux'; class HistoryViewerHeading extends Component { constructor(props) { @@ -46,7 +46,6 @@ class HistoryViewerHeading extends Component { isOpen={dropdownOpen} toggle={this.toggle} className="compare-dropdown" - right > @@ -54,17 +53,18 @@ class HistoryViewerHeading extends Component { - {hasActions ? : null} + {hasActions ? : null} ); } @@ -92,8 +92,8 @@ function mapDispatchToProps(dispatch) { }, onCompareModeUnSelect() { dispatch(setCompareMode(false)); - } - } + }, + }; } export { HistoryViewerHeading as Component }; diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index 82642082..e1633d97 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -56,42 +56,74 @@ class HistoryViewerVersion extends Component { onSelect(0); } + /** + * When the compare mode button is selected, pass the selected version to the Redux store + */ handleCompare() { const { onCompare, version } = this.props; onCompare(version.Version); } /** - * Return a "clear" button to close the version, for example when used in a "detail view" - * context. This is shown when this version is "active", displayed with a blue background. + * Renders a "compare mode" button which will allow the user to start selecting versions to + * compare differences between. This is usually rendered in the "more actions" menu. * * @returns {FormAction|null} */ - renderClearButton() { + renderCompareButton() { const { isActive, showCompareButton, FormActionComponent } = this.props; - if (!isActive) { + + if (!isActive || !showCompareButton) { return null; } - const compareButton = showCompareButton ? - ( {i18n._t('HistoryViewerVersion.COMPARE', 'Compare')} - ) - : null; +
+ ); + } + + /** + * Renders a "clear" button to close the version, for example when used in a "detail view" + * context. This is shown when this version is "active", displayed with a blue background. + * + * @returns {FormAction|null} + */ + renderClearButton() { + const { FormActionComponent } = this.props; + + return ( + + ); + } + + /** + * Renders the "actions" menu for the detail view. This menu may contain a compare mode toggle + * and/or a "clear" button to clear the current selected version + * + * @returns {DOMElement} + */ + renderActions() { + const { isActive } = this.props; + + if (!isActive) { + return null; + } return ( - {compareButton} - + {this.renderCompareButton()} + {this.renderClearButton()} ); } @@ -109,7 +141,7 @@ class HistoryViewerVersion extends Component { /> {this.getAuthor()} - { this.renderClearButton() } + {this.renderActions()} ); } @@ -127,6 +159,7 @@ HistoryViewerVersion.propTypes = { HistoryViewerVersion.defaultProps = { isActive: false, + showCompareButton: true, version: defaultVersion, }; diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js index 4ebf024d..e72277dc 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js @@ -2,7 +2,7 @@ import React from 'react'; import ReactTestUtils from 'react-addons-test-utils'; -import HistoryViewerHeading from '../HistoryViewerHeading'; +import { Component as HistoryViewerHeading } from '../HistoryViewerHeading'; class HeadingWrapper extends React.PureComponent { render() { diff --git a/client/src/state/historyviewer/HistoryViewerReducer.js b/client/src/state/historyviewer/HistoryViewerReducer.js index 890da4cc..ae435f39 100644 --- a/client/src/state/historyviewer/HistoryViewerReducer.js +++ b/client/src/state/historyviewer/HistoryViewerReducer.js @@ -65,13 +65,13 @@ export default function historyViewerReducer(state = initialState, { type, paylo case HISTORY_VIEWER.SET_COMPARE_MODE: { const updateState = { compareMode: payload.enabled, - } - + }; + if (!updateState.compareMode) { updateState.compareFrom = 0; updateState.compareTo = 0; } - + return { ...state, ...updateState, @@ -81,12 +81,12 @@ export default function historyViewerReducer(state = initialState, { type, paylo case HISTORY_VIEWER.SET_COMPARE_FROM: { let { compareFrom, compareTo } = state; compareFrom = payload.version; - + if (!payload.version) { compareFrom = compareTo; compareTo = 0; } - + return { ...state, compareFrom, @@ -97,14 +97,15 @@ export default function historyViewerReducer(state = initialState, { type, paylo case HISTORY_VIEWER.SET_COMPARE_TO: { let { compareFrom, compareTo } = state; compareTo = payload.version; - - // Comparisons are always oldest to newest version, version IDs are always positive and in creation order. + + // Comparisons are always oldest to newest version, version IDs are always positive + // and in creation order. // Different from a normal `diff` which is always what it takes turn FROM into TO if (compareFrom && compareTo < compareFrom) { compareFrom = compareTo; compareTo = state.compareFrom; } - + return { ...state, compareFrom, diff --git a/package.json b/package.json index 98b46975..33f234c2 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "react-redux": "^4.4.5", "react-router": "^2.5.2", "react-router-redux": "^4.0.5", + "reactstrap": "^5.0.0-beta", "redux": "^3.3.1", "uuid": "^3.2.1" }, diff --git a/yarn.lock b/yarn.lock index 3864a10f..9767c18e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2076,6 +2076,10 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +classnames@^2.2.3: + version "2.2.6" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" + classnames@^2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.5.tgz#fb3801d453467649ef3603c7d61a02bd129bde6d" @@ -5300,6 +5304,10 @@ lodash.isequal@^4.1.1, lodash.isequal@^4.2.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" +lodash.isfunction@^3.0.9: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051" + lodash.isnull@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash.isnull/-/lodash.isnull-3.0.0.tgz#fafbe59ea1dca27eed786534039dd84c2e07c56e" @@ -5376,6 +5384,10 @@ lodash.throttle@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" +lodash.tonumber@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/lodash.tonumber/-/lodash.tonumber-4.0.3.tgz#0b96b31b35672793eb7f5a63ee791f1b9e9025d9" + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -6317,6 +6329,10 @@ pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +popper.js@^1.12.9: + version "1.14.3" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.3.tgz#1438f98d046acf7b4d78cd502bf418ac64d4f095" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -6680,6 +6696,13 @@ prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.5.9, loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.6.2: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" + proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -6924,6 +6947,10 @@ react-lifecycles-compat@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.2.tgz#7279047275bd727a912e25f734c0559527e84eff" +react-lifecycles-compat@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" + react-modal@^3.3.2: version "3.4.4" resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.4.4.tgz#e9dde25e9e85a59c76831f2a2b468712a546aded" @@ -6933,6 +6960,13 @@ react-modal@^3.3.2: react-lifecycles-compat "^3.0.0" warning "^3.0.0" +react-popper@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-0.8.3.tgz#0f73333137c9fb0af6ec4074d2d0585a0a0461e1" + dependencies: + popper.js "^1.12.9" + prop-types "^15.6.0" + react-redux@^4.4.5: version "4.4.9" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-4.4.9.tgz#8ca6d4670925a454ce67086c2305e9630670909a" @@ -6980,6 +7014,15 @@ react-transition-group@^2.0.0: loose-envify "^1.3.1" prop-types "^15.6.1" +react-transition-group@^2.2.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.4.0.tgz#1d9391fabfd82e016f26fabd1eec329dbd922b5a" + dependencies: + dom-helpers "^3.3.1" + loose-envify "^1.3.1" + prop-types "^15.6.2" + react-lifecycles-compat "^3.0.4" + react-treebeard@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/react-treebeard/-/react-treebeard-2.1.0.tgz#fbd5cf51089b6f09a9b18350ab3bddf736e57800" @@ -6999,6 +7042,18 @@ react@15.3.1: loose-envify "^1.1.0" object-assign "^4.1.0" +reactstrap@^5.0.0-beta: + version "5.0.0" + resolved "https://registry.yarnpkg.com/reactstrap/-/reactstrap-5.0.0.tgz#d8948534df4816eddfb162a51643a499388e9228" + dependencies: + classnames "^2.2.3" + lodash.isfunction "^3.0.9" + lodash.isobject "^3.0.2" + lodash.tonumber "^4.0.3" + prop-types "^15.5.8" + react-popper "^0.8.3" + react-transition-group "^2.2.1" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" From f36539514f0418b9baad56b8bbd4ed408d926a0d Mon Sep 17 00:00:00 2001 From: Raissa North Date: Thu, 19 Jul 2018 15:35:35 +1200 Subject: [PATCH 08/44] Add tests to HistoryViewerHeading and slightly refactor it by dereferencing props --- .../HistoryViewer/HistoryViewerHeading.js | 26 ++++---- .../HistoryViewer/tests/HistoryViewer-test.js | 4 ++ .../tests/HistoryViewerHeading-test.js | 66 +++++++++++++++---- package.json | 2 + 4 files changed, 76 insertions(+), 22 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index 6866e082..e3b62648 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -23,12 +23,14 @@ class HistoryViewerHeading extends Component { })); } - handleCompareModeChange(event) { - const checkbox = event.target; - if (checkbox.checked) { - this.props.onCompareModeSelect(); - } else { - this.props.onCompareModeUnSelect(); + handleCompareModeChange() { + + const { compareModeSelected, onCompareModeUnselect, onCompareModeSelect } = this.props; + if (compareModeSelected) { + onCompareModeUnselect(); + } + else { + onCompareModeSelect(); } } @@ -48,12 +50,12 @@ class HistoryViewerHeading extends Component { className="compare-dropdown" > - +
@@ -71,8 +73,10 @@ class HistoryViewerHeading extends Component { } HistoryViewerHeading.propTypes = { - hasActions: PropTypes.bool, - compareModeSelected: PropTypes.bool, + hasActions: React.PropTypes.bool, + compareModeSelected: React.PropTypes.bool, + onCompareModeSelect: React.PropTypes.func, + onCompareModeUnselect: React.PropTypes.func, }; HistoryViewerHeading.defaultProps = { @@ -90,7 +94,7 @@ function mapDispatchToProps(dispatch) { onCompareModeSelect() { dispatch(setCompareMode(true)); }, - onCompareModeUnSelect() { + onCompareModeUnselect() { dispatch(setCompareMode(false)); }, }; diff --git a/client/src/components/HistoryViewer/tests/HistoryViewer-test.js b/client/src/components/HistoryViewer/tests/HistoryViewer-test.js index bbf63fdd..0d540e22 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewer-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewer-test.js @@ -3,6 +3,10 @@ import React from 'react'; import ReactTestUtils from 'react-addons-test-utils'; import { Component as HistoryViewer } from '../HistoryViewer'; +import Enzyme, { shallow } from 'enzyme'; +import Adapter from "enzyme-adapter-react-15.4/build/index"; + +Enzyme.configure({ adapter: new Adapter() }); describe('HistoryViewer', () => { let component = null; diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js index e72277dc..5a17ac83 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js @@ -3,20 +3,63 @@ import React from 'react'; import ReactTestUtils from 'react-addons-test-utils'; import { Component as HistoryViewerHeading } from '../HistoryViewerHeading'; +import Enzyme, { shallow } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-15.4/build/index'; -class HeadingWrapper extends React.PureComponent { - render() { - return ( - - - - -
- ); - } -} +Enzyme.configure({ adapter: new Adapter() }); describe('HistoryViewerHeading', () => { + // Mock select functions to replace the ones provided by mapDispatchToProps + const mockOnCompareModeSelect = jest.fn(); + const mockOnCompareModeUnselect = jest.fn(); + + describe('onChange function triggers mapDispatchToProps functions to notify and update the Redux store', () => { + describe('simulate change event in enabled compare mode', () => { + const wrapper = shallow( + + ); + + it('should dispatch an action to disable the compare mode', () => { + wrapper.find('.compare-mode__checkbox').at(0).simulate('change'); + expect(mockOnCompareModeUnselect).toHaveBeenCalled(); + }); + }); + + describe('simulate change event in disabled compare mode', () => { + const wrapper = shallow( + + ); + + it('should dispatch an action to enable the compare mode', () => { + wrapper.find('.compare-mode__checkbox').at(0).simulate('change'); + expect(mockOnCompareModeSelect).toHaveBeenCalled(); + }); + }); + }); + + + class HeadingWrapper extends React.PureComponent { + render() { + return ( + + + + +
+ ); + } + } + it('has four columns when hasActions is true', () => { const component = ReactTestUtils.renderIntoDocument( @@ -30,3 +73,4 @@ describe('HistoryViewerHeading', () => { expect(result.length).toBe(4); }); }); + diff --git a/package.json b/package.json index 33f234c2..8fdeceba 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "@silverstripe/eslint-config": "^0.0.2", "@silverstripe/webpack-config": "^0.8.0", "babel-jest": "^19.0.0", + "enzyme": "^3.3.0", + "enzyme-adapter-react-15.4": "^1.0.5", "expose-loader": "^0.7.4", "jest-cli": "^19.0.2", "sass-loader": "^6.0.7" From 75c2c8572a32139dce267976aa58fb0d765d1a83 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 19 Jul 2018 16:01:16 +1200 Subject: [PATCH 09/44] NEW Add schema endpoint and shell method for returning compareForm --- src/Controllers/HistoryViewerController.php | 96 ++++++++++++++++--- .../HistoryViewerControllerTest.php | 39 +++++++- 2 files changed, 120 insertions(+), 15 deletions(-) diff --git a/src/Controllers/HistoryViewerController.php b/src/Controllers/HistoryViewerController.php index ca4ee50d..136aa4d6 100644 --- a/src/Controllers/HistoryViewerController.php +++ b/src/Controllers/HistoryViewerController.php @@ -8,6 +8,8 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse; use SilverStripe\Core\Injector\Injector; +use SilverStripe\Forms\FieldList; +use SilverStripe\Forms\Form; use SilverStripe\Forms\FormFactory; use SilverStripe\Versioned\Versioned; use SilverStripe\VersionedAdmin\Forms\DataObjectVersionFormFactory; @@ -32,12 +34,23 @@ class HistoryViewerController extends LeftAndMain 'schema', ]; + /** + * An array of supported form names that can be requested through the schema + * + * @var string[] + */ + protected $formNames = ['versionForm', 'compareForm']; + public function getClientConfig() { $clientConfig = parent::getClientConfig(); $clientConfig['form']['versionForm'] = [ - 'schemaUrl' => $this->owner->Link('schema/versionForm') + 'schemaUrl' => $this->owner->Link('schema/versionForm'), + ]; + + $clientConfig['form']['compareForm'] = [ + 'schemaUrl' => $this->owner->Link('schema/compareForm'), ]; return $clientConfig; @@ -47,33 +60,57 @@ public function getClientConfig() * Gets a JSON schema representing the current version detail form. * * WARNING: Experimental API. - * + * @internal * @param HTTPRequest $request * @return HTTPResponse */ public function schema($request) { $formName = $request->param('FormName'); - if ($formName !== 'versionForm') { + if (!in_array($formName, $this->formNames)) { return parent::schema($request); } - // Get schema for history form - // @todo Eventually all form scaffolding will be based on context rather than record ID - // See https://github.com/silverstripe/silverstripe-framework/issues/6362 - $form = $this->getVersionForm([ - 'RecordClass' => $request->getVar('RecordClass'), - 'RecordID' => $request->getVar('RecordID'), - 'RecordVersion' => $request->getVar('RecordVersion'), - ]); + return $this->generateSchemaForForm($formName, $request); + } + + protected function generateSchemaForForm($formName, HTTPRequest $request) + { + switch ($formName) { + // Get schema for history form + case 'versionForm': + $form = $this->getVersionForm([ + 'RecordClass' => $request->getVar('RecordClass'), + 'RecordID' => $request->getVar('RecordID'), + 'RecordVersion' => $request->getVar('RecordVersion'), + ]); + break; + case 'compareForm': + $form = $this->getCompareForm([ + 'RecordClass' => $request->getVar('RecordClass'), + 'RecordID' => $request->getVar('RecordID'), + 'RecordVersionFrom' => $request->getVar('RecordVersionFrom'), + 'RecordVersionTo' => $request->getVar('RecordVersionTo'), + ]); + break; + default: + throw new InvalidArgumentException('Invalid form name passed to generate schema: ' . $formName); + } // Respond with this schema $response = $this->getResponse(); $response->addHeader('Content-Type', 'application/json'); $schemaID = $this->getRequest()->getURL(); + return $this->getSchemaResponse($schemaID, $form); } + /** + * Returns a {@link Form} showing the version details for a given version of a record + * + * @param array $context + * @return Form + */ public function getVersionForm(array $context) { // Check context @@ -119,6 +156,19 @@ public function getVersionForm(array $context) return $form; } + /** + * Returns a {@link Form} containing the comparison {@link DiffTransformation} view for a record + * between two specified versions. + * + * @param array $context + * @return Form + */ + public function getCompareForm(array $context) + { + // @todo write the code + return new Form($this, 'CompareForm', FieldList::create(), FieldList::create()); + } + public function versionForm(HTTPRequest $request = null) { if (!$request) { @@ -140,4 +190,28 @@ public function versionForm(HTTPRequest $request = null) 'RecordVersion' => $recordVersion, ]); } + + public function compareForm(HTTPRequest $request = null) + { + if (!$request) { + $this->jsonError(400); + return null; + } + + $recordClass = $request->getVar('RecordClass'); + $recordId = $request->getVar('RecordID'); + $recordVersionFrom = $request->getVar('RecordVersionFrom'); + $recordVersionTo = $request->getVar('RecordVersionTo'); + if (!$recordClass || !$recordId || !$recordVersionFrom || !$recordVersionTo) { + $this->jsonError(400); + return null; + } + + return $this->getVersionForm([ + 'RecordClass' => $recordClass, + 'RecordID' => $recordId, + 'RecordVersionFrom' => $recordVersionFrom, + 'RecordVersionTo' => $recordVersionTo, + ]); + } } diff --git a/tests/Controllers/HistoryViewerControllerTest.php b/tests/Controllers/HistoryViewerControllerTest.php index 231fc616..6f147628 100644 --- a/tests/Controllers/HistoryViewerControllerTest.php +++ b/tests/Controllers/HistoryViewerControllerTest.php @@ -28,13 +28,14 @@ public function testGetClientConfig() $clientConfig = $controller->getClientConfig(); $this->assertArrayHasKey('versionForm', $clientConfig['form']); + $this->assertArrayHasKey('compareForm', $clientConfig['form']); $this->assertArrayHasKey('schemaUrl', $clientConfig['form']['versionForm']); } public function testSchema() { $controllerMock = $this->getMockBuilder(HistoryViewerController::class) - ->setMethods(['getVersionForm', 'getSchemaResponse']) + ->setMethods(['getVersionForm', 'getCompareForm', 'getSchemaResponse']) ->getMock(); $controllerMock->expects($this->once())->method('getVersionForm')->with([ @@ -43,21 +44,41 @@ public function testSchema() 'RecordVersion' => 234, ]); - $controllerMock->expects($this->once())->method('getSchemaResponse')->willReturn(true); + $controllerMock->expects($this->once())->method('getCompareForm')->with([ + 'RecordClass' => 'Page', + 'RecordID' => 123, + 'RecordVersionFrom' => 234, + 'RecordVersionTo' => 236, + ]); + + $controllerMock->expects($this->exactly(2))->method('getSchemaResponse')->willReturn(true); $request = $this->getMockBuilder(HTTPRequest::class) ->setConstructorArgs(['GET', '/']) ->setMethods(['param']) ->getMock(); - $request->expects($this->once())->method('param')->with('FormName')->willReturn('versionForm'); - $request->offsetSet('RecordClass', 'Page'); $request->offsetSet('RecordID', 123); $request->offsetSet('RecordVersion', 234); $controllerMock->schema($request); + /** @var HTTPResponse $result */ + $result = $controllerMock->getResponse(); + $this->assertSame('application/json', $result->getHeader('Content-Type')); + + $request = $this->getMockBuilder(HTTPRequest::class) + ->setConstructorArgs(['GET', '/']) + ->setMethods(['param']) + ->getMock(); + $request->expects($this->once())->method('param')->with('FormName')->willReturn('compareForm'); + $request->offsetSet('RecordClass', 'Page'); + $request->offsetSet('RecordID', 123); + $request->offsetSet('RecordVersion', 234); + $request->offsetSet('RecordVersionFrom', 234); + $request->offsetSet('RecordVersionTo', 236); + $controllerMock->schema($request); /** @var HTTPResponse $result */ $result = $controllerMock->getResponse(); $this->assertSame('application/json', $result->getHeader('Content-Type')); @@ -139,6 +160,16 @@ public function testVersionFormThrowsExceptionWithoutRequest() $controller->versionForm(null); } + /** + * @expectedException \SilverStripe\Control\HTTPResponse_Exception + * @expectedExceptionCode 400 + */ + public function testCompareFormThrowsExceptionWithoutRequest() + { + $controller = new HistoryViewerController(); + $controller->compareForm(null); + } + /** * @expectedException \SilverStripe\Control\HTTPResponse_Exception * @expectedExceptionCode 404 From c48f5a1e98a19316797cddd601a102630d45af48 Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Thu, 19 Jul 2018 17:19:05 +1200 Subject: [PATCH 10/44] Refactor compare warning into own component And add to detail view as well as the list view. --- client/src/boot/registerComponents.js | 2 + .../components/HistoryViewer/HistoryViewer.js | 44 ++-------- .../HistoryViewer/HistoryViewer.scss | 6 +- .../HistoryViewerCompareWarning.js | 80 +++++++++++++++++++ .../HistoryViewerVersionDetail.js | 10 ++- 5 files changed, 102 insertions(+), 40 deletions(-) create mode 100644 client/src/components/HistoryViewer/HistoryViewerCompareWarning.js diff --git a/client/src/boot/registerComponents.js b/client/src/boot/registerComponents.js index f165345d..49e0558c 100644 --- a/client/src/boot/registerComponents.js +++ b/client/src/boot/registerComponents.js @@ -6,6 +6,7 @@ import HistoryViewerVersion from 'components/HistoryViewer/HistoryViewerVersion' import HistoryViewerVersionDetail from 'components/HistoryViewer/HistoryViewerVersionDetail'; import HistoryViewerVersionList from 'components/HistoryViewer/HistoryViewerVersionList'; import HistoryViewerVersionState from 'components/HistoryViewer/HistoryViewerVersionState'; +import HistoryViewerCompareWarning from 'components/HistoryViewer/HistoryViewerCompareWarning'; export default () => { Injector.component.registerMany({ @@ -16,6 +17,7 @@ export default () => { HistoryViewerVersionDetail, HistoryViewerVersionList, HistoryViewerVersionState, + HistoryViewerCompareWarning, }); }; diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index c31dfae2..c7aaa5d5 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -8,7 +8,7 @@ import historyViewerConfig from 'containers/HistoryViewer/HistoryViewerConfig'; import i18n from 'i18n'; import { inject } from 'lib/Injector'; import Loading from 'components/Loading/Loading'; -import { setCurrentPage, showVersion, setCompareMode } from 'state/historyviewer/HistoryViewerActions'; +import { setCurrentPage, showVersion } from 'state/historyviewer/HistoryViewerActions'; import { versionType } from 'types/versionType'; /** @@ -23,7 +23,6 @@ class HistoryViewer extends Component { this.handleSetPage = this.handleSetPage.bind(this); this.handleNextPage = this.handleNextPage.bind(this); this.handlePrevPage = this.handlePrevPage.bind(this); - this.handleDismissCompare = this.handleDismissCompare.bind(this); } /** @@ -124,33 +123,6 @@ class HistoryViewer extends Component { this.handleSetPage(currentPage - 1); } - handleDismissCompare() { - this.props.onDismissCompare(); - } - - /** - * Renders a notice indicating the user is in compare mode (iff compare mode is active) - * - * @returns {string} - */ - renderCompareWarning() { - if (!this.props.compareMode) { - return ''; - } - - return ( -
- - {i18n._t('HistoryViewer.COMPARE_MODE', 'Compare mode')}: - {i18n._t('HistoryViewer.SELECT_PROMPT', 'Select two versions')} - - -
- ); - } - /** * Renders the detail form for a selected version * @@ -241,11 +213,11 @@ class HistoryViewer extends Component { * @returns {HistoryViewerVersionList} */ renderVersionList() { - const { isPreviewable, ListComponent, onSelect } = this.props; + const { isPreviewable, ListComponent, onSelect, CompareWarningComponent } = this.props; return (
- {this.renderCompareWarning()} +
({ + ['HistoryViewerVersionList', 'HistoryViewerVersionDetail', 'HistoryViewerCompareWarning'], + (HistoryViewerVersionList, HistoryViewerVersionDetail, HistoryViewerCompareWarning) => ({ ListComponent: HistoryViewerVersionList, VersionDetailComponent: HistoryViewerVersionDetail, + CompareWarningComponent: HistoryViewerCompareWarning, }), ({ contextKey }) => `VersionedAdmin.HistoryViewer.${contextKey}` ) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index 664e6709..d2b4aa73 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -90,7 +90,7 @@ } .history-viewer__compare-notice { - margin: 0 auto; + align-self: center; background-color: lighten($color-notice, 13%); color: darken($color-notice, 35%); border: 1px solid $color-notice; @@ -98,6 +98,10 @@ border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; + &.fixed { + position: absolute; + } + .notice-message { padding: .4rem 1rem .4rem 1.5rem; vertical-align: middle; diff --git a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js new file mode 100644 index 00000000..dc7e2de9 --- /dev/null +++ b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js @@ -0,0 +1,80 @@ +import React, { Component, PropTypes } from 'react'; +import { connect } from 'react-redux'; +import i18n from 'i18n'; +import { setCompareMode } from 'state/historyviewer/HistoryViewerActions'; +import classNames from 'classnames'; + +class HistoryViewerCompareWarning extends Component { + constructor(props) { + super(props); + + this.handleDismissCompare = this.handleDismissCompare.bind(this); + } + + handleDismissCompare() { + this.props.onDismissCompare(); + } + + /** + * Renders a notice indicating the user is in compare mode (iff compare mode is active) + * + * @returns {string} + */ + render() { + const { compareMode, fixed } = this.props; + + if (!compareMode) { + return null; + } + + const classes = ['history-viewer__compare-notice']; + + if (fixed) { + classes.push('fixed'); + } + + return ( +
+ + {i18n._t('HistoryViewer.COMPARE_MODE', 'Compare mode')}: + {i18n._t('HistoryViewer.SELECT_PROMPT', 'Select two versions')} + + +
+ ); + } +} + +HistoryViewerCompareWarning.propTypes = { + compareMode: PropTypes.bool.isRequired, + fixed: PropTypes.bool.isRequired, +}; + +HistoryViewerCompareWarning.defaultProps = { + fixed: false, +}; + +function mapStateToProps(state) { + const { + compareMode, + } = state.versionedAdmin.historyViewer; + + return { + compareMode, + }; +} + +function mapDispatchToProps(dispatch) { + return { + onDismissCompare() { + dispatch(setCompareMode(false)); + }, + }; +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(HistoryViewerCompareWarning); diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index 54d49f10..a8c6a54f 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -68,7 +68,8 @@ class HistoryViewerVersionDetail extends PureComponent { recordId, schemaUrl, ToolbarComponent, - version + CompareWarningComponent, + version, } = this.props; const containerClasses = isPreviewable ? 'panel panel--padded panel--padded-side panel--scrollable' : ''; @@ -97,6 +98,8 @@ class HistoryViewerVersionDetail extends PureComponent { recordId={recordId} versionId={version.Version} /> + +
{this.getPreview()} @@ -124,11 +127,12 @@ HistoryViewerVersionDetail.defaultProps = { export { HistoryViewerVersionDetail as Component }; export default inject( - ['HistoryViewerVersionList', 'HistoryViewerToolbar', 'Preview'], - (ListComponent, ToolbarComponent, PreviewComponent) => ({ + ['HistoryViewerVersionList', 'HistoryViewerToolbar', 'Preview', 'HistoryViewerCompareWarning'], + (ListComponent, ToolbarComponent, PreviewComponent, CompareWarningComponent) => ({ ListComponent, ToolbarComponent, PreviewComponent, + CompareWarningComponent, }), ({ version }, context) => `${context}.HistoryViewerVersionDetail.${version.Version}` )(HistoryViewerVersionDetail); From e029b73106ef9bffa53ba38822e3b5a1ba975cdf Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Thu, 19 Jul 2018 19:19:05 +1200 Subject: [PATCH 11/44] NEW Alter components to allow for compare mode Enable compare mode handling for list view/selection, and detail views, then connect the PHP diff form to history view comparison so the components can actually serve real data. This results in being able to open a comparison. --- .../components/HistoryViewer/HistoryViewer.js | 32 +++-- .../HistoryViewer/HistoryViewerHeading.js | 15 +-- .../HistoryViewer/HistoryViewerVersion.js | 33 +++-- .../HistoryViewerVersionDetail.js | 119 ++++++++++++------ .../HistoryViewer/HistoryViewerConfig.js | 27 +++- .../historyviewer/HistoryViewerReducer.js | 8 +- src/Controllers/HistoryViewerController.php | 94 +++++++++++--- src/Forms/DiffTransformation.php | 6 +- 8 files changed, 249 insertions(+), 85 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index c7aaa5d5..da567f2c 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -136,25 +136,42 @@ class HistoryViewer extends Component { recordClass, schemaUrl, VersionDetailComponent, + compareMode, + compareFrom, + compareTo, } = this.props; // Insert variables into the schema URL via regex replacements - const schemaReplacements = { + const schemaVersionReplacements = { ':id': recordId, ':class': recordClass, ':version': currentVersion, }; + const schemaCompareReplacements = { + ':id': recordId, + ':class': recordClass, + ':from': compareFrom, + ':to': compareTo, + }; + const schemaSearch = compareMode ? /:id|:class|:from|:to/g : /:id|:class|:version/g; + const schemaReplacements = compareMode ? schemaCompareReplacements : schemaVersionReplacements; - // eslint-disable-next-line no-shadow - const version = this.getVersions().find(version => version.Version === currentVersion); + const filterVersions = (wantedID) => (potential => potential.Version === wantedID); + + const version = this.getVersions().find(filterVersions(currentVersion)); const latestVersion = this.getLatestVersion(); + const compare = compareMode ? { + versionFrom: this.getVersions().find(filterVersions(compareFrom)), + versionTo: this.getVersions().find(filterVersions(compareTo)), + } : false; const props = { isLatestVersion: latestVersion && latestVersion.Version === version.Version, isPreviewable, recordId, - schemaUrl: schemaUrl.replace(/:id|:class|:version/g, (match) => schemaReplacements[match]), + schemaUrl: schemaUrl.replace(schemaSearch, (match) => schemaReplacements[match]), version, + compare, }; return ( @@ -213,14 +230,13 @@ class HistoryViewer extends Component { * @returns {HistoryViewerVersionList} */ renderVersionList() { - const { isPreviewable, ListComponent, onSelect, CompareWarningComponent } = this.props; + const { isPreviewable, ListComponent, CompareWarningComponent } = this.props; return (
@@ -268,6 +284,8 @@ HistoryViewer.propTypes = { recordId: PropTypes.number.isRequired, currentVersion: PropTypes.number, compareMode: PropTypes.bool, + compareFrom: PropTypes.number, + compareTo: PropTypes.number, isPreviewable: PropTypes.bool, VersionDetailComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, CompareWarningComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, @@ -310,7 +328,7 @@ function mapStateToProps(state) { currentVersion, compareMode, compareFrom, - compareTo + compareTo, } = state.versionedAdmin.historyViewer; return { diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index e3b62648..e48489e3 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -23,21 +23,18 @@ class HistoryViewerHeading extends Component { })); } - handleCompareModeChange() { - - const { compareModeSelected, onCompareModeUnselect, onCompareModeSelect } = this.props; - if (compareModeSelected) { - onCompareModeUnselect(); - } - else { - onCompareModeSelect(); + handleCompareModeChange(event) { + const checkbox = event.target; + if (checkbox.checked) { + this.props.onCompareModeSelect(); + } else { + this.props.onCompareModeUnSelect(); } } render() { const { compareModeSelected, hasActions } = this.props; const { dropdownOpen } = this.state; - return ( # diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index e1633d97..fafaeb5d 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -3,7 +3,7 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { inject } from 'lib/Injector'; import { versionType, defaultVersion } from 'types/versionType'; -import { showVersion, setCompareMode, setCompareFrom } from 'state/historyviewer/HistoryViewerActions'; +import { showVersion, setCompareMode, setCompareFrom, setCompareTo } from 'state/historyviewer/HistoryViewerActions'; import i18n from 'i18n'; class HistoryViewerVersion extends Component { @@ -38,22 +38,30 @@ class HistoryViewerVersion extends Component { * When clicking on a version, render the detail view for it via a Redux action dispatch */ handleClick() { - const { onSelect, version, isActive } = this.props; + const { onSelect, version, isActive, compareMode, compareFrom, onCompareSelect } = this.props; // If the clear button is shown, don't do anything when clicking on the row if (isActive) { return; } - onSelect(version.Version); + if (compareMode) { + onCompareSelect(version.Version, !compareFrom); + } else { + onSelect(version.Version); + } } /** * When closing the version, return back to the list view via Redux action dispatch */ handleClose() { - const { onSelect } = this.props; - onSelect(0); + const { onSelect, compareMode, compareFrom, onCompareSelect, version } = this.props; + if (compareMode) { + onCompareSelect(0, version.Version === compareFrom); + } else { + onSelect(0); + } } /** @@ -149,9 +157,10 @@ class HistoryViewerVersion extends Component { HistoryViewerVersion.propTypes = { isActive: React.PropTypes.bool, - showCompareButton: React.PropTypes.bool, + compareMode: React.PropTypes.bool, onSelect: React.PropTypes.func, onCompare: React.PropTypes.func, + onCompareSelect: React.PropTypes.func, StateComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, FormActionComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, version: versionType, @@ -165,7 +174,8 @@ HistoryViewerVersion.defaultProps = { function mapStateToProps(state) { return { - showCompareButton: !state.versionedAdmin.historyViewer.compareMode, + compareMode: state.versionedAdmin.historyViewer.compareMode, + compareFrom: state.versionedAdmin.historyViewer.compareFrom, }; } @@ -175,8 +185,15 @@ function mapDispatchToProps(dispatch) { dispatch(showVersion(id)); }, onCompare(id) { - dispatch(setCompareMode(true)); dispatch(setCompareFrom(id)); + dispatch(setCompareMode(true)); + }, + onCompareSelect(versionID, setFrom) { + if (setFrom) { + dispatch(setCompareFrom(versionID)); + } else { + dispatch(setCompareTo(versionID)); + } }, }; } diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index a8c6a54f..fd48ba85 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -15,15 +15,64 @@ class HistoryViewerVersionDetail extends PureComponent { this.toggleToolbarClass(); } + /** + * Originally this component hard coded the array of versions to be passed + * to the list component as [version], but with the introduction of a compare mode + * this isn't always true (we need both "compare from" & "compare to"). + * So this getter abstracts that logic. + * + * @returns {array} + */ + getListVersions() { + const { compare, version } = this.props; + if (this.isCompareMode()) { + return [compare.versionTo, compare.versionFrom]; + } + return [version]; + } + + /* + * Return whether or not we should be displaying the preview component + * @returns {boolean} + */ + isPreviewable() { + const { isPreviewable } = this.props; + return isPreviewable && !this.isCompareMode(); + } + + /* + * Return whether or not we should be comparing two versions + * @returns {boolean} + */ + isCompareMode() { + const { compare } = this.props; + return compare && compare.versionFrom && compare.versionTo; + } + + /** + * Until the CMS is fully React driven, we must control certain aspects of the CMS DOM with + * manual CSS tweaks. @todo remove this when React drives the CMS. + */ + toggleToolbarClass() { + const selector = document + .querySelector('.CMSPageHistoryViewerController div:not(.cms-content-tools) .cms-content-header'); + + if (selector && this.isPreviewable()) { + selector + .classList + .toggle('history-viewer__toolbar--condensed'); + } + } + /** * If the preview panel is enabled, return the component * * @returns {Preview|null} */ - getPreview() { - const { isPreviewable, version, PreviewComponent } = this.props; + renderPreview() { + const { version, PreviewComponent } = this.props; - if (!isPreviewable) { + if (!this.isPreviewable()) { return null; } @@ -44,35 +93,29 @@ class HistoryViewerVersionDetail extends PureComponent { } /** - * Until the CMS is fully React driven, we must control certain aspects of the CMS DOM with - * manual CSS tweaks. @todo remove this when React drives the CMS. + * If the toolbar should be viewable, return the component + * + * @returns {HistoryViewerToolbar|null} */ - toggleToolbarClass() { - const { isPreviewable } = this.props; - - const selector = document - .querySelector('.CMSPageHistoryViewerController div:not(.cms-content-tools) .cms-content-header'); - - if (selector && isPreviewable) { - selector - .classList - .toggle('history-viewer__toolbar--condensed'); + renderToolbar() { + const { ToolbarComponent, isLatestVersion, recordId, version } = this.props; + if (this.isCompareMode()) { + return null; } + return ( + + ); } render() { - const { - isLatestVersion, - isPreviewable, - ListComponent, - recordId, - schemaUrl, - ToolbarComponent, - CompareWarningComponent, - version, - } = this.props; - - const containerClasses = isPreviewable ? 'panel panel--padded panel--padded-side panel--scrollable' : ''; + const { ListComponent, schemaUrl, CompareWarningComponent } = this.props; + + const containerClasses = this.isPreviewable() ? 'panel panel--padded panel--padded-side panel--scrollable' : ''; return (
@@ -81,7 +124,7 @@ class HistoryViewerVersionDetail extends PureComponent {
@@ -92,17 +135,11 @@ class HistoryViewerVersionDetail extends PureComponent {
- - + {this.renderToolbar()}
- {this.getPreview()} + {this.renderPreview()}
); } @@ -116,12 +153,20 @@ HistoryViewerVersionDetail.propTypes = { recordId: PropTypes.number.isRequired, schemaUrl: PropTypes.string.isRequired, ToolbarComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, - version: versionType.isRequired, + version: versionType, + compare: PropTypes.oneOfType([ + PropTypes.shape({ + versionFrom: versionType, + versionTo: versionType, + }), + PropTypes.bool, + ]), }; HistoryViewerVersionDetail.defaultProps = { isLatestVersion: false, isPreviewable: false, + compare: false, }; export { HistoryViewerVersionDetail as Component }; diff --git a/client/src/containers/HistoryViewer/HistoryViewerConfig.js b/client/src/containers/HistoryViewer/HistoryViewerConfig.js index 6a4c16e7..757a9df5 100644 --- a/client/src/containers/HistoryViewer/HistoryViewerConfig.js +++ b/client/src/containers/HistoryViewer/HistoryViewerConfig.js @@ -9,10 +9,31 @@ const historyViewerConfig = (HistoryViewer) => { return Config.getSection(sectionKey); } + getSchemaUrlDetails() { + const { compareMode } = this.props; + if (compareMode) { + return { + formName: 'compareForm', + queryParts: [ + 'RecordVersionFrom=:from', + 'RecordVersionTo=:to', + ], + }; + } + return { + formName: 'versionForm', + queryParts: [ + 'RecordVersion=:version', + ], + }; + } + getSchemaUrl() { - const schemaUrlBase = `${this.getConfig().form.versionForm.schemaUrl}/:id`; - const schemaQueryString = 'RecordClass=:class&RecordID=:id&RecordVersion=:version'; - return `${schemaUrlBase}?${schemaQueryString}`; + const config = this.getConfig(); + const { formName, queryParts } = this.getSchemaUrlDetails(); + const schemaUrlBase = `${config.form[formName].schemaUrl}/:id`; + const schemaUrlQuery = queryParts.concat('RecordClass=:class&RecordID=:id').join('&'); + return `${schemaUrlBase}?${schemaUrlQuery}`; } render() { diff --git a/client/src/state/historyviewer/HistoryViewerReducer.js b/client/src/state/historyviewer/HistoryViewerReducer.js index ae435f39..3dc8198f 100644 --- a/client/src/state/historyviewer/HistoryViewerReducer.js +++ b/client/src/state/historyviewer/HistoryViewerReducer.js @@ -98,10 +98,10 @@ export default function historyViewerReducer(state = initialState, { type, paylo let { compareFrom, compareTo } = state; compareTo = payload.version; - // Comparisons are always oldest to newest version, version IDs are always positive - // and in creation order. - // Different from a normal `diff` which is always what it takes turn FROM into TO - if (compareFrom && compareTo < compareFrom) { + // A normal `diff` always shows what it takes turn FROM into TO + // Here, comparisons are always FROM oldest TO newest version + // Version IDs are always positive & in creation order. + if (compareTo && compareFrom && compareTo < compareFrom) { compareFrom = compareTo; compareTo = state.compareFrom; } diff --git a/src/Controllers/HistoryViewerController.php b/src/Controllers/HistoryViewerController.php index 136aa4d6..4e0f95a7 100644 --- a/src/Controllers/HistoryViewerController.php +++ b/src/Controllers/HistoryViewerController.php @@ -13,6 +13,7 @@ use SilverStripe\Forms\FormFactory; use SilverStripe\Versioned\Versioned; use SilverStripe\VersionedAdmin\Forms\DataObjectVersionFormFactory; +use SilverStripe\VersionedAdmin\Forms\DiffTransformation; /** * The HistoryViewerController provides AJAX endpoints for React to enable functionality, such as retrieving the form @@ -128,18 +129,8 @@ public function getVersionForm(array $context) } // Load record and perform a canView check - $record = Versioned::get_version($recordClass, $recordId, $recordVersion); + $record = $this->getRecordVersion($recordClass, $recordId, $recordVersion); if (!$record) { - $this->jsonError(404); - return null; - } - - if (!$record->canView()) { - $this->jsonError(403, _t( - __CLASS__.'.ErrorItemViewPermissionDenied', - "You don't have the necessary permissions to view {ObjectTitle}", - ['ObjectTitle' => $record->i18n_singular_name()] - )); return null; } @@ -155,6 +146,35 @@ public function getVersionForm(array $context) return $form; } + + /** + * Fetches record version and checks canView permission for result + * + * @param string $recordClass + * @param int $recordId + * @param int $recordVersion + * @return DataObject|null + */ + protected function getRecordVersion($recordClass, $recordId, $recordVersion) + { + $record = Versioned::get_version($recordClass, $recordId, $recordVersion); + + if (!$record) { + $this->jsonError(404); + return null; + } + + if (!$record->canView()) { + $this->jsonError(403, _t( + __CLASS__.'.ErrorItemViewPermissionDenied', + "You don't have the necessary permissions to view {ObjectTitle}", + ['ObjectTitle' => $record->i18n_singular_name()] + )); + return null; + } + + return $record; + } /** * Returns a {@link Form} containing the comparison {@link DiffTransformation} view for a record @@ -165,8 +185,54 @@ public function getVersionForm(array $context) */ public function getCompareForm(array $context) { - // @todo write the code - return new Form($this, 'CompareForm', FieldList::create(), FieldList::create()); + // Check context + if (!isset( + $context['RecordClass'], + $context['RecordID'], + $context['RecordVersionFrom'], + $context['RecordVersionTo'] + )) { + throw new InvalidArgumentException('Missing RecordID / RecordVersion / RecordClass for this form'); + } + + $recordClass = $context['RecordClass']; + $recordId = $context['RecordID']; + $recordVersionFrom = $context['RecordVersionFrom']; + $recordVersionTo = $context['RecordVersionTo']; + + if (!$recordClass || !$recordId || !$recordVersionFrom || !$recordVersionTo) { + $this->jsonError(404); + return null; + } + + // Load record and perform a canView check + $recordFrom = $this->getRecordVersion($recordClass, $recordId, $recordVersionFrom); + $recordTo = $this->getRecordVersion($recordClass, $recordId, $recordVersionFrom); + if (!$recordFrom || !$recordTo) { + return null; + } + + $effectiveContext = array_merge($context, ['Record' => $recordFrom]); + /** @var FormFactory $scaffolder */ + $scaffolder = Injector::inst()->get(DataObjectVersionFormFactory::class); + $form = $scaffolder->getForm($this, 'compareForm', $effectiveContext); + $comparisonTransformation = DiffTransformation::create($recordTo); + $form->transform($comparisonTransformation); + + // Set form handler with class name, ID and VersionID + $form->setRequestHandler( + LeftAndMainFormRequestHandler::create( + $form, + [ + $recordClass, + $recordId, + $recordVersionFrom, + $recordVersionTo + ] + ) + ); + + return $form; } public function versionForm(HTTPRequest $request = null) @@ -207,7 +273,7 @@ public function compareForm(HTTPRequest $request = null) return null; } - return $this->getVersionForm([ + return $this->getCompareForm([ 'RecordClass' => $recordClass, 'RecordID' => $recordId, 'RecordVersionFrom' => $recordVersionFrom, diff --git a/src/Forms/DiffTransformation.php b/src/Forms/DiffTransformation.php index 1d00c0d1..560efe3b 100644 --- a/src/Forms/DiffTransformation.php +++ b/src/Forms/DiffTransformation.php @@ -96,9 +96,9 @@ public function transform(FormField $field) } // Do not "compare apples with oranges" - if (!isset($data[$name])) { - throw new LogicException("No comparison information set for field \"$name\""); - } +# if (!isset($data[$name])) { +# throw new LogicException("No comparison information set for field \"$name\""); +# } try { // First check if a field implements performDiffTransformation() From a47bdd07f5d3a77380eb8be3e7c78c7f5d1ba87a Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 23 Jul 2018 14:12:28 +1200 Subject: [PATCH 12/44] Add jest unit tests for the historyViewerReducer --- .../tests/HistoryViewerReducer-test.js | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 client/src/state/historyviewer/tests/HistoryViewerReducer-test.js diff --git a/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js b/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js new file mode 100644 index 00000000..e58c9d30 --- /dev/null +++ b/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js @@ -0,0 +1,171 @@ +/* global jest, describe, it, expect */ + +import historyViewerReducer from 'state/historyviewer/HistoryViewerReducer'; + +describe('HistoryViewerReducer', () => { + let state = {}; + beforeEach(() => { + state = { + currentPage: 1, + currentVersion: 0, + compareFrom: 0, + compareTo: 0, + compareMode: false, + loading: false, + messages: [], + }; + }); + + describe('SET_CURRENT_PAGE', () => { + it('adds the current page to the state', () => { + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_CURRENT_PAGE', + payload: { page: 3 }, + }); + + expect(result.currentPage).toBe(3); + }); + }); + + describe('SHOW_VERSION', () => { + it('sets the current version ID to the current page', () => { + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SHOW_VERSION', + payload: { id: 23 }, + }); + + expect(result.currentVersion).toBe(23); + }); + }); + + describe('SHOW_LIST', () => { + it('resets the page and version', () => { + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SHOW_LIST', + }); + + expect(result.currentVersion).toBe(0); + expect(result.currentPage).toBe(0); + }); + }); + + describe('ADD_MESSAGE', () => { + it('pushes a new message into the store', () => { + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.ADD_MESSAGE', + payload: { + type: 'success', + message: 'hello', + }, + }); + + expect(result.messages.length).toBe(1); + expect(result.messages[0].message).toBe('hello'); + }); + }); + + describe('CLEAR_MESSAGES', () => { + it('clears all messages from the store', () => { + state.messages = [{ + type: 'success', + message: 'hello world', + }]; + + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.CLEAR_MESSAGES', + }); + + expect(result.messages.length).toBe(0); + }); + }); + + describe('SET_COMPARE_MODE', () => { + it('sets compareMode to true when enabling compare mode', () => { + state = { + ...state, + compareFrom: 2, + compareTo: 5, + compareMode: false, + }; + + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_MODE', + payload: { enabled: true }, + }); + + expect(result.compareMode).toBe(true); + expect(result.compareFrom).toBe(2); + expect(result.compareTo).toBe(5); + }); + + it('resets the compare from/to versions when not in compare mode', () => { + state = { + ...state, + compareFrom: 1, + compareTo: 2, + compareMode: true, + }; + + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_MODE', + payload: { enabled: false }, + }); + + expect(result.compareMode).toBe(false); + }); + }); + + describe('SET_COMPARE_FROM', () => { + it('sets the compareFrom to the version', () => { + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_FROM', + payload: { version: 47 }, + }); + + expect(result.compareFrom).toBe(47); + }); + + it('uses compareTo for compareFrom when version is zero', () => { + state = { + ...state, + compareFrom: 50, + compareTo: 80, + }; + + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_FROM', + payload: { version: 0 }, + }); + + expect(result.compareFrom).toBe(80); + expect(result.compareTo).toBe(0); + }); + }); + + describe('SET_COMPARE_TO', () => { + it('sets the compareTo version', () => { + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_TO', + payload: { version: 85 }, + }); + + expect(result.compareTo).toBe(85); + }); + + it('flips the versions if a lower version "to" is selected', () => { + state = { + ...state, + compareFrom: 50, + compareTo: 100, + }; + + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_TO', + payload: { version: 25 }, + }); + + expect(result.compareFrom).toBe(25); + expect(result.compareTo).toBe(50); + }); + }); +}); From f3f6a5663f1ae8af5e956d5374b364f18a20111e Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 23 Jul 2018 11:25:17 +1200 Subject: [PATCH 13/44] MINOR Refactor HistoryViewerController to centralise input validation and form scaffolding methods --- src/Controllers/HistoryViewerController.php | 191 ++++++++++-------- .../HistoryViewerControllerTest.php | 10 +- 2 files changed, 107 insertions(+), 94 deletions(-) diff --git a/src/Controllers/HistoryViewerController.php b/src/Controllers/HistoryViewerController.php index 4e0f95a7..42561b57 100644 --- a/src/Controllers/HistoryViewerController.php +++ b/src/Controllers/HistoryViewerController.php @@ -8,9 +8,9 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse; use SilverStripe\Core\Injector\Injector; -use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Form; use SilverStripe\Forms\FormFactory; +use SilverStripe\ORM\DataObject; use SilverStripe\Versioned\Versioned; use SilverStripe\VersionedAdmin\Forms\DataObjectVersionFormFactory; use SilverStripe\VersionedAdmin\Forms\DiffTransformation; @@ -21,6 +21,15 @@ */ class HistoryViewerController extends LeftAndMain { + /** + * @var string + */ + const FORM_NAME_VERSION = 'versionForm'; + + /** + * @var string + */ + const FORM_NAME_COMPARE = 'compareForm'; private static $url_segment = 'historyviewer'; @@ -31,7 +40,8 @@ class HistoryViewerController extends LeftAndMain private static $required_permission_codes = 'CMS_ACCESS_CMSMain'; private static $allowed_actions = [ - 'versionForm', + self::FORM_NAME_VERSION, + self::FORM_NAME_COMPARE, 'schema', ]; @@ -40,19 +50,17 @@ class HistoryViewerController extends LeftAndMain * * @var string[] */ - protected $formNames = ['versionForm', 'compareForm']; + protected $formNames = [self::FORM_NAME_VERSION, self::FORM_NAME_COMPARE]; public function getClientConfig() { $clientConfig = parent::getClientConfig(); - $clientConfig['form']['versionForm'] = [ - 'schemaUrl' => $this->owner->Link('schema/versionForm'), - ]; - - $clientConfig['form']['compareForm'] = [ - 'schemaUrl' => $this->owner->Link('schema/compareForm'), - ]; + foreach ($this->formNames as $formName) { + $clientConfig['form'][$formName] = [ + 'schemaUrl' => $this->Link('schema/' . $formName), + ]; + } return $clientConfig; } @@ -75,18 +83,27 @@ public function schema($request) return $this->generateSchemaForForm($formName, $request); } + /** + * Checks the requested schema name and returns a scaffolded {@link Form}. An exception is thrown + * if an unexpected value is provided. + * + * @param string $formName + * @param HTTPRequest $request + * @return HTTPResponse + * @throws InvalidArgumentException + */ protected function generateSchemaForForm($formName, HTTPRequest $request) { switch ($formName) { // Get schema for history form - case 'versionForm': + case self::FORM_NAME_VERSION: $form = $this->getVersionForm([ 'RecordClass' => $request->getVar('RecordClass'), 'RecordID' => $request->getVar('RecordID'), 'RecordVersion' => $request->getVar('RecordVersion'), ]); break; - case 'compareForm': + case self::FORM_NAME_COMPARE: $form = $this->getCompareForm([ 'RecordClass' => $request->getVar('RecordClass'), 'RecordID' => $request->getVar('RecordID'), @@ -114,20 +131,12 @@ protected function generateSchemaForForm($formName, HTTPRequest $request) */ public function getVersionForm(array $context) { - // Check context - if (!isset($context['RecordClass'], $context['RecordID'], $context['RecordVersion'])) { - throw new InvalidArgumentException('Missing RecordID / RecordVersion / RecordClass for this form'); - } + $this->validateInput($context, ['RecordClass', 'RecordID', 'RecordVersion']); $recordClass = $context['RecordClass']; $recordId = $context['RecordID']; $recordVersion = $context['RecordVersion']; - if (!$recordClass || !$recordId || !$recordVersion) { - $this->jsonError(404); - return null; - } - // Load record and perform a canView check $record = $this->getRecordVersion($recordClass, $recordId, $recordVersion); if (!$record) { @@ -135,18 +144,13 @@ public function getVersionForm(array $context) } $effectiveContext = array_merge($context, ['Record' => $record]); - /** @var FormFactory $scaffolder */ - $scaffolder = Injector::inst()->get(DataObjectVersionFormFactory::class); - $form = $scaffolder->getForm($this, 'versionForm', $effectiveContext); - - // Set form handler with class name, ID and VersionID - $form->setRequestHandler( - LeftAndMainFormRequestHandler::create($form, [$recordClass, $recordId, $recordVersion]) - ); - - return $form; + return $this->scaffoldForm(self::FORM_NAME_VERSION, $effectiveContext, [ + $recordClass, + $recordId, + $recordVersion + ]); } - + /** * Fetches record version and checks canView permission for result * @@ -158,12 +162,12 @@ public function getVersionForm(array $context) protected function getRecordVersion($recordClass, $recordId, $recordVersion) { $record = Versioned::get_version($recordClass, $recordId, $recordVersion); - + if (!$record) { $this->jsonError(404); return null; } - + if (!$record->canView()) { $this->jsonError(403, _t( __CLASS__.'.ErrorItemViewPermissionDenied', @@ -172,7 +176,7 @@ protected function getRecordVersion($recordClass, $recordId, $recordVersion) )); return null; } - + return $record; } @@ -185,53 +189,33 @@ protected function getRecordVersion($recordClass, $recordId, $recordVersion) */ public function getCompareForm(array $context) { - // Check context - if (!isset( - $context['RecordClass'], - $context['RecordID'], - $context['RecordVersionFrom'], - $context['RecordVersionTo'] - )) { - throw new InvalidArgumentException('Missing RecordID / RecordVersion / RecordClass for this form'); - } + $this->validateInput($context, ['RecordClass', 'RecordID', 'RecordVersionFrom', 'RecordVersionTo']); $recordClass = $context['RecordClass']; $recordId = $context['RecordID']; $recordVersionFrom = $context['RecordVersionFrom']; $recordVersionTo = $context['RecordVersionTo']; - if (!$recordClass || !$recordId || !$recordVersionFrom || !$recordVersionTo) { - $this->jsonError(404); - return null; - } - // Load record and perform a canView check $recordFrom = $this->getRecordVersion($recordClass, $recordId, $recordVersionFrom); - $recordTo = $this->getRecordVersion($recordClass, $recordId, $recordVersionFrom); + $recordTo = $this->getRecordVersion($recordClass, $recordId, $recordVersionTo); if (!$recordFrom || !$recordTo) { return null; } $effectiveContext = array_merge($context, ['Record' => $recordFrom]); - /** @var FormFactory $scaffolder */ - $scaffolder = Injector::inst()->get(DataObjectVersionFormFactory::class); - $form = $scaffolder->getForm($this, 'compareForm', $effectiveContext); + + $form = $this->scaffoldForm(self::FORM_NAME_COMPARE, $effectiveContext, [ + $recordClass, + $recordId, + $recordVersionFrom, + $recordVersionTo, + ]); + + // Enable the "compare mode" diff view $comparisonTransformation = DiffTransformation::create($recordTo); $form->transform($comparisonTransformation); - // Set form handler with class name, ID and VersionID - $form->setRequestHandler( - LeftAndMainFormRequestHandler::create( - $form, - [ - $recordClass, - $recordId, - $recordVersionFrom, - $recordVersionTo - ] - ) - ); - return $form; } @@ -242,19 +226,15 @@ public function versionForm(HTTPRequest $request = null) return null; } - $recordClass = $request->getVar('RecordClass'); - $recordId = $request->getVar('RecordID'); - $recordVersion = $request->getVar('RecordVersion'); - if (!$recordClass || !$recordId || !$recordVersion) { + try { + return $this->getVersionForm([ + 'RecordClass' => $request->getVar('RecordClass'), + 'RecordID' => $request->getVar('RecordID'), + 'RecordVersion' => $request->getVar('RecordVersion'), + ]); + } catch (InvalidArgumentException $ex) { $this->jsonError(400); - return null; } - - return $this->getVersionForm([ - 'RecordClass' => $recordClass, - 'RecordID' => $recordId, - 'RecordVersion' => $recordVersion, - ]); } public function compareForm(HTTPRequest $request = null) @@ -264,20 +244,53 @@ public function compareForm(HTTPRequest $request = null) return null; } - $recordClass = $request->getVar('RecordClass'); - $recordId = $request->getVar('RecordID'); - $recordVersionFrom = $request->getVar('RecordVersionFrom'); - $recordVersionTo = $request->getVar('RecordVersionTo'); - if (!$recordClass || !$recordId || !$recordVersionFrom || !$recordVersionTo) { + try { + return $this->getCompareForm([ + 'RecordClass' => $request->getVar('RecordClass'), + 'RecordID' => $request->getVar('RecordID'), + 'RecordVersionFrom' => $request->getVar('RecordVersionFrom'), + 'RecordVersionTo' => $request->getVar('RecordVersionTo'), + ]); + } catch (InvalidArgumentException $ex) { $this->jsonError(400); - return null; } + } - return $this->getCompareForm([ - 'RecordClass' => $recordClass, - 'RecordID' => $recordId, - 'RecordVersionFrom' => $recordVersionFrom, - 'RecordVersionTo' => $recordVersionTo, - ]); + /** + * Perform some centralised validation checks on the input request and data within it + * + * @param array $context + * @param string[] $requiredFields + * @return bool + * @throws InvalidArgumentException + */ + protected function validateInput(array $context, array $requiredFields = []) + { + foreach ($requiredFields as $requiredField) { + if (empty($context[$requiredField])) { + throw new InvalidArgumentException('Missing required field ' . $requiredField); + } + } + return true; + } + + /** + * Given some context, scaffold a form using the FormFactory and return it + * + * @param string $formName The name for the returned {@link Form} + * @param array $context Context arguments for the {@link FormFactory} + * @param array $extra Context arguments for the {@link LeftAndMainFormRequestHandler} + * @return Form + */ + protected function scaffoldForm($formName, array $context = [], array $extra = []) + { + /** @var FormFactory $scaffolder */ + $scaffolder = Injector::inst()->get(DataObjectVersionFormFactory::class); + $form = $scaffolder->getForm($this, $formName, $context); + + // Set form handler with class name, ID and VersionID + return $form->setRequestHandler( + LeftAndMainFormRequestHandler::create($form, $extra) + ); } } diff --git a/tests/Controllers/HistoryViewerControllerTest.php b/tests/Controllers/HistoryViewerControllerTest.php index 6f147628..ff57783f 100644 --- a/tests/Controllers/HistoryViewerControllerTest.php +++ b/tests/Controllers/HistoryViewerControllerTest.php @@ -86,7 +86,7 @@ public function testSchema() /** * @expectedException InvalidArgumentException - * @expectedExceptionMessage Missing RecordID / RecordVersion / RecordClass for this form + * @expectedExceptionMessageRegExp /Missing required field/ */ public function testGetVersionFormThrowsExceptionWhenArgsAreMissing() { @@ -95,8 +95,8 @@ public function testGetVersionFormThrowsExceptionWhenArgsAreMissing() } /** - * @expectedException \SilverStripe\Control\HTTPResponse_Exception - * @expectedExceptionCode 404 + * @expectedException InvalidArgumentException + * @expectedExceptionMessageRegExp /Missing required field/ */ public function testGetVersionFormThrowsExceptionWhenArgsAreFalsy() { @@ -171,8 +171,8 @@ public function testCompareFormThrowsExceptionWithoutRequest() } /** - * @expectedException \SilverStripe\Control\HTTPResponse_Exception - * @expectedExceptionCode 404 + * @expectedException InvalidArgumentException + * @expectedExceptionMessageRegExp /Missing required field/ */ public function testVersionFormThrowsExceptionWhenArgsAreFalsy() { From a8e0d6394456b00a41bf815b1a6c50a6a09e49a2 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 23 Jul 2018 12:03:54 +1200 Subject: [PATCH 14/44] NEW styles and fixes for styling and code cleanliness NEW Add pointer cursor for versions in the list on hover FIX Ensure toolbar--condensed class is correctly removed when component unmounts FIX Correct eslint violations and provide component in broken unit test --- .../components/HistoryViewer/HistoryViewer.js | 4 ++- .../HistoryViewer/HistoryViewer.scss | 4 +++ .../HistoryViewerVersionDetail.js | 19 +++++++++---- .../HistoryViewer/HistoryViewerVersionList.js | 19 ++++++++++++- .../HistoryViewer/tests/HistoryViewer-test.js | 10 +++++-- .../tests/HistoryViewerHeading-test.js | 28 +------------------ 6 files changed, 47 insertions(+), 37 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index da567f2c..1ca08ea2 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -158,7 +158,9 @@ class HistoryViewer extends Component { const filterVersions = (wantedID) => (potential => potential.Version === wantedID); - const version = this.getVersions().find(filterVersions(currentVersion)); + const version = this.getVersions().find( + filterVersions(compareMode ? compareFrom : currentVersion) + ); const latestVersion = this.getLatestVersion(); const compare = compareMode ? { versionFrom: this.getVersions().find(filterVersions(compareFrom)), diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index d2b4aa73..52cb6ec1 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -8,6 +8,10 @@ } } +.history-viewer__table:not(.history-viewer__table--current) tbody tr:hover { + cursor: pointer; +} + // Used in conjunction with .panel--padded, removes top and bottom padding .panel--padded-side { padding-bottom: 0; diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index fd48ba85..f7252061 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -8,11 +8,11 @@ import { versionType } from 'types/versionType'; class HistoryViewerVersionDetail extends PureComponent { componentWillMount() { - this.toggleToolbarClass(); + this.toggleToolbarClass(true); } componentWillUnmount() { - this.toggleToolbarClass(); + this.toggleToolbarClass(false); } /** @@ -52,15 +52,20 @@ class HistoryViewerVersionDetail extends PureComponent { /** * Until the CMS is fully React driven, we must control certain aspects of the CMS DOM with * manual CSS tweaks. @todo remove this when React drives the CMS. + * + * @param {boolean} add */ - toggleToolbarClass() { + toggleToolbarClass(add = true) { const selector = document .querySelector('.CMSPageHistoryViewerController div:not(.cms-content-tools) .cms-content-header'); + const className = 'history-viewer__toolbar--condensed'; if (selector && this.isPreviewable()) { - selector - .classList - .toggle('history-viewer__toolbar--condensed'); + if (add) { + selector.classList.add(className); + } else { + selector.classList.remove(className); + } } } @@ -99,9 +104,11 @@ class HistoryViewerVersionDetail extends PureComponent { */ renderToolbar() { const { ToolbarComponent, isLatestVersion, recordId, version } = this.props; + if (this.isCompareMode()) { return null; } + return ( { let component = null; const ListComponent = () => ; const VersionDetailComponent = () =>
; + const CompareWarningComponent = () =>
; const versions = { Versions: { @@ -57,6 +59,7 @@ describe('HistoryViewer', () => { { { { { }); }); }); - - - class HeadingWrapper extends React.PureComponent { - render() { - return ( -
- - - -
- ); - } - } - - it('has four columns when hasActions is true', () => { - const component = ReactTestUtils.renderIntoDocument( - - ); - - const result = ReactTestUtils.scryRenderedDOMComponentsWithTag( - component, - 'th' - ); - - expect(result.length).toBe(4); - }); }); From 92eab5969d664531efb909ffee54476fb052c4f7 Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Mon, 23 Jul 2018 14:54:07 +1200 Subject: [PATCH 15/44] FIX selecting two rows in list view UI issues Updating implementation to not adjust the reducer, and preserve the state before you entered compare mode. Fixing up CSS specificity & removing !important. Fix the UI when choosing to select two versions to compare from the list screen. I also made the actions column always render, because is was causing some awkward jittering as things became visible. --- .../HistoryViewer/HistoryViewer.scss | 5 ++--- .../HistoryViewer/HistoryViewerHeading.js | 18 ++++++--------- .../HistoryViewer/HistoryViewerVersion.js | 22 +++++++++++++------ .../HistoryViewer/HistoryViewerVersionList.js | 10 +++++---- .../tests/HistoryViewerHeading-test.js | 4 +--- 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index 52cb6ec1..90b3bd8e 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -26,10 +26,9 @@ margin-left: 10px; } -.history-viewer__table--current { +.table .history-viewer__row--current { // There will only be one table row in this table state - tbody tr, - tbody tr:hover { + &, &:hover { background-color: $link-color; color: $white; } diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index e48489e3..8003f823 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -33,14 +33,16 @@ class HistoryViewerHeading extends Component { } render() { - const { compareModeSelected, hasActions } = this.props; + const { compareModeSelected } = this.props; const { dropdownOpen } = this.state; return ( # {i18n._t('HistoryViewer.Record', 'Record')} - + {i18n._t('HistoryViewer.Author', 'Author')} + + - {hasActions ? : null} ); } } HistoryViewerHeading.propTypes = { - hasActions: React.PropTypes.bool, - compareModeSelected: React.PropTypes.bool, - onCompareModeSelect: React.PropTypes.func, - onCompareModeUnselect: React.PropTypes.func, -}; - -HistoryViewerHeading.defaultProps = { - hasActions: false, + compareModeSelected: PropTypes.bool, + onCompareModeSelect: PropTypes.func, + onCompareModeUnselect: PropTypes.func, }; function mapStateToProps(state) { diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index fafaeb5d..6f2bd603 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -103,7 +103,11 @@ class HistoryViewerVersion extends Component { * @returns {FormAction|null} */ renderClearButton() { - const { FormActionComponent } = this.props; + const { FormActionComponent, isActive } = this.props; + + if (!isActive) { + return null; + } return ( + ); } return ( @@ -140,7 +146,7 @@ class HistoryViewerVersion extends Component { const { version, isActive, StateComponent } = this.props; return ( - + {version.Version} @@ -79,7 +79,7 @@ class HistoryViewerVersionList extends PureComponent { versions.map((version) => ( )) @@ -99,6 +99,8 @@ HistoryViewerVersionList.propTypes = { messages: PropTypes.arrayOf(messageType), VersionComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, versions: PropTypes.arrayOf(versionType), + compareFrom: versionType, + compareTo: versionType, }; HistoryViewerVersionList.defaultProps = { @@ -109,9 +111,9 @@ HistoryViewerVersionList.defaultProps = { }; function mapStateToProps(state) { - const { messages } = state.versionedAdmin.historyViewer; + const { messages, compareFrom, compareTo } = state.versionedAdmin.historyViewer; return { - messages, + messages, compareFrom, compareTo }; } diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js index d863697c..1e6b549c 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js @@ -17,8 +17,7 @@ describe('HistoryViewerHeading', () => { describe('simulate change event in enabled compare mode', () => { const wrapper = shallow( @@ -33,7 +32,6 @@ describe('HistoryViewerHeading', () => { describe('simulate change event in disabled compare mode', () => { const wrapper = shallow( Date: Mon, 23 Jul 2018 15:35:05 +1200 Subject: [PATCH 16/44] Fix margins when choosing versions to compare (#11) --- .../components/HistoryViewer/HistoryViewer.js | 31 +++++++++++++++++++ .../HistoryViewer/HistoryViewer.scss | 14 ++++++++- .../HistoryViewerCompareWarning.js | 2 +- .../HistoryViewerVersionDetail.js | 7 +++-- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index 1ca08ea2..5ac44118 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -23,6 +23,7 @@ class HistoryViewer extends Component { this.handleSetPage = this.handleSetPage.bind(this); this.handleNextPage = this.handleNextPage.bind(this); this.handlePrevPage = this.handlePrevPage.bind(this); + this.handleDismissCompare = this.handleDismissCompare.bind(this); } /** @@ -123,6 +124,35 @@ class HistoryViewer extends Component { this.handleSetPage(currentPage - 1); } + /** + * Handler to exit compare mode + */ + handleDismissCompare() { + this.props.onDismissCompare(); + } + + /** + * Renders a notice indicating the user is in compare mode (if compare mode is active) + * + * @returns {string} + */ + renderCompareWarning() { + if (!this.props.compareMode) { + return ''; + } + + return ( +
+ + {i18n._t('HistoryViewer.COMPARE_MODE', 'Compare mode')}: + {i18n._t('HistoryViewer.SELECT_PROMPT', 'Select two versions')} + + +
+ ); + } /** * Renders the detail form for a selected version * @@ -306,6 +336,7 @@ HistoryViewer.propTypes = { actions: PropTypes.object, onSelect: PropTypes.func, onSetPage: PropTypes.func, + onDismissCompare: PropTypes.func, }; HistoryViewer.defaultProps = { diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index 90b3bd8e..19fd0919 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -38,6 +38,13 @@ } } +.history-viewer__table--current { + &.history-viewer__table--compare { + margin-left: 0; + margin-right: 0; + } +} + // Table cell containing action buttons, e.g. compare and close .table .history-viewer__actions { padding: 0; @@ -47,8 +54,13 @@ white-space: nowrap; } -// Bring any CMS tabs in the detail view closer to the table above it .history-viewer__version-detail { + &.history-viewer__version-detail--compare { + margin-left: $panel-padding-x; + margin-right: $panel-padding-x; + } + + // Bring any CMS tabs in the detail view closer to the table above it .nav-tabs { margin-top: -$panel-padding-y; } diff --git a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js index dc7e2de9..07b650d1 100644 --- a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js +++ b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js @@ -16,7 +16,7 @@ class HistoryViewerCompareWarning extends Component { } /** - * Renders a notice indicating the user is in compare mode (iff compare mode is active) + * Renders a notice indicating the user is in compare mode (if compare mode is active) * * @returns {string} */ diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index f7252061..e9df6703 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -124,17 +124,20 @@ class HistoryViewerVersionDetail extends PureComponent { const containerClasses = this.isPreviewable() ? 'panel panel--padded panel--padded-side panel--scrollable' : ''; + const extraListClasses = classnames({ 'history-viewer__table--compare': this.isCompareMode() }, 'history-viewer__table--current'); + const formClasses = classnames({ 'history-viewer__version-detail--compare': this.isCompareMode() }, 'history-viewer__version-detail'); + return (
-
+
Date: Mon, 23 Jul 2018 16:18:44 +1200 Subject: [PATCH 17/44] Refactoring compare properties to a consistent shoaped object (#15) --- .../components/HistoryViewer/HistoryViewer.js | 43 ++++++++---------- .../HistoryViewerCompareWarning.js | 10 ++--- .../HistoryViewer/HistoryViewerHeading.js | 2 +- .../HistoryViewer/HistoryViewerVersion.js | 20 ++++----- .../HistoryViewer/HistoryViewerVersionList.js | 13 +++--- .../HistoryViewer/HistoryViewerConfig.js | 4 +- .../historyviewer/HistoryViewerReducer.js | 43 +++++++++--------- .../tests/HistoryViewerReducer-test.js | 44 +++++++++---------- client/src/types/compareType.js | 12 +++++ 9 files changed, 94 insertions(+), 97 deletions(-) create mode 100644 client/src/types/compareType.js diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index 5ac44118..b9661191 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -10,6 +10,7 @@ import { inject } from 'lib/Injector'; import Loading from 'components/Loading/Loading'; import { setCurrentPage, showVersion } from 'state/historyviewer/HistoryViewerActions'; import { versionType } from 'types/versionType'; +import { compareType } from 'types/compareType'; /** * The HistoryViewer component is abstract, and requires an Injector component @@ -166,9 +167,7 @@ class HistoryViewer extends Component { recordClass, schemaUrl, VersionDetailComponent, - compareMode, - compareFrom, - compareTo, + compare, } = this.props; // Insert variables into the schema URL via regex replacements @@ -180,21 +179,21 @@ class HistoryViewer extends Component { const schemaCompareReplacements = { ':id': recordId, ':class': recordClass, - ':from': compareFrom, - ':to': compareTo, + ':from': compare ? compare.versionFrom : 0, + ':to': compare ? compare.versionTo : 0, }; - const schemaSearch = compareMode ? /:id|:class|:from|:to/g : /:id|:class|:version/g; - const schemaReplacements = compareMode ? schemaCompareReplacements : schemaVersionReplacements; + const schemaSearch = compare ? /:id|:class|:from|:to/g : /:id|:class|:version/g; + const schemaReplacements = compare ? schemaCompareReplacements : schemaVersionReplacements; const filterVersions = (wantedID) => (potential => potential.Version === wantedID); const version = this.getVersions().find( - filterVersions(compareMode ? compareFrom : currentVersion) + filterVersions(compare ? compare.versionFrom : currentVersion) ); const latestVersion = this.getLatestVersion(); - const compare = compareMode ? { - versionFrom: this.getVersions().find(filterVersions(compareFrom)), - versionTo: this.getVersions().find(filterVersions(compareTo)), + const compareProps = compare ? { + versionFrom: this.getVersions().find(filterVersions(compare.versionFrom)), + versionTo: this.getVersions().find(filterVersions(compare.versionTo)), } : false; const props = { @@ -203,7 +202,7 @@ class HistoryViewer extends Component { recordId, schemaUrl: schemaUrl.replace(schemaSearch, (match) => schemaReplacements[match]), version, - compare, + compare: compareProps, }; return ( @@ -281,22 +280,22 @@ class HistoryViewer extends Component { } renderCompareMode() { - const { compareFrom, compareTo } = this.props; + const { compare } = this.props; - if (compareFrom && compareTo) { + if (compare && compare.versionFrom && compare.versionTo) { return this.renderVersionDetail(); } return this.renderVersionList(); } render() { - const { loading, compareMode, currentVersion } = this.props; + const { loading, compare, currentVersion } = this.props; if (loading) { return ; } - if (compareMode) { + if (compare) { return this.renderCompareMode(); } @@ -315,9 +314,7 @@ HistoryViewer.propTypes = { offset: PropTypes.number, recordId: PropTypes.number.isRequired, currentVersion: PropTypes.number, - compareMode: PropTypes.bool, - compareFrom: PropTypes.number, - compareTo: PropTypes.number, + compare: compareType, isPreviewable: PropTypes.bool, VersionDetailComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, CompareWarningComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, @@ -359,17 +356,13 @@ function mapStateToProps(state) { const { currentPage, currentVersion, - compareMode, - compareFrom, - compareTo, + compare, } = state.versionedAdmin.historyViewer; return { page: currentPage, currentVersion, - compareMode, - compareFrom, - compareTo, + compare }; } diff --git a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js index 07b650d1..8cbc90c5 100644 --- a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js +++ b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js @@ -21,9 +21,9 @@ class HistoryViewerCompareWarning extends Component { * @returns {string} */ render() { - const { compareMode, fixed } = this.props; + const { isCompare, fixed } = this.props; - if (!compareMode) { + if (!isCompare) { return null; } @@ -48,7 +48,7 @@ class HistoryViewerCompareWarning extends Component { } HistoryViewerCompareWarning.propTypes = { - compareMode: PropTypes.bool.isRequired, + isCompare: PropTypes.bool.isRequired, fixed: PropTypes.bool.isRequired, }; @@ -58,11 +58,11 @@ HistoryViewerCompareWarning.defaultProps = { function mapStateToProps(state) { const { - compareMode, + compare, } = state.versionedAdmin.historyViewer; return { - compareMode, + isCompare: !!compare, }; } diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index 8003f823..86b41a2e 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -78,7 +78,7 @@ HistoryViewerHeading.propTypes = { function mapStateToProps(state) { return { - compareModeSelected: state.versionedAdmin.historyViewer.compareMode, + compareModeSelected: !!state.versionedAdmin.historyViewer.compare, }; } diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index 6f2bd603..c9408d46 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -3,6 +3,7 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { inject } from 'lib/Injector'; import { versionType, defaultVersion } from 'types/versionType'; +import { compareType } from 'types/compareType'; import { showVersion, setCompareMode, setCompareFrom, setCompareTo } from 'state/historyviewer/HistoryViewerActions'; import i18n from 'i18n'; @@ -38,15 +39,15 @@ class HistoryViewerVersion extends Component { * When clicking on a version, render the detail view for it via a Redux action dispatch */ handleClick() { - const { onSelect, version, isActive, compareMode, compareFrom, onCompareSelect } = this.props; + const { onSelect, version, isActive, compare, onCompareSelect } = this.props; // If the clear button is shown, don't do anything when clicking on the row if (isActive) { return; } - if (compareMode) { - onCompareSelect(version.Version, !compareFrom); + if (compare) { + onCompareSelect(version.Version, !compare.versionFrom); } else { onSelect(version.Version); } @@ -56,9 +57,9 @@ class HistoryViewerVersion extends Component { * When closing the version, return back to the list view via Redux action dispatch */ handleClose() { - const { onSelect, compareMode, compareFrom, onCompareSelect, version } = this.props; - if (compareMode) { - onCompareSelect(0, version.Version === compareFrom); + const { onSelect, compare, onCompareSelect, version } = this.props; + if (compare) { + onCompareSelect(0, version.Version === compare.versionFrom); } else { onSelect(0); } @@ -163,10 +164,10 @@ class HistoryViewerVersion extends Component { HistoryViewerVersion.propTypes = { isActive: React.PropTypes.bool, - compareMode: React.PropTypes.bool, onSelect: React.PropTypes.func, onCompare: React.PropTypes.func, onCompareSelect: React.PropTypes.func, + compare: compareType, StateComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, FormActionComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, version: versionType, @@ -179,11 +180,8 @@ HistoryViewerVersion.defaultProps = { }; function mapStateToProps(state) { - const { compareMode, compareFrom } = state.versionedAdmin.historyViewer; - return { - compareMode, - compareFrom, + compare: state.versionedAdmin.historyViewer.compare, }; } diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionList.js b/client/src/components/HistoryViewer/HistoryViewerVersionList.js index f1d74dc6..611b7187 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionList.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionList.js @@ -6,6 +6,7 @@ import { compose } from 'redux'; import { inject } from 'lib/Injector'; import { messageType } from 'types/messageType'; import { versionType } from 'types/versionType'; +import { compareType } from 'types/compareType'; class HistoryViewerVersionList extends PureComponent { /** @@ -27,12 +28,12 @@ class HistoryViewerVersionList extends PureComponent { * @returns {boolean} */ isVersionActive(version) { - const { isActive, compareFrom, compareTo } = this.props; + const { isActive, compare } = this.props; if (isActive) { return true; } - return version.Version === compareFrom || version.Version === compareTo; + return version.Version === compare.versionFrom || version.Version === compare.versionTo; } /** @@ -99,8 +100,7 @@ HistoryViewerVersionList.propTypes = { messages: PropTypes.arrayOf(messageType), VersionComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, versions: PropTypes.arrayOf(versionType), - compareFrom: versionType, - compareTo: versionType, + compare: compareType }; HistoryViewerVersionList.defaultProps = { @@ -111,9 +111,10 @@ HistoryViewerVersionList.defaultProps = { }; function mapStateToProps(state) { - const { messages, compareFrom, compareTo } = state.versionedAdmin.historyViewer; + const { messages, compare } = state.versionedAdmin.historyViewer; return { - messages, compareFrom, compareTo + messages, + compare }; } diff --git a/client/src/containers/HistoryViewer/HistoryViewerConfig.js b/client/src/containers/HistoryViewer/HistoryViewerConfig.js index 757a9df5..87d4db38 100644 --- a/client/src/containers/HistoryViewer/HistoryViewerConfig.js +++ b/client/src/containers/HistoryViewer/HistoryViewerConfig.js @@ -10,8 +10,8 @@ const historyViewerConfig = (HistoryViewer) => { } getSchemaUrlDetails() { - const { compareMode } = this.props; - if (compareMode) { + const { compare } = this.props; + if (compare) { return { formName: 'compareForm', queryParts: [ diff --git a/client/src/state/historyviewer/HistoryViewerReducer.js b/client/src/state/historyviewer/HistoryViewerReducer.js index 3dc8198f..8db8bc9d 100644 --- a/client/src/state/historyviewer/HistoryViewerReducer.js +++ b/client/src/state/historyviewer/HistoryViewerReducer.js @@ -1,11 +1,10 @@ import HISTORY_VIEWER from './HistoryViewerActionTypes'; +import { defaultCompare } from 'types/compareType'; const initialState = { currentPage: 1, currentVersion: 0, - compareFrom: 0, - compareTo: 0, - compareMode: false, + compare: defaultCompare, loading: false, messages: [], }; @@ -63,53 +62,51 @@ export default function historyViewerReducer(state = initialState, { type, paylo } case HISTORY_VIEWER.SET_COMPARE_MODE: { - const updateState = { - compareMode: payload.enabled, - }; + let compare = false; - if (!updateState.compareMode) { - updateState.compareFrom = 0; - updateState.compareTo = 0; + if (payload.enabled) { + compare = { + versionFrom: 0, + versionTo: 0, + }; } return { ...state, - ...updateState, + compare, }; } case HISTORY_VIEWER.SET_COMPARE_FROM: { - let { compareFrom, compareTo } = state; - compareFrom = payload.version; + let { compare: { versionFrom, versionTo } } = state; + versionFrom = payload.version; if (!payload.version) { - compareFrom = compareTo; - compareTo = 0; + versionFrom = versionTo; + versionTo = 0; } return { ...state, - compareFrom, - compareTo, + compare: { versionFrom, versionTo }, }; } case HISTORY_VIEWER.SET_COMPARE_TO: { - let { compareFrom, compareTo } = state; - compareTo = payload.version; + let { compare: { versionFrom, versionTo } } = state; + versionTo = payload.version; // A normal `diff` always shows what it takes turn FROM into TO // Here, comparisons are always FROM oldest TO newest version // Version IDs are always positive & in creation order. - if (compareTo && compareFrom && compareTo < compareFrom) { - compareFrom = compareTo; - compareTo = state.compareFrom; + if (versionTo && versionFrom && versionTo < versionFrom) { + versionFrom = versionTo; + versionTo = state.compare.versionFrom; } return { ...state, - compareFrom, - compareTo, + compare: { versionFrom, versionTo }, }; } diff --git a/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js b/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js index e58c9d30..e136925a 100644 --- a/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js +++ b/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js @@ -1,6 +1,7 @@ /* global jest, describe, it, expect */ import historyViewerReducer from 'state/historyviewer/HistoryViewerReducer'; +import { defaultCompare } from 'types/compareType'; describe('HistoryViewerReducer', () => { let state = {}; @@ -8,9 +9,7 @@ describe('HistoryViewerReducer', () => { state = { currentPage: 1, currentVersion: 0, - compareFrom: 0, - compareTo: 0, - compareMode: false, + compare: defaultCompare, loading: false, messages: [], }; @@ -80,12 +79,10 @@ describe('HistoryViewerReducer', () => { }); describe('SET_COMPARE_MODE', () => { - it('sets compareMode to true when enabling compare mode', () => { + it('sets compare to the default enabled value when enabling compare mode', () => { state = { ...state, - compareFrom: 2, - compareTo: 5, - compareMode: false, + compare: false, }; const result = historyViewerReducer(state, { @@ -93,17 +90,13 @@ describe('HistoryViewerReducer', () => { payload: { enabled: true }, }); - expect(result.compareMode).toBe(true); - expect(result.compareFrom).toBe(2); - expect(result.compareTo).toBe(5); + expect(result.compare).toEqual({ versionFrom: 0, versionTo: 0 }); }); it('resets the compare from/to versions when not in compare mode', () => { state = { ...state, - compareFrom: 1, - compareTo: 2, - compareMode: true, + compare: { versionFrom: 1, versionTo: 2 }, }; const result = historyViewerReducer(state, { @@ -111,25 +104,29 @@ describe('HistoryViewerReducer', () => { payload: { enabled: false }, }); - expect(result.compareMode).toBe(false); + expect(result.compare).toBe(false); }); }); describe('SET_COMPARE_FROM', () => { it('sets the compareFrom to the version', () => { + state = { + ...state, + compare: { versionFrom: 0, versionTo: 0 }, + }; + const result = historyViewerReducer(state, { type: 'HISTORY_VIEWER.SET_COMPARE_FROM', payload: { version: 47 }, }); - expect(result.compareFrom).toBe(47); + expect(result.compare.versionFrom).toBe(47); }); it('uses compareTo for compareFrom when version is zero', () => { state = { ...state, - compareFrom: 50, - compareTo: 80, + compare: { versionFrom: 50, versionTo: 80 }, }; const result = historyViewerReducer(state, { @@ -137,8 +134,8 @@ describe('HistoryViewerReducer', () => { payload: { version: 0 }, }); - expect(result.compareFrom).toBe(80); - expect(result.compareTo).toBe(0); + expect(result.compare.versionFrom).toBe(80); + expect(result.compare.versionTo).toBe(0); }); }); @@ -149,14 +146,13 @@ describe('HistoryViewerReducer', () => { payload: { version: 85 }, }); - expect(result.compareTo).toBe(85); + expect(result.compare.versionTo).toBe(85); }); it('flips the versions if a lower version "to" is selected', () => { state = { ...state, - compareFrom: 50, - compareTo: 100, + compare: { versionFrom: 50, versionTo: 100 }, }; const result = historyViewerReducer(state, { @@ -164,8 +160,8 @@ describe('HistoryViewerReducer', () => { payload: { version: 25 }, }); - expect(result.compareFrom).toBe(25); - expect(result.compareTo).toBe(50); + expect(result.compare.versionFrom).toBe(25); + expect(result.compare.versionTo).toBe(50); }); }); }); diff --git a/client/src/types/compareType.js b/client/src/types/compareType.js new file mode 100644 index 00000000..d5abecd6 --- /dev/null +++ b/client/src/types/compareType.js @@ -0,0 +1,12 @@ +import { PropTypes } from 'react'; + +// Describes the data structure for compare version storage +const compareType = PropTypes.oneOf([false, PropTypes.shape({ + versionFrom: PropTypes.number, + versionTo: PropTypes.number +})]); + +// A default (empty) data set for a version +const defaultCompare = false; + +export { compareType, defaultCompare }; From 72938efb3aeb5db22951a20ddef51f1f981f906e Mon Sep 17 00:00:00 2001 From: Raissa North Date: Mon, 23 Jul 2018 20:12:07 +1200 Subject: [PATCH 18/44] Add colours to dels and ins (#16) --- client/src/components/HistoryViewer/HistoryViewer.scss | 10 ++++++++++ src/Forms/DiffTransformation.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index 19fd0919..fa15721d 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -167,7 +167,17 @@ .form-check-label { text-transform: none; } + } +} + +.history-viewer__version-detail-diff { + del { + color: #f44; + } + ins { + background-color: #dfd; + text-decoration: none; } } diff --git a/src/Forms/DiffTransformation.php b/src/Forms/DiffTransformation.php index 560efe3b..01c6a7c1 100644 --- a/src/Forms/DiffTransformation.php +++ b/src/Forms/DiffTransformation.php @@ -110,7 +110,7 @@ public function transform(FormField $field) Diff::compareHTML($field->Value(), isset($this->data[$name]) ? $this->data[$name] : '') ); - $diffField->addExtraClass($field->extraClass()); + $diffField->addExtraClass($field->extraClass() . " history-viewer__version-detail-diff"); $diffField->setDescription($field->getDescription()); return $diffField; From 55dc0095b992cae9500109a94f0050bf797b7099 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 23 Jul 2018 17:00:10 +1200 Subject: [PATCH 19/44] FIX SET_COMPARE_MODE reducer no longer clears previously set compareFrom value --- .../state/historyviewer/HistoryViewerReducer.js | 1 + .../tests/HistoryViewerReducer-test.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/client/src/state/historyviewer/HistoryViewerReducer.js b/client/src/state/historyviewer/HistoryViewerReducer.js index 8db8bc9d..6e63f382 100644 --- a/client/src/state/historyviewer/HistoryViewerReducer.js +++ b/client/src/state/historyviewer/HistoryViewerReducer.js @@ -68,6 +68,7 @@ export default function historyViewerReducer(state = initialState, { type, paylo compare = { versionFrom: 0, versionTo: 0, + ...state.compare, }; } diff --git a/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js b/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js index e136925a..3088371a 100644 --- a/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js +++ b/client/src/state/historyviewer/tests/HistoryViewerReducer-test.js @@ -106,6 +106,21 @@ describe('HistoryViewerReducer', () => { expect(result.compare).toBe(false); }); + + it('leaves the existing value for compareFrom when enabling', () => { + state = { + ...state, + compare: { ...state.compare, versionFrom: 1 }, + }; + + const result = historyViewerReducer(state, { + type: 'HISTORY_VIEWER.SET_COMPARE_MODE', + payload: { enabled: true }, + }); + + expect(result.compare.versionFrom).toBe(1); + expect(result.compare.versionTo).toBe(0); + }); }); describe('SET_COMPARE_FROM', () => { From aeaaa8675d354fcac8141bb966bfef71aa96042b Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Tue, 24 Jul 2018 12:14:50 +1200 Subject: [PATCH 20/44] Logic for Diff rendering moved from Transformation to new Field Major refactor of Diff Form Transformation The original approach was implmented as a "get it functional" state, and a bit of an attempt to circumvent the complexities involved with the logical order of operations, the nature of a failover (see ViewableData), and having form fields work in more than one display facet. However there were limitations in handling more complex data structures such as when a value from the database was NULL, this would fail a data comparison check between loaded data and transformation data. In order to work around this we now simply ignore all these complexities and pass off to normal errors or exceptions that will be output with such use. There is now a diff field that will handle the data explicitly, rather than having the entire transformation happen in the transformer class. This was originally avoided due to a failover being an underlay, not an overlay, so only methods that didn't exist on the superclass would be passed off to the form field we're tryign to transform, instead of for any method not defined on the class. To circumvent this issue, we now simply don't (cicumvent this issue), and rely on users not e.g. transforming a form then attempting to update one of the old fields. --- src/Controllers/HistoryViewerController.php | 5 +- src/Forms/DiffField.php | 94 +++++++++++++++++++++ src/Forms/DiffTransformation.php | 81 ++---------------- tests/Forms/DiffTransformationTest.php | 76 +++-------------- 4 files changed, 117 insertions(+), 139 deletions(-) create mode 100644 src/Forms/DiffField.php diff --git a/src/Controllers/HistoryViewerController.php b/src/Controllers/HistoryViewerController.php index 42561b57..eb595562 100644 --- a/src/Controllers/HistoryViewerController.php +++ b/src/Controllers/HistoryViewerController.php @@ -203,7 +203,7 @@ public function getCompareForm(array $context) return null; } - $effectiveContext = array_merge($context, ['Record' => $recordFrom]); + $effectiveContext = array_merge($context, ['Record' => $recordTo]); $form = $this->scaffoldForm(self::FORM_NAME_COMPARE, $effectiveContext, [ $recordClass, @@ -213,8 +213,9 @@ public function getCompareForm(array $context) ]); // Enable the "compare mode" diff view - $comparisonTransformation = DiffTransformation::create($recordTo); + $comparisonTransformation = DiffTransformation::create(); $form->transform($comparisonTransformation); + $form->loadDataFrom($recordFrom); return $form; } diff --git a/src/Forms/DiffField.php b/src/Forms/DiffField.php new file mode 100644 index 00000000..df6cdf1b --- /dev/null +++ b/src/Forms/DiffField.php @@ -0,0 +1,94 @@ +New Old data". Most useful in historic version comparisons + * {@see SilverStripe\Versioned\Versioned} + */ +class DiffField extends HTMLReadonlyField +{ + /** + * @var FormField Holds the field used as the 'To' (the newer) data for the diff. + */ + protected $comparisonField; + + /** + * @param FormField $field + * @return $this + */ + public function setComparisonField(FormField $field) + { + $this->comparisonField = $field; + $this->setFailover($this->comparisonField); + return $this; + } + + /** + * @return FormField + */ + public function getComparisonField() + { + return $this->comparisonField; + } + + public function Value() + { + $oldValue = $this->getOutdatedField()->Value(); + $newValue = $this->getComparisonField()->Value(); + return Diff::compareHTML($oldValue, $newValue); + } + + /** + * This function is so named not in the manner of chronology, + * but rather in terms of succession. + * That is to say the 'outdated' field may in fact be for a newer + * value in terms of chronology, but a diff shows what it takes to + * turn one value _into_ another... and in this case the 'from' field + * value is succeeded by the 'to' value - it becomes 'outdated'. + * + * @return FormField + */ + public function getOutdatedField() + { + $newField = clone $this->getComparisonField(); + $newField->setValue($this->value); + return $newField; + } + + public function getSchemaDataDefaults() + { + return array_merge( + $this->getComparisonField()->getSchemaDataDefaults(), + parent::getSchemaDataDefaults() + ); + } + + public function getSchemaStateDefaults() + { + $fromValue = $this->getOutdatedField()->Value(); + $toField = $this->getComparisonField(); + $toValue = $toField->Value(); + + $state = array_merge( + $toField->getSchemaStateDefaults(), + parent::getSchemaStateDefaults(), + ['value' => $this->Value()] + ); + $state['data']['diff'] = [ + 'from' => $fromValue, + 'to' => $toValue, + ]; + + return $state; + } +} diff --git a/src/Forms/DiffTransformation.php b/src/Forms/DiffTransformation.php index 01c6a7c1..ad4ad508 100644 --- a/src/Forms/DiffTransformation.php +++ b/src/Forms/DiffTransformation.php @@ -3,69 +3,13 @@ namespace SilverStripe\VersionedAdmin\Forms; use BadMethodCallException; -use InvalidArgumentException; -use LogicException; use SilverStripe\Forms\CompositeField; use SilverStripe\Forms\FormField; use SilverStripe\Forms\FormTransformation; -use SilverStripe\Forms\HTMLReadonlyField; use SilverStripe\Forms\LiteralField; -use SilverStripe\ORM\DataObject; -use SilverStripe\View\ArrayData; -use SilverStripe\View\Parsers\Diff; class DiffTransformation extends FormTransformation { - /** - * Field used to contain the 'from' value of the diff. - * @var array - */ - protected $data = []; - - /** - * @param DataObject|ArrayData|array $comparisonData - */ - public function __construct($comparisonData = null) - { - if (!empty($comparisonData)) { - $this->setComparisonData($comparisonData); - } - } - - /** - * Overrides the comparison data with a new set. - * - * @param DataObject|ArrayData|array $comparisonData - * @param bool $merge true to merge field values with existing data - * @throws InvalidArgumentException - * @return $this - */ - public function setComparisonData($comparisonData, $merge = false) - { - if (!is_array($comparisonData) - && !($comparisonData instanceof DataObject) - && !($comparisonData instanceof ArrayData) - ) { - throw new InvalidArgumentException( - 'comparisonData is not an array, nor an instance of DataObject or ArrayData' - ); - } - - $comparisonData = is_array($comparisonData) ? $comparisonData : $comparisonData->toMap(); - - $this->data = $merge ? array_merge($this->data, $comparisonData) : $comparisonData; - - return $this; - } - - /** - * @return array - */ - public function getComparisonData() - { - return $this->data; - } - public function transform(FormField $field) { if ($field->isComposite()) { @@ -82,12 +26,10 @@ public function transform(FormField $field) return clone $field; } - $data = $this->getComparisonData(); $name = $field->getName(); // Do not compare generated security data - if (!isset($data[$name]) - && ($form = $field->getForm()) + if (($form = $field->getForm()) && ($securityToken = $form->getSecurityToken()) && ($securityTokenName = $securityToken->getName()) && $securityTokenName === $name @@ -95,25 +37,14 @@ public function transform(FormField $field) return LiteralField::create($name, ''); } - // Do not "compare apples with oranges" -# if (!isset($data[$name])) { -# throw new LogicException("No comparison information set for field \"$name\""); -# } - try { // First check if a field implements performDiffTransformation() - parent::transform($field); + $diffField = parent::transform($field); } catch (BadMethodCallException $e) { - $diffField = HTMLReadonlyField::create( - $name, - $field->Title(), - Diff::compareHTML($field->Value(), isset($this->data[$name]) ? $this->data[$name] : '') - ); - - $diffField->addExtraClass($field->extraClass() . " history-viewer__version-detail-diff"); - $diffField->setDescription($field->getDescription()); - - return $diffField; + $diffField = $field->castedCopy(DiffField::class); + $diffField->addExtraClass("history-viewer__version-detail-diff"); + $diffField->setComparisonField($field); } + return $diffField; } } diff --git a/tests/Forms/DiffTransformationTest.php b/tests/Forms/DiffTransformationTest.php index 84e44d8a..7741a72a 100644 --- a/tests/Forms/DiffTransformationTest.php +++ b/tests/Forms/DiffTransformationTest.php @@ -47,56 +47,19 @@ protected function setUp() $this->testForm->disableSecurityToken(); } - public function testSetComparisonData() - { - $transformation = new DiffTransformation(); - $transformation->setComparisonData($this->testData); - $this->assertEquals($this->testData, $transformation->getComparisonData(), 'Arrays are accepted'); - - $transformation->setComparisonData(DataObject::create($this->testData)); - $this->assertEquals($this->testData, $transformation->getComparisonData(), 'DataObjects are accepted'); - - $transformation->setComparisonData(ArrayData::create($this->testData)); - $this->assertEquals($this->testData, $transformation->getComparisonData(), 'ArrayDatas are accepted'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testSetComparisonDataThrowsExceptionWithInvalidArgument() - { - $transformation = new DiffTransformation(); - $transformation->setComparisonData('First', '1st'); - } - - public function testSetComparisonDataMerge() - { - $transformation = new DiffTransformation([ - 'First' => 'Once', - 'Second' => '2nd', - ]); - - $transformation->setComparisonData([ - 'Second' => 'Twice', - 'Third' => 'Thrice', - ], $merge = true); - - // will throw an exception if not enough data is set - $this->testForm->transform($transformation); - } - public function testTransform() { $form = $this->testForm; - $update = [ + $oldData = [ 'First' => '1st', 'Second' => '2nd', 'Third' => '3rd', ]; - $expected = $this->getExpected($update); - $transformation = DiffTransformation::create($update); + $expected = $this->getExpected($oldData); + $transformation = DiffTransformation::create(); $form->transform($transformation); + $form->loadDataFrom($oldData); foreach ($form->Fields() as $index => $field) { $this->assertContains($expected[$index]['before'], $field->Value(), 'Value before is shown'); @@ -104,18 +67,6 @@ public function testTransform() } } - /** - * @expectedException LogicException - */ - public function testTransformWithNotEnoughData() - { - $form = $this->testForm; - $transformation = DiffTransformation::create([ - 'First' => '1st', - ]); - $form->transform($transformation); - } - public function testTransformWithCompositeFields() { $form = $this->testForm; @@ -124,15 +75,16 @@ public function testTransformWithCompositeFields() CompositeField::create($form->Fields()) ) ); - $update = [ + $oldData = [ 'First' => 'Uno', 'Second' => 'Dos', 'Third' => 'Tres', ]; - $expected = $this->getExpected($update); - $transformation = DiffTransformation::create($update); + $expected = $this->getExpected($oldData); + $transformation = DiffTransformation::create(); $form->transform($transformation); + $form->loadDataFrom($oldData); foreach (array_values($form->Fields()->dataFields()) as $index => $field) { $this->assertContains($expected[$index]['before'], $field->Value(), 'Value before is shown'); @@ -143,17 +95,17 @@ public function testTransformWithCompositeFields() /** * Helper method for generating the expected result for diff views between fields * - * @param array $update + * @param array $outdated * @return array */ - private function getExpected($update) + private function getExpected($outdated) { $expected = []; - $original = $this->testData; - foreach (array_combine(array_values($update), array_values($original)) as $now => $was) { + $current = $this->testData; + foreach (array_combine(array_values($outdated), array_values($current)) as $now => $was) { $expected[] = [ - 'before' => "$now", - 'after' => "$was", + 'before' => "$was", + 'after' => "$now", ]; } return $expected; From 0cdd00c92a4a4b65b8d44a0909149b0ed0e5f797 Mon Sep 17 00:00:00 2001 From: Raissa North Date: Tue, 24 Jul 2018 12:34:09 +1200 Subject: [PATCH 21/44] Refactor tests to use Enzyme and add tests for HistoryViewer and HistoryViewerVersion --- .../HistoryViewer/tests/HistoryViewer-test.js | 71 ++++++++++-- .../tests/HistoryViewerVersion-test.js | 107 +++++++++--------- 2 files changed, 112 insertions(+), 66 deletions(-) diff --git a/client/src/components/HistoryViewer/tests/HistoryViewer-test.js b/client/src/components/HistoryViewer/tests/HistoryViewer-test.js index 51df695e..20d18125 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewer-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewer-test.js @@ -2,19 +2,26 @@ /* global jest, describe, it, expect */ import React from 'react'; -import ReactTestUtils from 'react-addons-test-utils'; import { Component as HistoryViewer } from '../HistoryViewer'; -import Enzyme from 'enzyme'; +import Enzyme, { shallow } from 'enzyme'; import Adapter from 'enzyme-adapter-react-15.4/build/index'; Enzyme.configure({ adapter: new Adapter() }); describe('HistoryViewer', () => { - let component = null; const ListComponent = () => ; const VersionDetailComponent = () =>
; const CompareWarningComponent = () =>
; + // Mock select functions to replace the ones provided by mapDispatchToProps + let mockOnSelect; + let mockOnSetPage; + + beforeEach(() => { + mockOnSelect = jest.fn(); + mockOnSetPage = jest.fn(); + }); + const versions = { Versions: { pageInfo: { @@ -55,7 +62,7 @@ describe('HistoryViewer', () => { describe('getVersions()', () => { it('returns the node element from each version edge', () => { - component = ReactTestUtils.renderIntoDocument( + const wrapper = shallow( { /> ); - expect(component.getVersions().map((version) => version.Version)).toEqual([14, 13]); + expect(wrapper.instance().getVersions().map((version) => version.Version)).toEqual([14, 13]); }); }); describe('getLatestVersion()', () => { it('returns the latest version from page one', () => { - component = ReactTestUtils.renderIntoDocument( + const wrapper = shallow( { page={1} /> ); - expect(component.getLatestVersion().Version).toEqual(14); + expect(wrapper.instance().getLatestVersion().Version).toEqual(14); }); it('returns null if we are not on page one', () => { - component = ReactTestUtils.renderIntoDocument( + const wrapper = shallow( { page={2} /> ); - expect(component.getLatestVersion()).toEqual(false); + expect(wrapper.instance().getLatestVersion()).toEqual(false); }); }); describe('render()', () => { it('shows a loading state while loading results', () => { - component = ReactTestUtils.renderIntoDocument( + const wrapper = shallow( { /> ); - const result = ReactTestUtils.findRenderedDOMComponentWithClass( - component, + const result = wrapper.find( 'cms-content-loading-spinner' ); expect(result).toBeTruthy(); }); }); + + describe('handlePagination()', () => { + it('should have called onSetPage and handlePrevPage after prev button in navigation clicked', () => { + const wrapper = shallow( + + ); + wrapper.instance().handlePrevPage(); + expect(mockOnSetPage).toBeCalledWith(1); + }); + }); + + describe('onSelect()', () => { + it('called when components unmounts', () => { + const wrapper = shallow( + + ); + + wrapper.instance().componentWillUnmount(); + expect(mockOnSelect).toBeCalled(); + }); + }); }); diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js index 3ba645d8..fd9429a8 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js @@ -1,76 +1,75 @@ +/* eslint-disable import/no-extraneous-dependencies */ /* global jest, describe, it, expect */ import React from 'react'; -import ReactTestUtils from 'react-addons-test-utils'; import { Component as HistoryViewerVersion } from '../HistoryViewerVersion'; +import Enzyme, { shallow } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-15.4/build/index'; -/** - * Wrapper class to ensure the component is nested correctly before testing it - */ -class TestHistoryViewerVersion extends React.PureComponent { - render() { - const NullComponent = () =>
; - - return ( -
- - - -
- ); - } -} +Enzyme.configure({ adapter: new Adapter() }); describe('HistoryViewerVersion', () => { - let component = null; + const StateComponent = () =>
; + const FormActionComponent = () =>
; + + let mockOnCompare; let version = {}; - describe('getAuthor()', () => { - beforeEach(() => { - version = { - Version: 3, - Published: false, - Author: { - FirstName: 'John', - Surname: 'Smith', - }, - Publisher: { - FirstName: 'Sarah', - Surname: 'Smith', - }, - }; - }); + beforeEach(() => { + mockOnCompare = jest.fn(); + version = { + Version: 3, + Published: false, + Author: { + FirstName: 'John', + Surname: 'Smith', + }, + Publisher: { + FirstName: 'Sarah', + Surname: 'Smith', + }, + }; + }); - it('returns the author name when unpublished', () => { - component = ReactTestUtils.renderIntoDocument( - + describe('HistoryViewerVersion', () => { + it('calls onCompare to dispatch an action as the result of handleCompare call', () => { + const wrapper = shallow( + ); - const viewerVersion = ReactTestUtils.findRenderedDOMComponentWithTag( - component, - 'tr' + wrapper.instance().handleCompare(); + expect(mockOnCompare).toBeCalledWith(3); + }); + it('returns the author name when unpublished', () => { + const wrapper = shallow( + ); - expect(viewerVersion.textContent).toContain('John Smith'); + expect(wrapper.instance().getAuthor()).toEqual('John Smith'); }); it('returns the publisher name when published', () => { - version.Published = true; - - component = ReactTestUtils.renderIntoDocument( - - ); - - const viewerVersion = ReactTestUtils.findRenderedDOMComponentWithTag( - component, - 'tr' + const wrapper = shallow( + ); - expect(viewerVersion.textContent).toContain('Sarah Smith'); + expect(wrapper.instance().getAuthor()).toEqual('Sarah Smith'); }); }); }); From c8e9047f21fde6ca9572be588a43a6505497eb87 Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Tue, 24 Jul 2018 12:56:58 +1200 Subject: [PATCH 22/44] Removing the addition of old render methods that were previously extracted to a component --- .../components/HistoryViewer/HistoryViewer.js | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index b9661191..71367dd4 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -24,7 +24,6 @@ class HistoryViewer extends Component { this.handleSetPage = this.handleSetPage.bind(this); this.handleNextPage = this.handleNextPage.bind(this); this.handlePrevPage = this.handlePrevPage.bind(this); - this.handleDismissCompare = this.handleDismissCompare.bind(this); } /** @@ -125,35 +124,6 @@ class HistoryViewer extends Component { this.handleSetPage(currentPage - 1); } - /** - * Handler to exit compare mode - */ - handleDismissCompare() { - this.props.onDismissCompare(); - } - - /** - * Renders a notice indicating the user is in compare mode (if compare mode is active) - * - * @returns {string} - */ - renderCompareWarning() { - if (!this.props.compareMode) { - return ''; - } - - return ( -
- - {i18n._t('HistoryViewer.COMPARE_MODE', 'Compare mode')}: - {i18n._t('HistoryViewer.SELECT_PROMPT', 'Select two versions')} - - -
- ); - } /** * Renders the detail form for a selected version * @@ -333,7 +303,6 @@ HistoryViewer.propTypes = { actions: PropTypes.object, onSelect: PropTypes.func, onSetPage: PropTypes.func, - onDismissCompare: PropTypes.func, }; HistoryViewer.defaultProps = { From 9ac05c7c8fd2438ebb9f8a3941197c46cd46ed65 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 23 Jul 2018 15:40:59 +1200 Subject: [PATCH 23/44] FIX Set min-width for compare enabled table to 100% to prevent margin overflow --- .../HistoryViewer/HistoryViewer.scss | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index fa15721d..becf19ea 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -38,11 +38,15 @@ } } -.history-viewer__table--current { - &.history-viewer__table--compare { - margin-left: 0; - margin-right: 0; - } +.history-viewer__table--compare { + margin-left: 0; + margin-right: 0; + min-width: 100%; +} + +.history-viewer__version-detail--compare { + margin-left: $panel-padding-x; + margin-right: $panel-padding-x; } // Table cell containing action buttons, e.g. compare and close @@ -54,16 +58,9 @@ white-space: nowrap; } -.history-viewer__version-detail { - &.history-viewer__version-detail--compare { - margin-left: $panel-padding-x; - margin-right: $panel-padding-x; - } - - // Bring any CMS tabs in the detail view closer to the table above it - .nav-tabs { - margin-top: -$panel-padding-y; - } +// Bring any CMS tabs in the detail view closer to the table above it +.history-viewer__version-detail .nav-tabs { + margin-top: -$panel-padding-y; } .history-viewer__compare-button { @@ -137,7 +134,6 @@ } .history-viewer__heading { - .author-compare-toggle__container { display: flex; @@ -164,6 +160,7 @@ margin-top: .5rem; } } + .form-check-label { text-transform: none; } From 35afd7fbb2f0bd330fc68fc9b52197ccd024be63 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 23 Jul 2018 16:42:02 +1200 Subject: [PATCH 24/44] FIX Padding and scrolling around detail views is now consistent As well, component class names are updated to use BEM conventions and reduce CSS nesting levels --- .../HistoryViewer/HistoryViewer.scss | 60 +++++++++---------- .../HistoryViewer/HistoryViewerHeading.js | 10 ++-- .../HistoryViewerVersionDetail.js | 23 +++++-- .../tests/HistoryViewerHeading-test.js | 4 +- 4 files changed, 50 insertions(+), 47 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index becf19ea..fdcec8da 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -12,6 +12,11 @@ cursor: pointer; } +// In detail views, pulls the content (and content tabs) closer to the selected version table +.history-viewer__table--current { + margin-bottom: $panel-padding-y / 2; +} + // Used in conjunction with .panel--padded, removes top and bottom padding .panel--padded-side { padding-bottom: 0; @@ -38,12 +43,6 @@ } } -.history-viewer__table--compare { - margin-left: 0; - margin-right: 0; - min-width: 100%; -} - .history-viewer__version-detail--compare { margin-left: $panel-padding-x; margin-right: $panel-padding-x; @@ -133,37 +132,32 @@ } } -.history-viewer__heading { - .author-compare-toggle__container { - display: flex; - - .author-span { - align-self: flex-end; - } - - .compare-dropdown { - margin-left: auto; +// Don't let the actions column take up an equal portion of the calculated table width, +// and ensure that its height doesn't push out the heading +.table th.history-viewer-heading__toggle { + width: 1%; + padding-top: 0; + padding-bottom: 0; + vertical-align: middle; + text-align: right; +} - button { - &::before { - margin-right: 0; - } - } +// Labels are capitalised by default +.history-viewer-heading__toggle-dropdown .form-check-label { + text-transform: none; +} - &.show { - .dropdown-menu { - min-width: 14rem; - } - } +.history-viewer-heading__toggle-dropdown { + .btn[class*=font-icon-]:before { + margin-right: 0; + } - .form-check { - margin-top: .5rem; - } - } + &.show .dropdown-menu { + min-width: 14rem; + } - .form-check-label { - text-transform: none; - } + .form-check { + margin-top: .5rem; } } diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index 86b41a2e..b3ad33a7 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -39,14 +39,12 @@ class HistoryViewerHeading extends Component { # {i18n._t('HistoryViewer.Record', 'Record')} - - {i18n._t('HistoryViewer.Author', 'Author')} - - + {i18n._t('HistoryViewer.Author', 'Author')} + @@ -54,7 +52,7 @@ class HistoryViewerHeading extends Component { diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index e9df6703..f95ec1e7 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -122,17 +122,28 @@ class HistoryViewerVersionDetail extends PureComponent { render() { const { ListComponent, schemaUrl, CompareWarningComponent } = this.props; - const containerClasses = this.isPreviewable() ? 'panel panel--padded panel--padded-side panel--scrollable' : ''; - - const extraListClasses = classnames({ 'history-viewer__table--compare': this.isCompareMode() }, 'history-viewer__table--current'); - const formClasses = classnames({ 'history-viewer__version-detail--compare': this.isCompareMode() }, 'history-viewer__version-detail'); + const containerClasses = [ + 'flexbox-area-grow', + 'panel', + 'panel--scrollable', + 'panel--padded', + 'panel--padded-side', + ]; + const extraListClasses = { + 'history-viewer__table--current': true, + 'history-viewer__table--compare': this.isCompareMode(), + }; + const formClasses = { + 'history-viewer__version-detail': true, + 'history-viewer__version-detail--compare': this.isCompareMode(), + }; return (
-
+
diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js index 1e6b549c..782131a8 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerHeading-test.js @@ -24,7 +24,7 @@ describe('HistoryViewerHeading', () => { ); it('should dispatch an action to disable the compare mode', () => { - wrapper.find('.compare-mode__checkbox').at(0).simulate('change'); + wrapper.find('.history-viewer-heading__compare-mode-checkbox').at(0).simulate('change'); expect(mockOnCompareModeUnselect).toHaveBeenCalled(); }); }); @@ -39,7 +39,7 @@ describe('HistoryViewerHeading', () => { ); it('should dispatch an action to enable the compare mode', () => { - wrapper.find('.compare-mode__checkbox').at(0).simulate('change'); + wrapper.find('.history-viewer-heading__compare-mode-checkbox').at(0).simulate('change'); expect(mockOnCompareModeSelect).toHaveBeenCalled(); }); }); From 064bb9a6544a78212ba23b946b57454ebed4dbdb Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 24 Jul 2018 12:16:59 +1200 Subject: [PATCH 25/44] NEW Add behat tests for using compare mode --- tests/Behat/Context/FeatureContext.php | 35 ++++++++++++++++ tests/Behat/features/compare-mode.feature | 51 +++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 tests/Behat/features/compare-mode.feature diff --git a/tests/Behat/Context/FeatureContext.php b/tests/Behat/Context/FeatureContext.php index db918659..f2796c85 100644 --- a/tests/Behat/Context/FeatureContext.php +++ b/tests/Behat/Context/FeatureContext.php @@ -65,6 +65,41 @@ public function iClickOnVersion($versionNo) $this->clickVersion($desiredVersion); } + /** + * @Given I open the history viewer actions menu + */ + public function iOpenTheHistoryViewerActionsMenu() + { + $button = $this->getSession()->getPage()->find('css', '.history-viewer-heading__toggle .btn'); + assertNotNull($button, 'History viewer actions menu not found in the page.'); + + $button->click(); + } + + /** + * @Then the text :text should be deleted + */ + public function theTextShouldBeDeleted($text) + { + $result = $this->getSession()->getPage()->find( + 'xpath', + sprintf('//del[contains(normalize-space(string(.)), \'%s\')]', $text) + ); + assertNotNull($result, $text . ' was not shown as deleted'); + } + + /** + * @Then the text :text should be added + */ + public function theTextShouldBeAdded($text) + { + $result = $this->getSession()->getPage()->find( + 'xpath', + sprintf('//ins[contains(normalize-space(string(.)), \'%s\')]', $text) + ); + assertNotNull($result, $text . ' was not shown as added'); + } + /** * Click on the given version * diff --git a/tests/Behat/features/compare-mode.feature b/tests/Behat/features/compare-mode.feature new file mode 100644 index 00000000..6e3e3f1d --- /dev/null +++ b/tests/Behat/features/compare-mode.feature @@ -0,0 +1,51 @@ +@javascript +Feature: Compare mode + As a cms author + I want to enter compare mode + So that I can compare changes between two versions + + Background: + Given I have a config file "enable-historyviewer.yml" + And a "page" "Home" with "Content"="

Hello world

" + + Given I am logged in with "ADMIN" permissions + And I go to "/admin/pages" + And I click on "Home" in the tree + Then I click on "History" in the header tabs + + Scenario: The dropdown toggle can enable compare mode + Given I open the history viewer actions menu + Then I should see text matching "Compare two versions" + + When I check "Compare two versions" + Then I should see text matching "Compare mode" + + When I press the "Exit" button + Then I should not see text matching "Compare mode" + + Scenario: I can enter compare mode from the detail screen + Given I click on the first version + Then I should see a "Compare" button + + When I press the "Compare" button + Then I should see text matching "Compare mode" + + When I click on version 1 + Then I should see text matching "Compare mode" + And I should see text matching "Select two versions" + + Scenario: Changes between versions are highlighted + Given I click on "Content" in the header tabs + Then I fill in the "Content" HTML field with "

Hello universe

" + And I press the "Save" button + # This is a workaround @todo remove when https://github.com/silverstripe/silverstripe-cms/issues/2128 is resolved in framework + And I go to "/admin/pages/history/show/1" + And I wait for 3 seconds + Then I should see a list of versions + + When I open the history viewer actions menu + And I check "Compare two versions" + And I click on the first version + And I click on version 1 + Then the text "world" should be deleted + And the text "universe" should be added From 4900fed1a0a756b1d26b74fc18938546b0f9ba81 Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Tue, 24 Jul 2018 15:11:56 +1200 Subject: [PATCH 26/44] Simplifying actions definitions that dispatch a single action --- .../historyviewer/HistoryViewerActions.js | 54 +++++++------------ 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/client/src/state/historyviewer/HistoryViewerActions.js b/client/src/state/historyviewer/HistoryViewerActions.js index 9812a6b9..35d9676b 100644 --- a/client/src/state/historyviewer/HistoryViewerActions.js +++ b/client/src/state/historyviewer/HistoryViewerActions.js @@ -25,10 +25,8 @@ export function showVersion(id) { * @returns {function} */ export function showList() { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.SHOW_LIST, - }); + return { + type: HISTORY_VIEWER.SHOW_LIST, }; } @@ -39,11 +37,9 @@ export function showList() { * @returns {function} */ export function setCurrentPage(page) { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.SET_CURRENT_PAGE, - payload: { page }, - }); + return { + type: HISTORY_VIEWER.SET_CURRENT_PAGE, + payload: { page }, }; } @@ -55,11 +51,9 @@ export function setCurrentPage(page) { * @returns {function} */ export function addMessage(message, type = 'success') { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.ADD_MESSAGE, - payload: { id: uuidv1(), message, type }, - }); + return { + type: HISTORY_VIEWER.ADD_MESSAGE, + payload: { id: uuidv1(), message, type }, }; } @@ -69,11 +63,9 @@ export function addMessage(message, type = 'success') { * @returns {function} */ export function clearMessages() { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.CLEAR_MESSAGES, - payload: {}, - }); + return { + type: HISTORY_VIEWER.CLEAR_MESSAGES, + payload: {}, }; } @@ -84,11 +76,9 @@ export function clearMessages() { * @returns {function} */ export function setCompareMode(enabled) { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.SET_COMPARE_MODE, - payload: { enabled }, - }); + return { + type: HISTORY_VIEWER.SET_COMPARE_MODE, + payload: { enabled }, }; } @@ -99,11 +89,9 @@ export function setCompareMode(enabled) { * @returns {function} */ export function setCompareFrom(version) { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.SET_COMPARE_FROM, - payload: { version }, - }); + return { + type: HISTORY_VIEWER.SET_COMPARE_FROM, + payload: { version }, }; } @@ -114,10 +102,8 @@ export function setCompareFrom(version) { * @returns {function} */ export function setCompareTo(version) { - return (dispatch) => { - dispatch({ - type: HISTORY_VIEWER.SET_COMPARE_TO, - payload: { version }, - }); + return { + type: HISTORY_VIEWER.SET_COMPARE_TO, + payload: { version }, }; } From 6c421b5ef15f2ffd21ec8d36ebbc7de2cb034ea0 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 24 Jul 2018 15:17:11 +1200 Subject: [PATCH 27/44] FIX Badge margin is moved to the text to allow it to break lines nicely on mobile --- client/src/components/HistoryViewer/HistoryViewer.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index fdcec8da..0640b19c 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -27,8 +27,8 @@ position: relative; } -.history-viewer__version-state .badge { - margin-left: 10px; +.history-viewer__version-state .text-muted { + margin-right: 10px; } .table .history-viewer__row--current { From 6a8b7eaae6af4ca0e44f7822edfb85362b51270d Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Tue, 24 Jul 2018 15:39:12 +1200 Subject: [PATCH 28/44] Removing option to fix compare notice & adding padding under it --- .../components/HistoryViewer/HistoryViewer.js | 22 +++++++++++++++++-- .../HistoryViewer/HistoryViewer.scss | 9 ++++---- .../HistoryViewerCompareWarning.js | 18 ++------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index 71367dd4..c86e6997 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -11,6 +11,7 @@ import Loading from 'components/Loading/Loading'; import { setCurrentPage, showVersion } from 'state/historyviewer/HistoryViewerActions'; import { versionType } from 'types/versionType'; import { compareType } from 'types/compareType'; +import classNames from 'classnames'; /** * The HistoryViewer component is abstract, and requires an Injector component @@ -65,6 +66,22 @@ class HistoryViewer extends Component { return edges.map((version) => version.node); } + /** + * Returns a string to be used as the "class" attribute on the history viewer container + * + * @returns {string} + */ + getContainerClasses() { + const classes = ['history-viewer', 'fill-height']; + + if (this.props.compare) { + classes.push('history-viewer__compare-mode'); + } + + return classNames(classes); + } + + /** * Get the latest (highest) version number from the list available. If we are not on page * zero then it's always false, because there are higher versions that we aren't aware of @@ -176,7 +193,7 @@ class HistoryViewer extends Component { }; return ( -
+
); @@ -233,8 +250,9 @@ class HistoryViewer extends Component { renderVersionList() { const { isPreviewable, ListComponent, CompareWarningComponent } = this.props; + return ( -
+
.panel--padded { padding-top: 0; } + + &.history-viewer__compare-mode .panel--padded { + padding-top: 30px; + } } .history-viewer__table:not(.history-viewer__table--current) tbody tr:hover { @@ -108,10 +112,7 @@ border-top: none; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; - - &.fixed { - position: absolute; - } + position: absolute; .notice-message { padding: .4rem 1rem .4rem 1.5rem; diff --git a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js index 8cbc90c5..aebf5a84 100644 --- a/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js +++ b/client/src/components/HistoryViewer/HistoryViewerCompareWarning.js @@ -2,7 +2,6 @@ import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import i18n from 'i18n'; import { setCompareMode } from 'state/historyviewer/HistoryViewerActions'; -import classNames from 'classnames'; class HistoryViewerCompareWarning extends Component { constructor(props) { @@ -21,20 +20,12 @@ class HistoryViewerCompareWarning extends Component { * @returns {string} */ render() { - const { isCompare, fixed } = this.props; - - if (!isCompare) { + if (!this.props.isCompare) { return null; } - const classes = ['history-viewer__compare-notice']; - - if (fixed) { - classes.push('fixed'); - } - return ( -
+
{i18n._t('HistoryViewer.COMPARE_MODE', 'Compare mode')}: {i18n._t('HistoryViewer.SELECT_PROMPT', 'Select two versions')} @@ -49,11 +40,6 @@ class HistoryViewerCompareWarning extends Component { HistoryViewerCompareWarning.propTypes = { isCompare: PropTypes.bool.isRequired, - fixed: PropTypes.bool.isRequired, -}; - -HistoryViewerCompareWarning.defaultProps = { - fixed: false, }; function mapStateToProps(state) { From 3dabca1d56c28ea2f418ae943dfb7c25dae9bb5f Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Tue, 24 Jul 2018 16:08:47 +1200 Subject: [PATCH 29/44] Use classnames helper on object defined classes --- .../src/components/HistoryViewer/HistoryViewerVersionDetail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index f95ec1e7..26a80142 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -148,7 +148,7 @@ class HistoryViewerVersionDetail extends PureComponent { versions={this.getListVersions()} /> -
+
Date: Tue, 24 Jul 2018 16:43:08 +1200 Subject: [PATCH 30/44] FIX History viewer list is now rendered as an unordered list instead of a table --- .../HistoryViewer/HistoryViewer.scss | 63 --------------- .../HistoryViewer/HistoryViewerHeading.js | 20 +++-- .../HistoryViewer/HistoryViewerHeading.scss | 23 ++++++ .../HistoryViewer/HistoryViewerVersion.js | 37 ++++++--- .../HistoryViewerVersionDetail.js | 1 + .../HistoryViewer/HistoryViewerVersionList.js | 32 ++++---- .../HistoryViewerVersionList.scss | 81 +++++++++++++++++++ .../tests/HistoryViewerVersionList-test.js | 8 +- client/src/styles/bundle.scss | 2 + tests/Behat/Context/FeatureContext.php | 2 +- 10 files changed, 164 insertions(+), 105 deletions(-) create mode 100644 client/src/components/HistoryViewer/HistoryViewerHeading.scss create mode 100644 client/src/components/HistoryViewer/HistoryViewerVersionList.scss diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index f3a6b812..db6fd152 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -1,8 +1,4 @@ .history-viewer { - td:first-child { - width: 1%; - } - > .panel--padded { padding-top: 0; } @@ -12,15 +8,6 @@ } } -.history-viewer__table:not(.history-viewer__table--current) tbody tr:hover { - cursor: pointer; -} - -// In detail views, pulls the content (and content tabs) closer to the selected version table -.history-viewer__table--current { - margin-bottom: $panel-padding-y / 2; -} - // Used in conjunction with .panel--padded, removes top and bottom padding .panel--padded-side { padding-bottom: 0; @@ -35,32 +22,11 @@ margin-right: 10px; } -.table .history-viewer__row--current { - // There will only be one table row in this table state - &, &:hover { - background-color: $link-color; - color: $white; - } - - .text-muted { - color: $white !important; - } -} - .history-viewer__version-detail--compare { margin-left: $panel-padding-x; margin-right: $panel-padding-x; } -// Table cell containing action buttons, e.g. compare and close -.table .history-viewer__actions { - padding: 0; - text-align: right; - width: 1%; - vertical-align: middle; - white-space: nowrap; -} - // Bring any CMS tabs in the detail view closer to the table above it .history-viewer__version-detail .nav-tabs { margin-top: -$panel-padding-y; @@ -133,35 +99,6 @@ } } -// Don't let the actions column take up an equal portion of the calculated table width, -// and ensure that its height doesn't push out the heading -.table th.history-viewer-heading__toggle { - width: 1%; - padding-top: 0; - padding-bottom: 0; - vertical-align: middle; - text-align: right; -} - -// Labels are capitalised by default -.history-viewer-heading__toggle-dropdown .form-check-label { - text-transform: none; -} - -.history-viewer-heading__toggle-dropdown { - .btn[class*=font-icon-]:before { - margin-right: 0; - } - - &.show .dropdown-menu { - min-width: 14rem; - } - - .form-check { - margin-top: .5rem; - } -} - .history-viewer__version-detail-diff { del { color: #f44; diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index b3ad33a7..97e74549 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -36,15 +36,19 @@ class HistoryViewerHeading extends Component { const { compareModeSelected } = this.props; const { dropdownOpen } = this.state; return ( - - # - {i18n._t('HistoryViewer.Record', 'Record')} - {i18n._t('HistoryViewer.Author', 'Author')} - +
  • + # + + {i18n._t('HistoryViewer.Record', 'Record')} + + + {i18n._t('HistoryViewer.Author', 'Author')} + + @@ -62,8 +66,8 @@ class HistoryViewerHeading extends Component {
  • - - + + ); } } diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.scss b/client/src/components/HistoryViewer/HistoryViewerHeading.scss new file mode 100644 index 00000000..b1743cfe --- /dev/null +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.scss @@ -0,0 +1,23 @@ +// Labels are capitalised by default +.history-viewer__actions-dropdown .form-check-label { + text-transform: none; +} + +.history-viewer__actions-dropdown { + .btn[class*=font-icon-]:before { + margin-right: 0; + } + + &.show .dropdown-menu { + min-width: 14rem; + } + + .form-check { + margin-top: .5rem; + } +} + +.history-viewer__heading { + font-size: $font-size-sm; + text-transform: uppercase; +} diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index c9408d46..a1d48e05 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -6,6 +6,7 @@ import { versionType, defaultVersion } from 'types/versionType'; import { compareType } from 'types/compareType'; import { showVersion, setCompareMode, setCompareFrom, setCompareTo } from 'state/historyviewer/HistoryViewerActions'; import i18n from 'i18n'; +import classNames from 'classnames'; class HistoryViewerVersion extends Component { constructor(props) { @@ -43,7 +44,7 @@ class HistoryViewerVersion extends Component { // If the clear button is shown, don't do anything when clicking on the row if (isActive) { - return; + return false; } if (compare) { @@ -51,6 +52,8 @@ class HistoryViewerVersion extends Component { } else { onSelect(version.Version); } + + return false; } /** @@ -131,33 +134,45 @@ class HistoryViewerVersion extends Component { if (!isActive && !compareMode) { return ( - + ); } return ( - + {this.renderCompareButton()} {this.renderClearButton()} - + ); } render() { const { version, isActive, StateComponent } = this.props; + const classnames = classNames({ + 'history-viewer__row': true, + 'history-viewer__row--current': isActive, + }); + + const rowTitle = i18n._t('HistoryViewerVersion.GO_TO_VERSION', 'Go to version {version}'); + return ( - - {version.Version} - +
  • + + {version.Version} - - {this.getAuthor()} - {this.renderActions()} - + {this.getAuthor()} + {this.renderActions()} + +
  • ); } } diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index 26a80142..21e50fdd 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -130,6 +130,7 @@ class HistoryViewerVersionDetail extends PureComponent { 'panel--padded-side', ]; const extraListClasses = { + 'history-viewer__table': true, 'history-viewer__table--current': true, 'history-viewer__table--compare': this.isCompareMode(), }; diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionList.js b/client/src/components/HistoryViewer/HistoryViewerVersionList.js index 611b7187..9efee42d 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionList.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionList.js @@ -68,25 +68,21 @@ class HistoryViewerVersionList extends PureComponent { const { HeadingComponent, VersionComponent, versions } = this.props; return ( -
    +
    {this.renderMessages()} - - - - - - { - versions.map((version) => ( - - )) - } - -
    +
      + + { + versions.map((version) => ( + + )) + } +
    ); } @@ -104,7 +100,7 @@ HistoryViewerVersionList.propTypes = { }; HistoryViewerVersionList.defaultProps = { - extraClass: 'table-hover history-viewer__table', + extraClass: 'history-viewer__table', isActive: false, messages: [], versions: [], diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionList.scss b/client/src/components/HistoryViewer/HistoryViewerVersionList.scss new file mode 100644 index 00000000..ca712b01 --- /dev/null +++ b/client/src/components/HistoryViewer/HistoryViewerVersionList.scss @@ -0,0 +1,81 @@ +// Replicate Bootstrap table stylings relatively closely but using a unordered list +.history-viewer__table { + padding: 0; + + li { + display: flex; + list-style-type: none; + } +} + +.history-viewer__heading, +.history-viewer__row { + border-bottom: 1px solid $table-border-color; +} + +// Add colours to the table rows +.history-viewer__row { + background-color: $table-accent-bg; + + &:hover, + &:active { + background-color: $table-hover-bg; + } +} + +.history-viewer__version-anchor { + color: inherit; + display: flex; + flex-grow: 1; // use up 3 columns worth of space by default + + &:hover, + &:active { + color: inherit; + text-decoration: none; + } +} + +// Give all columns equal width to start with, and table padding +.history-viewer__version-no, +.history-viewer__version-state, +.history-viewer__author, +.history-viewer__actions { + padding: $table-cell-padding; +} + +.history-viewer__version-state, +.history-viewer__author { + flex-grow: 1; + width: 50%; +} + +// Remove padding in the heading's last column so it doesn't push padding in the others +.history-viewer__actions { + padding-top: 0; + padding-bottom: 0; + display: flex; + align-items: center; + justify-content: flex-end; // right alignment + min-width: 12rem; // big enough to fit both Compare and "X" close buttons +} + +.table .history-viewer__row--current { + // There will only be one table row in this table state + &, &:hover { + background-color: $link-color; + color: $white; + } + + .text-muted { + color: $white !important; + } +} + +.history-viewer__table:not(.history-viewer__table--current) .history-viewer__version-anchor:hover { + cursor: pointer; +} + +// In detail views, pulls the content (and content tabs) closer to the selected version table +.history-viewer__table--current { + margin-bottom: $panel-padding-y / 2; +} diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerVersionList-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerVersionList-test.js index a36e9c68..e17f0e6d 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerVersionList-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerVersionList-test.js @@ -6,7 +6,7 @@ import { Component as HistoryViewerVersionList } from '../HistoryViewerVersionLi describe('HistoryViewerVersionList', () => { const FormAlertComponent = () =>
    ; - const HeadingComponent = () => ; + const HeadingComponent = () =>
  • ; const VersionComponent = () =>
    ; const component = ReactTestUtils.renderIntoDocument( @@ -19,13 +19,13 @@ describe('HistoryViewerVersionList', () => { ); describe('render()', () => { - it('returns a table', () => { + it('returns an unordered list', () => { const list = ReactTestUtils.scryRenderedDOMComponentsWithTag( component, - 'table' + 'ul' ); - expect(list[0].className).toContain('table-hover'); + expect(list[0].className).toContain('history-viewer__table'); }); }); }); diff --git a/client/src/styles/bundle.scss b/client/src/styles/bundle.scss index 9ca21417..4c552a0b 100644 --- a/client/src/styles/bundle.scss +++ b/client/src/styles/bundle.scss @@ -9,3 +9,5 @@ // Components @import "../components/HistoryViewer/HistoryViewer"; +@import "../components/HistoryViewer/HistoryViewerHeading"; +@import "../components/HistoryViewer/HistoryViewerVersionList"; diff --git a/tests/Behat/Context/FeatureContext.php b/tests/Behat/Context/FeatureContext.php index f2796c85..fcfb4055 100644 --- a/tests/Behat/Context/FeatureContext.php +++ b/tests/Behat/Context/FeatureContext.php @@ -70,7 +70,7 @@ public function iClickOnVersion($versionNo) */ public function iOpenTheHistoryViewerActionsMenu() { - $button = $this->getSession()->getPage()->find('css', '.history-viewer-heading__toggle .btn'); + $button = $this->getSession()->getPage()->find('css', '.history-viewer__heading .history-viewer__actions .btn'); assertNotNull($button, 'History viewer actions menu not found in the page.'); $button->click(); From dee3fc286fc7448e24222640167e37ae95ec705b Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 24 Jul 2018 23:51:21 +1200 Subject: [PATCH 31/44] NEW History Viewer now uses ViewModeToggle to control the preview panel --- .../components/HistoryViewer/HistoryViewer.js | 26 +++++-- .../HistoryViewer/HistoryViewerToolbar.js | 11 ++- .../HistoryViewerVersionDetail.js | 74 +++++++++++++------ .../tests/HistoryViewerToolbar-test.js | 2 + package.json | 3 +- 5 files changed, 84 insertions(+), 32 deletions(-) diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index c86e6997..d4cf9cf0 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -12,6 +12,8 @@ import { setCurrentPage, showVersion } from 'state/historyviewer/HistoryViewerAc import { versionType } from 'types/versionType'; import { compareType } from 'types/compareType'; import classNames from 'classnames'; +import ResizeAware from 'react-resize-aware'; +import * as viewModeActions from 'state/viewMode/viewModeActions'; /** * The HistoryViewer component is abstract, and requires an Injector component @@ -155,6 +157,7 @@ class HistoryViewer extends Component { schemaUrl, VersionDetailComponent, compare, + previewState, } = this.props; // Insert variables into the schema URL via regex replacements @@ -190,12 +193,13 @@ class HistoryViewer extends Component { schemaUrl: schemaUrl.replace(schemaSearch, (match) => schemaReplacements[match]), version, compare: compareProps, + previewState, }; return ( -
    + this.props.onResize(width)} > -
    + ); } @@ -318,9 +322,11 @@ HistoryViewer.propTypes = { }), page: PropTypes.number, schemaUrl: PropTypes.string, + previewState: PropTypes.oneOf(['edit', 'preview', 'split']), actions: PropTypes.object, onSelect: PropTypes.func, onSetPage: PropTypes.func, + onResize: PropTypes.func, }; HistoryViewer.defaultProps = { @@ -346,10 +352,13 @@ function mapStateToProps(state) { compare, } = state.versionedAdmin.historyViewer; + const { activeState } = state.viewMode; + return { page: currentPage, currentVersion, - compare + compare, + previewState: activeState, }; } @@ -361,6 +370,9 @@ function mapDispatchToProps(dispatch) { onSetPage(page) { dispatch(setCurrentPage(page)); }, + onResize(panelWidth) { + dispatch(viewModeActions.enableOrDisableSplitMode(panelWidth)); + } }; } @@ -371,10 +383,10 @@ export default compose( historyViewerConfig, inject( ['HistoryViewerVersionList', 'HistoryViewerVersionDetail', 'HistoryViewerCompareWarning'], - (HistoryViewerVersionList, HistoryViewerVersionDetail, HistoryViewerCompareWarning) => ({ - ListComponent: HistoryViewerVersionList, - VersionDetailComponent: HistoryViewerVersionDetail, - CompareWarningComponent: HistoryViewerCompareWarning, + (ListComponent, VersionDetailComponent, CompareWarningComponent) => ({ + ListComponent, + VersionDetailComponent, + CompareWarningComponent, }), ({ contextKey }) => `VersionedAdmin.HistoryViewer.${contextKey}` ) diff --git a/client/src/components/HistoryViewer/HistoryViewerToolbar.js b/client/src/components/HistoryViewer/HistoryViewerToolbar.js index cb6947c7..09243394 100644 --- a/client/src/components/HistoryViewer/HistoryViewerToolbar.js +++ b/client/src/components/HistoryViewer/HistoryViewerToolbar.js @@ -24,7 +24,7 @@ class HistoryViewerToolbar extends Component { } render() { - const { FormActionComponent, isLatestVersion } = this.props; + const { FormActionComponent, ViewModeComponent, isLatestVersion, isPreviewable } = this.props; return (
    @@ -42,6 +42,7 @@ class HistoryViewerToolbar extends Component { disabled={isLatestVersion} title={i18n._t('HistoryViewerToolbar.REVERT_TO_VERSION', 'Revert to this version')} /> + { isPreviewable && }
    ); @@ -53,7 +54,9 @@ HistoryViewerToolbar.propTypes = { revertToVersion: PropTypes.func.isRequired, }), FormActionComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, + ViewModeComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, isLatestVersion: PropTypes.bool, + isPreviewable: PropTypes.bool, onAfterRevert: PropTypes.func, recordId: PropTypes.number.isRequired, versionId: PropTypes.number.isRequired, @@ -61,6 +64,7 @@ HistoryViewerToolbar.propTypes = { HistoryViewerToolbar.defaultProps = { isLatestVersion: false, + isPreviewable: false, }; function mapStateToProps() { @@ -86,9 +90,10 @@ export { HistoryViewerToolbar as Component }; export default compose( connect(mapStateToProps, mapDispatchToProps), inject( - ['FormAction'], - (FormActionComponent) => ({ + ['FormAction', 'ViewModeToggle'], + (FormActionComponent, ViewModeComponent) => ({ FormActionComponent, + ViewModeComponent, }), () => 'VersionedAdmin.HistoryViewer.Toolbar' ) diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index 21e50fdd..0def4ec9 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -11,6 +11,19 @@ class HistoryViewerVersionDetail extends PureComponent { this.toggleToolbarClass(true); } + /** + * When new props are received (from Redux dispatch events), check whether the preview + * state changes. If so, we want to add or remove the legacy CSS modifier for the CMS + * north toolbar based on whether the view mode is "split" (add) or anything else (remove) + * + * @param {Object} nextProps + */ + componentWillReceiveProps(nextProps) { + if (nextProps.previewState !== this.props.previewState) { + this.toggleToolbarClass(nextProps.previewState === 'split'); + } + } + componentWillUnmount() { this.toggleToolbarClass(false); } @@ -75,9 +88,10 @@ class HistoryViewerVersionDetail extends PureComponent { * @returns {Preview|null} */ renderPreview() { - const { version, PreviewComponent } = this.props; + const { version, PreviewComponent, previewState } = this.props; - if (!this.isPreviewable()) { + // Don't render the preview if the view mode is "edit" + if (!this.isPreviewable() || previewState === 'edit') { return null; } @@ -115,12 +129,23 @@ class HistoryViewerVersionDetail extends PureComponent { isLatestVersion={isLatestVersion} recordId={recordId} versionId={version.Version} + isPreviewable={this.isPreviewable()} /> ); } - render() { - const { ListComponent, schemaUrl, CompareWarningComponent } = this.props; + /** + * Renders the version detail view form + * + * @returns {Object} + */ + renderDetails() { + const { ListComponent, schemaUrl, CompareWarningComponent, previewState } = this.props; + + // Hide when the preview mode is explicitly enabled + if (this.isPreviewable() && previewState === 'preview') { + return null; + } const containerClasses = [ 'flexbox-area-grow', @@ -140,27 +165,33 @@ class HistoryViewerVersionDetail extends PureComponent { }; return ( -
    -
    -
    - +
    + + +
    + - -
    - -
    - - {this.renderToolbar()} -
    + {this.renderToolbar()} + + +
    + ); + } + + render() { + return ( +
    + {this.renderDetails()} {this.renderPreview()}
    ); @@ -183,6 +214,7 @@ HistoryViewerVersionDetail.propTypes = { }), PropTypes.bool, ]), + previewState: PropTypes.oneOf(['edit', 'preview', 'split']), }; HistoryViewerVersionDetail.defaultProps = { diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerToolbar-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerToolbar-test.js index 06f78c95..40157018 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerToolbar-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerToolbar-test.js @@ -6,6 +6,7 @@ import { Component as HistoryViewerToolbar } from '../HistoryViewerToolbar'; describe('HistoryViewerToolbar', () => { const FormActionComponent = () =>
    ; + const ViewModeComponent = () =>
    ; let component = null; let mockRevertMutation; let revertHandler; @@ -22,6 +23,7 @@ describe('HistoryViewerToolbar', () => { onAfterRevert={revertHandler} actions={{ revertToVersion: mockRevertMutation }} FormActionComponent={FormActionComponent} + ViewModeComponent={ViewModeComponent} recordId={123} versionId={234} /> diff --git a/package.json b/package.json index 8fdeceba..515ceea6 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@silverstripe/eslint-config": "^0.0.2", - "@silverstripe/webpack-config": "^0.8.0", + "@silverstripe/webpack-config": "^0.9.0", "babel-jest": "^19.0.0", "enzyme": "^3.3.0", "enzyme-adapter-react-15.4": "^1.0.5", @@ -74,6 +74,7 @@ "react-apollo": "^0.7.1", "react-dom": "15.3.1", "react-redux": "^4.4.5", + "react-resize-aware": "^2.7.1", "react-router": "^2.5.2", "react-router-redux": "^4.0.5", "reactstrap": "^5.0.0-beta", From 786990c71ad61e3487215e51f4ceb1b353557585 Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 25 Jul 2018 10:29:23 +1200 Subject: [PATCH 32/44] Add tests for HistoryViewerVersion --- .../tests/HistoryViewerVersion-test.js | 123 ++++++++++++++++++ client/src/types/compareType.js | 2 +- 2 files changed, 124 insertions(+), 1 deletion(-) diff --git a/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js b/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js index fd9429a8..2b63255f 100644 --- a/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js +++ b/client/src/components/HistoryViewer/tests/HistoryViewerVersion-test.js @@ -13,10 +13,15 @@ describe('HistoryViewerVersion', () => { const FormActionComponent = () =>
    ; let mockOnCompare; + let mockOnCompareSelect; + let mockOnSelect; let version = {}; beforeEach(() => { mockOnCompare = jest.fn(); + mockOnCompareSelect = jest.fn(); + mockOnSelect = jest.fn(); + version = { Version: 3, Published: false, @@ -71,5 +76,123 @@ describe('HistoryViewerVersion', () => { expect(wrapper.instance().getAuthor()).toEqual('Sarah Smith'); }); + + describe('handleClick()', () => { + it('does nothing on row click when the clear button is shown', () => { + const wrapper = shallow( + + ); + + wrapper.simulate('click'); + expect(mockOnCompareSelect).not.toHaveBeenCalled(); + expect(mockOnSelect).not.toHaveBeenCalled(); + }); + + it('renders version details when version clicked', () => { + const wrapper = shallow( + + ); + + wrapper.instance().handleClick(); + expect(mockOnCompareSelect).not.toHaveBeenCalled(); + expect(mockOnSelect).toHaveBeenCalledWith(version.Version); + }); + + + it('renders the close button in the version details', () => { + const wrapper = shallow( + + ); + + expect(wrapper.find(FormActionComponent).at(1).props().extraClass).toEqual('history-viewer__close-button'); + }); + + it('renders the compare button in the version details', () => { + const wrapper = shallow( + + ); + + expect(wrapper.find(FormActionComponent).at(0).props().extraClass).toEqual('history-viewer__compare-button'); + }); + + it('chooses version when version clicked in compare mode', () => { + const wrapper = shallow( + + ); + + wrapper.instance().handleClick(); + expect(mockOnCompareSelect).toHaveBeenCalled(); + expect(mockOnSelect).not.toHaveBeenCalled(); + }); + }); + + describe('handleClose()', () => { + it('return back to list view when closing version via action dispatch', () => { + const wrapper = shallow( + + ); + + wrapper.instance().handleClose(); + expect(mockOnCompareSelect).not.toHaveBeenCalled(); + expect(mockOnSelect).toHaveBeenCalled(); + }); + + it('deselect version when closing version in compare mode', () => { + const wrapper = shallow( + + ); + + wrapper.instance().handleClose(); + expect(mockOnCompareSelect).toHaveBeenCalled(); + expect(mockOnSelect).not.toHaveBeenCalled(); + }); + }); }); }); diff --git a/client/src/types/compareType.js b/client/src/types/compareType.js index d5abecd6..c27d2b9d 100644 --- a/client/src/types/compareType.js +++ b/client/src/types/compareType.js @@ -1,7 +1,7 @@ import { PropTypes } from 'react'; // Describes the data structure for compare version storage -const compareType = PropTypes.oneOf([false, PropTypes.shape({ +const compareType = PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({ versionFrom: PropTypes.number, versionTo: PropTypes.number })]); From 6b5b3d4ad7d00e5a47433ace0f3e6fabff954b23 Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 25 Jul 2018 14:48:03 +1200 Subject: [PATCH 33/44] Update feature context since the versions are list items now instead of table elements --- tests/Behat/Context/FeatureContext.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/Behat/Context/FeatureContext.php b/tests/Behat/Context/FeatureContext.php index fcfb4055..6bc312df 100644 --- a/tests/Behat/Context/FeatureContext.php +++ b/tests/Behat/Context/FeatureContext.php @@ -52,7 +52,7 @@ public function iClickOnTheFirstVersion() */ public function iClickOnVersion($versionNo) { - $versions = $this->getVersions(' td:first-child'); + $versions = $this->getVersions(' .history-viewer__version-anchor .history-viewer__version-no'); $desiredVersion = null; foreach ($versions as $version) { /** @var NodeElement $version */ @@ -121,13 +121,12 @@ protected function clickVersion(NodeElement $version) */ protected function getVersions($modifier = '') { - // Wait for the table to be visible + // Wait for the list to be visible $this->getSession()->wait(3000, 'window.jQuery(".history-viewer .table").length > 0'); $versions = $this->getSession() ->getPage() - ->findAll('css', '.history-viewer .table tbody tr' . $modifier); - + ->findAll('css', '.history-viewer__list .history-viewer__table .history-viewer__row' . $modifier); return $versions; } @@ -156,7 +155,7 @@ public function iShouldSeeTheBadge($negative, $text) public function iShouldSeeInTheAuthorColumn($text, $versionNumber) { $version = $this->getSpecificVersion($versionNumber); - $authorColumn = $version->find('css', 'td:nth-of-type(3)'); + $authorColumn = $version->find('css', '.history-viewer__version-anchor .history-viewer__author'); $exists = strpos($authorColumn->getText(), $text) !== false; assertTrue($exists, 'Author column contains ' . $text); @@ -170,7 +169,7 @@ public function iShouldSeeInTheAuthorColumn($text, $versionNumber) public function iShouldSeeInTheRecordColumn($text, $versionNumber) { $version = $this->getSpecificVersion($versionNumber); - $recordColumn = $version->find('css', 'td:nth-of-type(2)'); + $recordColumn = $version->find('css', '.history-viewer__version-anchor .history-viewer__version-state'); $exists = strpos($recordColumn->getText(), $text) !== false; assertTrue($exists, 'Record column contains ' . $text); @@ -182,7 +181,7 @@ public function iShouldSeeInTheRecordColumn($text, $versionNumber) public function iShouldSeeInTheVersionColumn($text, $versionNumber) { $version = $this->getSpecificVersion($versionNumber); - $versionColumn = $version->find('css', 'td'); + $versionColumn = $version->find('css', '.history-viewer__version-anchor .history-viewer__version-no'); $exists = strpos($versionColumn->getText(), $text) !== false; assertTrue($exists, 'Version column contains ' . $text); From 2758348be0b84fdda27d0dbf5ee4078eece6929e Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Tue, 31 Jul 2018 09:43:49 +1200 Subject: [PATCH 34/44] fix rebase --- client/dist/js/bundle.js | 2 +- client/dist/styles/bundle.css | 2 +- .../HistoryViewer/HistoryViewerHeading.js | 11 +- .../HistoryViewer/HistoryViewerVersion.js | 5 +- yarn.lock | 1766 ++++++++++++++++- 5 files changed, 1718 insertions(+), 68 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 134051aa..95c455e4 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(e){function t(s){if(o[s])return o[s].exports;var n=o[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};t.m=e,t.c=o,t.d=function(e,o,s){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/index.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}var n=o("./client/src/boot/registerComponents.js"),r=s(n),l=o("./client/src/boot/registerReducers.js"),a=s(l);window.document.addEventListener("DOMContentLoaded",function(){(0,r.default)(),(0,a.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),l=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js"),a=s(l),i=o("./client/src/components/HistoryViewer/HistoryViewerHeading.js"),d=s(i),u=o("./client/src/components/HistoryViewer/HistoryViewerToolbar.js"),c=s(u),p=o("./client/src/components/HistoryViewer/HistoryViewerVersion.js"),h=s(p),m=o("./client/src/components/HistoryViewer/HistoryViewerVersionDetail.js"),f=s(m),_=o("./client/src/components/HistoryViewer/HistoryViewerVersionList.js"),g=s(_),y=o("./client/src/components/HistoryViewer/HistoryViewerVersionState.js"),j=s(y);t.default=function(){r.default.component.registerMany({HistoryViewer:a.default,HistoryViewerHeading:d.default,HistoryViewerToolbar:c.default,HistoryViewerVersion:h.default,HistoryViewerVersionDetail:f.default,HistoryViewerVersionList:g.default,HistoryViewerVersionState:j.default})}},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),l=o("redux"),a=o("./client/src/state/historyviewer/HistoryViewerReducer.js"),i=s(a),d=function(){r.default.reducer.register("versionedAdmin",(0,l.combineReducers)({historyViewer:i.default}))};t.default=d},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed"),o("./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed"),o("./client/src/legacy/ArchiveAdmin/ArchiveAdmin.js"),o("./client/src/legacy/HistoryViewer/HistoryViewerEntwine.js"),o("./client/src/boot/index.js")},"./client/src/components/HistoryViewer/HistoryViewerHeading.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("i18n"),r=s(n),l=o("react"),a=s(l),i=function(e){return a.default.createElement("tr",null,a.default.createElement("th",null,"#"),a.default.createElement("th",null,r.default._t("HistoryViewer.Record","Record")),a.default.createElement("th",null,r.default._t("HistoryViewer.Author","Author")),e.hasActions?a.default.createElement("th",null):null)};i.propTypes={hasActions:a.default.PropTypes.bool},i.defaultProps={hasActions:!1},t.default=i},"./client/src/components/HistoryViewer/HistoryViewerToolbar.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(){return{}}function i(e){return{onAfterRevert:function(t){e((0,g.addMessage)(f.default.sprintf(f.default._t("HistoryViewerToolbar.REVERTED_MESSAGE","Successfully reverted to version %s"),t))),e((0,g.showList)())}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:"success";return function(o){o({type:u.default.ADD_MESSAGE,payload:{id:(0,p.default)(),message:e,type:t}})}}function i(){return function(e){e({type:u.default.CLEAR_MESSAGES,payload:{}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.showVersion=n,t.showList=r,t.setCurrentPage=l,t.addMessage=a,t.clearMessages=i;var d=o("./client/src/state/historyviewer/HistoryViewerActionTypes.js"),u=s(d),c=o("./node_modules/uuid/v1.js"),p=s(c)},"./client/src/state/historyviewer/HistoryViewerReducer.js":function(e,t,o){"use strict";function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case a.default.SET_CURRENT_PAGE:return r({},e,{currentPage:n.page});case a.default.SHOW_VERSION:return r({},e,{currentVersion:n.id});case a.default.SHOW_LIST:return r({},e,{currentVersion:0,currentPage:0});case a.default.ADD_MESSAGE:return r({},e,{messages:[n].concat(s(e.messages))});case a.default.CLEAR_MESSAGES:return e.messages.length?r({},e,{messages:[]}):e;default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t1)&&this.getVersions().reduce(function(e,t){return e.Version>t.Version?e:t})}},{key:"handleSetPage",value:function(e){var t=this.props.onSetPage;"function"==typeof t&&t(e+1)}},{key:"handleNextPage",value:function(){var e=this.props.page;this.handleSetPage(e)}},{key:"handlePrevPage",value:function(){var e=this.props.page,t=e-1;if(t<1)return void this.handleSetPage(t);this.handleSetPage(t-1)}},{key:"renderVersionDetail",value:function(){var e=this.props,t=e.currentVersion,o=e.isPreviewable,s=e.recordId,n=e.recordClass,r=e.schemaUrl,l=e.VersionDetailComponent,a={":id":s,":class":n,":version":t},i=this.getVersions().find(function(e){return e.Version===t}),d=this.getLatestVersion(),u={isLatestVersion:d&&d.Version===i.Version,isPreviewable:o,recordId:s,schemaUrl:r.replace(/:id|:class|:version/g,function(e){return a[e]}),version:i};return c.default.createElement("div",{className:"history-viewer fill-height"},c.default.createElement(l,u))}},{key:"renderPagination",value:function(){var e=this.props,t=e.limit,o=e.page,s=e.versions;if(!s)return null;var n=s.Versions?s.Versions.pageInfo.totalCount:0;if(n<=t)return null;var r={setPage:this.handleSetPage,maxPage:Math.ceil(n/t),next:this.handleNextPage,nextText:j.default._t("HistoryViewer.NEXT","Next"),previous:this.handlePrevPage,previousText:j.default._t("HistoryViewer.PREVIOUS","Previous"),currentPage:o-1,useGriddleStyles:!1};return c.default.createElement("div",{className:"griddle-footer"},c.default.createElement(f.default.GridPagination,r))}},{key:"renderVersionList",value:function(){var e=this.props,t=e.isPreviewable,o=e.ListComponent,s=e.onSelect;return c.default.createElement("div",{className:"history-viewer fill-height"},c.default.createElement("div",{className:t?"panel panel--padded panel--scrollable":""},c.default.createElement(o,{onSelect:s,versions:this.getVersions()}),c.default.createElement("div",{className:"history-viewer__pagination"},this.renderPagination())))}},{key:"render",value:function(){var e=this.props,t=e.loading,o=e.currentVersion;return t?c.default.createElement(C.default,null):o?this.renderVersionDetail():this.renderVersionList()}}]),t}(u.Component);S.propTypes={contextKey:u.PropTypes.string,limit:u.PropTypes.number,ListComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,offset:u.PropTypes.number,recordId:u.PropTypes.number.isRequired,currentVersion:u.PropTypes.number,isPreviewable:u.PropTypes.bool,VersionDetailComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,versions:u.PropTypes.shape({Versions:u.PropTypes.shape({pageInfo:u.PropTypes.shape({totalCount:u.PropTypes.number}),edges:u.PropTypes.arrayOf(u.PropTypes.shape({node:w.versionType}))})}),page:u.PropTypes.number,schemaUrl:u.PropTypes.string,actions:u.PropTypes.object,onSelect:u.PropTypes.func,onSetPage:u.PropTypes.func},S.defaultProps={contextKey:"",currentVersion:0,isPreviewable:!1,schemaUrl:"",versions:{Versions:{pageInfo:{totalCount:0},edges:[]}}},t.Component=S,t.default=(0,p.compose)((0,h.connect)(a,i),g.default,(0,v.inject)(["HistoryViewerVersionList","HistoryViewerVersionDetail"],function(e,t){return{ListComponent:e,VersionDetailComponent:t}},function(e){return"VersionedAdmin.HistoryViewer."+e.contextKey}))(S)},"./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultVersion=t.versionType=void 0;var s=o("react"),n=s.PropTypes.shape({FirstName:s.PropTypes.string,Surname:s.PropTypes.string}),r=s.PropTypes.shape({Version:s.PropTypes.number,AbsoluteLink:s.PropTypes.string,LastEdited:s.PropTypes.string,Published:s.PropTypes.boolean,LiveVersion:s.PropTypes.boolean,LatestDraftVersion:s.PropTypes.boolean,Publisher:n,Author:n}),l={Version:0,AbsoluteLink:"",LastEdited:"",Published:!1,LiveVersion:!1,LatestDraftVersion:!1,Publisher:{FirstName:"",Surname:""},Author:{FirstName:"",Surname:""}};t.versionType=r,t.defaultVersion=l},"./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed":function(e,t,o){(function(t){e.exports=t.HistoryViewer=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed":function(e,t,o){(function(t){e.exports=t.versionType=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var s=this.getColumnMetadataByName(e);return void 0===s||null===s?o:s.hasOwnProperty(t)?s[t]:o}},{key:"orderColumns",value:function(e){var t=this;return i(e,function(e){var o=a(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=s.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),s.createElement("div",null)):s.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=n},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t0&&(e=s.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=s.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,r=null,l=null;if(!0===this.props.useGriddleStyles){var a={float:"left",minHeight:"1px",marginTop:"5px"};l=n({textAlign:"right",width:"34%"},a),r=n({textAlign:"center",width:"33%"},a),o=n({width:"33%"},a)}for(var i=[],d=1;d<=this.props.maxPage;d++)i.push(s.createElement("option",{value:d,key:d},d));return s.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},s.createElement("div",{className:this.props.previousClassName,style:o},e),s.createElement("div",{className:"griddle-page",style:r},s.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},i)," / ",this.props.maxPage),s.createElement("div",{className:this.props.nextClassName,style:l},t))}});e.exports=r},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),r=o("./node_modules/lodash/isFunction.js"),l=o("./node_modules/lodash/zipObject.js"),a=o("./node_modules/lodash/assign.js"),i=o("./node_modules/lodash/defaults.js"),d=o("./node_modules/lodash/toPairs.js"),u=o("./node_modules/lodash/without.js"),c=s.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&r(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=l(c,[]),h=a({},this.props.data);i(h,p);var m,f,_=d(n.pick(h,u(c,"children"))),g=_.map(function(t,n){var r=null,l=e.props.columnSettings.getColumnMetadataByName(t[0]),i=0===n&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===n&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===n&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=a(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==l&&null!==l)if(void 0!==l.customComponent&&null!==l.customComponent){var d=s.createElement(l.customComponent,{data:t[1],rowData:h,metadata:l});r=s.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:n,style:o},d)}else r=s.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:n,style:o},i,e.formatData(t[1]));return r||s.createElement("td",{onClick:e.handleClick,key:n,style:o},i,t[1])});null!==this.props.onRowClick&&r(this.props.onRowClick)?(m=null,f=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(m=this.handleSelectClick,f=null):(m=null,f=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),g.unshift(s.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:f},s.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(h),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),s.createElement("tr",{onClick:m,className:y},g)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/lodash/pick.js")),r=s.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return s.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(s.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?n(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var r=null;return e.state.showChildren&&(r=e.props.hasChildren&&this.props.data.children.map(function(t,o){var n=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var r=e.constructor.Griddle;return s.createElement("tr",{key:n,style:{paddingLeft:5}},s.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},s.createElement(r,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return s.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:n})})),!1===e.props.hasChildren?t[0]:s.createElement("tbody",null,e.state.showChildren?t.concat(r):t)}});e.exports=r},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/lodash/includes.js"),r=o("./node_modules/lodash/without.js"),l=o("./node_modules/lodash/find.js"),a=s.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===n(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(r(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var r=n(e.props.selectedColumns,t),a=l(e.props.columnMetadata,{columnName:t}),i=t;return void 0!==a&&void 0!==a.displayName&&null!=a.displayName&&(i=a.displayName),void 0!==a&&null!=a&&a.locked?s.createElement("div",{className:"column checkbox"},s.createElement("label",null,s.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:r,"data-name":t}),i)):void 0!==a&&null!=a&&void 0!==a.visible&&!1===a.visible?null:s.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},s.createElement("label",null,s.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:r,"data-name":t}),i))}));var o=e.props.enableToggleCustom?s.createElement("div",{className:"form-group"},s.createElement("label",{htmlFor:"maxRows"},s.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",r=this.props.showSetPageSize?s.createElement("div",null,s.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",s.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},s.createElement("option",{value:"5"},"5"),s.createElement("option",{value:"10"},"10"),s.createElement("option",{value:"25"},"25"),s.createElement("option",{value:"50"},"50"),s.createElement("option",{value:"100"},"100")))):"";return s.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},s.createElement("h6",null,this.props.settingsText),s.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),r,o)}});e.exports=a},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),r=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),l=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),s.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,s=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var n={scrollTop:t,scrollHeight:o,clientHeight:s};this.setState(n)}.6*(o-(t+s)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,n=null,l=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var a=e.getAdjustedRowHeight(),i=Math.ceil(e.state.clientHeight/a),d=Math.max(0,Math.floor(e.state.scrollTop/a)-.25*i),u=Math.min(d+1.25*i,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*a+"px"};n=s.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*a+"px"};l=s.createElement("tr",{key:"below-"+p.height,style:p})}var h=o.map(function(o,n){var l=void 0!==o.children&&o.children.length>0,a=e.props.rowSettings.getRowKey(o,n);return l&&(t=l),s.createElement(r,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:a+"-container",uniqueId:a,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:l,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var m=this.props.columnSettings.getVisibleColumnCount();h.push(s.createElement("tr",{key:"no-data-section"},s.createElement("td",{colSpan:m},this.props.noDataSection)))}return n&&h.unshift(n),l&&h.push(l),{nodes:h,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var r=null,l=null,a={width:"100%"};if(this.props.useFixedLayout&&(a.tableLayout="fixed"),this.props.enableInfiniteScroll&&(r={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var i=null,d=null;this.props.useGriddleStyles&&(i={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?s.createElement(this.props.externalLoadingComponent,null):s.createElement("div",null,"Loading...");l=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{style:i,colSpan:d},u)))}var c=this.props.showTableHeading?s.createElement(n,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=s.createElement("tbody",null,e));var p=s.createElement("tbody",null);if(this.props.showPager){var h=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:h,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(a.tableLayout="fixed"),s.createElement("div",null,s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},c),s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},e,l,p)))):s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&a||null},c,e,l,p))}}));e.exports=l},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return k(g.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,s){return k(o,function(o){var n=g.getAt(o,s||""),r=e[s];return t(n,r)})},this.props.results),s={columnFilters:e};e?(s.filteredResults=o,s.maxPage=this.getMaxPage(s.filteredResults)):this.state.filter?s.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):s.filteredResults=null,this.setState(s)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=O(o,t);else{var s={};s[t]=e,o=R({},o,s)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(E(e)||T(e)||P(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=S(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=v(this.props.columnMetadata,{columnName:e})||{},s=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],n=null,r=s.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);r=(r+1)%s.length,n=s[r]?s[r]:null;var l={page:0,sortColumn:e,sortDirection:n};this.setState(l)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=g.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,A(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new f(this.props.results.length>0?g.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new _(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var s=this,n=this;if(""!==this.state.sortColumn){var r,l=this.state.sortColumn,a=k(this.props.columnMetadata,{columnName:l}),i={columns:[],orders:[]};if(a.length>0&&(r=a[0].hasOwnProperty("customCompareFn")&&a[0].customCompareFn,a[0].multiSort&&(i=a[0].multiSort)),this.state.sortDirection)if("function"==typeof r)2===r.length?(e=e.sort(function(e,t){return r(V(e,l),V(t,l))}),"desc"===this.state.sortDirection&&e.reverse()):1===r.length&&(e=N(e,function(e){return r(V(e,l))},[this.state.sortDirection]));else{var d=[function(e){return(V(e,l)||"").toString().toLowerCase()}],u=[this.state.sortDirection];i.columns.forEach(function(e,t){d.push(function(t){return(V(t,e)||"").toString().toLowerCase()}),"asc"===i.orders[t]||"desc"===i.orders[t]?u.push(i.orders[t]):u.push(s.state.sortDirection)}),e=N(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=b(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(j||x)(p,p.length-this.state.resultsPerPage)}for(var h=(this.columnSettings.getMetadataColumns,[]),m=0;m0&&(f.children=n.getDataForRender(f[n.props.childrenColumnName],t,!1),"children"!==n.props.childrenColumnName&&delete f[n.props.childrenColumnName]),h.push(f)}return h},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),s=this;C(e,function(e){s._updateSelectedRowIds(e[s.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),s=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],s,t);var n=this._getAreAllRowsChecked(s,A(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:n,selectedRowIds:s}),this.props.onSelectionChange&&this.props.onSelectionChange(s,n)},_updateSelectedRowIds:function(e,t,o){o?void 0===v(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===w(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!v(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?n.createElement(m,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):n.createElement(l,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?n.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,s=null,r=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),s=this.getSettingsStyles(),r=this.getClearFixStyles()),n.createElement("div",{className:"top-section",style:r},n.createElement("div",{className:"griddle-filter",style:o},e),n.createElement("div",{className:"griddle-settings-toggle",style:s},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return n.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?n.createElement(h,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):n.createElement(a,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?n.createElement(i,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return n.createElement(this.props.customGridComponent,s({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,s,r){return n.createElement("div",null,n.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:r,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&s)},getStandardGridSection:function(e,t,o,s,l){var a=this.getSortObject(),i=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return n.createElement("div",{className:"griddle-body"},n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:a,multipleSelectionSettings:i,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:s,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:l,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,s,n,r){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,s,r):this.getStandardGridSection(e,t,o,s,n)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?n.createElement("div",{className:this.props.noDataClassName},n.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):n.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),s=this.getTopSection(t,o),r=[],l=this.columnSettings.getColumns(),a=this.getDataForRender(e,l,!0),i=this.columnSettings.getMetadataColumns();this.props.columnMetadata?C(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||r.push(e.columnName)}):r=g.keys(O(e[0],i)),r=this.columnSettings.orderColumns(r);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return f+=this.shouldUseCustomRowComponent()?" griddle-custom":"",n.createElement("div",{className:f},s,m,n.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},h))}});c.Griddle=e.exports=I},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o-1}var n=o("./node_modules/lodash/_baseIndexOf.js");e.exports=s},"./node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var s=-1,n=null==e?0:e.length;++s=u&&(p=d,h=!1,t=new n(t));e:for(;++c0&&o(u)?t>1?s(u,t-1,o,l,a):n(a,u):l||(a[a.length]=u)}return a}var n=o("./node_modules/lodash/_arrayPush.js"),r=o("./node_modules/lodash/_isFlattenable.js");e.exports=s},"./node_modules/lodash/_baseFor.js":function(e,t,o){var s=o("./node_modules/lodash/_createBaseFor.js"),n=s();e.exports=n},"./node_modules/lodash/_baseForOwn.js":function(e,t,o){function s(e,t){return e&&n(e,t,r)}var n=o("./node_modules/lodash/_baseFor.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_baseGet.js":function(e,t,o){function s(e,t){t=n(t,e);for(var o=0,s=t.length;null!=e&&o=120&&g.length>=120)?new n(h&&g):void 0}g=e[0];var y=-1,j=m[0];e:for(;++yn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var r=Array(n);++st||l&&a&&d&&!i&&!u||s&&a&&d||!o&&d||!r)return 1;if(!s&&!l&&!u&&e=i?d:d*("desc"==o[s]?-1:1)}return e.index-t.index}var n=o("./node_modules/lodash/_compareAscending.js");e.exports=s},"./node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,s=e.length;for(t||(t=Array(s));++o1?o[n-1]:void 0,a=n>2?o[2]:void 0;for(l=e.length>3&&"function"==typeof l?(n--,l):void 0,a&&r(o[0],o[1],a)&&(l=n<3?void 0:l,n=1),t=Object(t);++s-1?a[i?t[d]:d]:void 0}}var n=o("./node_modules/lodash/_baseIteratee.js"),r=o("./node_modules/lodash/isArrayLike.js"),l=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_createToPairs.js":function(e,t,o){function s(e){return function(t){var o=r(t);return o==i?l(t):o==d?a(t):n(t,e(t))}}var n=o("./node_modules/lodash/_baseToPairs.js"),r=o("./node_modules/lodash/_getTag.js"),l=o("./node_modules/lodash/_mapToArray.js"),a=o("./node_modules/lodash/_setToPairs.js"),i="[object Map]",d="[object Set]";e.exports=s},"./node_modules/lodash/_customOmitClone.js":function(e,t,o){function s(e){return n(e)?void 0:e}var n=o("./node_modules/lodash/isPlainObject.js");e.exports=s},"./node_modules/lodash/_defineProperty.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},"./node_modules/lodash/_equalArrays.js":function(e,t,o){function s(e,t,o,s,d,u){var c=o&a,p=e.length,h=t.length;if(p!=h&&!(c&&h>p))return!1;var m=u.get(e);if(m&&u.get(t))return m==t;var f=-1,_=!0,g=o&i?new n:void 0;for(u.set(e,t),u.set(t,e);++f-1&&e%1==0&&e-1}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function s(e,t){var o=this.__data__,s=n(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function s(){this.size=0,this.__data__={hash:new n,map:new(l||r),string:new n}}var n=o("./node_modules/lodash/_Hash.js"),r=o("./node_modules/lodash/_ListCache.js"),l=o("./node_modules/lodash/_Map.js");e.exports=s},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function s(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function s(e){return n(this,e).get(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function s(e){return n(this,e).has(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function s(e,t){var o=n(this,e),s=o.size;return o.set(e,t),this.size+=o.size==s?0:1,this}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,s){o[++t]=[s,e]}),o}e.exports=o},"./node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function s(e){var t=n(e,function(e){return o.size===r&&o.clear(),e}),o=t.cache;return t}var n=o("./node_modules/lodash/memoize.js"),r=500;e.exports=s},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=s(Object,"create");e.exports=n},"./node_modules/lodash/_nativeKeys.js":function(e,t,o){var s=o("./node_modules/lodash/_overArg.js"),n=s(Object.keys,Object);e.exports=n},"./node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_freeGlobal.js"),n="object"==typeof t&&t&&!t.nodeType&&t,r=n&&"object"==typeof e&&e&&!e.nodeType&&e,l=r&&r.exports===n,a=l&&s.process,i=function(){try{return r&&r.require&&r.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=i}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return n.call(e)}var s=Object.prototype,n=s.toString;e.exports=o},"./node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/lodash/_overRest.js":function(e,t,o){function s(e,t,o){return t=r(void 0===t?e.length-1:t,0),function(){for(var s=arguments,l=-1,a=r(s.length-t,0),i=Array(a);++l0){if(++t>=s)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var s=800,n=16,r=Date.now;e.exports=o},"./node_modules/lodash/_stackClear.js":function(e,t,o){function s(){this.__data__=new n,this.size=0}var n=o("./node_modules/lodash/_ListCache.js");e.exports=s},"./node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/lodash/_stackSet.js":function(e,t,o){function s(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length2?t[2]:void 0;for(d&&r(t[0],t[1],d)&&(s=1);++o-1:!!u&&n(e,t,o)>-1}var n=o("./node_modules/lodash/_baseIndexOf.js"),r=o("./node_modules/lodash/isArrayLike.js"),l=o("./node_modules/lodash/isString.js"),a=o("./node_modules/lodash/toInteger.js"),i=o("./node_modules/lodash/values.js"),d=Math.max;e.exports=s},"./node_modules/lodash/initial.js":function(e,t,o){function s(e){return(null==e?0:e.length)?n(e,0,-1):[]}var n=o("./node_modules/lodash/_baseSlice.js");e.exports=s},"./node_modules/lodash/intersection.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseIntersection.js"),r=o("./node_modules/lodash/_baseRest.js"),l=o("./node_modules/lodash/_castArrayLikeObject.js"),a=r(function(e){var t=s(e,l);return t.length&&t[0]===e[0]?n(t):[]});e.exports=a},"./node_modules/lodash/isArguments.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsArguments.js"),n=o("./node_modules/lodash/isObjectLike.js"),r=Object.prototype,l=r.hasOwnProperty,a=r.propertyIsEnumerable,i=s(function(){return arguments}())?s:function(e){return n(e)&&l.call(e,"callee")&&!a.call(e,"callee")};e.exports=i},"./node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/lodash/isArrayLike.js":function(e,t,o){function s(e){return null!=e&&r(e.length)&&!n(e)}var n=o("./node_modules/lodash/isFunction.js"),r=o("./node_modules/lodash/isLength.js");e.exports=s},"./node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function s(e){return r(e)&&n(e)}var n=o("./node_modules/lodash/isArrayLike.js"),r=o("./node_modules/lodash/isObjectLike.js");e.exports=s},"./node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_root.js"),n=o("./node_modules/lodash/stubFalse.js"),r="object"==typeof t&&t&&!t.nodeType&&t,l=r&&"object"==typeof e&&e&&!e.nodeType&&e,a=l&&l.exports===r,i=a?s.Buffer:void 0,d=i?i.isBuffer:void 0,u=d||n;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/isEmpty.js":function(e,t,o){function s(e){if(null==e)return!0;if(i(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||l(e)))return!e.length;var t=r(e);if(t==p||t==h)return!e.size;if(u(e))return!n(e).length;for(var o in e)if(f.call(e,o))return!1;return!0}var n=o("./node_modules/lodash/_baseKeys.js"),r=o("./node_modules/lodash/_getTag.js"),l=o("./node_modules/lodash/isArguments.js"),a=o("./node_modules/lodash/isArray.js"),i=o("./node_modules/lodash/isArrayLike.js"),d=o("./node_modules/lodash/isBuffer.js"),u=o("./node_modules/lodash/_isPrototype.js"),c=o("./node_modules/lodash/isTypedArray.js"),p="[object Map]",h="[object Set]",m=Object.prototype,f=m.hasOwnProperty;e.exports=s},"./node_modules/lodash/isFunction.js":function(e,t,o){function s(e){if(!r(e))return!1;var t=n(e);return t==a||t==i||t==l||t==d}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObject.js"),l="[object AsyncFunction]",a="[object Function]",i="[object GeneratorFunction]",d="[object Proxy]";e.exports=s},"./node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}var s=9007199254740991;e.exports=o},"./node_modules/lodash/isMap.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsMap.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),l=r&&r.isMap,a=l?n(l):s;e.exports=a},"./node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isPlainObject.js":function(e,t,o){function s(e){if(!l(e)||n(e)!=a)return!1;var t=r(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/_getPrototype.js"),l=o("./node_modules/lodash/isObjectLike.js"),a="[object Object]",i=Function.prototype,d=Object.prototype,u=i.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=s},"./node_modules/lodash/isSet.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsSet.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),l=r&&r.isSet,a=l?n(l):s;e.exports=a},"./node_modules/lodash/isString.js":function(e,t,o){function s(e){return"string"==typeof e||!r(e)&&l(e)&&n(e)==a}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isArray.js"),l=o("./node_modules/lodash/isObjectLike.js"),a="[object String]";e.exports=s},"./node_modules/lodash/isSymbol.js":function(e,t,o){function s(e){return"symbol"==typeof e||r(e)&&n(e)==l}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=s},"./node_modules/lodash/isTypedArray.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsTypedArray.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),l=r&&r.isTypedArray,a=l?n(l):s;e.exports=a},"./node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/lodash/keys.js":function(e,t,o){function s(e){return l(e)?n(e):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeys.js"),l=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/keysIn.js":function(e,t,o){function s(e){return l(e)?n(e,!0):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeysIn.js"),l=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/lodash/map.js":function(e,t,o){function s(e,t){return(a(e)?n:l)(e,r(t,3))}var n=o("./node_modules/lodash/_arrayMap.js"),r=o("./node_modules/lodash/_baseIteratee.js"),l=o("./node_modules/lodash/_baseMap.js"),a=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/memoize.js":function(e,t,o){function s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(r);var o=function(){var s=arguments,n=t?t.apply(this,s):s[0],r=o.cache;if(r.has(n))return r.get(n);var l=e.apply(this,s);return o.cache=r.set(n,l)||r,l};return o.cache=new(s.Cache||n),o}var n=o("./node_modules/lodash/_MapCache.js"),r="Expected a function";s.Cache=n,e.exports=s},"./node_modules/lodash/omit.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseClone.js"),r=o("./node_modules/lodash/_baseUnset.js"),l=o("./node_modules/lodash/_castPath.js"),a=o("./node_modules/lodash/_copyObject.js"),i=o("./node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/lodash/_flatRest.js"),u=o("./node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=s(t,function(t){return t=l(t,e),d||(d=t.length>1),t}),a(e,u(e),o),d&&(o=n(o,7,i));for(var c=t.length;c--;)r(o,t[c]);return o});e.exports=c},"./node_modules/lodash/orderBy.js":function(e,t,o){function s(e,t,o,s){return null==e?[]:(r(t)||(t=null==t?[]:[t]),o=s?void 0:o,r(o)||(o=null==o?[]:[o]),n(e,t,o))}var n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/pick.js":function(e,t,o){var s=o("./node_modules/lodash/_basePick.js"),n=o("./node_modules/lodash/_flatRest.js"),r=n(function(e,t){return null==e?{}:s(e,t)});e.exports=r},"./node_modules/lodash/property.js":function(e,t,o){function s(e){return l(e)?n(a(e)):r(e)}var n=o("./node_modules/lodash/_baseProperty.js"),r=o("./node_modules/lodash/_basePropertyDeep.js"),l=o("./node_modules/lodash/_isKey.js"),a=o("./node_modules/lodash/_toKey.js");e.exports=s},"./node_modules/lodash/sortBy.js":function(e,t,o){var s=o("./node_modules/lodash/_baseFlatten.js"),n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/_baseRest.js"),l=o("./node_modules/lodash/_isIterateeCall.js"),a=r(function(e,t){if(null==e)return[];var o=t.length;return o>1&&l(e,t[0],t[1])?t=[]:o>2&&l(t[0],t[1],t[2])&&(t=[t[0]]),n(e,s(t,1),[])});e.exports=a},"./node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/lodash/take.js":function(e,t,o){function s(e,t,o){return e&&e.length?(t=o||void 0===t?1:r(t),n(e,0,t<0?0:t)):[]}var n=o("./node_modules/lodash/_baseSlice.js"),r=o("./node_modules/lodash/toInteger.js");e.exports=s},"./node_modules/lodash/toFinite.js":function(e,t,o){function s(e){return e?(e=n(e))===r||e===-r?(e<0?-1:1)*l:e===e?e:0:0===e?e:0}var n=o("./node_modules/lodash/toNumber.js"),r=1/0,l=1.7976931348623157e308;e.exports=s},"./node_modules/lodash/toInteger.js":function(e,t,o){function s(e){var t=n(e),o=t%1;return t===t?o?t-o:t:0}var n=o("./node_modules/lodash/toFinite.js");e.exports=s},"./node_modules/lodash/toNumber.js":function(e,t,o){function s(e){if("number"==typeof e)return e;if(r(e))return l;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):i.test(e)?l:+e}var n=o("./node_modules/lodash/isObject.js"),r=o("./node_modules/lodash/isSymbol.js"),l=NaN,a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=s},"./node_modules/lodash/toPairs.js":function(e,t,o){var s=o("./node_modules/lodash/_createToPairs.js"),n=o("./node_modules/lodash/keys.js"),r=s(n);e.exports=r},"./node_modules/lodash/toString.js":function(e,t,o){function s(e){return null==e?"":n(e)}var n=o("./node_modules/lodash/_baseToString.js");e.exports=s},"./node_modules/lodash/uniqueId.js":function(e,t,o){function s(e){var t=++r;return n(e)+t}var n=o("./node_modules/lodash/toString.js"),r=0;e.exports=s},"./node_modules/lodash/values.js":function(e,t,o){function s(e){return null==e?[]:n(e,r(e))}var n=o("./node_modules/lodash/_baseValues.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/without.js":function(e,t,o){var s=o("./node_modules/lodash/_baseDifference.js"),n=o("./node_modules/lodash/_baseRest.js"),r=o("./node_modules/lodash/isArrayLikeObject.js"),l=n(function(e,t){return r(e)?s(e,t):[]});e.exports=l},"./node_modules/lodash/zipObject.js":function(e,t,o){function s(e,t){return r(e||[],t||[],n)}var n=o("./node_modules/lodash/_assignValue.js"),r=o("./node_modules/lodash/_baseZipObject.js");e.exports=s},"./node_modules/uuid/lib/bytesToUuid.js":function(e,t){function o(e,t){var o=t||0,n=s;return n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]}for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);e.exports=o},"./node_modules/uuid/lib/rng-browser.js":function(e,t){var o="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(o){var s=new Uint8Array(16);e.exports=function(){return o(s),s}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},"./node_modules/uuid/v1.js":function(e,t,o){function s(e,t,o){var s=t&&o||0,u=t||[];e=e||{};var c=e.node||n,p=void 0!==e.clockseq?e.clockseq:r;if(null==c||null==p){var h=l();null==c&&(c=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=r=16383&(h[6]<<8|h[7]))}var m=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:d+1,_=m-i+(f-d)/1e4;if(_<0&&void 0===e.clockseq&&(p=p+1&16383),(_<0||m>i)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");i=m,d=f,r=p,m+=122192928e5;var g=(1e4*(268435455&m)+f)%4294967296;u[s++]=g>>>24&255,u[s++]=g>>>16&255,u[s++]=g>>>8&255,u[s++]=255&g;var y=m/4294967296*1e4&268435455;u[s++]=y>>>8&255,u[s++]=255&y,u[s++]=y>>>24&15|16,u[s++]=y>>>16&255,u[s++]=p>>>8|128,u[s++]=255&p;for(var j=0;j<6;++j)u[s+j]=c[j];return t||a(u)}var n,r,l=o("./node_modules/uuid/lib/rng-browser.js"),a=o("./node_modules/uuid/lib/bytesToUuid.js"),i=0,d=0;e.exports=s},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},classnames:function(e,t){e.exports=classnames},"components/Loading/Loading":function(e,t){e.exports=Loading},"containers/FormBuilderLoader/FormBuilderLoader":function(e,t){e.exports=FormBuilderLoader},i18n:function(e,t){e.exports=i18n},jquery:function(e,t){e.exports=jQuery},"lib/Config":function(e,t){e.exports=Config},"lib/Injector":function(e,t){e.exports=Injector},moment:function(e,t){e.exports=moment},react:function(e,t){e.exports=React},"react-dom":function(e,t){e.exports=ReactDom},"react-redux":function(e,t){e.exports=ReactRedux},redux:function(e,t){e.exports=Redux}}); \ No newline at end of file +!function(e){function t(s){if(o[s])return o[s].exports;var n=o[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};t.m=e,t.c=o,t.d=function(e,o,s){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/index.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}var n=o("./client/src/boot/registerComponents.js"),r=s(n),a=o("./client/src/boot/registerReducers.js"),i=s(a);window.document.addEventListener("DOMContentLoaded",function(){(0,r.default)(),(0,i.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),a=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js"),i=s(a),l=o("./client/src/components/HistoryViewer/HistoryViewerHeading.js"),d=s(l),u=o("./client/src/components/HistoryViewer/HistoryViewerToolbar.js"),c=s(u),p=o("./client/src/components/HistoryViewer/HistoryViewerVersion.js"),h=s(p),m=o("./client/src/components/HistoryViewer/HistoryViewerVersionDetail.js"),f=s(m),_=o("./client/src/components/HistoryViewer/HistoryViewerVersionList.js"),g=s(_),y=o("./client/src/components/HistoryViewer/HistoryViewerVersionState.js"),v=s(y),j=o("./client/src/components/HistoryViewer/HistoryViewerCompareWarning.js"),b=s(j);t.default=function(){r.default.component.registerMany({HistoryViewer:i.default,HistoryViewerHeading:d.default,HistoryViewerToolbar:c.default,HistoryViewerVersion:h.default,HistoryViewerVersionDetail:f.default,HistoryViewerVersionList:g.default,HistoryViewerVersionState:v.default,HistoryViewerCompareWarning:b.default})}},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),a=o("redux"),i=o("./client/src/state/historyviewer/HistoryViewerReducer.js"),l=s(i),d=function(){r.default.reducer.register("versionedAdmin",(0,a.combineReducers)({historyViewer:l.default}))};t.default=d},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed"),o("./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed"),o("./client/src/legacy/ArchiveAdmin/ArchiveAdmin.js"),o("./client/src/legacy/HistoryViewer/HistoryViewerEntwine.js"),o("./client/src/boot/index.js")},"./client/src/components/HistoryViewer/HistoryViewerCompareWarning.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return{isCompare:!!e.versionedAdmin.historyViewer.compare}}function l(e){return{onDismissCompare:function(){e((0,f.setCompareMode)(!1))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0])||arguments[0],t=document.querySelector(".CMSPageHistoryViewerController div:not(.cms-content-tools) .cms-content-header"),o="history-viewer__toolbar--condensed";t&&this.isPreviewable()&&(e?t.classList.add(o):t.classList.remove(o))}},{key:"renderPreview",value:function(){var e=this.props,t=e.version,o=e.PreviewComponent,s=e.previewState;return this.isPreviewable()&&"edit"!==s?d.default.createElement(o,{className:"history-viewer__preview flexbox-area-grow",itemLinks:{preview:{Stage:{href:t.AbsoluteLink+"&archiveDate="+t.LastEdited,type:"text/html"}}},itemId:t.Version}):null}},{key:"renderToolbar",value:function(){var e=this.props,t=e.ToolbarComponent,o=e.isLatestVersion,s=e.recordId,n=e.version;return this.isCompareMode()?null:d.default.createElement(t,{identifier:"HistoryViewer.VersionDetail.Toolbar",isLatestVersion:o,recordId:s,versionId:n.Version,isPreviewable:this.isPreviewable()})}},{key:"renderDetails",value:function(){var e=this.props,t=e.ListComponent,o=e.schemaUrl,s=e.CompareWarningComponent,n=e.previewState;if(this.isPreviewable()&&"preview"===n)return null;var r=["flexbox-area-grow","panel","panel--scrollable","panel--padded","panel--padded-side"],a={"history-viewer__table":!0,"history-viewer__table--current":!0,"history-viewer__table--compare":this.isCompareMode()},i={"history-viewer__version-detail":!0,"history-viewer__version-detail--compare":this.isCompareMode()};return d.default.createElement("div",{className:"flexbox-area-grow fill-height"},d.default.createElement("div",{className:(0,c.default)(r)},d.default.createElement(t,{extraClass:(0,c.default)(a),isActive:!0,versions:this.getListVersions()}),d.default.createElement("div",{className:(0,c.default)(i)},d.default.createElement(h.default,{identifier:"HistoryViewer.VersionDetail",schemaUrl:o}))),this.renderToolbar(),d.default.createElement(s,{fixed:!0}))}},{key:"render",value:function(){return d.default.createElement("div",{className:"flexbox-area-grow fill-width"},this.renderDetails(),this.renderPreview())}}]),t}(l.PureComponent);_.propTypes={isLatestVersion:l.PropTypes.bool,isPreviewable:l.PropTypes.bool,ListComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]).isRequired,PreviewComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]),recordId:l.PropTypes.number.isRequired,schemaUrl:l.PropTypes.string.isRequired,ToolbarComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]).isRequired,version:f.versionType,compare:l.PropTypes.oneOfType([l.PropTypes.shape({versionFrom:f.versionType,versionTo:f.versionType}),l.PropTypes.bool]),previewState:l.PropTypes.oneOf(["edit","preview","split"])},_.defaultProps={isLatestVersion:!1,isPreviewable:!1,compare:!1},t.Component=_,t.default=(0,m.inject)(["HistoryViewerVersionList","HistoryViewerToolbar","Preview","HistoryViewerCompareWarning"],function(e,t,o,s){return{ListComponent:e,ToolbarComponent:t,PreviewComponent:o,CompareWarningComponent:s}},function(e,t){return t+".HistoryViewerVersionDetail."+e.version.Version})(_)},"./client/src/components/HistoryViewer/HistoryViewerVersionList.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.versionedAdmin.historyViewer;return{messages:t.messages,compare:t.compare}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:"success";return{type:h.default.ADD_MESSAGE,payload:{id:(0,f.default)(),message:e,type:t}}}function l(){return{type:h.default.CLEAR_MESSAGES,payload:{}}}function d(e){return{type:h.default.SET_COMPARE_MODE,payload:{enabled:e}}}function u(e){return{type:h.default.SET_COMPARE_FROM,payload:{version:e}}}function c(e){return{type:h.default.SET_COMPARE_TO,payload:{version:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.showVersion=n,t.showList=r,t.setCurrentPage=a,t.addMessage=i,t.clearMessages=l,t.setCompareMode=d,t.setCompareFrom=u,t.setCompareTo=c;var p=o("./client/src/state/historyviewer/HistoryViewerActionTypes.js"),h=s(p),m=o("./node_modules/uuid/v1.js"),f=s(m)},"./client/src/state/historyviewer/HistoryViewerReducer.js":function(e,t,o){"use strict";function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case i.default.SET_CURRENT_PAGE:return r({},e,{currentPage:n.page});case i.default.SHOW_VERSION:return r({},e,{currentVersion:n.id});case i.default.SHOW_LIST:return r({},e,{currentVersion:0,currentPage:0});case i.default.ADD_MESSAGE:return r({},e,{messages:[n].concat(s(e.messages))});case i.default.CLEAR_MESSAGES:return e.messages.length?r({},e,{messages:[]}):e;case i.default.SET_COMPARE_MODE:var a=!1;return n.enabled&&(a=r({versionFrom:0,versionTo:0},e.compare)),r({},e,{compare:a});case i.default.SET_COMPARE_FROM:var l=e.compare,u=l.versionFrom,c=l.versionTo;return u=n.version,n.version||(u=c,c=0),r({},e,{compare:{versionFrom:u,versionTo:c}});case i.default.SET_COMPARE_TO:var p=e.compare,h=p.versionFrom,m=p.versionTo;return m=n.version,m&&h&&m1)&&this.getVersions().reduce(function(e,t){return e.Version>t.Version?e:t})}},{key:"handleSetPage",value:function(e){var t=this.props.onSetPage;"function"==typeof t&&t(e+1)}},{key:"handleNextPage",value:function(){var e=this.props.page;this.handleSetPage(e)}},{key:"handlePrevPage",value:function(){var e=this.props.page,t=e-1;if(t<1)return void this.handleSetPage(t);this.handleSetPage(t-1)}},{key:"renderVersionDetail",value:function(){var e=this,t=this.props,o=t.currentVersion,s=t.isPreviewable,n=t.recordId,r=t.recordClass,a=t.schemaUrl,i=t.VersionDetailComponent,l=t.compare,d=t.previewState,u={":id":n,":class":r,":version":o},p={":id":n,":class":r,":from":l?l.versionFrom:0,":to":l?l.versionTo:0},h=l?/:id|:class|:from|:to/g:/:id|:class|:version/g,m=l?p:u,f=function(e){return function(t){return t.Version===e}},_=this.getVersions().find(f(l?l.versionFrom:o)),g=this.getLatestVersion(),y=!!l&&{versionFrom:this.getVersions().find(f(l.versionFrom)),versionTo:this.getVersions().find(f(l.versionTo))},v={isLatestVersion:g&&g.Version===_.Version,isPreviewable:s,recordId:n,schemaUrl:a.replace(h,function(e){return m[e]}),version:_,compare:y,previewState:d};return c.default.createElement(O.default,{style:{position:"relative"},className:this.getContainerClasses(),onResize:function(t){var o=t.width;return e.props.onResize(o)}},c.default.createElement(i,v))}},{key:"renderPagination",value:function(){var e=this.props,t=e.limit,o=e.page,s=e.versions;if(!s)return null;var n=s.Versions?s.Versions.pageInfo.totalCount:0;if(n<=t)return null;var r={setPage:this.handleSetPage,maxPage:Math.ceil(n/t),next:this.handleNextPage,nextText:v.default._t("HistoryViewer.NEXT","Next"),previous:this.handlePrevPage,previousText:v.default._t("HistoryViewer.PREVIOUS","Previous"),currentPage:o-1,useGriddleStyles:!1};return c.default.createElement("div",{className:"griddle-footer"},c.default.createElement(f.default.GridPagination,r))}},{key:"renderVersionList",value:function(){var e=this.props,t=e.isPreviewable,o=e.ListComponent,s=e.CompareWarningComponent;return c.default.createElement("div",{className:this.getContainerClasses()},c.default.createElement(s,null),c.default.createElement("div",{className:t?"panel panel--padded panel--scrollable":""},c.default.createElement(o,{versions:this.getVersions()}),c.default.createElement("div",{className:"history-viewer__pagination"},this.renderPagination())))}},{key:"renderCompareMode",value:function(){var e=this.props.compare;return e&&e.versionFrom&&e.versionTo?this.renderVersionDetail():this.renderVersionList()}},{key:"render",value:function(){var e=this.props,t=e.loading,o=e.compare,s=e.currentVersion;return t?c.default.createElement(C.default,null):o?this.renderCompareMode():s?this.renderVersionDetail():this.renderVersionList()}}]),t}(u.Component);k.propTypes={contextKey:u.PropTypes.string,limit:u.PropTypes.number,ListComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,offset:u.PropTypes.number,recordId:u.PropTypes.number.isRequired,currentVersion:u.PropTypes.number,compare:S.compareType,isPreviewable:u.PropTypes.bool,VersionDetailComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,CompareWarningComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,versions:u.PropTypes.shape({Versions:u.PropTypes.shape({pageInfo:u.PropTypes.shape({totalCount:u.PropTypes.number}),edges:u.PropTypes.arrayOf(u.PropTypes.shape({node:x.versionType}))})}),page:u.PropTypes.number,schemaUrl:u.PropTypes.string,previewState:u.PropTypes.oneOf(["edit","preview","split"]),actions:u.PropTypes.object,onSelect:u.PropTypes.func,onSetPage:u.PropTypes.func,onResize:u.PropTypes.func},k.defaultProps={contextKey:"",currentVersion:0,isPreviewable:!1,schemaUrl:"",versions:{Versions:{pageInfo:{totalCount:0},edges:[]}}},t.Component=k,t.default=(0,p.compose)((0,h.connect)(i,l),g.default,(0,j.inject)(["HistoryViewerVersionList","HistoryViewerVersionDetail","HistoryViewerCompareWarning"],function(e,t,o){return{ListComponent:e,VersionDetailComponent:t,CompareWarningComponent:o}},function(e){return"VersionedAdmin.HistoryViewer."+e.contextKey}))(k)},"./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultVersion=t.versionType=void 0;var s=o("react"),n=s.PropTypes.shape({FirstName:s.PropTypes.string,Surname:s.PropTypes.string}),r=s.PropTypes.shape({Version:s.PropTypes.number,AbsoluteLink:s.PropTypes.string,LastEdited:s.PropTypes.string,Published:s.PropTypes.boolean,LiveVersion:s.PropTypes.boolean,LatestDraftVersion:s.PropTypes.boolean,Publisher:n,Author:n}),a={Version:0,AbsoluteLink:"",LastEdited:"",Published:!1,LiveVersion:!1,LatestDraftVersion:!1,Publisher:{FirstName:"",Surname:""},Author:{FirstName:"",Surname:""}};t.versionType=r,t.defaultVersion=a},"./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed":function(e,t,o){(function(t){e.exports=t.HistoryViewer=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed":function(e,t,o){(function(t){e.exports=t.versionType=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var s=this.getColumnMetadataByName(e);return void 0===s||null===s?o:s.hasOwnProperty(t)?s[t]:o}},{key:"orderColumns",value:function(e){var t=this;return l(e,function(e){var o=i(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=s.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),s.createElement("div",null)):s.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=n},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t0&&(e=s.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=s.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,r=null,a=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};a=n({textAlign:"right",width:"34%"},i),r=n({textAlign:"center",width:"33%"},i),o=n({width:"33%"},i)}for(var l=[],d=1;d<=this.props.maxPage;d++)l.push(s.createElement("option",{value:d,key:d},d));return s.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},s.createElement("div",{className:this.props.previousClassName,style:o},e),s.createElement("div",{className:"griddle-page",style:r},s.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},l)," / ",this.props.maxPage),s.createElement("div",{className:this.props.nextClassName,style:a},t))}});e.exports=r},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),r=o("./node_modules/lodash/isFunction.js"),a=o("./node_modules/lodash/zipObject.js"),i=o("./node_modules/lodash/assign.js"),l=o("./node_modules/lodash/defaults.js"),d=o("./node_modules/lodash/toPairs.js"),u=o("./node_modules/lodash/without.js"),c=s.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&r(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=a(c,[]),h=i({},this.props.data);l(h,p);var m,f,_=d(n.pick(h,u(c,"children"))),g=_.map(function(t,n){var r=null,a=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===n&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===n&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===n&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=i(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==a&&null!==a)if(void 0!==a.customComponent&&null!==a.customComponent){var d=s.createElement(a.customComponent,{data:t[1],rowData:h,metadata:a});r=s.createElement("td",{onClick:e.handleClick,className:a.cssClassName,key:n,style:o},d)}else r=s.createElement("td",{onClick:e.handleClick,className:a.cssClassName,key:n,style:o},l,e.formatData(t[1]));return r||s.createElement("td",{onClick:e.handleClick,key:n,style:o},l,t[1])});null!==this.props.onRowClick&&r(this.props.onRowClick)?(m=null,f=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(m=this.handleSelectClick,f=null):(m=null,f=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),g.unshift(s.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:f},s.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(h),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),s.createElement("tr",{onClick:m,className:y},g)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/lodash/pick.js")),r=s.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return s.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(s.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?n(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var r=null;return e.state.showChildren&&(r=e.props.hasChildren&&this.props.data.children.map(function(t,o){var n=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var r=e.constructor.Griddle;return s.createElement("tr",{key:n,style:{paddingLeft:5}},s.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},s.createElement(r,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return s.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:n})})),!1===e.props.hasChildren?t[0]:s.createElement("tbody",null,e.state.showChildren?t.concat(r):t)}});e.exports=r},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/lodash/includes.js"),r=o("./node_modules/lodash/without.js"),a=o("./node_modules/lodash/find.js"),i=s.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===n(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(r(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var r=n(e.props.selectedColumns,t),i=a(e.props.columnMetadata,{columnName:t}),l=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(l=i.displayName),void 0!==i&&null!=i&&i.locked?s.createElement("div",{className:"column checkbox"},s.createElement("label",null,s.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:r,"data-name":t}),l)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:s.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},s.createElement("label",null,s.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:r,"data-name":t}),l))}));var o=e.props.enableToggleCustom?s.createElement("div",{className:"form-group"},s.createElement("label",{htmlFor:"maxRows"},s.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",r=this.props.showSetPageSize?s.createElement("div",null,s.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",s.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},s.createElement("option",{value:"5"},"5"),s.createElement("option",{value:"10"},"10"),s.createElement("option",{value:"25"},"25"),s.createElement("option",{value:"50"},"50"),s.createElement("option",{value:"100"},"100")))):"";return s.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},s.createElement("h6",null,this.props.settingsText),s.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),r,o)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),r=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),a=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),s.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,s=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var n={scrollTop:t,scrollHeight:o,clientHeight:s};this.setState(n)}.6*(o-(t+s)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,n=null,a=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),l=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*l),u=Math.min(d+1.25*l,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*i+"px"};n=s.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};a=s.createElement("tr",{key:"below-"+p.height,style:p})}var h=o.map(function(o,n){var a=void 0!==o.children&&o.children.length>0,i=e.props.rowSettings.getRowKey(o,n);return a&&(t=a),s.createElement(r,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:a,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var m=this.props.columnSettings.getVisibleColumnCount();h.push(s.createElement("tr",{key:"no-data-section"},s.createElement("td",{colSpan:m},this.props.noDataSection)))}return n&&h.unshift(n),a&&h.push(a),{nodes:h,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var r=null,a=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(r={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var l=null,d=null;this.props.useGriddleStyles&&(l={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?s.createElement(this.props.externalLoadingComponent,null):s.createElement("div",null,"Loading...");a=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{style:l,colSpan:d},u)))}var c=this.props.showTableHeading?s.createElement(n,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=s.createElement("tbody",null,e));var p=s.createElement("tbody",null);if(this.props.showPager){var h=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:h,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),s.createElement("div",null,s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,a,p)))):s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,a,p))}}));e.exports=a},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return k(g.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,s){return k(o,function(o){var n=g.getAt(o,s||""),r=e[s];return t(n,r)})},this.props.results),s={columnFilters:e};e?(s.filteredResults=o,s.maxPage=this.getMaxPage(s.filteredResults)):this.state.filter?s.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):s.filteredResults=null,this.setState(s)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=O(o,t);else{var s={};s[t]=e,o=A({},o,s)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(E(e)||T(e)||P(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=S(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=j(this.props.columnMetadata,{columnName:e})||{},s=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],n=null,r=s.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);r=(r+1)%s.length,n=s[r]?s[r]:null;var a={page:0,sortColumn:e,sortDirection:n};this.setState(a)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=g.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,R(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new f(this.props.results.length>0?g.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new _(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var s=this,n=this;if(""!==this.state.sortColumn){var r,a=this.state.sortColumn,i=k(this.props.columnMetadata,{columnName:a}),l={columns:[],orders:[]};if(i.length>0&&(r=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(l=i[0].multiSort)),this.state.sortDirection)if("function"==typeof r)2===r.length?(e=e.sort(function(e,t){return r(V(e,a),V(t,a))}),"desc"===this.state.sortDirection&&e.reverse()):1===r.length&&(e=M(e,function(e){return r(V(e,a))},[this.state.sortDirection]));else{var d=[function(e){return(V(e,a)||"").toString().toLowerCase()}],u=[this.state.sortDirection];l.columns.forEach(function(e,t){d.push(function(t){return(V(t,e)||"").toString().toLowerCase()}),"asc"===l.orders[t]||"desc"===l.orders[t]?u.push(l.orders[t]):u.push(s.state.sortDirection)}),e=M(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=b(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||w)(p,p.length-this.state.resultsPerPage)}for(var h=(this.columnSettings.getMetadataColumns,[]),m=0;m0&&(f.children=n.getDataForRender(f[n.props.childrenColumnName],t,!1),"children"!==n.props.childrenColumnName&&delete f[n.props.childrenColumnName]),h.push(f)}return h},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),s=this;C(e,function(e){s._updateSelectedRowIds(e[s.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),s=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],s,t);var n=this._getAreAllRowsChecked(s,R(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:n,selectedRowIds:s}),this.props.onSelectionChange&&this.props.onSelectionChange(s,n)},_updateSelectedRowIds:function(e,t,o){o?void 0===j(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===x(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!j(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?n.createElement(m,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):n.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?n.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,s=null,r=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),s=this.getSettingsStyles(),r=this.getClearFixStyles()),n.createElement("div",{className:"top-section",style:r},n.createElement("div",{className:"griddle-filter",style:o},e),n.createElement("div",{className:"griddle-settings-toggle",style:s},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return n.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?n.createElement(h,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):n.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?n.createElement(l,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return n.createElement(this.props.customGridComponent,s({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,s,r){return n.createElement("div",null,n.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:r,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&s)},getStandardGridSection:function(e,t,o,s,a){var i=this.getSortObject(),l=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return n.createElement("div",{className:"griddle-body"},n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:l,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:s,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:a,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,s,n,r){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,s,r):this.getStandardGridSection(e,t,o,s,n)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?n.createElement("div",{className:this.props.noDataClassName},n.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):n.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),s=this.getTopSection(t,o),r=[],a=this.columnSettings.getColumns(),i=this.getDataForRender(e,a,!0),l=this.columnSettings.getMetadataColumns();this.props.columnMetadata?C(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||r.push(e.columnName)}):r=g.keys(O(e[0],l)),r=this.columnSettings.orderColumns(r);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return f+=this.shouldUseCustomRowComponent()?" griddle-custom":"",n.createElement("div",{className:f},s,m,n.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},h))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o-1}var n=o("./node_modules/lodash/_baseIndexOf.js");e.exports=s},"./node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var s=-1,n=null==e?0:e.length;++s=u&&(p=d,h=!1,t=new n(t));e:for(;++c0&&o(u)?t>1?s(u,t-1,o,a,i):n(i,u):a||(i[i.length]=u)}return i}var n=o("./node_modules/lodash/_arrayPush.js"),r=o("./node_modules/lodash/_isFlattenable.js");e.exports=s},"./node_modules/lodash/_baseFor.js":function(e,t,o){var s=o("./node_modules/lodash/_createBaseFor.js"),n=s();e.exports=n},"./node_modules/lodash/_baseForOwn.js":function(e,t,o){function s(e,t){return e&&n(e,t,r)}var n=o("./node_modules/lodash/_baseFor.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_baseGet.js":function(e,t,o){function s(e,t){t=n(t,e);for(var o=0,s=t.length;null!=e&&o=120&&g.length>=120)?new n(h&&g):void 0}g=e[0];var y=-1,v=m[0];e:for(;++yn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var r=Array(n);++st||a&&i&&d&&!l&&!u||s&&i&&d||!o&&d||!r)return 1;if(!s&&!a&&!u&&e=l?d:d*("desc"==o[s]?-1:1)}return e.index-t.index}var n=o("./node_modules/lodash/_compareAscending.js");e.exports=s},"./node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,s=e.length;for(t||(t=Array(s));++o1?o[n-1]:void 0,i=n>2?o[2]:void 0;for(a=e.length>3&&"function"==typeof a?(n--,a):void 0,i&&r(o[0],o[1],i)&&(a=n<3?void 0:a,n=1),t=Object(t);++s-1?i[l?t[d]:d]:void 0}}var n=o("./node_modules/lodash/_baseIteratee.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_createToPairs.js":function(e,t,o){function s(e){return function(t){var o=r(t);return o==l?a(t):o==d?i(t):n(t,e(t))}}var n=o("./node_modules/lodash/_baseToPairs.js"),r=o("./node_modules/lodash/_getTag.js"),a=o("./node_modules/lodash/_mapToArray.js"),i=o("./node_modules/lodash/_setToPairs.js"),l="[object Map]",d="[object Set]";e.exports=s},"./node_modules/lodash/_customOmitClone.js":function(e,t,o){function s(e){return n(e)?void 0:e}var n=o("./node_modules/lodash/isPlainObject.js");e.exports=s},"./node_modules/lodash/_defineProperty.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},"./node_modules/lodash/_equalArrays.js":function(e,t,o){function s(e,t,o,s,d,u){var c=o&i,p=e.length,h=t.length;if(p!=h&&!(c&&h>p))return!1;var m=u.get(e);if(m&&u.get(t))return m==t;var f=-1,_=!0,g=o&l?new n:void 0;for(u.set(e,t),u.set(t,e);++f-1&&e%1==0&&e-1}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function s(e,t){var o=this.__data__,s=n(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function s(){this.size=0,this.__data__={hash:new n,map:new(a||r),string:new n}}var n=o("./node_modules/lodash/_Hash.js"),r=o("./node_modules/lodash/_ListCache.js"),a=o("./node_modules/lodash/_Map.js");e.exports=s},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function s(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function s(e){return n(this,e).get(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function s(e){return n(this,e).has(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function s(e,t){var o=n(this,e),s=o.size;return o.set(e,t),this.size+=o.size==s?0:1,this}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,s){o[++t]=[s,e]}),o}e.exports=o},"./node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function s(e){var t=n(e,function(e){return o.size===r&&o.clear(),e}),o=t.cache;return t}var n=o("./node_modules/lodash/memoize.js"),r=500;e.exports=s},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=s(Object,"create");e.exports=n},"./node_modules/lodash/_nativeKeys.js":function(e,t,o){var s=o("./node_modules/lodash/_overArg.js"),n=s(Object.keys,Object);e.exports=n},"./node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_freeGlobal.js"),n="object"==typeof t&&t&&!t.nodeType&&t,r=n&&"object"==typeof e&&e&&!e.nodeType&&e,a=r&&r.exports===n,i=a&&s.process,l=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return n.call(e)}var s=Object.prototype,n=s.toString;e.exports=o},"./node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/lodash/_overRest.js":function(e,t,o){function s(e,t,o){return t=r(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,i=r(s.length-t,0),l=Array(i);++a0){if(++t>=s)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var s=800,n=16,r=Date.now;e.exports=o},"./node_modules/lodash/_stackClear.js":function(e,t,o){function s(){this.__data__=new n,this.size=0}var n=o("./node_modules/lodash/_ListCache.js");e.exports=s},"./node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/lodash/_stackSet.js":function(e,t,o){function s(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length2?t[2]:void 0;for(d&&r(t[0],t[1],d)&&(s=1);++o-1:!!u&&n(e,t,o)>-1}var n=o("./node_modules/lodash/_baseIndexOf.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/isString.js"),i=o("./node_modules/lodash/toInteger.js"),l=o("./node_modules/lodash/values.js"),d=Math.max;e.exports=s},"./node_modules/lodash/initial.js":function(e,t,o){function s(e){return(null==e?0:e.length)?n(e,0,-1):[]}var n=o("./node_modules/lodash/_baseSlice.js");e.exports=s},"./node_modules/lodash/intersection.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseIntersection.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_castArrayLikeObject.js"),i=r(function(e){var t=s(e,a);return t.length&&t[0]===e[0]?n(t):[]});e.exports=i},"./node_modules/lodash/isArguments.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsArguments.js"),n=o("./node_modules/lodash/isObjectLike.js"),r=Object.prototype,a=r.hasOwnProperty,i=r.propertyIsEnumerable,l=s(function(){return arguments}())?s:function(e){return n(e)&&a.call(e,"callee")&&!i.call(e,"callee")};e.exports=l},"./node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/lodash/isArrayLike.js":function(e,t,o){function s(e){return null!=e&&r(e.length)&&!n(e)}var n=o("./node_modules/lodash/isFunction.js"),r=o("./node_modules/lodash/isLength.js");e.exports=s},"./node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function s(e){return r(e)&&n(e)}var n=o("./node_modules/lodash/isArrayLike.js"),r=o("./node_modules/lodash/isObjectLike.js");e.exports=s},"./node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_root.js"),n=o("./node_modules/lodash/stubFalse.js"),r="object"==typeof t&&t&&!t.nodeType&&t,a=r&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===r,l=i?s.Buffer:void 0,d=l?l.isBuffer:void 0,u=d||n;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/isEmpty.js":function(e,t,o){function s(e){if(null==e)return!0;if(l(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||a(e)))return!e.length;var t=r(e);if(t==p||t==h)return!e.size;if(u(e))return!n(e).length;for(var o in e)if(f.call(e,o))return!1;return!0}var n=o("./node_modules/lodash/_baseKeys.js"),r=o("./node_modules/lodash/_getTag.js"),a=o("./node_modules/lodash/isArguments.js"),i=o("./node_modules/lodash/isArray.js"),l=o("./node_modules/lodash/isArrayLike.js"),d=o("./node_modules/lodash/isBuffer.js"),u=o("./node_modules/lodash/_isPrototype.js"),c=o("./node_modules/lodash/isTypedArray.js"),p="[object Map]",h="[object Set]",m=Object.prototype,f=m.hasOwnProperty;e.exports=s},"./node_modules/lodash/isFunction.js":function(e,t,o){function s(e){if(!r(e))return!1;var t=n(e);return t==i||t==l||t==a||t==d}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObject.js"),a="[object AsyncFunction]",i="[object Function]",l="[object GeneratorFunction]",d="[object Proxy]";e.exports=s},"./node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}var s=9007199254740991;e.exports=o},"./node_modules/lodash/isMap.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsMap.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isMap,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isPlainObject.js":function(e,t,o){function s(e){if(!a(e)||n(e)!=i)return!1;var t=r(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/_getPrototype.js"),a=o("./node_modules/lodash/isObjectLike.js"),i="[object Object]",l=Function.prototype,d=Object.prototype,u=l.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=s},"./node_modules/lodash/isSet.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsSet.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isSet,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isString.js":function(e,t,o){function s(e){return"string"==typeof e||!r(e)&&a(e)&&n(e)==i}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isArray.js"),a=o("./node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=s},"./node_modules/lodash/isSymbol.js":function(e,t,o){function s(e){return"symbol"==typeof e||r(e)&&n(e)==a}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=s},"./node_modules/lodash/isTypedArray.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsTypedArray.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isTypedArray,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/lodash/keys.js":function(e,t,o){function s(e){return a(e)?n(e):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeys.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/keysIn.js":function(e,t,o){function s(e){return a(e)?n(e,!0):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeysIn.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/lodash/map.js":function(e,t,o){function s(e,t){return(i(e)?n:a)(e,r(t,3))}var n=o("./node_modules/lodash/_arrayMap.js"),r=o("./node_modules/lodash/_baseIteratee.js"),a=o("./node_modules/lodash/_baseMap.js"),i=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/memoize.js":function(e,t,o){function s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(r);var o=function(){var s=arguments,n=t?t.apply(this,s):s[0],r=o.cache;if(r.has(n))return r.get(n);var a=e.apply(this,s);return o.cache=r.set(n,a)||r,a};return o.cache=new(s.Cache||n),o}var n=o("./node_modules/lodash/_MapCache.js"),r="Expected a function";s.Cache=n,e.exports=s},"./node_modules/lodash/omit.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseClone.js"),r=o("./node_modules/lodash/_baseUnset.js"),a=o("./node_modules/lodash/_castPath.js"),i=o("./node_modules/lodash/_copyObject.js"),l=o("./node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/lodash/_flatRest.js"),u=o("./node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=s(t,function(t){return t=a(t,e),d||(d=t.length>1),t}),i(e,u(e),o),d&&(o=n(o,7,l));for(var c=t.length;c--;)r(o,t[c]);return o});e.exports=c},"./node_modules/lodash/orderBy.js":function(e,t,o){function s(e,t,o,s){return null==e?[]:(r(t)||(t=null==t?[]:[t]),o=s?void 0:o,r(o)||(o=null==o?[]:[o]),n(e,t,o))}var n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/pick.js":function(e,t,o){var s=o("./node_modules/lodash/_basePick.js"),n=o("./node_modules/lodash/_flatRest.js"),r=n(function(e,t){return null==e?{}:s(e,t)});e.exports=r},"./node_modules/lodash/property.js":function(e,t,o){function s(e){return a(e)?n(i(e)):r(e)}var n=o("./node_modules/lodash/_baseProperty.js"),r=o("./node_modules/lodash/_basePropertyDeep.js"),a=o("./node_modules/lodash/_isKey.js"),i=o("./node_modules/lodash/_toKey.js");e.exports=s},"./node_modules/lodash/sortBy.js":function(e,t,o){var s=o("./node_modules/lodash/_baseFlatten.js"),n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_isIterateeCall.js"),i=r(function(e,t){if(null==e)return[];var o=t.length;return o>1&&a(e,t[0],t[1])?t=[]:o>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),n(e,s(t,1),[])});e.exports=i},"./node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/lodash/take.js":function(e,t,o){function s(e,t,o){return e&&e.length?(t=o||void 0===t?1:r(t),n(e,0,t<0?0:t)):[]}var n=o("./node_modules/lodash/_baseSlice.js"),r=o("./node_modules/lodash/toInteger.js");e.exports=s},"./node_modules/lodash/toFinite.js":function(e,t,o){function s(e){return e?(e=n(e))===r||e===-r?(e<0?-1:1)*a:e===e?e:0:0===e?e:0}var n=o("./node_modules/lodash/toNumber.js"),r=1/0,a=1.7976931348623157e308;e.exports=s},"./node_modules/lodash/toInteger.js":function(e,t,o){function s(e){var t=n(e),o=t%1;return t===t?o?t-o:t:0}var n=o("./node_modules/lodash/toFinite.js");e.exports=s},"./node_modules/lodash/toNumber.js":function(e,t,o){function s(e){if("number"==typeof e)return e;if(r(e))return a;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):l.test(e)?a:+e}var n=o("./node_modules/lodash/isObject.js"),r=o("./node_modules/lodash/isSymbol.js"),a=NaN,i=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=s},"./node_modules/lodash/toPairs.js":function(e,t,o){var s=o("./node_modules/lodash/_createToPairs.js"),n=o("./node_modules/lodash/keys.js"),r=s(n);e.exports=r},"./node_modules/lodash/toString.js":function(e,t,o){function s(e){return null==e?"":n(e)}var n=o("./node_modules/lodash/_baseToString.js");e.exports=s},"./node_modules/lodash/uniqueId.js":function(e,t,o){function s(e){var t=++r;return n(e)+t}var n=o("./node_modules/lodash/toString.js"),r=0;e.exports=s},"./node_modules/lodash/values.js":function(e,t,o){function s(e){return null==e?[]:n(e,r(e))}var n=o("./node_modules/lodash/_baseValues.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/without.js":function(e,t,o){var s=o("./node_modules/lodash/_baseDifference.js"),n=o("./node_modules/lodash/_baseRest.js"),r=o("./node_modules/lodash/isArrayLikeObject.js"),a=n(function(e,t){return r(e)?s(e,t):[]});e.exports=a},"./node_modules/lodash/zipObject.js":function(e,t,o){function s(e,t){return r(e||[],t||[],n)}var n=o("./node_modules/lodash/_assignValue.js"),r=o("./node_modules/lodash/_baseZipObject.js");e.exports=s},"./node_modules/react-resize-aware/dist/index.js":function(e,t,o){!function(e,s){!function(e,t){"use strict";function o(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(e,t){var o={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(o[s]=e[s]);return o}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(o){return t.createElement(c,l({component:e},o))}}var l=Object.assign||function(e){for(var t=1;t>>((3&t)<<3)&255;return n}}},"./node_modules/uuid/v1.js":function(e,t,o){function s(e,t,o){var s=t&&o||0,u=t||[];e=e||{};var c=e.node||n,p=void 0!==e.clockseq?e.clockseq:r;if(null==c||null==p){var h=a();null==c&&(c=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=r=16383&(h[6]<<8|h[7]))}var m=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:d+1,_=m-l+(f-d)/1e4;if(_<0&&void 0===e.clockseq&&(p=p+1&16383),(_<0||m>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=m,d=f,r=p,m+=122192928e5;var g=(1e4*(268435455&m)+f)%4294967296;u[s++]=g>>>24&255,u[s++]=g>>>16&255,u[s++]=g>>>8&255,u[s++]=255&g;var y=m/4294967296*1e4&268435455;u[s++]=y>>>8&255,u[s++]=255&y,u[s++]=y>>>24&15|16,u[s++]=y>>>16&255,u[s++]=p>>>8|128,u[s++]=255&p;for(var v=0;v<6;++v)u[s+v]=c[v];return t||i(u)}var n,r,a=o("./node_modules/uuid/lib/rng-browser.js"),i=o("./node_modules/uuid/lib/bytesToUuid.js"),l=0,d=0;e.exports=s},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},classnames:function(e,t){e.exports=classnames},"components/Loading/Loading":function(e,t){e.exports=Loading},"containers/FormBuilderLoader/FormBuilderLoader":function(e,t){e.exports=FormBuilderLoader},i18n:function(e,t){e.exports=i18n},jquery:function(e,t){e.exports=jQuery},"lib/Config":function(e,t){e.exports=Config},"lib/Injector":function(e,t){e.exports=Injector},moment:function(e,t){e.exports=moment},react:function(e,t){e.exports=React},"react-dom":function(e,t){e.exports=ReactDom},"react-redux":function(e,t){e.exports=ReactRedux},reactstrap:function(e,t){e.exports=Reactstrap},redux:function(e,t){e.exports=Redux},"state/viewMode/viewModeActions":function(e,t){e.exports=ViewModeActions}}); \ No newline at end of file diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index 2bf75f26..d68cecca 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1 @@ -#Form_EditForm_OtherDropdown_Holder{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:-1.5385rem -1.5385rem 0;border-bottom:1px solid #ced5e1;padding:3.077rem;background-color:#fff}#Form_EditForm_error.good+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.info+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.warning+fieldset>#Form_EditForm_OtherDropdown_Holder{margin-top:0}#Form_EditForm_OtherDropdown_Holder:after{border-bottom:none}#Form_EditForm_OtherDropdown_Holder .form__field-label{max-width:none;width:auto;margin-bottom:.9231rem;color:#566b8d;font-size:19px}#Form_EditForm_OtherDropdown_Holder .form__field-holder{width:100%;max-width:23rem}.history-viewer td:first-child{width:1%}.history-viewer>.panel--padded{padding-top:0}.panel--padded-side{padding-bottom:0;padding-top:0}.history-viewer__form{position:relative}.history-viewer__version-state .badge{margin-left:10px}.history-viewer__table--current tbody tr,.history-viewer__table--current tbody tr:hover{background-color:#0071c4;color:#fff}.history-viewer__table--current .text-muted{color:#fff!important}.table .history-viewer__actions{padding:0;text-align:right;width:1%;vertical-align:middle}.history-viewer__version-detail .nav-tabs{margin-top:-1.5385rem}.history-viewer__close-button{background:transparent;border:1px solid #fff;border-radius:50%;color:#fff;padding:.4rem .55rem}.history-viewer__close-button:before{font-size:1.4rem}.history-viewer__messages .message-box:first-child{margin-top:1.5385rem}.history-viewer__messages .message-box:last-child{margin-bottom:0}.history-viewer__preview{margin-top:-54px}.history-viewer__toolbar--condensed{min-width:50%;width:50%}@media (max-width:991.98px){.history-viewer__preview{display:none}} \ No newline at end of file +#Form_EditForm_OtherDropdown_Holder{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:-1.5385rem -1.5385rem 0;border-bottom:1px solid #ced5e1;padding:3.077rem;background-color:#fff}#Form_EditForm_error.good+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.info+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.warning+fieldset>#Form_EditForm_OtherDropdown_Holder{margin-top:0}#Form_EditForm_OtherDropdown_Holder:after{border-bottom:none}#Form_EditForm_OtherDropdown_Holder .form__field-label{max-width:none;width:auto;margin-bottom:.9231rem;color:#566b8d;font-size:19px}#Form_EditForm_OtherDropdown_Holder .form__field-holder{width:100%;max-width:23rem}.history-viewer>.panel--padded{padding-top:0}.history-viewer.history-viewer__compare-mode .panel--padded{padding-top:30px}.panel--padded-side{padding-bottom:0;padding-top:0}.history-viewer__form{position:relative}.history-viewer__version-state .text-muted{margin-right:10px}.history-viewer__version-detail--compare{margin-left:1.5385rem;margin-right:1.5385rem}.history-viewer__version-detail .nav-tabs{margin-top:-1.5385rem}.history-viewer__compare-button{border:1px solid #fff;color:#fff;margin-right:1rem}.history-viewer__close-button{background:transparent;border:1px solid #fff;border-radius:50%;color:#fff;padding:.4rem .55rem}.history-viewer__close-button:before{font-size:1.4rem}.history-viewer__messages .message-box:first-child{margin-top:1.5385rem}.history-viewer__messages .message-box:last-child{margin-bottom:0}.history-viewer__preview{margin-top:-54px}.history-viewer__toolbar--condensed{min-width:50%;width:50%}.history-viewer__compare-notice{-webkit-align-self:center;-ms-grid-row-align:center;align-self:center;background-color:#cae6f4;color:#237ca5;border:1px solid #93cde8;border-top:none;border-bottom-right-radius:5px;border-bottom-left-radius:5px;position:absolute}.history-viewer__compare-notice .notice-message{padding:.4rem 1rem .4rem 1.5rem;vertical-align:middle}.history-viewer__compare-notice button{background-color:inherit;color:inherit;border-width:0 0 0 1px;border-color:#93cde8;margin-right:0;border-radius:0 0 5px 0}.history-viewer__compare-notice button:hover{background-color:#dff0f8}.history-viewer__version-detail-diff del{color:#f44}.history-viewer__version-detail-diff ins{background-color:#dfd;text-decoration:none}@media (max-width:991.98px){.history-viewer__preview{display:none}}.history-viewer__actions-dropdown .form-check-label{text-transform:none}.history-viewer__actions-dropdown .btn[class*=font-icon-]:before{margin-right:0}.history-viewer__actions-dropdown.show .dropdown-menu{min-width:14rem}.history-viewer__actions-dropdown .form-check{margin-top:.5rem}.history-viewer__heading{font-size:.923rem;text-transform:uppercase}.history-viewer__table{padding:0}.history-viewer__table li{display:-webkit-box;display:-webkit-flex;display:flex;list-style-type:none}.history-viewer__heading,.history-viewer__row{border-bottom:1px solid #dbe0e9}.history-viewer__row{background-color:#fff}.history-viewer__row:active,.history-viewer__row:hover{background-color:#f0f4f7}.history-viewer__version-anchor{color:inherit;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.history-viewer__version-anchor:active,.history-viewer__version-anchor:hover{color:inherit;text-decoration:none}.history-viewer__actions,.history-viewer__author,.history-viewer__version-no,.history-viewer__version-state{padding:1.2308rem}.history-viewer__author,.history-viewer__version-state{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;width:50%}.history-viewer__actions{padding-top:0;padding-bottom:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;min-width:12rem}.table .history-viewer__row--current,.table .history-viewer__row--current:hover{background-color:#0071c4;color:#fff}.table .history-viewer__row--current .text-muted{color:#fff!important}.history-viewer__table:not(.history-viewer__table--current) .history-viewer__version-anchor:hover{cursor:pointer}.history-viewer__table--current{margin-bottom:.76925rem} \ No newline at end of file diff --git a/client/src/components/HistoryViewer/HistoryViewerHeading.js b/client/src/components/HistoryViewer/HistoryViewerHeading.js index 97e74549..f4bb8839 100644 --- a/client/src/components/HistoryViewer/HistoryViewerHeading.js +++ b/client/src/components/HistoryViewer/HistoryViewerHeading.js @@ -23,18 +23,19 @@ class HistoryViewerHeading extends Component { })); } - handleCompareModeChange(event) { - const checkbox = event.target; - if (checkbox.checked) { - this.props.onCompareModeSelect(); + handleCompareModeChange() { + const { compareModeSelected, onCompareModeUnselect, onCompareModeSelect } = this.props; + if (compareModeSelected) { + onCompareModeUnselect(); } else { - this.props.onCompareModeUnSelect(); + onCompareModeSelect(); } } render() { const { compareModeSelected } = this.props; const { dropdownOpen } = this.state; + return (
  • # diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index a1d48e05..137b2602 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -83,9 +83,9 @@ class HistoryViewerVersion extends Component { * @returns {FormAction|null} */ renderCompareButton() { - const { isActive, showCompareButton, FormActionComponent } = this.props; + const { compare, FormActionComponent } = this.props; - if (!isActive || !showCompareButton) { + if (compare) { return null; } @@ -190,7 +190,6 @@ HistoryViewerVersion.propTypes = { HistoryViewerVersion.defaultProps = { isActive: false, - showCompareButton: true, version: defaultVersion, }; diff --git a/yarn.lock b/yarn.lock index 9767c18e..ee4da1e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,9 +14,9 @@ eslint-plugin-jsx-a11y "^5.1.1" eslint-plugin-react "^7.3.0" -"@silverstripe/webpack-config@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-0.8.0.tgz#64ae69717394c07b6ba88e5e03716f41b8747a7a" +"@silverstripe/webpack-config@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-0.9.0.tgz#38da63a35d1c061d96ae3825d99561c5ed91a543" dependencies: autoprefixer "^6.4.0" babel-core "^6.24.1" @@ -33,6 +33,7 @@ modernizr "^3.5.0" modernizr-loader "^1.0.1" node-sass "^4.5.3" + npm "^6.0.0" postcss-load-config "^1.2.0" postcss-loader "^2.0.5" resolve-url-loader "^2.0.2" @@ -258,6 +259,10 @@ version "4.14.108" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.108.tgz#02656af3add2e5b3174f830862c47421c00ef817" +"@types/node@*": + version "10.5.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707" + "@types/node@^6.0.38": version "6.0.106" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.106.tgz#391bc3598ab5823563f7155847212152893edcd7" @@ -276,11 +281,18 @@ version "1.16.36" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-1.16.36.tgz#74bb6ed7928597c1b3fb1b009005e94dc6eae357" +JSONStream@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.3.tgz#27b4b8fbbfeab4e71bcf551e7f27be8d952239bf" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + abab@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" -abbrev@1: +abbrev@1, abbrev@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -337,6 +349,38 @@ adjust-sourcemap-loader@^1.1.0: object-path "^0.9.2" regex-parser "^2.2.9" +agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + dependencies: + es6-promisify "^5.0.0" + +agentkeepalive@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.4.1.tgz#aa95aebc3a749bca5ed53e3880a09f5235b48f0c" + dependencies: + humanize-ms "^1.2.1" + +airbnb-js-shims@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/airbnb-js-shims/-/airbnb-js-shims-1.6.0.tgz#b0675d05113e928c89bfa5b7b80b7399de8cee2a" + dependencies: + array-includes "^3.0.3" + array.prototype.flat "^1.2.1" + array.prototype.flatmap "^1.2.1" + array.prototype.flatten "^1.2.1" + es5-shim "^4.5.10" + es6-shim "^0.35.3" + function.prototype.name "^1.1.0" + object.entries "^1.0.4" + object.getownpropertydescriptors "^2.0.3" + object.values "^1.0.4" + promise.prototype.finally "^3.1.0" + string.prototype.matchall "^3.0.0" + string.prototype.padend "^3.0.0" + string.prototype.padstart "^3.0.0" + symbol.prototype.description "^1.0.0" + airbnb-js-shims@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/airbnb-js-shims/-/airbnb-js-shims-1.4.1.tgz#cc3e8eb8d35877f9d0fdc6583e26b0ee75b98ad0" @@ -366,7 +410,7 @@ ajv-keywords@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be" -ajv@^4.7.0: +ajv@^4.7.0, ajv@^4.9.1: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: @@ -407,6 +451,12 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + dependencies: + string-width "^2.0.0" + ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -419,7 +469,7 @@ ansi-html@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" -ansi-regex@^2.0.0: +ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -437,6 +487,14 @@ ansi-styles@^3.0.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansicolors@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" + +ansistyles@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ansistyles/-/ansistyles-0.1.3.tgz#5de60415bda071bb37127854c864f41b23254539" + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -478,10 +536,18 @@ append-transform@^0.4.0: dependencies: default-require-extensions "^1.0.0" -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.0.3, aproba@^1.1.1, aproba@^1.1.2, aproba@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" +"aproba@^1.1.2 || 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + +archy@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + are-we-there-yet@~1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" @@ -580,7 +646,15 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -array.prototype.flatmap@^1.2.0: +array.prototype.flat@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.10.0" + function-bind "^1.1.1" + +array.prototype.flatmap@^1.2.0, array.prototype.flatmap@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.1.tgz#3103cd4826ef90019c9b0a4839b2535fa6faf4e9" dependencies: @@ -588,7 +662,7 @@ array.prototype.flatmap@^1.2.0: es-abstract "^1.10.0" function-bind "^1.1.1" -array.prototype.flatten@^1.2.0: +array.prototype.flatten@^1.2.0, array.prototype.flatten@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/array.prototype.flatten/-/array.prototype.flatten-1.2.1.tgz#a77ae1b64524ce373b137fade324d12040d3c680" dependencies: @@ -600,7 +674,7 @@ arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asap@~2.0.3: +asap@^2.0.0, asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -1452,6 +1526,14 @@ babel-polyfill@6.7.4: babel-runtime "^5.0.0" core-js "^2.1.0" +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + babel-preset-env@^1.6.0, babel-preset-env@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48" @@ -1677,6 +1759,16 @@ big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" +bin-links@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-1.1.2.tgz#fb74bd54bae6b7befc6c6221f25322ac830d9757" + dependencies: + bluebird "^3.5.0" + cmd-shim "^2.0.2" + gentle-fs "^2.0.0" + graceful-fs "^4.1.11" + write-file-atomic "^2.3.0" + binary-extensions@^1.0.0: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" @@ -1687,7 +1779,7 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@^3.4.7, bluebird@^3.5.1: +bluebird@^3.4.7, bluebird@^3.5.0, bluebird@^3.5.1, bluebird@~3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -1740,6 +1832,18 @@ bowser@^1.0.0, bowser@^1.7.3: version "1.9.3" resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.3.tgz#6643ae4d783f31683f6d23156976b74183862162" +boxen@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" + brace-expansion@^1.0.0, brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1886,6 +1990,18 @@ builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" +builtins@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + +byline@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + +byte-size@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.3.tgz#b7c095efc68eadf82985fccd9a2df43a74fa2ccd" + bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -1908,6 +2024,25 @@ cacache@^10.0.4: unique-filename "^1.1.0" y18n "^4.0.0" +cacache@^11.0.1, cacache@^11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.0.2.tgz#ff30541a05302200108a759e660e30786f788764" + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + figgy-pudding "^3.1.0" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.2" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^6.0.0" + unique-filename "^1.1.0" + y18n "^4.0.0" + cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -1922,6 +2057,10 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +call-limit@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/call-limit/-/call-limit-1.1.0.tgz#6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea" + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -1962,7 +2101,7 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -camelcase@^4.1.0: +camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" @@ -1983,6 +2122,10 @@ caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000805: version "1.0.30000830" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000830.tgz#cb96b8a2dd3cbfe04acea2af3c4e894249095328" +capture-stack-trace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" + case-sensitive-paths-webpack-plugin@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.1.2.tgz#c899b52175763689224571dad778742e133f0192" @@ -2012,7 +2155,7 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.2: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: @@ -2024,6 +2167,17 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +cheerio@^1.0.0-rc.2: + version "1.0.0-rc.2" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.2.tgz#4b9f53a81b27e4d5dac31c0ffd0cfa03cc6830db" + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.0" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash "^4.15.0" + parse5 "^3.0.1" + chokidar@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.3.tgz#dcbd4f6cbb2a55b4799ba8a840ac527e5f4b1176" @@ -2042,7 +2196,7 @@ chokidar@^2.0.2: optionalDependencies: fsevents "^1.1.2" -chownr@^1.0.1: +chownr@^1.0.1, chownr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" @@ -2050,6 +2204,12 @@ ci-info@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" +cidr-regex@^2.0.8: + version "2.0.9" + resolved "https://registry.yarnpkg.com/cidr-regex/-/cidr-regex-2.0.9.tgz#9c17bb2b18e15af07f7d0c3b994b961d687ed1c9" + dependencies: + ip-regex "^2.1.0" + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -2090,6 +2250,28 @@ clean-css@4.1.x: dependencies: source-map "0.5.x" +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + +cli-color@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-1.2.0.tgz#3a5ae74fd76b6267af666e69e2afbbd01def34d1" + dependencies: + ansi-regex "^2.1.1" + d "1" + es5-ext "^0.10.12" + es6-iterator "2" + memoizee "^0.4.3" + timers-ext "0.1" + +cli-columns@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cli-columns/-/cli-columns-3.1.2.tgz#6732d972979efc2ae444a1f08e08fa139c96a18e" + dependencies: + string-width "^2.0.0" + strip-ansi "^3.0.1" + cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -2102,6 +2284,15 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-table3@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" + dependencies: + object-assign "^4.1.0" + string-width "^2.1.1" + optionalDependencies: + colors "^1.1.2" + cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" @@ -2122,6 +2313,14 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + clone-deep@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-2.0.2.tgz#00db3a1e173656730d1188c3d6aced6d7ea97713" @@ -2135,6 +2334,13 @@ clone@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" +cmd-shim@^2.0.2, cmd-shim@~2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" + dependencies: + graceful-fs "^4.1.2" + mkdirp "~0.5.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -2188,10 +2394,25 @@ colormin@^1.0.5: css-color-names "0.0.4" has "^1.0.1" +colors@0.5.x: + version "0.5.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.5.1.tgz#7d0023eaeb154e8ee9fce75dcb923d0ed1667774" + +colors@^1.1.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.1.tgz#4accdb89cf2cabc7f982771925e9468784f32f3d" + colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" +columnify@~1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + dependencies: + strip-ansi "^3.0.0" + wcwidth "^1.0.0" + combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" @@ -2228,7 +2449,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0: +concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.5.2, concat-stream@^1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: @@ -2237,13 +2458,31 @@ concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +config-chain@~1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.11.tgz#aba09747dfbe4c3e70e766a6e41586e1859fc6f2" + dependencies: + ini "^1.3.4" + proto-list "~1.2.1" + +configstore@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" dependencies: date-now "^0.1.4" -console-control-strings@^1.0.0, console-control-strings@~1.1.0: +console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -2338,6 +2577,12 @@ create-ecdh@^4.0.0: bn.js "^4.1.0" elliptic "^6.0.0" +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + create-hash@^1.1.0, create-hash@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -2410,6 +2655,10 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + css-color-names@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" @@ -2440,7 +2689,7 @@ css-loader@^0.28.1, css-loader@^0.28.11: postcss-value-parser "^3.3.0" source-list-map "^2.0.0" -css-select@^1.1.0: +css-select@^1.1.0, css-select@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" dependencies: @@ -2568,12 +2817,16 @@ debug@2.6.9, debug@^2.1.1, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6. dependencies: ms "2.0.0" -debug@^3.1.0: +debug@3.1.0, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: ms "2.0.0" +debuglog@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" + decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -2586,6 +2839,10 @@ deep-equal@^1.0.0, deep-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -2600,6 +2857,12 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + define-properties@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" @@ -2675,10 +2938,18 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +detect-indent@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + detect-port-alt@1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275" @@ -2686,6 +2957,13 @@ detect-port-alt@1.1.6: address "^1.0.1" debug "^2.6.0" +dezalgo@^1.0.0, dezalgo@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" + dependencies: + asap "^2.0.0" + wrappy "1" + diff@^3.0.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -2698,6 +2976,10 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + doctrine@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.2.3.tgz#6aec6bbd62cf89dd498cae70c0ed9f49da873a6a" @@ -2728,7 +3010,7 @@ dom-helpers@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.3.1.tgz#fc1a4e15ffdf60ddde03a480a9c0fece821dd4a6" -dom-serializer@0: +dom-serializer@0, dom-serializer@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" dependencies: @@ -2743,7 +3025,7 @@ domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" -domelementtype@1: +domelementtype@1, domelementtype@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" @@ -2757,6 +3039,12 @@ domhandler@2.1: dependencies: domelementtype "1" +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + dependencies: + domelementtype "1" + domutils@1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" @@ -2770,6 +3058,19 @@ domutils@1.5.1: dom-serializer "0" domelementtype "1" +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + dependencies: + dom-serializer "0" + domelementtype "1" + +dot-prop@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + dependencies: + is-obj "^1.0.0" + dotenv-webpack@^1.5.5: version "1.5.5" resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.5.5.tgz#3441094f04d304b6119e6b72524e62fb3252f5f2" @@ -2780,6 +3081,10 @@ dotenv@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -2799,6 +3104,10 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" +editor@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -2852,10 +3161,64 @@ enhanced-resolve@^3.3.0, enhanced-resolve@^3.4.0: object-assign "^4.0.1" tapable "^0.2.7" -entities@~1.1.1: +entities@^1.1.1, entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" +enzyme-adapter-react-15.4@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-15.4/-/enzyme-adapter-react-15.4-1.0.6.tgz#a69a4c7bc2dbfaf8b037ac0faf1c1512475b839f" + dependencies: + enzyme-adapter-react-helper "^1.2.2" + enzyme-adapter-utils "^1.4.0" + object.assign "^4.1.0" + object.values "^1.0.4" + prop-types "^15.6.0" + react-is "^16.4.1" + +enzyme-adapter-react-helper@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-helper/-/enzyme-adapter-react-helper-1.2.3.tgz#4c0c40fa7ca739d7928019524166cc6bad27d6bd" + dependencies: + airbnb-js-shims "^1.4.0" + install-peerdeps "^1.4.1" + npm-run "^4.1.2" + object.assign "^4.1.0" + object.getownpropertydescriptors "^2.0.3" + semver "^5.5.0" + +enzyme-adapter-utils@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.4.0.tgz#c403b81e8eb9953658569e539780964bdc98de62" + dependencies: + object.assign "^4.1.0" + prop-types "^15.6.0" + +enzyme@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.3.0.tgz#0971abd167f2d4bf3f5bd508229e1c4b6dc50479" + dependencies: + cheerio "^1.0.0-rc.2" + function.prototype.name "^1.0.3" + has "^1.0.1" + is-boolean-object "^1.0.0" + is-callable "^1.1.3" + is-number-object "^1.0.3" + is-string "^1.0.4" + is-subset "^0.1.1" + lodash "^4.17.4" + object-inspect "^1.5.0" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.0.4" + object.values "^1.0.4" + raf "^3.4.0" + rst-selector-parser "^2.2.3" + +err-code@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" + errno@^0.1.3, errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" @@ -2878,6 +3241,16 @@ es-abstract@^1.10.0, es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.6.1, is-callable "^1.1.3" is-regex "^1.0.4" +es-abstract@^1.12.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + es-to-primitive@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" @@ -2886,6 +3259,14 @@ es-to-primitive@^1.1.1: is-date-object "^1.0.1" is-symbol "^1.0.1" +es5-ext@^0.10.12, es5-ext@^0.10.30, es5-ext@~0.10.2: + version "0.10.45" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.45.tgz#0bfdf7b473da5919d5adf3bd25ceb754fccc3653" + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.1" + next-tick "1" + es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: version "0.10.42" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.42.tgz#8c07dd33af04d5dcd1310b5cef13bea63a89ba8d" @@ -2898,7 +3279,7 @@ es5-shim@^4.5.10: version "4.5.10" resolved "https://registry.yarnpkg.com/es5-shim/-/es5-shim-4.5.10.tgz#b7e17ef4df2a145b821f1497b50c25cf94026205" -es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" dependencies: @@ -2917,6 +3298,16 @@ es6-map@^0.1.3: es6-symbol "~3.1.1" event-emitter "~0.3.5" +es6-promise@^4.0.3: + version "4.2.4" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29" + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + dependencies: + es6-promise "^4.0.3" + es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" @@ -2945,7 +3336,7 @@ es6-templates@^0.2.3: recast "~0.11.12" through "~2.3.6" -es6-weak-map@^2.0.1: +es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" dependencies: @@ -3199,7 +3590,7 @@ etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" -event-emitter@~0.3.5: +event-emitter@^0.3.5, event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" dependencies: @@ -3433,6 +3824,10 @@ fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.4, fbjs@^0.8.9: setimmediate "^1.0.5" ua-parser-js "^0.7.9" +figgy-pudding@^3.0.0, figgy-pudding@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.1.0.tgz#a77ed2284175976c424b390b298569e9df86dd1e" + figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -3539,6 +3934,10 @@ find-cache-dir@^1.0.0: make-dir "^1.0.0" pkg-dir "^2.0.0" +find-npm-prefix@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz#8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf" + find-parent-dir@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" @@ -3634,6 +4033,13 @@ fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" +from2@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-1.3.0.tgz#88413baaa5f9a597cfde9221d86986cd3c061dfd" + dependencies: + inherits "~2.0.1" + readable-stream "~1.1.10" + from2@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" @@ -3661,7 +4067,15 @@ fs-minipass@^1.2.5: dependencies: minipass "^2.2.1" -fs-write-stream-atomic@^1.0.8: +fs-vacuum@^1.2.10, fs-vacuum@~1.2.10: + version "1.2.10" + resolved "https://registry.yarnpkg.com/fs-vacuum/-/fs-vacuum-1.2.10.tgz#b7629bec07a4031a2548fdf99f5ecf1cc8b31e36" + dependencies: + graceful-fs "^4.1.2" + path-is-inside "^1.0.1" + rimraf "^2.5.2" + +fs-write-stream-atomic@^1.0.8, fs-write-stream-atomic@~1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" dependencies: @@ -3694,7 +4108,7 @@ function-bind@^1.0.2, function-bind@^1.1.0, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" -function.prototype.name@^1.1.0: +function.prototype.name@^1.0.3, function.prototype.name@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327" dependencies: @@ -3739,6 +4153,23 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" +genfun@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/genfun/-/genfun-4.0.1.tgz#ed10041f2e4a7f1b0a38466d17a5c3e27df1dfc1" + +gentle-fs@^2.0.0, gentle-fs@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/gentle-fs/-/gentle-fs-2.0.1.tgz#585cfd612bfc5cd52471fdb42537f016a5ce3687" + dependencies: + aproba "^1.1.2" + fs-vacuum "^1.2.10" + graceful-fs "^4.1.11" + iferr "^0.1.5" + mkdirp "^0.5.1" + path-is-inside "^1.0.2" + read-cmd-shim "^1.0.1" + slide "^1.1.6" + get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" @@ -3814,7 +4245,7 @@ glob@^6.0.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.1, glob@~7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -3825,6 +4256,12 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + dependencies: + ini "^1.3.4" + global-modules@1.0.0, global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -3883,7 +4320,23 @@ gonzales-pe-sl@^4.2.3: dependencies: minimist "1.1.x" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@~4.1.11: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -3957,6 +4410,10 @@ handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -3970,6 +4427,13 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + har-validator@~5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" @@ -3995,7 +4459,11 @@ has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" -has-unicode@^2.0.0: +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + +has-unicode@^2.0.0, has-unicode@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -4118,6 +4586,10 @@ hosted-git-info@^2.1.4: version "2.6.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" +hosted-git-info@^2.6.0: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + html-comment-regex@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" @@ -4173,6 +4645,17 @@ html-webpack-plugin@^2.30.1: pretty-error "^2.0.2" toposort "^1.0.0" +htmlparser2@^3.9.1: + version "3.9.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + htmlparser2@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.3.0.tgz#cc70d05a59f6542e43f0e685c982e14c924a9efe" @@ -4182,6 +4665,10 @@ htmlparser2@~3.3.0: domutils "1.1" readable-stream "1.0" +http-cache-semantics@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + http-errors@1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" @@ -4204,6 +4691,13 @@ http-parser-js@>=0.4.0: version "0.4.12" resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.4.12.tgz#b9cfbf4a2cf26f0fc34b10ca1489a27771e3474f" +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + dependencies: + agent-base "4" + debug "3.1.0" + http-signature@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" @@ -4224,6 +4718,19 @@ https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" +https-proxy-agent@^2.2.0, https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + dependencies: + ms "^2.0.0" + hyphenate-style-name@^1.0.1, hyphenate-style-name@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b" @@ -4256,6 +4763,10 @@ iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" +iferr@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-1.0.2.tgz#e9fde49a9da06dc4a4194c6c9ed6d08305037a6d" + ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" @@ -4270,6 +4781,10 @@ immutable@^3.8.1: version "3.8.2" resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + imports-loader@^0.6.5: version "0.6.5" resolved "https://registry.yarnpkg.com/imports-loader/-/imports-loader-0.6.5.tgz#ae74653031d59e37b3c2fb2544ac61aeae3530a6" @@ -4299,7 +4814,7 @@ indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" -inflight@^1.0.4: +inflight@^1.0.4, inflight@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" dependencies: @@ -4314,10 +4829,23 @@ inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" -ini@^1.3.4, ini@~1.3.0: +ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" +init-package-json@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-1.10.3.tgz#45ffe2f610a8ca134f2bd1db5637b235070f6cbe" + dependencies: + glob "^7.1.1" + npm-package-arg "^4.0.0 || ^5.0.0 || ^6.0.0" + promzard "^0.3.0" + read "~1.0.1" + read-package-json "1 || 2" + semver "2.x || 3.x || 4 || 5" + validate-npm-package-license "^3.0.1" + validate-npm-package-name "^3.0.0" + inline-style-prefixer@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-2.0.5.tgz#c153c7e88fd84fef5c602e95a8168b2770671fe7" @@ -4369,6 +4897,18 @@ inquirer@^0.12.0: strip-ansi "^3.0.0" through "^2.3.6" +install-peerdeps@^1.4.1: + version "1.8.0" + resolved "https://registry.yarnpkg.com/install-peerdeps/-/install-peerdeps-1.8.0.tgz#3c937b0d4dabba0ae1f086707eccbb8066f82873" + dependencies: + babel-polyfill "^6.26.0" + cli-color "^1.2.0" + commander "^2.11.0" + promptly "^2.1.0" + request "^2.83.0" + request-promise-native "^1.0.5" + semver "^5.5.0" + interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" @@ -4383,6 +4923,14 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + +ip@^1.1.4, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + ipaddr.js@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b" @@ -4413,6 +4961,10 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" +is-boolean-object@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -4427,12 +4979,18 @@ is-callable@^1.1.1, is-callable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" -is-ci@^1.0.9: +is-ci@^1.0.10, is-ci@^1.0.9: version "1.1.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" dependencies: ci-info "^1.0.0" +is-cidr@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/is-cidr/-/is-cidr-2.0.6.tgz#4b01c9693d8e18399dacd18a4f3d60ea5871ac60" + dependencies: + cidr-regex "^2.0.8" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -4539,6 +5097,13 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-installed-globally@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + dependencies: + global-dirs "^0.1.0" + is-path-inside "^1.0.0" + is-my-ip-valid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" @@ -4553,6 +5118,14 @@ is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + +is-number-object@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -4569,6 +5142,10 @@ is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + is-odd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" @@ -4609,7 +5186,7 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-promise@^2.1.0: +is-promise@^2.1, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -4617,6 +5194,10 @@ is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" @@ -4627,14 +5208,26 @@ is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + is-root@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-root/-/is-root-1.0.0.tgz#07b6c233bc394cd9d02ba15c966bd6660d6342d5" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-string@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + is-svg@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" @@ -5020,7 +5613,7 @@ json-loader@^0.5.4, json-loader@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" -json-parse-better-errors@^1.0.1: +json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -5064,6 +5657,10 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + jsonpointer@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" @@ -5115,10 +5712,20 @@ known-css-properties@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.3.0.tgz#a3d135bbfc60ee8c6eacf2f7e7e6f2d4755e49a4" +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + dependencies: + package-json "^4.0.0" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +lazy-property@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazy-property/-/lazy-property-1.0.0.tgz#84ddc4b370679ba8bd4cdcfa4c06b43d57111147" + lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" @@ -5136,6 +5743,44 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +libcipm@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/libcipm/-/libcipm-2.0.0.tgz#577cdedcb2bfb1e9170a191e2045b757722beb65" + dependencies: + bin-links "^1.1.2" + bluebird "^3.5.1" + find-npm-prefix "^1.0.2" + graceful-fs "^4.1.11" + lock-verify "^2.0.2" + npm-lifecycle "^2.0.3" + npm-logical-tree "^1.2.1" + npm-package-arg "^6.1.0" + pacote "^8.1.6" + protoduck "^5.0.0" + read-package-json "^2.0.13" + rimraf "^2.6.2" + worker-farm "^1.6.0" + +libnpmhook@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/libnpmhook/-/libnpmhook-4.0.1.tgz#63641654de772cbeb96a88527a7fd5456ec3c2d7" + dependencies: + figgy-pudding "^3.1.0" + npm-registry-fetch "^3.0.0" + +libnpx@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/libnpx/-/libnpx-10.2.0.tgz#1bf4a1c9f36081f64935eb014041da10855e3102" + dependencies: + dotenv "^5.0.1" + npm-package-arg "^6.0.0" + rimraf "^2.6.2" + safe-buffer "^5.1.0" + update-notifier "^2.3.0" + which "^1.3.0" + y18n "^4.0.0" + yargs "^11.0.0" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -5190,6 +5835,19 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +lock-verify@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lock-verify/-/lock-verify-2.0.2.tgz#148e4f85974915c9e3c34d694b7de9ecb18ee7a8" + dependencies: + npm-package-arg "^5.1.2 || 6" + semver "^5.4.1" + +lockfile@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.4.tgz#07f819d25ae48f87e538e6578b6964a4981a5609" + dependencies: + signal-exit "^3.0.2" + lodash-es@^4.2.1: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.10.tgz#62cd7104cdf5dd87f235a837f0ede0e8e5117e05" @@ -5205,6 +5863,13 @@ lodash._basecopy@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" +lodash._baseuniq@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" + dependencies: + lodash._createset "~4.0.0" + lodash._root "~3.0.0" + lodash._bindcallback@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" @@ -5217,6 +5882,10 @@ lodash._createassigner@^3.0.0: lodash._isiterateecall "^3.0.0" lodash.restparam "^3.0.0" +lodash._createset@~4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" + lodash._getnative@^3.0.0: version "3.9.1" resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" @@ -5225,6 +5894,10 @@ lodash._isiterateecall@^3.0.0: version "3.0.9" resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" +lodash._root@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + lodash.assign@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.2.0.tgz#3ce9f0234b4b2223e296b8fa0ac1fee8ebca64fa" @@ -5245,7 +5918,7 @@ lodash.capitalize@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" -lodash.clonedeep@^4.3.2: +lodash.clonedeep@^4.3.2, lodash.clonedeep@~4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" @@ -5388,15 +6061,23 @@ lodash.tonumber@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash.tonumber/-/lodash.tonumber-4.0.3.tgz#0b96b31b35672793eb7f5a63ee791f1b9e9025d9" -lodash.uniq@^4.5.0: +lodash.union@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" + +lodash.uniq@^4.5.0, lodash.uniq@~4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" +lodash.without@~4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" + lodash@4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -lodash@^4.0.0, lodash@^4.12.0, lodash@^4.14.0, lodash@^4.17.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.4: +lodash@^4.0.0, lodash@^4.12.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.4: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -5421,6 +6102,10 @@ lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + lru-cache@^4.0.1, lru-cache@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f" @@ -5428,6 +6113,19 @@ lru-cache@^4.0.1, lru-cache@^4.1.1: pseudomap "^1.0.2" yallist "^2.1.2" +lru-cache@^4.1.2, lru-cache@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +lru-queue@0.1: + version "0.1.0" + resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + dependencies: + es5-ext "~0.10.2" + macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" @@ -5442,6 +6140,38 @@ make-error@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" +"make-fetch-happen@^2.5.0 || 3 || 4", make-fetch-happen@^4.0.0, make-fetch-happen@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" + dependencies: + agentkeepalive "^3.4.1" + cacache "^11.0.1" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + lru-cache "^4.1.2" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^4.0.0" + ssri "^6.0.0" + +make-fetch-happen@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-3.0.0.tgz#7b661d2372fc4710ab5cc8e1fa3c290eea69a961" + dependencies: + agentkeepalive "^3.4.1" + cacache "^10.0.4" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.0" + lru-cache "^4.1.2" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^3.0.1" + ssri "^5.2.4" + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -5484,6 +6214,10 @@ md5.js@^1.3.4: hash-base "^3.0.0" inherits "^2.0.1" +meant@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/meant/-/meant-1.0.1.tgz#66044fea2f23230ec806fb515efea29c44d2115d" + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -5494,6 +6228,19 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +memoizee@^0.4.3: + version "0.4.12" + resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.12.tgz#780e99a219c50c549be6d0fc61765080975c58fb" + dependencies: + d "1" + es5-ext "^0.10.30" + es6-weak-map "^2.0.2" + event-emitter "^0.3.5" + is-promise "^2.1" + lru-queue "0.1" + next-tick "1" + timers-ext "^0.1.2" + memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -5646,6 +6393,13 @@ minipass@^2.2.1, minipass@^2.2.4: safe-buffer "^5.1.1" yallist "^3.0.0" +minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + minizlib@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" @@ -5667,6 +6421,21 @@ mississippi@^2.0.0: stream-each "^1.1.0" through2 "^2.0.0" +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" @@ -5723,7 +6492,7 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -ms@2.1.1: +ms@2.1.1, ms@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" @@ -5731,7 +6500,7 @@ mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" -mute-stream@0.0.7: +mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -5760,6 +6529,15 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +nearley@^2.7.10: + version "2.13.0" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.13.0.tgz#6e7b0f4e68bfc3e74c99eaef2eda39e513143439" + dependencies: + nomnom "~1.6.2" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + needle@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.0.tgz#f14efc69cee1024b72c8b21c7bdf94a731dc12fa" @@ -5792,6 +6570,14 @@ node-dir@^0.1.10: dependencies: minimatch "^3.0.2" +node-fetch-npm@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" + dependencies: + encoding "^0.1.11" + json-parse-better-errors "^1.0.0" + safe-buffer "^5.1.1" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -5817,6 +6603,23 @@ node-gyp@^3.3.1: tar "^2.0.0" which "1" +node-gyp@^3.6.2, node-gyp@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.7.0.tgz#789478e8f6c45e277aa014f3e28f958f286f9203" + dependencies: + fstream "^1.0.0" + glob "^7.0.3" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + nopt "2 || 3" + npmlog "0 || 1 || 2 || 3 || 4" + osenv "0" + request ">=2.9.0 <2.82.0" + rimraf "2" + semver "~5.3.0" + tar "^2.0.0" + which "1" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -5897,20 +6700,27 @@ node-sass@^4.5.3: stdout-stream "^1.4.0" "true-case-path" "^1.0.2" +nomnom@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.6.2.tgz#84a66a260174408fc5b77a18f888eccc44fb6971" + dependencies: + colors "0.5.x" + underscore "~1.4.4" + "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" dependencies: abbrev "1" -nopt@^4.0.1: +nopt@^4.0.1, nopt@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" dependencies: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.4.0, "normalize-package-data@~1.0.1 || ^2.0.0", normalize-package-data@~2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" dependencies: @@ -5938,24 +6748,262 @@ normalize-url@^1.4.0: query-string "^4.1.0" sort-keys "^1.0.0" +npm-audit-report@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-1.3.1.tgz#e79ea1fcb5ffaf3031102b389d5222c2b0459632" + dependencies: + cli-table3 "^0.5.0" + console-control-strings "^1.1.0" + npm-bundled@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" -npm-packlist@^1.1.6: +npm-cache-filename@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz#ded306c5b0bfc870a9e9faf823bc5f283e05ae11" + +npm-install-checks@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-3.0.0.tgz#d4aecdfd51a53e3723b7b2f93b2ee28e307bc0d7" + dependencies: + semver "^2.3.0 || 3.x || 4 || 5" + +npm-lifecycle@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.0.3.tgz#696bedf1143371163e9cc16fe872357e25d8d90e" + dependencies: + byline "^5.0.0" + graceful-fs "^4.1.11" + node-gyp "^3.6.2" + resolve-from "^4.0.0" + slide "^1.1.6" + uid-number "0.0.6" + umask "^1.1.0" + which "^1.3.0" + +npm-logical-tree@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz#44610141ca24664cad35d1e607176193fd8f5b88" + +"npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^5.1.2 || 6", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" + dependencies: + hosted-git-info "^2.6.0" + osenv "^0.1.5" + semver "^5.5.0" + validate-npm-package-name "^3.0.0" + +npm-packlist@^1.1.10, npm-packlist@^1.1.6, npm-packlist@~1.1.10: version "1.1.10" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" +npm-path@^2.0.2, npm-path@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" + dependencies: + which "^1.2.10" + +npm-pick-manifest@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.1.0.tgz#dc381bdd670c35d81655e1d5a94aa3dd4d87fce5" + dependencies: + npm-package-arg "^6.0.0" + semver "^5.4.1" + +npm-profile@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-3.0.2.tgz#58d568f1b56ef769602fd0aed8c43fa0e0de0f57" + dependencies: + aproba "^1.1.2 || 2" + make-fetch-happen "^2.5.0 || 3 || 4" + +npm-registry-client@^8.5.1: + version "8.6.0" + resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-8.6.0.tgz#7f1529f91450732e89f8518e0f21459deea3e4c4" + dependencies: + concat-stream "^1.5.2" + graceful-fs "^4.1.6" + normalize-package-data "~1.0.1 || ^2.0.0" + npm-package-arg "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" + once "^1.3.3" + request "^2.74.0" + retry "^0.10.0" + safe-buffer "^5.1.1" + semver "2 >=2.2.1 || 3.x || 4 || 5" + slide "^1.1.3" + ssri "^5.2.4" + optionalDependencies: + npmlog "2 || ^3.1.0 || ^4.0.0" + +npm-registry-fetch@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-1.1.1.tgz#710bc5947d9ee2c549375072dab6d5d17baf2eb2" + dependencies: + bluebird "^3.5.1" + figgy-pudding "^3.0.0" + lru-cache "^4.1.2" + make-fetch-happen "^3.0.0" + npm-package-arg "^6.0.0" + safe-buffer "^5.1.1" + +npm-registry-fetch@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.1.1.tgz#e96bae698afdd45d4a01aca29e881fc0bc55206c" + dependencies: + bluebird "^3.5.1" + figgy-pudding "^3.1.0" + lru-cache "^4.1.2" + make-fetch-happen "^4.0.0" + npm-package-arg "^6.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" dependencies: path-key "^2.0.0" -"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2, npmlog@^4.1.2: +npm-run@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npm-run/-/npm-run-4.1.2.tgz#1030e1ec56908c89fcc3fa366d03a2c2ba98eb99" + dependencies: + cross-spawn "^5.1.0" + minimist "^1.2.0" + npm-path "^2.0.3" + npm-which "^3.0.1" + serializerr "^1.0.3" + sync-exec "^0.6.2" + +npm-user-validate@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-1.0.0.tgz#8ceca0f5cea04d4e93519ef72d0557a75122e951" + +npm-which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + dependencies: + commander "^2.9.0" + npm-path "^2.0.2" + which "^1.2.10" + +npm@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/npm/-/npm-6.2.0.tgz#2cee4b52825a91f531cd324a3b0f6e105be40c16" + dependencies: + JSONStream "^1.3.3" + abbrev "~1.1.1" + ansicolors "~0.3.2" + ansistyles "~0.1.3" + aproba "~1.2.0" + archy "~1.0.0" + bin-links "^1.1.2" + bluebird "~3.5.1" + byte-size "^4.0.3" + cacache "^11.0.2" + call-limit "~1.1.0" + chownr "~1.0.1" + cli-columns "^3.1.2" + cli-table3 "^0.5.0" + cmd-shim "~2.0.2" + columnify "~1.5.4" + config-chain "~1.1.11" + detect-indent "~5.0.0" + detect-newline "^2.1.0" + dezalgo "~1.0.3" + editor "~1.0.0" + figgy-pudding "^3.1.0" + find-npm-prefix "^1.0.2" + fs-vacuum "~1.2.10" + fs-write-stream-atomic "~1.0.10" + gentle-fs "^2.0.1" + glob "~7.1.2" + graceful-fs "~4.1.11" + has-unicode "~2.0.1" + hosted-git-info "^2.6.0" + iferr "^1.0.0" + inflight "~1.0.6" + inherits "~2.0.3" + ini "^1.3.5" + init-package-json "^1.10.3" + is-cidr "^2.0.6" + json-parse-better-errors "^1.0.2" + lazy-property "~1.0.0" + libcipm "^2.0.0" + libnpmhook "^4.0.1" + libnpx "^10.2.0" + lock-verify "^2.0.2" + lockfile "^1.0.4" + lodash._baseuniq "~4.6.0" + lodash.clonedeep "~4.5.0" + lodash.union "~4.6.0" + lodash.uniq "~4.5.0" + lodash.without "~4.4.0" + lru-cache "^4.1.3" + meant "~1.0.1" + mississippi "^3.0.0" + mkdirp "~0.5.1" + move-concurrently "^1.0.1" + node-gyp "^3.7.0" + nopt "~4.0.1" + normalize-package-data "~2.4.0" + npm-audit-report "^1.3.1" + npm-cache-filename "~1.0.2" + npm-install-checks "~3.0.0" + npm-lifecycle "^2.0.3" + npm-package-arg "^6.1.0" + npm-packlist "~1.1.10" + npm-pick-manifest "^2.1.0" + npm-profile "^3.0.2" + npm-registry-client "^8.5.1" + npm-registry-fetch "^1.1.0" + npm-user-validate "~1.0.0" + npmlog "~4.1.2" + once "~1.4.0" + opener "~1.4.3" + osenv "^0.1.5" + pacote "^8.1.6" + path-is-inside "~1.0.2" + promise-inflight "~1.0.1" + qrcode-terminal "^0.12.0" + query-string "^6.1.0" + qw "~1.0.1" + read "~1.0.7" + read-cmd-shim "~1.0.1" + read-installed "~4.0.3" + read-package-json "^2.0.13" + read-package-tree "^5.2.1" + readable-stream "^2.3.6" + request "^2.81.0" + retry "^0.12.0" + rimraf "~2.6.2" + safe-buffer "^5.1.2" + semver "^5.5.0" + sha "~2.0.1" + slide "~1.1.6" + sorted-object "~2.0.1" + sorted-union-stream "~2.1.3" + ssri "^6.0.0" + tar "^4.4.4" + text-table "~0.2.0" + tiny-relative-date "^1.3.0" + uid-number "0.0.6" + umask "~1.1.0" + unique-filename "~1.1.0" + unpipe "~1.0.0" + update-notifier "^2.5.0" + uuid "^3.3.2" + validate-npm-package-license "^3.0.3" + validate-npm-package-name "~3.0.0" + which "^1.3.1" + worker-farm "^1.6.0" + wrappy "~1.0.2" + write-file-atomic "^2.3.0" + +"npmlog@0 || 1 || 2 || 3 || 4", "npmlog@2 || ^3.1.0 || ^4.0.0", npmlog@^4.0.0, npmlog@^4.0.2, npmlog@^4.1.2, npmlog@~4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -6002,6 +7050,18 @@ object-hash@^1.1.4: version "1.3.0" resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.0.tgz#76d9ba6ff113cf8efc0d996102851fe6723963e2" +object-inspect@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + +object-is@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" + +object-keys@^1.0.11: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + object-keys@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" @@ -6016,6 +7076,15 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + object.entries@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f" @@ -6060,7 +7129,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0, once@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -6076,6 +7145,10 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +opener@~1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8" + opn@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.2.0.tgz#71fdf934d6827d676cecbea1531f95d354641225" @@ -6132,7 +7205,7 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@0, osenv@^0.1.4: +osenv@0, osenv@^0.1.4, osenv@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" dependencies: @@ -6159,6 +7232,45 @@ p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +pacote@^8.1.6: + version "8.1.6" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-8.1.6.tgz#8e647564d38156367e7a9dc47a79ca1ab278d46e" + dependencies: + bluebird "^3.5.1" + cacache "^11.0.2" + get-stream "^3.0.0" + glob "^7.1.2" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + minimatch "^3.0.4" + minipass "^2.3.3" + mississippi "^3.0.0" + mkdirp "^0.5.1" + normalize-package-data "^2.4.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.1.10" + npm-pick-manifest "^2.1.0" + osenv "^0.1.5" + promise-inflight "^1.0.1" + promise-retry "^1.1.1" + protoduck "^5.0.0" + rimraf "^2.6.2" + safe-buffer "^5.1.2" + semver "^5.5.0" + ssri "^6.0.0" + tar "^4.4.3" + unique-filename "^1.1.0" + which "^1.3.0" + pako@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" @@ -6217,6 +7329,12 @@ parse5@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" +parse5@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + dependencies: + "@types/node" "*" + parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -6247,7 +7365,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1, path-is-inside@^1.0.2: +path-is-inside@^1.0.1, path-is-inside@^1.0.2, path-is-inside@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -6287,6 +7405,10 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -6625,7 +7747,7 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" -prepend-http@^1.0.0: +prepend-http@^1.0.0, prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -6670,10 +7792,17 @@ progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" -promise-inflight@^1.0.1: +promise-inflight@^1.0.1, promise-inflight@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" +promise-retry@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d" + dependencies: + err-code "^1.0.0" + retry "^0.10.0" + promise.prototype.finally@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/promise.prototype.finally/-/promise.prototype.finally-3.1.0.tgz#66f161b1643636e50e7cf201dc1b84a857f3864e" @@ -6688,6 +7817,18 @@ promise@^7.1.1: dependencies: asap "~2.0.3" +promptly@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/promptly/-/promptly-2.2.0.tgz#2a13fa063688a2a5983b161fff0108a07d26fc74" + dependencies: + read "^1.0.4" + +promzard@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" + dependencies: + read "1" + prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.6.1: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" @@ -6703,6 +7844,20 @@ prop-types@^15.6.2: loose-envify "^1.3.1" object-assign "^4.1.1" +proto-list@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + +protochain@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/protochain/-/protochain-1.0.5.tgz#991c407e99de264aadf8f81504b5e7faf7bfa260" + +protoduck@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.0.tgz#752145e6be0ad834cb25716f670a713c860dce70" + dependencies: + genfun "^4.0.1" + proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -6718,6 +7873,10 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +psl@^1.1.24: + version "1.1.28" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.28.tgz#4fb6ceb08a1e2214d4fd4de0ca22dae13740bc7b" + public-encrypt@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" @@ -6735,6 +7894,13 @@ pump@^2.0.0, pump@^2.0.1: end-of-stream "^1.1.0" once "^1.3.1" +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + pumpify@^1.3.3: version "1.4.0" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.4.0.tgz#80b7c5df7e24153d03f0e7ac8a05a5d068bd07fb" @@ -6759,6 +7925,10 @@ q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" +qrcode-terminal@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" + qs@6.5.1, qs@^6.5.1, qs@~6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" @@ -6767,6 +7937,10 @@ qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + query-string@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/query-string/-/query-string-3.0.3.tgz#ae2e14b4d05071d4e9b9eb4873c35b0dcd42e638" @@ -6780,6 +7954,13 @@ query-string@^4.1.0: object-assign "^4.1.0" strict-uri-encode "^1.0.0" +query-string@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.1.0.tgz#01e7d69f6a0940dac67a937d6c6325647aa4532a" + dependencies: + decode-uri-component "^0.2.0" + strict-uri-encode "^2.0.0" + querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -6796,6 +7977,10 @@ querystringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.0.0.tgz#fa3ed6e68eb15159457c89b37bc6472833195755" +qw@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/qw/-/qw-1.0.1.tgz#efbfdc740f9ad054304426acb183412cc8b996d4" + radium@^0.19.0: version "0.19.6" resolved "https://registry.yarnpkg.com/radium/-/radium-0.19.6.tgz#b86721d08dbd303b061a4ae2ebb06cc6e335ae72" @@ -6805,6 +7990,23 @@ radium@^0.19.0: inline-style-prefixer "^2.0.5" prop-types "^15.5.8" +raf@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.0.tgz#a28876881b4bc2ca9117d4138163ddb80f781575" + dependencies: + performance-now "^2.1.0" + +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + randomatic@^1.1.3: version "1.1.7" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" @@ -6842,6 +8044,15 @@ raw-loader@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa" +rc@^1.0.1, rc@^1.1.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + rc@^1.1.7: version "1.2.6" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.6.tgz#eb18989c6d4f4f162c399f79ddd29f3835568092" @@ -6943,6 +8154,10 @@ react-inspector@^2.2.2: babel-runtime "^6.26.0" is-dom "^1.0.9" +react-is@^16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.4.1.tgz#d624c4650d2c65dbd52c72622bbf389435d9776e" + react-lifecycles-compat@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.2.tgz#7279047275bd727a912e25f734c0559527e84eff" @@ -6978,6 +8193,10 @@ react-redux@^4.4.5: loose-envify "^1.1.0" prop-types "^15.5.4" +react-resize-aware@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/react-resize-aware/-/react-resize-aware-2.7.1.tgz#e54bc5fc4d67e3f9cc0342626e836bfc207e322e" + react-router-redux@^4.0.5: version "4.0.8" resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-4.0.8.tgz#227403596b5151e182377dab835b5d45f0f8054e" @@ -7054,6 +8273,46 @@ reactstrap@^5.0.0-beta: react-popper "^0.8.3" react-transition-group "^2.2.1" +read-cmd-shim@^1.0.1, read-cmd-shim@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" + dependencies: + graceful-fs "^4.1.2" + +read-installed@~4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" + dependencies: + debuglog "^1.0.1" + read-package-json "^2.0.0" + readdir-scoped-modules "^1.0.0" + semver "2 || 3 || 4 || 5" + slide "~1.1.3" + util-extend "^1.0.1" + optionalDependencies: + graceful-fs "^4.1.2" + +"read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" + dependencies: + glob "^7.1.1" + json-parse-better-errors "^1.0.1" + normalize-package-data "^2.0.0" + slash "^1.0.0" + optionalDependencies: + graceful-fs "^4.1.2" + +read-package-tree@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.2.1.tgz#6218b187d6fac82289ce4387bbbaf8eef536ad63" + dependencies: + debuglog "^1.0.1" + dezalgo "^1.0.0" + once "^1.3.0" + read-package-json "^2.0.0" + readdir-scoped-modules "^1.0.0" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -7084,7 +8343,13 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3: +read@1, read@^1.0.4, read@~1.0.1, read@~1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + dependencies: + mute-stream "~0.0.4" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -7105,6 +8370,24 @@ readable-stream@1.0: isarray "0.0.1" string_decoder "~0.10.x" +readable-stream@~1.1.10: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdir-scoped-modules@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" + dependencies: + debuglog "^1.0.1" + dezalgo "^1.0.0" + graceful-fs "^4.1.2" + once "^1.3.0" + readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -7194,6 +8477,10 @@ regenerate@^1.2.1: version "1.3.3" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -7223,6 +8510,12 @@ regex-parser@^2.2.9: version "2.2.9" resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.9.tgz#a372f45a248b62976a568037c1b6e60a60599192" +regexp.prototype.flags@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz#6b30724e306a27833eeb171b66ac8890ba37e41c" + dependencies: + define-properties "^1.1.2" + regexpp@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" @@ -7243,6 +8536,19 @@ regexpu-core@^2.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" +registry-auth-token@^3.0.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" @@ -7292,6 +8598,20 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@2, request@^2.79.0: version "2.85.0" resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" @@ -7319,6 +8639,58 @@ request@2, request@^2.79.0: tunnel-agent "^0.6.0" uuid "^3.1.0" +"request@>=2.9.0 <2.82.0": + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +request@^2.74.0, request@^2.81.0, request@^2.83.0: + version "2.87.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + request@~2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -7386,6 +8758,10 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + resolve-url-loader@^2.0.2: version "2.3.0" resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-2.3.0.tgz#e1b37034d48f22f8cfb9f04c026faaa070fdaf26" @@ -7432,6 +8808,14 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" +retry@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + rework-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/rework-visit/-/rework-visit-1.0.0.tgz#9945b2803f219e2f7aca00adb8bc9f640f842c9a" @@ -7449,7 +8833,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -7462,6 +8846,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + dependencies: + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" + run-async@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" @@ -7498,7 +8889,7 @@ safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -7592,7 +8983,13 @@ scss-tokenizer@^0.2.3: js-base64 "^2.1.8" source-map "^0.4.2" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1: +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" @@ -7622,6 +9019,12 @@ serialize-javascript@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" +serializerr@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/serializerr/-/serializerr-1.0.3.tgz#12d4c5aa1c3ffb8f6d1dc5f395aa9455569c3f91" + dependencies: + protochain "^1.0.5" + serve-favicon@^2.4.5: version "2.5.0" resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0" @@ -7686,6 +9089,13 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" +sha@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/sha/-/sha-2.0.1.tgz#6030822fbd2c9823949f8f72ed6411ee5cf25aae" + dependencies: + graceful-fs "^4.1.2" + readable-stream "^2.0.2" + shallow-clone@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-1.0.0.tgz#4480cd06e882ef68b2ad88a3ea54832e2c48b571" @@ -7753,6 +9163,18 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" +slide@^1.1.3, slide@^1.1.6, slide@~1.1.3, slide@~1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +smart-buffer@^1.0.13: + version "1.1.15" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" + +smart-buffer@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -7803,12 +9225,51 @@ sockjs-client@1.1.4: json3 "^3.3.2" url-parse "^1.1.8" +socks-proxy-agent@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz#2eae7cf8e2a82d34565761539a7f9718c5617659" + dependencies: + agent-base "^4.1.0" + socks "^1.1.10" + +socks-proxy-agent@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" + dependencies: + agent-base "~4.2.0" + socks "~2.2.0" + +socks@^1.1.10: + version "1.1.10" + resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" + dependencies: + ip "^1.1.4" + smart-buffer "^1.0.13" + +socks@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" + dependencies: + ip "^1.1.5" + smart-buffer "^4.0.1" + sort-keys@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" dependencies: is-plain-obj "^1.0.0" +sorted-object@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/sorted-object/-/sorted-object-2.0.1.tgz#7d631f4bd3a798a24af1dffcfbfe83337a5df5fc" + +sorted-union-stream@~2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/sorted-union-stream/-/sorted-union-stream-2.1.3.tgz#c7794c7e077880052ff71a8d4a2dbb4a9a638ac7" + dependencies: + from2 "^1.3.0" + stream-iterate "^1.1.0" + source-list-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" @@ -7918,6 +9379,10 @@ ssri@^5.2.4: dependencies: safe-buffer "^5.1.1" +ssri@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.0.tgz#fc21bfc90e03275ac3e23d5a42e38b8a1cbc130d" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -7939,6 +9404,10 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" @@ -7963,6 +9432,13 @@ stream-http@^2.7.2: to-arraybuffer "^1.0.0" xtend "^4.0.0" +stream-iterate@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/stream-iterate/-/stream-iterate-1.2.0.tgz#2bd7c77296c1702a46488b8ad41f79865eecd4e1" + dependencies: + readable-stream "^2.1.5" + stream-shift "^1.0.0" + stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" @@ -7971,6 +9447,10 @@ strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + string-length@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" @@ -7992,6 +9472,16 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string.prototype.matchall@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-3.0.0.tgz#66f4d8dd5c6c6cea4dffb55ec5f3184a8dd0dd59" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has-symbols "^1.0.0" + regexp.prototype.flags "^1.2.0" + string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -8115,6 +9605,16 @@ symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" +symbol.prototype.description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/symbol.prototype.description/-/symbol.prototype.description-1.0.0.tgz#6e355660eb1e44ca8ad53a68fdb72ef131ca4b12" + dependencies: + has-symbols "^1.0.0" + +sync-exec@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/sync-exec/-/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105" + table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" @@ -8161,6 +9661,24 @@ tar@^4: safe-buffer "^5.1.1" yallist "^3.0.2" +tar@^4.4.3, tar@^4.4.4: + version "4.4.4" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + dependencies: + execa "^0.7.0" + test-exclude@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" @@ -8186,7 +9704,7 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through@^2.3.6, through@^2.3.8, through@~2.3.6: +"through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8, through@~2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -8194,12 +9712,27 @@ time-stamp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357" +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" dependencies: setimmediate "^1.0.4" +timers-ext@0.1, timers-ext@^0.1.2: + version "0.1.5" + resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.5.tgz#77147dd4e76b660c2abb8785db96574cbbd12922" + dependencies: + es5-ext "~0.10.14" + next-tick "1" + +tiny-relative-date@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -8244,6 +9777,13 @@ toposort@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.6.tgz#c31748e55d210effc00fdcdc7d6e68d7d7bb9cec" +tough-cookie@>=2.3.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + tough-cookie@^2.3.2, tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" @@ -8359,10 +9899,22 @@ uglifyjs-webpack-plugin@^1.2.4: webpack-sources "^1.1.0" worker-farm "^1.5.2" +uid-number@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +umask@^1.1.0, umask@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" + underscore.string@~2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b" +underscore@~1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" + underscore@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" @@ -8390,7 +9942,7 @@ uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" -unique-filename@^1.1.0: +unique-filename@^1.1.0, unique-filename@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.0.tgz#d05f2fe4032560871f30e93cbe735eea201514f3" dependencies: @@ -8402,6 +9954,12 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + universalify@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" @@ -8417,10 +9975,29 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + upath@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" +update-notifier@^2.3.0, update-notifier@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + dependencies: + boxen "^1.2.1" + chalk "^2.0.1" + configstore "^3.0.0" + import-lazy "^2.1.0" + is-ci "^1.0.10" + is-installed-globally "^0.1.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" + upper-case@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" @@ -8450,6 +10027,12 @@ url-loader@^0.6.2: mime "^1.4.1" schema-utils "^0.3.0" +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + url-parse@1.0.x: version "1.0.5" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.0.5.tgz#0854860422afdcfefeb6c965c662d4800169927b" @@ -8487,6 +10070,10 @@ util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +util-extend@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f" + util@0.10.3, util@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" @@ -8509,13 +10096,23 @@ uuid@^3.0.0, uuid@^3.1.0, uuid@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" -validate-npm-package-license@^3.0.1: +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + dependencies: + builtins "^1.0.3" + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -8581,6 +10178,12 @@ watchpack@^1.3.1, watchpack@^1.4.0: graceful-fs "^4.1.2" neo-async "^2.5.0" +wcwidth@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + dependencies: + defaults "^1.0.3" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -8714,12 +10317,24 @@ which@1, which@^1.1.1, which@^1.2.14, which@^1.2.9, which@^1.3.0: dependencies: isexe "^2.0.0" +which@^1.2.10, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + wide-align@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" dependencies: string-width "^1.0.2" +widest-line@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273" + dependencies: + string-width "^2.1.1" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" @@ -8736,7 +10351,7 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -worker-farm@^1.3.1, worker-farm@^1.5.2: +worker-farm@^1.3.1, worker-farm@^1.5.2, worker-farm@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" dependencies: @@ -8749,16 +10364,28 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" -wrappy@1: +wrappy@1, wrappy@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" dependencies: mkdirp "^0.5.1" +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" @@ -8801,6 +10428,12 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + yargs@7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.0.2.tgz#115b97df1321823e8b8648e8968c782521221f67" @@ -8819,6 +10452,23 @@ yargs@7.0.2: y18n "^3.2.1" yargs-parser "^5.0.0" +yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@^6.0.0, yargs@^6.3.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" From 47e3ae27ea451f769c5e90f4c31589a5265c337c Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Wed, 1 Aug 2018 09:29:54 +1200 Subject: [PATCH 35/44] API Versions from and to are now stored as objects in the store (#29) * Reducer refactor & listing version lists * Enable inter-page operablility for versoon list --- client/dist/js/bundle.js | 2 +- client/dist/styles/bundle.css | 2 +- .../components/HistoryViewer/HistoryViewer.js | 71 +++++++--- .../HistoryViewer/HistoryViewer.scss | 5 - .../HistoryViewer/HistoryViewerToolbar.js | 5 +- .../HistoryViewer/HistoryViewerVersion.js | 121 ++++++++++-------- .../HistoryViewerVersionDetail.js | 1 - .../HistoryViewer/HistoryViewerVersionList.js | 65 +++++++--- .../HistoryViewerVersionList.scss | 12 +- .../HistoryViewer/tests/HistoryViewer-test.js | 5 + .../tests/HistoryViewerVersion-test.js | 50 ++++++-- .../historyviewer/HistoryViewerActions.js | 36 +++--- .../historyviewer/HistoryViewerReducer.js | 44 +++---- .../tests/HistoryViewerReducer-test.js | 72 ++++++++--- 14 files changed, 304 insertions(+), 187 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 95c455e4..fe5022a3 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(e){function t(s){if(o[s])return o[s].exports;var n=o[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};t.m=e,t.c=o,t.d=function(e,o,s){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/index.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}var n=o("./client/src/boot/registerComponents.js"),r=s(n),a=o("./client/src/boot/registerReducers.js"),i=s(a);window.document.addEventListener("DOMContentLoaded",function(){(0,r.default)(),(0,i.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),a=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js"),i=s(a),l=o("./client/src/components/HistoryViewer/HistoryViewerHeading.js"),d=s(l),u=o("./client/src/components/HistoryViewer/HistoryViewerToolbar.js"),c=s(u),p=o("./client/src/components/HistoryViewer/HistoryViewerVersion.js"),h=s(p),m=o("./client/src/components/HistoryViewer/HistoryViewerVersionDetail.js"),f=s(m),_=o("./client/src/components/HistoryViewer/HistoryViewerVersionList.js"),g=s(_),y=o("./client/src/components/HistoryViewer/HistoryViewerVersionState.js"),v=s(y),j=o("./client/src/components/HistoryViewer/HistoryViewerCompareWarning.js"),b=s(j);t.default=function(){r.default.component.registerMany({HistoryViewer:i.default,HistoryViewerHeading:d.default,HistoryViewerToolbar:c.default,HistoryViewerVersion:h.default,HistoryViewerVersionDetail:f.default,HistoryViewerVersionList:g.default,HistoryViewerVersionState:v.default,HistoryViewerCompareWarning:b.default})}},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),a=o("redux"),i=o("./client/src/state/historyviewer/HistoryViewerReducer.js"),l=s(i),d=function(){r.default.reducer.register("versionedAdmin",(0,a.combineReducers)({historyViewer:l.default}))};t.default=d},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed"),o("./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed"),o("./client/src/legacy/ArchiveAdmin/ArchiveAdmin.js"),o("./client/src/legacy/HistoryViewer/HistoryViewerEntwine.js"),o("./client/src/boot/index.js")},"./client/src/components/HistoryViewer/HistoryViewerCompareWarning.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return{isCompare:!!e.versionedAdmin.historyViewer.compare}}function l(e){return{onDismissCompare:function(){e((0,f.setCompareMode)(!1))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0])||arguments[0],t=document.querySelector(".CMSPageHistoryViewerController div:not(.cms-content-tools) .cms-content-header"),o="history-viewer__toolbar--condensed";t&&this.isPreviewable()&&(e?t.classList.add(o):t.classList.remove(o))}},{key:"renderPreview",value:function(){var e=this.props,t=e.version,o=e.PreviewComponent,s=e.previewState;return this.isPreviewable()&&"edit"!==s?d.default.createElement(o,{className:"history-viewer__preview flexbox-area-grow",itemLinks:{preview:{Stage:{href:t.AbsoluteLink+"&archiveDate="+t.LastEdited,type:"text/html"}}},itemId:t.Version}):null}},{key:"renderToolbar",value:function(){var e=this.props,t=e.ToolbarComponent,o=e.isLatestVersion,s=e.recordId,n=e.version;return this.isCompareMode()?null:d.default.createElement(t,{identifier:"HistoryViewer.VersionDetail.Toolbar",isLatestVersion:o,recordId:s,versionId:n.Version,isPreviewable:this.isPreviewable()})}},{key:"renderDetails",value:function(){var e=this.props,t=e.ListComponent,o=e.schemaUrl,s=e.CompareWarningComponent,n=e.previewState;if(this.isPreviewable()&&"preview"===n)return null;var r=["flexbox-area-grow","panel","panel--scrollable","panel--padded","panel--padded-side"],a={"history-viewer__table":!0,"history-viewer__table--current":!0,"history-viewer__table--compare":this.isCompareMode()},i={"history-viewer__version-detail":!0,"history-viewer__version-detail--compare":this.isCompareMode()};return d.default.createElement("div",{className:"flexbox-area-grow fill-height"},d.default.createElement("div",{className:(0,c.default)(r)},d.default.createElement(t,{extraClass:(0,c.default)(a),isActive:!0,versions:this.getListVersions()}),d.default.createElement("div",{className:(0,c.default)(i)},d.default.createElement(h.default,{identifier:"HistoryViewer.VersionDetail",schemaUrl:o}))),this.renderToolbar(),d.default.createElement(s,{fixed:!0}))}},{key:"render",value:function(){return d.default.createElement("div",{className:"flexbox-area-grow fill-width"},this.renderDetails(),this.renderPreview())}}]),t}(l.PureComponent);_.propTypes={isLatestVersion:l.PropTypes.bool,isPreviewable:l.PropTypes.bool,ListComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]).isRequired,PreviewComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]),recordId:l.PropTypes.number.isRequired,schemaUrl:l.PropTypes.string.isRequired,ToolbarComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]).isRequired,version:f.versionType,compare:l.PropTypes.oneOfType([l.PropTypes.shape({versionFrom:f.versionType,versionTo:f.versionType}),l.PropTypes.bool]),previewState:l.PropTypes.oneOf(["edit","preview","split"])},_.defaultProps={isLatestVersion:!1,isPreviewable:!1,compare:!1},t.Component=_,t.default=(0,m.inject)(["HistoryViewerVersionList","HistoryViewerToolbar","Preview","HistoryViewerCompareWarning"],function(e,t,o,s){return{ListComponent:e,ToolbarComponent:t,PreviewComponent:o,CompareWarningComponent:s}},function(e,t){return t+".HistoryViewerVersionDetail."+e.version.Version})(_)},"./client/src/components/HistoryViewer/HistoryViewerVersionList.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.versionedAdmin.historyViewer;return{messages:t.messages,compare:t.compare}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:"success";return{type:h.default.ADD_MESSAGE,payload:{id:(0,f.default)(),message:e,type:t}}}function l(){return{type:h.default.CLEAR_MESSAGES,payload:{}}}function d(e){return{type:h.default.SET_COMPARE_MODE,payload:{enabled:e}}}function u(e){return{type:h.default.SET_COMPARE_FROM,payload:{version:e}}}function c(e){return{type:h.default.SET_COMPARE_TO,payload:{version:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.showVersion=n,t.showList=r,t.setCurrentPage=a,t.addMessage=i,t.clearMessages=l,t.setCompareMode=d,t.setCompareFrom=u,t.setCompareTo=c;var p=o("./client/src/state/historyviewer/HistoryViewerActionTypes.js"),h=s(p),m=o("./node_modules/uuid/v1.js"),f=s(m)},"./client/src/state/historyviewer/HistoryViewerReducer.js":function(e,t,o){"use strict";function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case i.default.SET_CURRENT_PAGE:return r({},e,{currentPage:n.page});case i.default.SHOW_VERSION:return r({},e,{currentVersion:n.id});case i.default.SHOW_LIST:return r({},e,{currentVersion:0,currentPage:0});case i.default.ADD_MESSAGE:return r({},e,{messages:[n].concat(s(e.messages))});case i.default.CLEAR_MESSAGES:return e.messages.length?r({},e,{messages:[]}):e;case i.default.SET_COMPARE_MODE:var a=!1;return n.enabled&&(a=r({versionFrom:0,versionTo:0},e.compare)),r({},e,{compare:a});case i.default.SET_COMPARE_FROM:var l=e.compare,u=l.versionFrom,c=l.versionTo;return u=n.version,n.version||(u=c,c=0),r({},e,{compare:{versionFrom:u,versionTo:c}});case i.default.SET_COMPARE_TO:var p=e.compare,h=p.versionFrom,m=p.versionTo;return m=n.version,m&&h&&m1)&&this.getVersions().reduce(function(e,t){return e.Version>t.Version?e:t})}},{key:"handleSetPage",value:function(e){var t=this.props.onSetPage;"function"==typeof t&&t(e+1)}},{key:"handleNextPage",value:function(){var e=this.props.page;this.handleSetPage(e)}},{key:"handlePrevPage",value:function(){var e=this.props.page,t=e-1;if(t<1)return void this.handleSetPage(t);this.handleSetPage(t-1)}},{key:"renderVersionDetail",value:function(){var e=this,t=this.props,o=t.currentVersion,s=t.isPreviewable,n=t.recordId,r=t.recordClass,a=t.schemaUrl,i=t.VersionDetailComponent,l=t.compare,d=t.previewState,u={":id":n,":class":r,":version":o},p={":id":n,":class":r,":from":l?l.versionFrom:0,":to":l?l.versionTo:0},h=l?/:id|:class|:from|:to/g:/:id|:class|:version/g,m=l?p:u,f=function(e){return function(t){return t.Version===e}},_=this.getVersions().find(f(l?l.versionFrom:o)),g=this.getLatestVersion(),y=!!l&&{versionFrom:this.getVersions().find(f(l.versionFrom)),versionTo:this.getVersions().find(f(l.versionTo))},v={isLatestVersion:g&&g.Version===_.Version,isPreviewable:s,recordId:n,schemaUrl:a.replace(h,function(e){return m[e]}),version:_,compare:y,previewState:d};return c.default.createElement(O.default,{style:{position:"relative"},className:this.getContainerClasses(),onResize:function(t){var o=t.width;return e.props.onResize(o)}},c.default.createElement(i,v))}},{key:"renderPagination",value:function(){var e=this.props,t=e.limit,o=e.page,s=e.versions;if(!s)return null;var n=s.Versions?s.Versions.pageInfo.totalCount:0;if(n<=t)return null;var r={setPage:this.handleSetPage,maxPage:Math.ceil(n/t),next:this.handleNextPage,nextText:v.default._t("HistoryViewer.NEXT","Next"),previous:this.handlePrevPage,previousText:v.default._t("HistoryViewer.PREVIOUS","Previous"),currentPage:o-1,useGriddleStyles:!1};return c.default.createElement("div",{className:"griddle-footer"},c.default.createElement(f.default.GridPagination,r))}},{key:"renderVersionList",value:function(){var e=this.props,t=e.isPreviewable,o=e.ListComponent,s=e.CompareWarningComponent;return c.default.createElement("div",{className:this.getContainerClasses()},c.default.createElement(s,null),c.default.createElement("div",{className:t?"panel panel--padded panel--scrollable":""},c.default.createElement(o,{versions:this.getVersions()}),c.default.createElement("div",{className:"history-viewer__pagination"},this.renderPagination())))}},{key:"renderCompareMode",value:function(){var e=this.props.compare;return e&&e.versionFrom&&e.versionTo?this.renderVersionDetail():this.renderVersionList()}},{key:"render",value:function(){var e=this.props,t=e.loading,o=e.compare,s=e.currentVersion;return t?c.default.createElement(C.default,null):o?this.renderCompareMode():s?this.renderVersionDetail():this.renderVersionList()}}]),t}(u.Component);k.propTypes={contextKey:u.PropTypes.string,limit:u.PropTypes.number,ListComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,offset:u.PropTypes.number,recordId:u.PropTypes.number.isRequired,currentVersion:u.PropTypes.number,compare:S.compareType,isPreviewable:u.PropTypes.bool,VersionDetailComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,CompareWarningComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,versions:u.PropTypes.shape({Versions:u.PropTypes.shape({pageInfo:u.PropTypes.shape({totalCount:u.PropTypes.number}),edges:u.PropTypes.arrayOf(u.PropTypes.shape({node:x.versionType}))})}),page:u.PropTypes.number,schemaUrl:u.PropTypes.string,previewState:u.PropTypes.oneOf(["edit","preview","split"]),actions:u.PropTypes.object,onSelect:u.PropTypes.func,onSetPage:u.PropTypes.func,onResize:u.PropTypes.func},k.defaultProps={contextKey:"",currentVersion:0,isPreviewable:!1,schemaUrl:"",versions:{Versions:{pageInfo:{totalCount:0},edges:[]}}},t.Component=k,t.default=(0,p.compose)((0,h.connect)(i,l),g.default,(0,j.inject)(["HistoryViewerVersionList","HistoryViewerVersionDetail","HistoryViewerCompareWarning"],function(e,t,o){return{ListComponent:e,VersionDetailComponent:t,CompareWarningComponent:o}},function(e){return"VersionedAdmin.HistoryViewer."+e.contextKey}))(k)},"./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultVersion=t.versionType=void 0;var s=o("react"),n=s.PropTypes.shape({FirstName:s.PropTypes.string,Surname:s.PropTypes.string}),r=s.PropTypes.shape({Version:s.PropTypes.number,AbsoluteLink:s.PropTypes.string,LastEdited:s.PropTypes.string,Published:s.PropTypes.boolean,LiveVersion:s.PropTypes.boolean,LatestDraftVersion:s.PropTypes.boolean,Publisher:n,Author:n}),a={Version:0,AbsoluteLink:"",LastEdited:"",Published:!1,LiveVersion:!1,LatestDraftVersion:!1,Publisher:{FirstName:"",Surname:""},Author:{FirstName:"",Surname:""}};t.versionType=r,t.defaultVersion=a},"./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed":function(e,t,o){(function(t){e.exports=t.HistoryViewer=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed":function(e,t,o){(function(t){e.exports=t.versionType=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var s=this.getColumnMetadataByName(e);return void 0===s||null===s?o:s.hasOwnProperty(t)?s[t]:o}},{key:"orderColumns",value:function(e){var t=this;return l(e,function(e){var o=i(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=s.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),s.createElement("div",null)):s.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=n},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t0&&(e=s.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=s.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,r=null,a=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};a=n({textAlign:"right",width:"34%"},i),r=n({textAlign:"center",width:"33%"},i),o=n({width:"33%"},i)}for(var l=[],d=1;d<=this.props.maxPage;d++)l.push(s.createElement("option",{value:d,key:d},d));return s.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},s.createElement("div",{className:this.props.previousClassName,style:o},e),s.createElement("div",{className:"griddle-page",style:r},s.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},l)," / ",this.props.maxPage),s.createElement("div",{className:this.props.nextClassName,style:a},t))}});e.exports=r},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),r=o("./node_modules/lodash/isFunction.js"),a=o("./node_modules/lodash/zipObject.js"),i=o("./node_modules/lodash/assign.js"),l=o("./node_modules/lodash/defaults.js"),d=o("./node_modules/lodash/toPairs.js"),u=o("./node_modules/lodash/without.js"),c=s.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&r(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=a(c,[]),h=i({},this.props.data);l(h,p);var m,f,_=d(n.pick(h,u(c,"children"))),g=_.map(function(t,n){var r=null,a=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===n&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===n&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===n&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=i(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==a&&null!==a)if(void 0!==a.customComponent&&null!==a.customComponent){var d=s.createElement(a.customComponent,{data:t[1],rowData:h,metadata:a});r=s.createElement("td",{onClick:e.handleClick,className:a.cssClassName,key:n,style:o},d)}else r=s.createElement("td",{onClick:e.handleClick,className:a.cssClassName,key:n,style:o},l,e.formatData(t[1]));return r||s.createElement("td",{onClick:e.handleClick,key:n,style:o},l,t[1])});null!==this.props.onRowClick&&r(this.props.onRowClick)?(m=null,f=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(m=this.handleSelectClick,f=null):(m=null,f=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),g.unshift(s.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:f},s.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(h),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),s.createElement("tr",{onClick:m,className:y},g)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/lodash/pick.js")),r=s.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return s.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(s.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?n(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var r=null;return e.state.showChildren&&(r=e.props.hasChildren&&this.props.data.children.map(function(t,o){var n=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var r=e.constructor.Griddle;return s.createElement("tr",{key:n,style:{paddingLeft:5}},s.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},s.createElement(r,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return s.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:n})})),!1===e.props.hasChildren?t[0]:s.createElement("tbody",null,e.state.showChildren?t.concat(r):t)}});e.exports=r},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/lodash/includes.js"),r=o("./node_modules/lodash/without.js"),a=o("./node_modules/lodash/find.js"),i=s.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===n(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(r(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var r=n(e.props.selectedColumns,t),i=a(e.props.columnMetadata,{columnName:t}),l=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(l=i.displayName),void 0!==i&&null!=i&&i.locked?s.createElement("div",{className:"column checkbox"},s.createElement("label",null,s.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:r,"data-name":t}),l)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:s.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},s.createElement("label",null,s.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:r,"data-name":t}),l))}));var o=e.props.enableToggleCustom?s.createElement("div",{className:"form-group"},s.createElement("label",{htmlFor:"maxRows"},s.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",r=this.props.showSetPageSize?s.createElement("div",null,s.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",s.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},s.createElement("option",{value:"5"},"5"),s.createElement("option",{value:"10"},"10"),s.createElement("option",{value:"25"},"25"),s.createElement("option",{value:"50"},"50"),s.createElement("option",{value:"100"},"100")))):"";return s.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},s.createElement("h6",null,this.props.settingsText),s.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),r,o)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),r=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),a=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),s.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,s=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var n={scrollTop:t,scrollHeight:o,clientHeight:s};this.setState(n)}.6*(o-(t+s)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,n=null,a=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),l=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*l),u=Math.min(d+1.25*l,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*i+"px"};n=s.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};a=s.createElement("tr",{key:"below-"+p.height,style:p})}var h=o.map(function(o,n){var a=void 0!==o.children&&o.children.length>0,i=e.props.rowSettings.getRowKey(o,n);return a&&(t=a),s.createElement(r,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:a,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var m=this.props.columnSettings.getVisibleColumnCount();h.push(s.createElement("tr",{key:"no-data-section"},s.createElement("td",{colSpan:m},this.props.noDataSection)))}return n&&h.unshift(n),a&&h.push(a),{nodes:h,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var r=null,a=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(r={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var l=null,d=null;this.props.useGriddleStyles&&(l={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?s.createElement(this.props.externalLoadingComponent,null):s.createElement("div",null,"Loading...");a=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{style:l,colSpan:d},u)))}var c=this.props.showTableHeading?s.createElement(n,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=s.createElement("tbody",null,e));var p=s.createElement("tbody",null);if(this.props.showPager){var h=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:h,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),s.createElement("div",null,s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,a,p)))):s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,a,p))}}));e.exports=a},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return k(g.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,s){return k(o,function(o){var n=g.getAt(o,s||""),r=e[s];return t(n,r)})},this.props.results),s={columnFilters:e};e?(s.filteredResults=o,s.maxPage=this.getMaxPage(s.filteredResults)):this.state.filter?s.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):s.filteredResults=null,this.setState(s)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=O(o,t);else{var s={};s[t]=e,o=A({},o,s)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(E(e)||T(e)||P(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=S(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=j(this.props.columnMetadata,{columnName:e})||{},s=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],n=null,r=s.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);r=(r+1)%s.length,n=s[r]?s[r]:null;var a={page:0,sortColumn:e,sortDirection:n};this.setState(a)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=g.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,R(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new f(this.props.results.length>0?g.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new _(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var s=this,n=this;if(""!==this.state.sortColumn){var r,a=this.state.sortColumn,i=k(this.props.columnMetadata,{columnName:a}),l={columns:[],orders:[]};if(i.length>0&&(r=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(l=i[0].multiSort)),this.state.sortDirection)if("function"==typeof r)2===r.length?(e=e.sort(function(e,t){return r(V(e,a),V(t,a))}),"desc"===this.state.sortDirection&&e.reverse()):1===r.length&&(e=M(e,function(e){return r(V(e,a))},[this.state.sortDirection]));else{var d=[function(e){return(V(e,a)||"").toString().toLowerCase()}],u=[this.state.sortDirection];l.columns.forEach(function(e,t){d.push(function(t){return(V(t,e)||"").toString().toLowerCase()}),"asc"===l.orders[t]||"desc"===l.orders[t]?u.push(l.orders[t]):u.push(s.state.sortDirection)}),e=M(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=b(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||w)(p,p.length-this.state.resultsPerPage)}for(var h=(this.columnSettings.getMetadataColumns,[]),m=0;m0&&(f.children=n.getDataForRender(f[n.props.childrenColumnName],t,!1),"children"!==n.props.childrenColumnName&&delete f[n.props.childrenColumnName]),h.push(f)}return h},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),s=this;C(e,function(e){s._updateSelectedRowIds(e[s.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),s=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],s,t);var n=this._getAreAllRowsChecked(s,R(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:n,selectedRowIds:s}),this.props.onSelectionChange&&this.props.onSelectionChange(s,n)},_updateSelectedRowIds:function(e,t,o){o?void 0===j(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===x(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!j(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?n.createElement(m,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):n.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?n.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,s=null,r=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),s=this.getSettingsStyles(),r=this.getClearFixStyles()),n.createElement("div",{className:"top-section",style:r},n.createElement("div",{className:"griddle-filter",style:o},e),n.createElement("div",{className:"griddle-settings-toggle",style:s},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return n.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?n.createElement(h,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):n.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?n.createElement(l,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return n.createElement(this.props.customGridComponent,s({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,s,r){return n.createElement("div",null,n.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:r,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&s)},getStandardGridSection:function(e,t,o,s,a){var i=this.getSortObject(),l=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return n.createElement("div",{className:"griddle-body"},n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:l,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:s,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:a,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,s,n,r){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,s,r):this.getStandardGridSection(e,t,o,s,n)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?n.createElement("div",{className:this.props.noDataClassName},n.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):n.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),s=this.getTopSection(t,o),r=[],a=this.columnSettings.getColumns(),i=this.getDataForRender(e,a,!0),l=this.columnSettings.getMetadataColumns();this.props.columnMetadata?C(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||r.push(e.columnName)}):r=g.keys(O(e[0],l)),r=this.columnSettings.orderColumns(r);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return f+=this.shouldUseCustomRowComponent()?" griddle-custom":"",n.createElement("div",{className:f},s,m,n.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},h))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o-1}var n=o("./node_modules/lodash/_baseIndexOf.js");e.exports=s},"./node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var s=-1,n=null==e?0:e.length;++s=u&&(p=d,h=!1,t=new n(t));e:for(;++c0&&o(u)?t>1?s(u,t-1,o,a,i):n(i,u):a||(i[i.length]=u)}return i}var n=o("./node_modules/lodash/_arrayPush.js"),r=o("./node_modules/lodash/_isFlattenable.js");e.exports=s},"./node_modules/lodash/_baseFor.js":function(e,t,o){var s=o("./node_modules/lodash/_createBaseFor.js"),n=s();e.exports=n},"./node_modules/lodash/_baseForOwn.js":function(e,t,o){function s(e,t){return e&&n(e,t,r)}var n=o("./node_modules/lodash/_baseFor.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_baseGet.js":function(e,t,o){function s(e,t){t=n(t,e);for(var o=0,s=t.length;null!=e&&o=120&&g.length>=120)?new n(h&&g):void 0}g=e[0];var y=-1,v=m[0];e:for(;++yn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var r=Array(n);++st||a&&i&&d&&!l&&!u||s&&i&&d||!o&&d||!r)return 1;if(!s&&!a&&!u&&e=l?d:d*("desc"==o[s]?-1:1)}return e.index-t.index}var n=o("./node_modules/lodash/_compareAscending.js");e.exports=s},"./node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,s=e.length;for(t||(t=Array(s));++o1?o[n-1]:void 0,i=n>2?o[2]:void 0;for(a=e.length>3&&"function"==typeof a?(n--,a):void 0,i&&r(o[0],o[1],i)&&(a=n<3?void 0:a,n=1),t=Object(t);++s-1?i[l?t[d]:d]:void 0}}var n=o("./node_modules/lodash/_baseIteratee.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_createToPairs.js":function(e,t,o){function s(e){return function(t){var o=r(t);return o==l?a(t):o==d?i(t):n(t,e(t))}}var n=o("./node_modules/lodash/_baseToPairs.js"),r=o("./node_modules/lodash/_getTag.js"),a=o("./node_modules/lodash/_mapToArray.js"),i=o("./node_modules/lodash/_setToPairs.js"),l="[object Map]",d="[object Set]";e.exports=s},"./node_modules/lodash/_customOmitClone.js":function(e,t,o){function s(e){return n(e)?void 0:e}var n=o("./node_modules/lodash/isPlainObject.js");e.exports=s},"./node_modules/lodash/_defineProperty.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},"./node_modules/lodash/_equalArrays.js":function(e,t,o){function s(e,t,o,s,d,u){var c=o&i,p=e.length,h=t.length;if(p!=h&&!(c&&h>p))return!1;var m=u.get(e);if(m&&u.get(t))return m==t;var f=-1,_=!0,g=o&l?new n:void 0;for(u.set(e,t),u.set(t,e);++f-1&&e%1==0&&e-1}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function s(e,t){var o=this.__data__,s=n(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function s(){this.size=0,this.__data__={hash:new n,map:new(a||r),string:new n}}var n=o("./node_modules/lodash/_Hash.js"),r=o("./node_modules/lodash/_ListCache.js"),a=o("./node_modules/lodash/_Map.js");e.exports=s},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function s(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function s(e){return n(this,e).get(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function s(e){return n(this,e).has(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function s(e,t){var o=n(this,e),s=o.size;return o.set(e,t),this.size+=o.size==s?0:1,this}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,s){o[++t]=[s,e]}),o}e.exports=o},"./node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function s(e){var t=n(e,function(e){return o.size===r&&o.clear(),e}),o=t.cache;return t}var n=o("./node_modules/lodash/memoize.js"),r=500;e.exports=s},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=s(Object,"create");e.exports=n},"./node_modules/lodash/_nativeKeys.js":function(e,t,o){var s=o("./node_modules/lodash/_overArg.js"),n=s(Object.keys,Object);e.exports=n},"./node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_freeGlobal.js"),n="object"==typeof t&&t&&!t.nodeType&&t,r=n&&"object"==typeof e&&e&&!e.nodeType&&e,a=r&&r.exports===n,i=a&&s.process,l=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return n.call(e)}var s=Object.prototype,n=s.toString;e.exports=o},"./node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/lodash/_overRest.js":function(e,t,o){function s(e,t,o){return t=r(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,i=r(s.length-t,0),l=Array(i);++a0){if(++t>=s)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var s=800,n=16,r=Date.now;e.exports=o},"./node_modules/lodash/_stackClear.js":function(e,t,o){function s(){this.__data__=new n,this.size=0}var n=o("./node_modules/lodash/_ListCache.js");e.exports=s},"./node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/lodash/_stackSet.js":function(e,t,o){function s(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length2?t[2]:void 0;for(d&&r(t[0],t[1],d)&&(s=1);++o-1:!!u&&n(e,t,o)>-1}var n=o("./node_modules/lodash/_baseIndexOf.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/isString.js"),i=o("./node_modules/lodash/toInteger.js"),l=o("./node_modules/lodash/values.js"),d=Math.max;e.exports=s},"./node_modules/lodash/initial.js":function(e,t,o){function s(e){return(null==e?0:e.length)?n(e,0,-1):[]}var n=o("./node_modules/lodash/_baseSlice.js");e.exports=s},"./node_modules/lodash/intersection.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseIntersection.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_castArrayLikeObject.js"),i=r(function(e){var t=s(e,a);return t.length&&t[0]===e[0]?n(t):[]});e.exports=i},"./node_modules/lodash/isArguments.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsArguments.js"),n=o("./node_modules/lodash/isObjectLike.js"),r=Object.prototype,a=r.hasOwnProperty,i=r.propertyIsEnumerable,l=s(function(){return arguments}())?s:function(e){return n(e)&&a.call(e,"callee")&&!i.call(e,"callee")};e.exports=l},"./node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/lodash/isArrayLike.js":function(e,t,o){function s(e){return null!=e&&r(e.length)&&!n(e)}var n=o("./node_modules/lodash/isFunction.js"),r=o("./node_modules/lodash/isLength.js");e.exports=s},"./node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function s(e){return r(e)&&n(e)}var n=o("./node_modules/lodash/isArrayLike.js"),r=o("./node_modules/lodash/isObjectLike.js");e.exports=s},"./node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_root.js"),n=o("./node_modules/lodash/stubFalse.js"),r="object"==typeof t&&t&&!t.nodeType&&t,a=r&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===r,l=i?s.Buffer:void 0,d=l?l.isBuffer:void 0,u=d||n;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/isEmpty.js":function(e,t,o){function s(e){if(null==e)return!0;if(l(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||a(e)))return!e.length;var t=r(e);if(t==p||t==h)return!e.size;if(u(e))return!n(e).length;for(var o in e)if(f.call(e,o))return!1;return!0}var n=o("./node_modules/lodash/_baseKeys.js"),r=o("./node_modules/lodash/_getTag.js"),a=o("./node_modules/lodash/isArguments.js"),i=o("./node_modules/lodash/isArray.js"),l=o("./node_modules/lodash/isArrayLike.js"),d=o("./node_modules/lodash/isBuffer.js"),u=o("./node_modules/lodash/_isPrototype.js"),c=o("./node_modules/lodash/isTypedArray.js"),p="[object Map]",h="[object Set]",m=Object.prototype,f=m.hasOwnProperty;e.exports=s},"./node_modules/lodash/isFunction.js":function(e,t,o){function s(e){if(!r(e))return!1;var t=n(e);return t==i||t==l||t==a||t==d}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObject.js"),a="[object AsyncFunction]",i="[object Function]",l="[object GeneratorFunction]",d="[object Proxy]";e.exports=s},"./node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}var s=9007199254740991;e.exports=o},"./node_modules/lodash/isMap.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsMap.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isMap,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isPlainObject.js":function(e,t,o){function s(e){if(!a(e)||n(e)!=i)return!1;var t=r(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/_getPrototype.js"),a=o("./node_modules/lodash/isObjectLike.js"),i="[object Object]",l=Function.prototype,d=Object.prototype,u=l.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=s},"./node_modules/lodash/isSet.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsSet.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isSet,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isString.js":function(e,t,o){function s(e){return"string"==typeof e||!r(e)&&a(e)&&n(e)==i}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isArray.js"),a=o("./node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=s},"./node_modules/lodash/isSymbol.js":function(e,t,o){function s(e){return"symbol"==typeof e||r(e)&&n(e)==a}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=s},"./node_modules/lodash/isTypedArray.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsTypedArray.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isTypedArray,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/lodash/keys.js":function(e,t,o){function s(e){return a(e)?n(e):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeys.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/keysIn.js":function(e,t,o){function s(e){return a(e)?n(e,!0):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeysIn.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/lodash/map.js":function(e,t,o){function s(e,t){return(i(e)?n:a)(e,r(t,3))}var n=o("./node_modules/lodash/_arrayMap.js"),r=o("./node_modules/lodash/_baseIteratee.js"),a=o("./node_modules/lodash/_baseMap.js"),i=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/memoize.js":function(e,t,o){function s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(r);var o=function(){var s=arguments,n=t?t.apply(this,s):s[0],r=o.cache;if(r.has(n))return r.get(n);var a=e.apply(this,s);return o.cache=r.set(n,a)||r,a};return o.cache=new(s.Cache||n),o}var n=o("./node_modules/lodash/_MapCache.js"),r="Expected a function";s.Cache=n,e.exports=s},"./node_modules/lodash/omit.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseClone.js"),r=o("./node_modules/lodash/_baseUnset.js"),a=o("./node_modules/lodash/_castPath.js"),i=o("./node_modules/lodash/_copyObject.js"),l=o("./node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/lodash/_flatRest.js"),u=o("./node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=s(t,function(t){return t=a(t,e),d||(d=t.length>1),t}),i(e,u(e),o),d&&(o=n(o,7,l));for(var c=t.length;c--;)r(o,t[c]);return o});e.exports=c},"./node_modules/lodash/orderBy.js":function(e,t,o){function s(e,t,o,s){return null==e?[]:(r(t)||(t=null==t?[]:[t]),o=s?void 0:o,r(o)||(o=null==o?[]:[o]),n(e,t,o))}var n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/pick.js":function(e,t,o){var s=o("./node_modules/lodash/_basePick.js"),n=o("./node_modules/lodash/_flatRest.js"),r=n(function(e,t){return null==e?{}:s(e,t)});e.exports=r},"./node_modules/lodash/property.js":function(e,t,o){function s(e){return a(e)?n(i(e)):r(e)}var n=o("./node_modules/lodash/_baseProperty.js"),r=o("./node_modules/lodash/_basePropertyDeep.js"),a=o("./node_modules/lodash/_isKey.js"),i=o("./node_modules/lodash/_toKey.js");e.exports=s},"./node_modules/lodash/sortBy.js":function(e,t,o){var s=o("./node_modules/lodash/_baseFlatten.js"),n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_isIterateeCall.js"),i=r(function(e,t){if(null==e)return[];var o=t.length;return o>1&&a(e,t[0],t[1])?t=[]:o>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),n(e,s(t,1),[])});e.exports=i},"./node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/lodash/take.js":function(e,t,o){function s(e,t,o){return e&&e.length?(t=o||void 0===t?1:r(t),n(e,0,t<0?0:t)):[]}var n=o("./node_modules/lodash/_baseSlice.js"),r=o("./node_modules/lodash/toInteger.js");e.exports=s},"./node_modules/lodash/toFinite.js":function(e,t,o){function s(e){return e?(e=n(e))===r||e===-r?(e<0?-1:1)*a:e===e?e:0:0===e?e:0}var n=o("./node_modules/lodash/toNumber.js"),r=1/0,a=1.7976931348623157e308;e.exports=s},"./node_modules/lodash/toInteger.js":function(e,t,o){function s(e){var t=n(e),o=t%1;return t===t?o?t-o:t:0}var n=o("./node_modules/lodash/toFinite.js");e.exports=s},"./node_modules/lodash/toNumber.js":function(e,t,o){function s(e){if("number"==typeof e)return e;if(r(e))return a;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):l.test(e)?a:+e}var n=o("./node_modules/lodash/isObject.js"),r=o("./node_modules/lodash/isSymbol.js"),a=NaN,i=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=s},"./node_modules/lodash/toPairs.js":function(e,t,o){var s=o("./node_modules/lodash/_createToPairs.js"),n=o("./node_modules/lodash/keys.js"),r=s(n);e.exports=r},"./node_modules/lodash/toString.js":function(e,t,o){function s(e){return null==e?"":n(e)}var n=o("./node_modules/lodash/_baseToString.js");e.exports=s},"./node_modules/lodash/uniqueId.js":function(e,t,o){function s(e){var t=++r;return n(e)+t}var n=o("./node_modules/lodash/toString.js"),r=0;e.exports=s},"./node_modules/lodash/values.js":function(e,t,o){function s(e){return null==e?[]:n(e,r(e))}var n=o("./node_modules/lodash/_baseValues.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/without.js":function(e,t,o){var s=o("./node_modules/lodash/_baseDifference.js"),n=o("./node_modules/lodash/_baseRest.js"),r=o("./node_modules/lodash/isArrayLikeObject.js"),a=n(function(e,t){return r(e)?s(e,t):[]});e.exports=a},"./node_modules/lodash/zipObject.js":function(e,t,o){function s(e,t){return r(e||[],t||[],n)}var n=o("./node_modules/lodash/_assignValue.js"),r=o("./node_modules/lodash/_baseZipObject.js");e.exports=s},"./node_modules/react-resize-aware/dist/index.js":function(e,t,o){!function(e,s){!function(e,t){"use strict";function o(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(e,t){var o={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(o[s]=e[s]);return o}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(o){return t.createElement(c,l({component:e},o))}}var l=Object.assign||function(e){for(var t=1;t>>((3&t)<<3)&255;return n}}},"./node_modules/uuid/v1.js":function(e,t,o){function s(e,t,o){var s=t&&o||0,u=t||[];e=e||{};var c=e.node||n,p=void 0!==e.clockseq?e.clockseq:r;if(null==c||null==p){var h=a();null==c&&(c=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=r=16383&(h[6]<<8|h[7]))}var m=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:d+1,_=m-l+(f-d)/1e4;if(_<0&&void 0===e.clockseq&&(p=p+1&16383),(_<0||m>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=m,d=f,r=p,m+=122192928e5;var g=(1e4*(268435455&m)+f)%4294967296;u[s++]=g>>>24&255,u[s++]=g>>>16&255,u[s++]=g>>>8&255,u[s++]=255&g;var y=m/4294967296*1e4&268435455;u[s++]=y>>>8&255,u[s++]=255&y,u[s++]=y>>>24&15|16,u[s++]=y>>>16&255,u[s++]=p>>>8|128,u[s++]=255&p;for(var v=0;v<6;++v)u[s+v]=c[v];return t||i(u)}var n,r,a=o("./node_modules/uuid/lib/rng-browser.js"),i=o("./node_modules/uuid/lib/bytesToUuid.js"),l=0,d=0;e.exports=s},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},classnames:function(e,t){e.exports=classnames},"components/Loading/Loading":function(e,t){e.exports=Loading},"containers/FormBuilderLoader/FormBuilderLoader":function(e,t){e.exports=FormBuilderLoader},i18n:function(e,t){e.exports=i18n},jquery:function(e,t){e.exports=jQuery},"lib/Config":function(e,t){e.exports=Config},"lib/Injector":function(e,t){e.exports=Injector},moment:function(e,t){e.exports=moment},react:function(e,t){e.exports=React},"react-dom":function(e,t){e.exports=ReactDom},"react-redux":function(e,t){e.exports=ReactRedux},reactstrap:function(e,t){e.exports=Reactstrap},redux:function(e,t){e.exports=Redux},"state/viewMode/viewModeActions":function(e,t){e.exports=ViewModeActions}}); \ No newline at end of file +!function(e){function t(s){if(o[s])return o[s].exports;var n=o[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};t.m=e,t.c=o,t.d=function(e,o,s){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/index.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}var n=o("./client/src/boot/registerComponents.js"),r=s(n),a=o("./client/src/boot/registerReducers.js"),i=s(a);window.document.addEventListener("DOMContentLoaded",function(){(0,r.default)(),(0,i.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),a=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js"),i=s(a),l=o("./client/src/components/HistoryViewer/HistoryViewerHeading.js"),d=s(l),u=o("./client/src/components/HistoryViewer/HistoryViewerToolbar.js"),c=s(u),p=o("./client/src/components/HistoryViewer/HistoryViewerVersion.js"),h=s(p),m=o("./client/src/components/HistoryViewer/HistoryViewerVersionDetail.js"),f=s(m),_=o("./client/src/components/HistoryViewer/HistoryViewerVersionList.js"),g=s(_),y=o("./client/src/components/HistoryViewer/HistoryViewerVersionState.js"),v=s(y),j=o("./client/src/components/HistoryViewer/HistoryViewerCompareWarning.js"),b=s(j);t.default=function(){r.default.component.registerMany({HistoryViewer:i.default,HistoryViewerHeading:d.default,HistoryViewerToolbar:c.default,HistoryViewerVersion:h.default,HistoryViewerVersionDetail:f.default,HistoryViewerVersionList:g.default,HistoryViewerVersionState:v.default,HistoryViewerCompareWarning:b.default})}},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o("lib/Injector"),r=s(n),a=o("redux"),i=o("./client/src/state/historyviewer/HistoryViewerReducer.js"),l=s(i),d=function(){r.default.reducer.register("versionedAdmin",(0,a.combineReducers)({historyViewer:l.default}))};t.default=d},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed"),o("./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed"),o("./client/src/legacy/ArchiveAdmin/ArchiveAdmin.js"),o("./client/src/legacy/HistoryViewer/HistoryViewerEntwine.js"),o("./client/src/boot/index.js")},"./client/src/components/HistoryViewer/HistoryViewerCompareWarning.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return{isCompare:!!e.versionedAdmin.historyViewer.compare}}function l(e){return{onDismissCompare:function(){e((0,f.setCompareMode)(!1))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0])||arguments[0],t=document.querySelector(".CMSPageHistoryViewerController div:not(.cms-content-tools) .cms-content-header"),o="history-viewer__toolbar--condensed";t&&this.isPreviewable()&&(e?t.classList.add(o):t.classList.remove(o))}},{key:"renderPreview",value:function(){var e=this.props,t=e.version,o=e.PreviewComponent,s=e.previewState;return this.isPreviewable()&&"edit"!==s?d.default.createElement(o,{className:"history-viewer__preview flexbox-area-grow",itemLinks:{preview:{Stage:{href:t.AbsoluteLink+"&archiveDate="+t.LastEdited,type:"text/html"}}},itemId:t.Version}):null}},{key:"renderToolbar",value:function(){var e=this.props,t=e.ToolbarComponent,o=e.isLatestVersion,s=e.recordId,n=e.version;return this.isCompareMode()?null:d.default.createElement(t,{identifier:"HistoryViewer.VersionDetail.Toolbar",isLatestVersion:o,recordId:s,versionId:n.Version,isPreviewable:this.isPreviewable()})}},{key:"renderDetails",value:function(){var e=this.props,t=e.ListComponent,o=e.schemaUrl,s=e.CompareWarningComponent,n=e.previewState;if(this.isPreviewable()&&"preview"===n)return null;var r=["flexbox-area-grow","panel","panel--scrollable","panel--padded","panel--padded-side"],a={"history-viewer__table":!0,"history-viewer__table--current":!0,"history-viewer__table--compare":this.isCompareMode()},i={"history-viewer__version-detail":!0,"history-viewer__version-detail--compare":this.isCompareMode()};return d.default.createElement("div",{className:"flexbox-area-grow fill-height"},d.default.createElement("div",{className:(0,c.default)(r)},d.default.createElement(t,{extraClass:(0,c.default)(a),versions:this.getListVersions()}),d.default.createElement("div",{className:(0,c.default)(i)},d.default.createElement(h.default,{identifier:"HistoryViewer.VersionDetail",schemaUrl:o}))),this.renderToolbar(),d.default.createElement(s,{fixed:!0}))}},{key:"render",value:function(){return d.default.createElement("div",{className:"flexbox-area-grow fill-width"},this.renderDetails(),this.renderPreview())}}]),t}(l.PureComponent);_.propTypes={isLatestVersion:l.PropTypes.bool,isPreviewable:l.PropTypes.bool,ListComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]).isRequired,PreviewComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]),recordId:l.PropTypes.number.isRequired,schemaUrl:l.PropTypes.string.isRequired,ToolbarComponent:l.PropTypes.oneOfType([l.PropTypes.node,l.PropTypes.func]).isRequired,version:f.versionType,compare:l.PropTypes.oneOfType([l.PropTypes.shape({versionFrom:f.versionType,versionTo:f.versionType}),l.PropTypes.bool]),previewState:l.PropTypes.oneOf(["edit","preview","split"])},_.defaultProps={isLatestVersion:!1,isPreviewable:!1,compare:!1},t.Component=_,t.default=(0,m.inject)(["HistoryViewerVersionList","HistoryViewerToolbar","Preview","HistoryViewerCompareWarning"],function(e,t,o,s){return{ListComponent:e,ToolbarComponent:t,PreviewComponent:o,CompareWarningComponent:s}},function(e,t){return t+".HistoryViewerVersionDetail."+e.version.Version})(_)},"./client/src/components/HistoryViewer/HistoryViewerVersionList.js":function(e,t,o){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.versionedAdmin.historyViewer;return{messages:t.messages,compare:t.compare,currentVersion:t.currentVersion}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:"success";return{type:h.default.ADD_MESSAGE,payload:{id:(0,f.default)(),message:e,type:t}}}function l(){return{type:h.default.CLEAR_MESSAGES}}function d(e){return{type:h.default.SET_COMPARE_MODE,payload:{enabled:e}}}function u(e){return{type:h.default.SET_COMPARE_FROM,payload:{version:e}}}function c(e){return{type:h.default.SET_COMPARE_TO,payload:{version:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.showVersion=n,t.showList=r,t.setCurrentPage=a,t.addMessage=i,t.clearMessages=l,t.setCompareMode=d,t.setCompareFrom=u,t.setCompareTo=c;var p=o("./client/src/state/historyviewer/HistoryViewerActionTypes.js"),h=s(p),m=o("./node_modules/uuid/v1.js"),f=s(m)},"./client/src/state/historyviewer/HistoryViewerReducer.js":function(e,t,o){"use strict";function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case i.default.SET_CURRENT_PAGE:return r({},e,{currentPage:n.page});case i.default.SHOW_VERSION:return r({},e,{currentVersion:n.version});case i.default.SHOW_LIST:return r({},e,{currentVersion:0,currentPage:0});case i.default.ADD_MESSAGE:return r({},e,{messages:[n].concat(s(e.messages))});case i.default.CLEAR_MESSAGES:return r({},e,{messages:[]});case i.default.SET_COMPARE_MODE:var a=r({versionFrom:!1,versionTo:!1},e.compare);return r({},e,{compare:!!n.enabled&&a});case i.default.SET_COMPARE_FROM:var l=e.compare,u=l.versionFrom,c=l.versionTo;return u=n.version||!1,u||(u=c,c=!1),r({},e,{compare:{versionFrom:u,versionTo:c}});case i.default.SET_COMPARE_TO:var p=e.compare,h=p.versionFrom,m=p.versionTo;return m=n.version||!1,m&&h&&m.Version1)&&this.getVersions().reduce(function(e,t){return e.Version>t.Version?e:t})}},{key:"handleSetPage",value:function(e){var t=this.props.onSetPage;"function"==typeof t&&t(e+1)}},{key:"handleNextPage",value:function(){var e=this.props.page;this.handleSetPage(e)}},{key:"handlePrevPage",value:function(){var e=this.props.page,t=e-1;if(t<1)return void this.handleSetPage(t);this.handleSetPage(t-1)}},{key:"renderVersionDetail",value:function(){var e=this,t=this.props,o=t.currentVersion,s=t.isPreviewable,n=t.recordId,r=t.recordClass,a=t.schemaUrl,i=t.VersionDetailComponent,l=t.compare,d=t.compare,u=d.versionFrom,p=void 0!==u&&u,h=d.versionTo,m=void 0!==h&&h,f=t.previewState,_={":id":n,":class":r,":version":o.Version},g={":id":n,":class":r,":from":p.Version||0,":to":m.Version||0},y=l?/:id|:class|:from|:to/g:/:id|:class|:version/g,v=l?g:_,j=l?l.versionFrom:o,b=this.getLatestVersion(),C={isLatestVersion:!l&&b&&b.Version===j.Version,isPreviewable:s,recordId:n,schemaUrl:a.replace(y,function(e){return v[e]}),version:j,compare:l,previewState:f};return c.default.createElement(O.default,{style:{position:"relative"},className:this.getContainerClasses(),onResize:function(t){var o=t.width;return e.props.onResize(o)}},c.default.createElement(i,C))}},{key:"renderPagination",value:function(){var e=this.props,t=e.limit,o=e.page,s=e.versions;if(!s)return null;var n=s.Versions?s.Versions.pageInfo.totalCount:0;if(n<=t)return null;var r={setPage:this.handleSetPage,maxPage:Math.ceil(n/t),next:this.handleNextPage,nextText:v.default._t("HistoryViewer.NEXT","Next"),previous:this.handlePrevPage,previousText:v.default._t("HistoryViewer.PREVIOUS","Previous"),currentPage:o-1,useGriddleStyles:!1};return c.default.createElement("div",{className:"griddle-footer"},c.default.createElement(f.default.GridPagination,r))}},{key:"renderComparisonSelectionList",value:function(){var e=this.props,t=e.compare.versionFrom,o=e.ListComponent;return t?c.default.createElement(o,{versions:[t],extraClass:"history-viewer__table history-viewer__table--comparison-selected"}):null}},{key:"renderVersionList",value:function(){var e=this.props,t=e.isPreviewable,o=e.ListComponent,s=e.CompareWarningComponent,n=e.compare,r=e.compare.versionFrom;return c.default.createElement("div",{className:this.getContainerClasses()},c.default.createElement(s,null),c.default.createElement("div",{className:t?"panel panel--padded panel--scrollable":""},this.renderComparisonSelectionList(),c.default.createElement(o,{versions:this.getVersions(),showHeader:!n||n&&!r}),c.default.createElement("div",{className:"history-viewer__pagination"},this.renderPagination())))}},{key:"renderCompareMode",value:function(){var e=this.props.compare;return e&&e.versionFrom&&e.versionTo?this.renderVersionDetail():this.renderVersionList()}},{key:"render",value:function(){var e=this.props,t=e.loading,o=e.compare,s=e.currentVersion;return t?c.default.createElement(C.default,null):o?this.renderCompareMode():s?this.renderVersionDetail():this.renderVersionList()}}]),t}(u.Component);k.propTypes={contextKey:u.PropTypes.string,limit:u.PropTypes.number,ListComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,offset:u.PropTypes.number,recordId:u.PropTypes.number.isRequired,currentVersion:u.PropTypes.oneOfType([u.PropTypes.bool,x.versionType]),compare:S.compareType,isPreviewable:u.PropTypes.bool,VersionDetailComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,CompareWarningComponent:u.PropTypes.oneOfType([u.PropTypes.node,u.PropTypes.func]).isRequired,versions:u.PropTypes.shape({Versions:u.PropTypes.shape({pageInfo:u.PropTypes.shape({totalCount:u.PropTypes.number}),edges:u.PropTypes.arrayOf(u.PropTypes.shape({node:x.versionType}))})}),page:u.PropTypes.number,schemaUrl:u.PropTypes.string,previewState:u.PropTypes.oneOf(["edit","preview","split"]),actions:u.PropTypes.object,onSelect:u.PropTypes.func,onSetPage:u.PropTypes.func,onResize:u.PropTypes.func},k.defaultProps={contextKey:"",currentVersion:!1,isPreviewable:!1,schemaUrl:"",versions:{Versions:{pageInfo:{totalCount:0},edges:[]}}},t.Component=k,t.default=(0,p.compose)((0,h.connect)(i,l),g.default,(0,j.inject)(["HistoryViewerVersionList","HistoryViewerVersionDetail","HistoryViewerCompareWarning"],function(e,t,o){return{ListComponent:e,VersionDetailComponent:t,CompareWarningComponent:o}},function(e){return"VersionedAdmin.HistoryViewer."+e.contextKey}))(k)},"./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultVersion=t.versionType=void 0;var s=o("react"),n=s.PropTypes.shape({FirstName:s.PropTypes.string,Surname:s.PropTypes.string}),r=s.PropTypes.shape({Version:s.PropTypes.number,AbsoluteLink:s.PropTypes.string,LastEdited:s.PropTypes.string,Published:s.PropTypes.boolean,LiveVersion:s.PropTypes.boolean,LatestDraftVersion:s.PropTypes.boolean,Publisher:n,Author:n}),a={Version:0,AbsoluteLink:"",LastEdited:"",Published:!1,LiveVersion:!1,LatestDraftVersion:!1,Publisher:{FirstName:"",Surname:""},Author:{FirstName:"",Surname:""}};t.versionType=r,t.defaultVersion=a},"./node_modules/expose-loader/index.js?HistoryViewer!./client/src/components/HistoryViewer/HistoryViewer.js-exposed":function(e,t,o){(function(t){e.exports=t.HistoryViewer=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/components/HistoryViewer/HistoryViewer.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?versionType!./client/src/types/versionType.js-exposed":function(e,t,o){(function(t){e.exports=t.versionType=o("./node_modules/babel-loader/lib/index.js??ref--0!./client/src/types/versionType.js")}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var s=this.getColumnMetadataByName(e);return void 0===s||null===s?o:s.hasOwnProperty(t)?s[t]:o}},{key:"orderColumns",value:function(e){var t=this;return l(e,function(e){var o=i(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=s.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),s.createElement("div",null)):s.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=n},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t0&&(e=s.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=s.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,r=null,a=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};a=n({textAlign:"right",width:"34%"},i),r=n({textAlign:"center",width:"33%"},i),o=n({width:"33%"},i)}for(var l=[],d=1;d<=this.props.maxPage;d++)l.push(s.createElement("option",{value:d,key:d},d));return s.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},s.createElement("div",{className:this.props.previousClassName,style:o},e),s.createElement("div",{className:"griddle-page",style:r},s.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},l)," / ",this.props.maxPage),s.createElement("div",{className:this.props.nextClassName,style:a},t))}});e.exports=r},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),r=o("./node_modules/lodash/isFunction.js"),a=o("./node_modules/lodash/zipObject.js"),i=o("./node_modules/lodash/assign.js"),l=o("./node_modules/lodash/defaults.js"),d=o("./node_modules/lodash/toPairs.js"),u=o("./node_modules/lodash/without.js"),c=s.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&r(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=a(c,[]),h=i({},this.props.data);l(h,p);var m,f,_=d(n.pick(h,u(c,"children"))),g=_.map(function(t,n){var r=null,a=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===n&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===n&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?s.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===n&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=i(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==a&&null!==a)if(void 0!==a.customComponent&&null!==a.customComponent){var d=s.createElement(a.customComponent,{data:t[1],rowData:h,metadata:a});r=s.createElement("td",{onClick:e.handleClick,className:a.cssClassName,key:n,style:o},d)}else r=s.createElement("td",{onClick:e.handleClick,className:a.cssClassName,key:n,style:o},l,e.formatData(t[1]));return r||s.createElement("td",{onClick:e.handleClick,key:n,style:o},l,t[1])});null!==this.props.onRowClick&&r(this.props.onRowClick)?(m=null,f=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(m=this.handleSelectClick,f=null):(m=null,f=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),g.unshift(s.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:f},s.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(h),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),s.createElement("tr",{onClick:m,className:y},g)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/lodash/pick.js")),r=s.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return s.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(s.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?n(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var r=null;return e.state.showChildren&&(r=e.props.hasChildren&&this.props.data.children.map(function(t,o){var n=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var r=e.constructor.Griddle;return s.createElement("tr",{key:n,style:{paddingLeft:5}},s.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},s.createElement(r,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return s.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:n})})),!1===e.props.hasChildren?t[0]:s.createElement("tbody",null,e.state.showChildren?t.concat(r):t)}});e.exports=r},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/lodash/includes.js"),r=o("./node_modules/lodash/without.js"),a=o("./node_modules/lodash/find.js"),i=s.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===n(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(r(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var r=n(e.props.selectedColumns,t),i=a(e.props.columnMetadata,{columnName:t}),l=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(l=i.displayName),void 0!==i&&null!=i&&i.locked?s.createElement("div",{className:"column checkbox"},s.createElement("label",null,s.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:r,"data-name":t}),l)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:s.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},s.createElement("label",null,s.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:r,"data-name":t}),l))}));var o=e.props.enableToggleCustom?s.createElement("div",{className:"form-group"},s.createElement("label",{htmlFor:"maxRows"},s.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",r=this.props.showSetPageSize?s.createElement("div",null,s.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",s.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},s.createElement("option",{value:"5"},"5"),s.createElement("option",{value:"10"},"10"),s.createElement("option",{value:"25"},"25"),s.createElement("option",{value:"50"},"50"),s.createElement("option",{value:"100"},"100")))):"";return s.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},s.createElement("h6",null,this.props.settingsText),s.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),r,o)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var s=o("react"),n=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),r=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),a=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),s.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,s=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var n={scrollTop:t,scrollHeight:o,clientHeight:s};this.setState(n)}.6*(o-(t+s)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,n=null,a=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),l=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*l),u=Math.min(d+1.25*l,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*i+"px"};n=s.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};a=s.createElement("tr",{key:"below-"+p.height,style:p})}var h=o.map(function(o,n){var a=void 0!==o.children&&o.children.length>0,i=e.props.rowSettings.getRowKey(o,n);return a&&(t=a),s.createElement(r,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:a,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var m=this.props.columnSettings.getVisibleColumnCount();h.push(s.createElement("tr",{key:"no-data-section"},s.createElement("td",{colSpan:m},this.props.noDataSection)))}return n&&h.unshift(n),a&&h.push(a),{nodes:h,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var r=null,a=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(r={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var l=null,d=null;this.props.useGriddleStyles&&(l={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?s.createElement(this.props.externalLoadingComponent,null):s.createElement("div",null,"Loading...");a=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{style:l,colSpan:d},u)))}var c=this.props.showTableHeading?s.createElement(n,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=s.createElement("tbody",null,e));var p=s.createElement("tbody",null);if(this.props.showPager){var h=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:h,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),s.createElement("div",null,s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,a,p)))):s.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:r},s.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,a,p))}}));e.exports=a},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var s=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return k(g.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,s){return k(o,function(o){var n=g.getAt(o,s||""),r=e[s];return t(n,r)})},this.props.results),s={columnFilters:e};e?(s.filteredResults=o,s.maxPage=this.getMaxPage(s.filteredResults)):this.state.filter?s.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):s.filteredResults=null,this.setState(s)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=O(o,t);else{var s={};s[t]=e,o=A({},o,s)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(E(e)||T(e)||P(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=S(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=j(this.props.columnMetadata,{columnName:e})||{},s=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],n=null,r=s.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);r=(r+1)%s.length,n=s[r]?s[r]:null;var a={page:0,sortColumn:e,sortDirection:n};this.setState(a)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=g.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,R(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new f(this.props.results.length>0?g.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new _(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var s=this,n=this;if(""!==this.state.sortColumn){var r,a=this.state.sortColumn,i=k(this.props.columnMetadata,{columnName:a}),l={columns:[],orders:[]};if(i.length>0&&(r=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(l=i[0].multiSort)),this.state.sortDirection)if("function"==typeof r)2===r.length?(e=e.sort(function(e,t){return r(V(e,a),V(t,a))}),"desc"===this.state.sortDirection&&e.reverse()):1===r.length&&(e=M(e,function(e){return r(V(e,a))},[this.state.sortDirection]));else{var d=[function(e){return(V(e,a)||"").toString().toLowerCase()}],u=[this.state.sortDirection];l.columns.forEach(function(e,t){d.push(function(t){return(V(t,e)||"").toString().toLowerCase()}),"asc"===l.orders[t]||"desc"===l.orders[t]?u.push(l.orders[t]):u.push(s.state.sortDirection)}),e=M(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=b(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||w)(p,p.length-this.state.resultsPerPage)}for(var h=(this.columnSettings.getMetadataColumns,[]),m=0;m0&&(f.children=n.getDataForRender(f[n.props.childrenColumnName],t,!1),"children"!==n.props.childrenColumnName&&delete f[n.props.childrenColumnName]),h.push(f)}return h},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),s=this;C(e,function(e){s._updateSelectedRowIds(e[s.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),s=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],s,t);var n=this._getAreAllRowsChecked(s,R(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:n,selectedRowIds:s}),this.props.onSelectionChange&&this.props.onSelectionChange(s,n)},_updateSelectedRowIds:function(e,t,o){o?void 0===j(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===x(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!j(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?n.createElement(m,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):n.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?n.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,s=null,r=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),s=this.getSettingsStyles(),r=this.getClearFixStyles()),n.createElement("div",{className:"top-section",style:r},n.createElement("div",{className:"griddle-filter",style:o},e),n.createElement("div",{className:"griddle-settings-toggle",style:s},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return n.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?n.createElement(h,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):n.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?n.createElement(l,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return n.createElement(this.props.customGridComponent,s({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,s,r){return n.createElement("div",null,n.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:r,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&s)},getStandardGridSection:function(e,t,o,s,a){var i=this.getSortObject(),l=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return n.createElement("div",{className:"griddle-body"},n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:l,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:s,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:a,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,s,n,r){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,s,r):this.getStandardGridSection(e,t,o,s,n)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?n.createElement("div",{className:this.props.noDataClassName},n.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):n.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),s=this.getTopSection(t,o),r=[],a=this.columnSettings.getColumns(),i=this.getDataForRender(e,a,!0),l=this.columnSettings.getMetadataColumns();this.props.columnMetadata?C(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||r.push(e.columnName)}):r=g.keys(O(e[0],l)),r=this.columnSettings.orderColumns(r);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return f+=this.shouldUseCustomRowComponent()?" griddle-custom":"",n.createElement("div",{className:f},s,m,n.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},h))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o-1}var n=o("./node_modules/lodash/_baseIndexOf.js");e.exports=s},"./node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var s=-1,n=null==e?0:e.length;++s=u&&(p=d,h=!1,t=new n(t));e:for(;++c0&&o(u)?t>1?s(u,t-1,o,a,i):n(i,u):a||(i[i.length]=u)}return i}var n=o("./node_modules/lodash/_arrayPush.js"),r=o("./node_modules/lodash/_isFlattenable.js");e.exports=s},"./node_modules/lodash/_baseFor.js":function(e,t,o){var s=o("./node_modules/lodash/_createBaseFor.js"),n=s();e.exports=n},"./node_modules/lodash/_baseForOwn.js":function(e,t,o){function s(e,t){return e&&n(e,t,r)}var n=o("./node_modules/lodash/_baseFor.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_baseGet.js":function(e,t,o){function s(e,t){t=n(t,e);for(var o=0,s=t.length;null!=e&&o=120&&g.length>=120)?new n(h&&g):void 0}g=e[0];var y=-1,v=m[0];e:for(;++yn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var r=Array(n);++st||a&&i&&d&&!l&&!u||s&&i&&d||!o&&d||!r)return 1;if(!s&&!a&&!u&&e=l?d:d*("desc"==o[s]?-1:1)}return e.index-t.index}var n=o("./node_modules/lodash/_compareAscending.js");e.exports=s},"./node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,s=e.length;for(t||(t=Array(s));++o1?o[n-1]:void 0,i=n>2?o[2]:void 0;for(a=e.length>3&&"function"==typeof a?(n--,a):void 0,i&&r(o[0],o[1],i)&&(a=n<3?void 0:a,n=1),t=Object(t);++s-1?i[l?t[d]:d]:void 0}}var n=o("./node_modules/lodash/_baseIteratee.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/_createToPairs.js":function(e,t,o){function s(e){return function(t){var o=r(t);return o==l?a(t):o==d?i(t):n(t,e(t))}}var n=o("./node_modules/lodash/_baseToPairs.js"),r=o("./node_modules/lodash/_getTag.js"),a=o("./node_modules/lodash/_mapToArray.js"),i=o("./node_modules/lodash/_setToPairs.js"),l="[object Map]",d="[object Set]";e.exports=s},"./node_modules/lodash/_customOmitClone.js":function(e,t,o){function s(e){return n(e)?void 0:e}var n=o("./node_modules/lodash/isPlainObject.js");e.exports=s},"./node_modules/lodash/_defineProperty.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},"./node_modules/lodash/_equalArrays.js":function(e,t,o){function s(e,t,o,s,d,u){var c=o&i,p=e.length,h=t.length;if(p!=h&&!(c&&h>p))return!1;var m=u.get(e);if(m&&u.get(t))return m==t;var f=-1,_=!0,g=o&l?new n:void 0;for(u.set(e,t),u.set(t,e);++f-1&&e%1==0&&e-1}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function s(e,t){var o=this.__data__,s=n(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this}var n=o("./node_modules/lodash/_assocIndexOf.js");e.exports=s},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function s(){this.size=0,this.__data__={hash:new n,map:new(a||r),string:new n}}var n=o("./node_modules/lodash/_Hash.js"),r=o("./node_modules/lodash/_ListCache.js"),a=o("./node_modules/lodash/_Map.js");e.exports=s},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function s(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function s(e){return n(this,e).get(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function s(e){return n(this,e).has(e)}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function s(e,t){var o=n(this,e),s=o.size;return o.set(e,t),this.size+=o.size==s?0:1,this}var n=o("./node_modules/lodash/_getMapData.js");e.exports=s},"./node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,s){o[++t]=[s,e]}),o}e.exports=o},"./node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function s(e){var t=n(e,function(e){return o.size===r&&o.clear(),e}),o=t.cache;return t}var n=o("./node_modules/lodash/memoize.js"),r=500;e.exports=s},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var s=o("./node_modules/lodash/_getNative.js"),n=s(Object,"create");e.exports=n},"./node_modules/lodash/_nativeKeys.js":function(e,t,o){var s=o("./node_modules/lodash/_overArg.js"),n=s(Object.keys,Object);e.exports=n},"./node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_freeGlobal.js"),n="object"==typeof t&&t&&!t.nodeType&&t,r=n&&"object"==typeof e&&e&&!e.nodeType&&e,a=r&&r.exports===n,i=a&&s.process,l=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return n.call(e)}var s=Object.prototype,n=s.toString;e.exports=o},"./node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/lodash/_overRest.js":function(e,t,o){function s(e,t,o){return t=r(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,i=r(s.length-t,0),l=Array(i);++a0){if(++t>=s)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var s=800,n=16,r=Date.now;e.exports=o},"./node_modules/lodash/_stackClear.js":function(e,t,o){function s(){this.__data__=new n,this.size=0}var n=o("./node_modules/lodash/_ListCache.js");e.exports=s},"./node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/lodash/_stackSet.js":function(e,t,o){function s(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length2?t[2]:void 0;for(d&&r(t[0],t[1],d)&&(s=1);++o-1:!!u&&n(e,t,o)>-1}var n=o("./node_modules/lodash/_baseIndexOf.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/isString.js"),i=o("./node_modules/lodash/toInteger.js"),l=o("./node_modules/lodash/values.js"),d=Math.max;e.exports=s},"./node_modules/lodash/initial.js":function(e,t,o){function s(e){return(null==e?0:e.length)?n(e,0,-1):[]}var n=o("./node_modules/lodash/_baseSlice.js");e.exports=s},"./node_modules/lodash/intersection.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseIntersection.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_castArrayLikeObject.js"),i=r(function(e){var t=s(e,a);return t.length&&t[0]===e[0]?n(t):[]});e.exports=i},"./node_modules/lodash/isArguments.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsArguments.js"),n=o("./node_modules/lodash/isObjectLike.js"),r=Object.prototype,a=r.hasOwnProperty,i=r.propertyIsEnumerable,l=s(function(){return arguments}())?s:function(e){return n(e)&&a.call(e,"callee")&&!i.call(e,"callee")};e.exports=l},"./node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/lodash/isArrayLike.js":function(e,t,o){function s(e){return null!=e&&r(e.length)&&!n(e)}var n=o("./node_modules/lodash/isFunction.js"),r=o("./node_modules/lodash/isLength.js");e.exports=s},"./node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function s(e){return r(e)&&n(e)}var n=o("./node_modules/lodash/isArrayLike.js"),r=o("./node_modules/lodash/isObjectLike.js");e.exports=s},"./node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var s=o("./node_modules/lodash/_root.js"),n=o("./node_modules/lodash/stubFalse.js"),r="object"==typeof t&&t&&!t.nodeType&&t,a=r&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===r,l=i?s.Buffer:void 0,d=l?l.isBuffer:void 0,u=d||n;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/isEmpty.js":function(e,t,o){function s(e){if(null==e)return!0;if(l(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||a(e)))return!e.length;var t=r(e);if(t==p||t==h)return!e.size;if(u(e))return!n(e).length;for(var o in e)if(f.call(e,o))return!1;return!0}var n=o("./node_modules/lodash/_baseKeys.js"),r=o("./node_modules/lodash/_getTag.js"),a=o("./node_modules/lodash/isArguments.js"),i=o("./node_modules/lodash/isArray.js"),l=o("./node_modules/lodash/isArrayLike.js"),d=o("./node_modules/lodash/isBuffer.js"),u=o("./node_modules/lodash/_isPrototype.js"),c=o("./node_modules/lodash/isTypedArray.js"),p="[object Map]",h="[object Set]",m=Object.prototype,f=m.hasOwnProperty;e.exports=s},"./node_modules/lodash/isFunction.js":function(e,t,o){function s(e){if(!r(e))return!1;var t=n(e);return t==i||t==l||t==a||t==d}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObject.js"),a="[object AsyncFunction]",i="[object Function]",l="[object GeneratorFunction]",d="[object Proxy]";e.exports=s},"./node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}var s=9007199254740991;e.exports=o},"./node_modules/lodash/isMap.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsMap.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isMap,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isPlainObject.js":function(e,t,o){function s(e){if(!a(e)||n(e)!=i)return!1;var t=r(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/_getPrototype.js"),a=o("./node_modules/lodash/isObjectLike.js"),i="[object Object]",l=Function.prototype,d=Object.prototype,u=l.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=s},"./node_modules/lodash/isSet.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsSet.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isSet,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isString.js":function(e,t,o){function s(e){return"string"==typeof e||!r(e)&&a(e)&&n(e)==i}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isArray.js"),a=o("./node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=s},"./node_modules/lodash/isSymbol.js":function(e,t,o){function s(e){return"symbol"==typeof e||r(e)&&n(e)==a}var n=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=s},"./node_modules/lodash/isTypedArray.js":function(e,t,o){var s=o("./node_modules/lodash/_baseIsTypedArray.js"),n=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isTypedArray,i=a?n(a):s;e.exports=i},"./node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/lodash/keys.js":function(e,t,o){function s(e){return a(e)?n(e):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeys.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/keysIn.js":function(e,t,o){function s(e){return a(e)?n(e,!0):r(e)}var n=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeysIn.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=s},"./node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/lodash/map.js":function(e,t,o){function s(e,t){return(i(e)?n:a)(e,r(t,3))}var n=o("./node_modules/lodash/_arrayMap.js"),r=o("./node_modules/lodash/_baseIteratee.js"),a=o("./node_modules/lodash/_baseMap.js"),i=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/memoize.js":function(e,t,o){function s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(r);var o=function(){var s=arguments,n=t?t.apply(this,s):s[0],r=o.cache;if(r.has(n))return r.get(n);var a=e.apply(this,s);return o.cache=r.set(n,a)||r,a};return o.cache=new(s.Cache||n),o}var n=o("./node_modules/lodash/_MapCache.js"),r="Expected a function";s.Cache=n,e.exports=s},"./node_modules/lodash/omit.js":function(e,t,o){var s=o("./node_modules/lodash/_arrayMap.js"),n=o("./node_modules/lodash/_baseClone.js"),r=o("./node_modules/lodash/_baseUnset.js"),a=o("./node_modules/lodash/_castPath.js"),i=o("./node_modules/lodash/_copyObject.js"),l=o("./node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/lodash/_flatRest.js"),u=o("./node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=s(t,function(t){return t=a(t,e),d||(d=t.length>1),t}),i(e,u(e),o),d&&(o=n(o,7,l));for(var c=t.length;c--;)r(o,t[c]);return o});e.exports=c},"./node_modules/lodash/orderBy.js":function(e,t,o){function s(e,t,o,s){return null==e?[]:(r(t)||(t=null==t?[]:[t]),o=s?void 0:o,r(o)||(o=null==o?[]:[o]),n(e,t,o))}var n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/isArray.js");e.exports=s},"./node_modules/lodash/pick.js":function(e,t,o){var s=o("./node_modules/lodash/_basePick.js"),n=o("./node_modules/lodash/_flatRest.js"),r=n(function(e,t){return null==e?{}:s(e,t)});e.exports=r},"./node_modules/lodash/property.js":function(e,t,o){function s(e){return a(e)?n(i(e)):r(e)}var n=o("./node_modules/lodash/_baseProperty.js"),r=o("./node_modules/lodash/_basePropertyDeep.js"),a=o("./node_modules/lodash/_isKey.js"),i=o("./node_modules/lodash/_toKey.js");e.exports=s},"./node_modules/lodash/sortBy.js":function(e,t,o){var s=o("./node_modules/lodash/_baseFlatten.js"),n=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_isIterateeCall.js"),i=r(function(e,t){if(null==e)return[];var o=t.length;return o>1&&a(e,t[0],t[1])?t=[]:o>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),n(e,s(t,1),[])});e.exports=i},"./node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/lodash/take.js":function(e,t,o){function s(e,t,o){return e&&e.length?(t=o||void 0===t?1:r(t),n(e,0,t<0?0:t)):[]}var n=o("./node_modules/lodash/_baseSlice.js"),r=o("./node_modules/lodash/toInteger.js");e.exports=s},"./node_modules/lodash/toFinite.js":function(e,t,o){function s(e){return e?(e=n(e))===r||e===-r?(e<0?-1:1)*a:e===e?e:0:0===e?e:0}var n=o("./node_modules/lodash/toNumber.js"),r=1/0,a=1.7976931348623157e308;e.exports=s},"./node_modules/lodash/toInteger.js":function(e,t,o){function s(e){var t=n(e),o=t%1;return t===t?o?t-o:t:0}var n=o("./node_modules/lodash/toFinite.js");e.exports=s},"./node_modules/lodash/toNumber.js":function(e,t,o){function s(e){if("number"==typeof e)return e;if(r(e))return a;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):l.test(e)?a:+e}var n=o("./node_modules/lodash/isObject.js"),r=o("./node_modules/lodash/isSymbol.js"),a=NaN,i=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=s},"./node_modules/lodash/toPairs.js":function(e,t,o){var s=o("./node_modules/lodash/_createToPairs.js"),n=o("./node_modules/lodash/keys.js"),r=s(n);e.exports=r},"./node_modules/lodash/toString.js":function(e,t,o){function s(e){return null==e?"":n(e)}var n=o("./node_modules/lodash/_baseToString.js");e.exports=s},"./node_modules/lodash/uniqueId.js":function(e,t,o){function s(e){var t=++r;return n(e)+t}var n=o("./node_modules/lodash/toString.js"),r=0;e.exports=s},"./node_modules/lodash/values.js":function(e,t,o){function s(e){return null==e?[]:n(e,r(e))}var n=o("./node_modules/lodash/_baseValues.js"),r=o("./node_modules/lodash/keys.js");e.exports=s},"./node_modules/lodash/without.js":function(e,t,o){var s=o("./node_modules/lodash/_baseDifference.js"),n=o("./node_modules/lodash/_baseRest.js"),r=o("./node_modules/lodash/isArrayLikeObject.js"),a=n(function(e,t){return r(e)?s(e,t):[]});e.exports=a},"./node_modules/lodash/zipObject.js":function(e,t,o){function s(e,t){return r(e||[],t||[],n)}var n=o("./node_modules/lodash/_assignValue.js"),r=o("./node_modules/lodash/_baseZipObject.js");e.exports=s},"./node_modules/react-resize-aware/dist/index.js":function(e,t,o){!function(e,s){!function(e,t){"use strict";function o(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(e,t){var o={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(o[s]=e[s]);return o}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(o){return t.createElement(c,l({component:e},o))}}var l=Object.assign||function(e){for(var t=1;t>>((3&t)<<3)&255;return n}}},"./node_modules/uuid/v1.js":function(e,t,o){function s(e,t,o){var s=t&&o||0,u=t||[];e=e||{};var c=e.node||n,p=void 0!==e.clockseq?e.clockseq:r;if(null==c||null==p){var h=a();null==c&&(c=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=r=16383&(h[6]<<8|h[7]))}var m=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:d+1,_=m-l+(f-d)/1e4;if(_<0&&void 0===e.clockseq&&(p=p+1&16383),(_<0||m>l)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=m,d=f,r=p,m+=122192928e5;var g=(1e4*(268435455&m)+f)%4294967296;u[s++]=g>>>24&255,u[s++]=g>>>16&255,u[s++]=g>>>8&255,u[s++]=255&g;var y=m/4294967296*1e4&268435455;u[s++]=y>>>8&255,u[s++]=255&y,u[s++]=y>>>24&15|16,u[s++]=y>>>16&255,u[s++]=p>>>8|128,u[s++]=255&p;for(var v=0;v<6;++v)u[s+v]=c[v];return t||i(u)}var n,r,a=o("./node_modules/uuid/lib/rng-browser.js"),i=o("./node_modules/uuid/lib/bytesToUuid.js"),l=0,d=0;e.exports=s},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},classnames:function(e,t){e.exports=classnames},"components/Loading/Loading":function(e,t){e.exports=Loading},"containers/FormBuilderLoader/FormBuilderLoader":function(e,t){e.exports=FormBuilderLoader},i18n:function(e,t){e.exports=i18n},jquery:function(e,t){e.exports=jQuery},"lib/Config":function(e,t){e.exports=Config},"lib/Injector":function(e,t){e.exports=Injector},moment:function(e,t){e.exports=moment},react:function(e,t){e.exports=React},"react-dom":function(e,t){e.exports=ReactDom},"react-redux":function(e,t){e.exports=ReactRedux},reactstrap:function(e,t){e.exports=Reactstrap},redux:function(e,t){e.exports=Redux},"state/viewMode/viewModeActions":function(e,t){e.exports=ViewModeActions}}); \ No newline at end of file diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index d68cecca..1037414a 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1 @@ -#Form_EditForm_OtherDropdown_Holder{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:-1.5385rem -1.5385rem 0;border-bottom:1px solid #ced5e1;padding:3.077rem;background-color:#fff}#Form_EditForm_error.good+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.info+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.warning+fieldset>#Form_EditForm_OtherDropdown_Holder{margin-top:0}#Form_EditForm_OtherDropdown_Holder:after{border-bottom:none}#Form_EditForm_OtherDropdown_Holder .form__field-label{max-width:none;width:auto;margin-bottom:.9231rem;color:#566b8d;font-size:19px}#Form_EditForm_OtherDropdown_Holder .form__field-holder{width:100%;max-width:23rem}.history-viewer>.panel--padded{padding-top:0}.history-viewer.history-viewer__compare-mode .panel--padded{padding-top:30px}.panel--padded-side{padding-bottom:0;padding-top:0}.history-viewer__form{position:relative}.history-viewer__version-state .text-muted{margin-right:10px}.history-viewer__version-detail--compare{margin-left:1.5385rem;margin-right:1.5385rem}.history-viewer__version-detail .nav-tabs{margin-top:-1.5385rem}.history-viewer__compare-button{border:1px solid #fff;color:#fff;margin-right:1rem}.history-viewer__close-button{background:transparent;border:1px solid #fff;border-radius:50%;color:#fff;padding:.4rem .55rem}.history-viewer__close-button:before{font-size:1.4rem}.history-viewer__messages .message-box:first-child{margin-top:1.5385rem}.history-viewer__messages .message-box:last-child{margin-bottom:0}.history-viewer__preview{margin-top:-54px}.history-viewer__toolbar--condensed{min-width:50%;width:50%}.history-viewer__compare-notice{-webkit-align-self:center;-ms-grid-row-align:center;align-self:center;background-color:#cae6f4;color:#237ca5;border:1px solid #93cde8;border-top:none;border-bottom-right-radius:5px;border-bottom-left-radius:5px;position:absolute}.history-viewer__compare-notice .notice-message{padding:.4rem 1rem .4rem 1.5rem;vertical-align:middle}.history-viewer__compare-notice button{background-color:inherit;color:inherit;border-width:0 0 0 1px;border-color:#93cde8;margin-right:0;border-radius:0 0 5px 0}.history-viewer__compare-notice button:hover{background-color:#dff0f8}.history-viewer__version-detail-diff del{color:#f44}.history-viewer__version-detail-diff ins{background-color:#dfd;text-decoration:none}@media (max-width:991.98px){.history-viewer__preview{display:none}}.history-viewer__actions-dropdown .form-check-label{text-transform:none}.history-viewer__actions-dropdown .btn[class*=font-icon-]:before{margin-right:0}.history-viewer__actions-dropdown.show .dropdown-menu{min-width:14rem}.history-viewer__actions-dropdown .form-check{margin-top:.5rem}.history-viewer__heading{font-size:.923rem;text-transform:uppercase}.history-viewer__table{padding:0}.history-viewer__table li{display:-webkit-box;display:-webkit-flex;display:flex;list-style-type:none}.history-viewer__heading,.history-viewer__row{border-bottom:1px solid #dbe0e9}.history-viewer__row{background-color:#fff}.history-viewer__row:active,.history-viewer__row:hover{background-color:#f0f4f7}.history-viewer__version-anchor{color:inherit;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.history-viewer__version-anchor:active,.history-viewer__version-anchor:hover{color:inherit;text-decoration:none}.history-viewer__actions,.history-viewer__author,.history-viewer__version-no,.history-viewer__version-state{padding:1.2308rem}.history-viewer__author,.history-viewer__version-state{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;width:50%}.history-viewer__actions{padding-top:0;padding-bottom:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;min-width:12rem}.table .history-viewer__row--current,.table .history-viewer__row--current:hover{background-color:#0071c4;color:#fff}.table .history-viewer__row--current .text-muted{color:#fff!important}.history-viewer__table:not(.history-viewer__table--current) .history-viewer__version-anchor:hover{cursor:pointer}.history-viewer__table--current{margin-bottom:.76925rem} \ No newline at end of file +#Form_EditForm_OtherDropdown_Holder{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:-1.5385rem -1.5385rem 0;border-bottom:1px solid #ced5e1;padding:3.077rem;background-color:#fff}#Form_EditForm_error.good+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.info+fieldset>#Form_EditForm_OtherDropdown_Holder,#Form_EditForm_error.warning+fieldset>#Form_EditForm_OtherDropdown_Holder{margin-top:0}#Form_EditForm_OtherDropdown_Holder:after{border-bottom:none}#Form_EditForm_OtherDropdown_Holder .form__field-label{max-width:none;width:auto;margin-bottom:.9231rem;color:#566b8d;font-size:19px}#Form_EditForm_OtherDropdown_Holder .form__field-holder{width:100%;max-width:23rem}.history-viewer>.panel--padded{padding-top:0}.history-viewer.history-viewer__compare-mode .panel--padded{padding-top:30px}.panel--padded-side{padding-bottom:0;padding-top:0}.history-viewer__form{position:relative}.history-viewer__version-state .text-muted{margin-right:10px}.history-viewer__version-detail--compare{margin-left:1.5385rem;margin-right:1.5385rem}.history-viewer__compare-button{border:1px solid #fff;color:#fff;margin-right:1rem}.history-viewer__close-button{background:transparent;border:1px solid #fff;border-radius:50%;color:#fff;padding:.4rem .55rem}.history-viewer__close-button:before{font-size:1.4rem}.history-viewer__messages .message-box:first-child{margin-top:1.5385rem}.history-viewer__messages .message-box:last-child{margin-bottom:0}.history-viewer__preview{margin-top:-54px}.history-viewer__toolbar--condensed{min-width:50%;width:50%}.history-viewer__compare-notice{-webkit-align-self:center;-ms-grid-row-align:center;align-self:center;background-color:#cae6f4;color:#237ca5;border:1px solid #93cde8;border-top:none;border-bottom-right-radius:5px;border-bottom-left-radius:5px;position:absolute}.history-viewer__compare-notice .notice-message{padding:.4rem 1rem .4rem 1.5rem;vertical-align:middle}.history-viewer__compare-notice button{background-color:inherit;color:inherit;border-width:0 0 0 1px;border-color:#93cde8;margin-right:0;border-radius:0 0 5px 0}.history-viewer__compare-notice button:hover{background-color:#dff0f8}.history-viewer__version-detail-diff del{color:#f44}.history-viewer__version-detail-diff ins{background-color:#dfd;text-decoration:none}@media (max-width:991.98px){.history-viewer__preview{display:none}}.history-viewer__actions-dropdown .form-check-label{text-transform:none}.history-viewer__actions-dropdown .btn[class*=font-icon-]:before{margin-right:0}.history-viewer__actions-dropdown.show .dropdown-menu{min-width:14rem}.history-viewer__actions-dropdown .form-check{margin-top:.5rem}.history-viewer__heading{font-size:.923rem;text-transform:uppercase}.history-viewer__table{padding:0}.history-viewer__table li{display:-webkit-box;display:-webkit-flex;display:flex;list-style-type:none}.history-viewer__table--comparison-selected{margin-bottom:0;border-bottom:5px solid #303b4d}.history-viewer__row--comparison-selected:last-child{border-bottom:none}.history-viewer__heading,.history-viewer__row{border-bottom:1px solid #dbe0e9}.history-viewer__row{background-color:#fff}.history-viewer__row:active,.history-viewer__row:hover{background-color:#f0f4f7}.history-viewer__version-anchor{color:inherit;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.history-viewer__version-anchor:active,.history-viewer__version-anchor:hover{color:inherit;text-decoration:none}.history-viewer__actions,.history-viewer__author,.history-viewer__version-no,.history-viewer__version-state{padding:1.2308rem}.history-viewer__author,.history-viewer__version-state{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;width:50%}.history-viewer__actions{padding-top:0;padding-bottom:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;min-width:12rem}.table .history-viewer__row--current,.table .history-viewer__row--current:hover{background-color:#0071c4;color:#fff}.table .history-viewer__row--current .text-muted{color:#fff!important}.history-viewer__table:not(.history-viewer__table--current) .history-viewer__version-anchor:hover{cursor:pointer}.history-viewer__table--current{margin-bottom:.76925rem} \ No newline at end of file diff --git a/client/src/components/HistoryViewer/HistoryViewer.js b/client/src/components/HistoryViewer/HistoryViewer.js index d4cf9cf0..fe77e1cf 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.js +++ b/client/src/components/HistoryViewer/HistoryViewer.js @@ -8,7 +8,11 @@ import historyViewerConfig from 'containers/HistoryViewer/HistoryViewerConfig'; import i18n from 'i18n'; import { inject } from 'lib/Injector'; import Loading from 'components/Loading/Loading'; -import { setCurrentPage, showVersion } from 'state/historyviewer/HistoryViewerActions'; +import { + setCurrentPage, + showVersion, + clearMessages, +} from 'state/historyviewer/HistoryViewerActions'; import { versionType } from 'types/versionType'; import { compareType } from 'types/compareType'; import classNames from 'classnames'; @@ -157,6 +161,7 @@ class HistoryViewer extends Component { schemaUrl, VersionDetailComponent, compare, + compare: { versionFrom = false, versionTo = false }, previewState, } = this.props; @@ -164,40 +169,37 @@ class HistoryViewer extends Component { const schemaVersionReplacements = { ':id': recordId, ':class': recordClass, - ':version': currentVersion, + ':version': currentVersion.Version, }; const schemaCompareReplacements = { ':id': recordId, ':class': recordClass, - ':from': compare ? compare.versionFrom : 0, - ':to': compare ? compare.versionTo : 0, + ':from': versionFrom.Version || 0, + ':to': versionTo.Version || 0, }; const schemaSearch = compare ? /:id|:class|:from|:to/g : /:id|:class|:version/g; const schemaReplacements = compare ? schemaCompareReplacements : schemaVersionReplacements; - const filterVersions = (wantedID) => (potential => potential.Version === wantedID); - - const version = this.getVersions().find( - filterVersions(compare ? compare.versionFrom : currentVersion) - ); + const version = compare ? compare.versionFrom : currentVersion; const latestVersion = this.getLatestVersion(); - const compareProps = compare ? { - versionFrom: this.getVersions().find(filterVersions(compare.versionFrom)), - versionTo: this.getVersions().find(filterVersions(compare.versionTo)), - } : false; const props = { - isLatestVersion: latestVersion && latestVersion.Version === version.Version, + // comparison shows two versions as one, so by nature cannot be a single 'latest' version. + isLatestVersion: !compare && latestVersion && latestVersion.Version === version.Version, isPreviewable, recordId, schemaUrl: schemaUrl.replace(schemaSearch, (match) => schemaReplacements[match]), version, - compare: compareProps, + compare, previewState, }; return ( - this.props.onResize(width)} > + this.props.onResize(width)} + > ); @@ -246,21 +248,51 @@ class HistoryViewer extends Component { ); } + /** + * Render the list containing versions selected for comparison. + * It is not the ListComponent's place to know the context in which it is being rendered + * so it is the directive of this contextual component to tell it what stylistic adaptations + * it should present based on the context (the type of list it contains). + * + * @returns {HistoryViewerVersionList|null} + */ + renderComparisonSelectionList() { + const { compare: { versionFrom }, ListComponent } = this.props; + if (!versionFrom) { + return null; + } + return ( + + ); + } + /** * Renders a list of versions * * @returns {HistoryViewerVersionList} */ renderVersionList() { - const { isPreviewable, ListComponent, CompareWarningComponent } = this.props; + const { + isPreviewable, + ListComponent, + CompareWarningComponent, + compare, + compare: { versionFrom: hasVersionFrom }, + } = this.props; return (
    +
    + {this.renderComparisonSelectionList()}
    @@ -305,7 +337,7 @@ HistoryViewer.propTypes = { ListComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, offset: PropTypes.number, recordId: PropTypes.number.isRequired, - currentVersion: PropTypes.number, + currentVersion: PropTypes.oneOfType([PropTypes.bool, versionType]), compare: compareType, isPreviewable: PropTypes.bool, VersionDetailComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, @@ -331,7 +363,7 @@ HistoryViewer.propTypes = { HistoryViewer.defaultProps = { contextKey: '', - currentVersion: 0, + currentVersion: false, isPreviewable: false, schemaUrl: '', versions: { @@ -366,6 +398,7 @@ function mapDispatchToProps(dispatch) { return { onSelect(id) { dispatch(showVersion(id)); + dispatch(clearMessages()); }, onSetPage(page) { dispatch(setCurrentPage(page)); diff --git a/client/src/components/HistoryViewer/HistoryViewer.scss b/client/src/components/HistoryViewer/HistoryViewer.scss index db6fd152..317cbfcc 100644 --- a/client/src/components/HistoryViewer/HistoryViewer.scss +++ b/client/src/components/HistoryViewer/HistoryViewer.scss @@ -27,11 +27,6 @@ margin-right: $panel-padding-x; } -// Bring any CMS tabs in the detail view closer to the table above it -.history-viewer__version-detail .nav-tabs { - margin-top: -$panel-padding-y; -} - .history-viewer__compare-button { border: 1px solid $white; color: $white; diff --git a/client/src/components/HistoryViewer/HistoryViewerToolbar.js b/client/src/components/HistoryViewer/HistoryViewerToolbar.js index 09243394..5b6d0eb6 100644 --- a/client/src/components/HistoryViewer/HistoryViewerToolbar.js +++ b/client/src/components/HistoryViewer/HistoryViewerToolbar.js @@ -67,9 +67,6 @@ HistoryViewerToolbar.defaultProps = { isPreviewable: false, }; -function mapStateToProps() { - return {}; -} function mapDispatchToProps(dispatch) { return { @@ -88,7 +85,7 @@ function mapDispatchToProps(dispatch) { export { HistoryViewerToolbar as Component }; export default compose( - connect(mapStateToProps, mapDispatchToProps), + connect(null, mapDispatchToProps), inject( ['FormAction', 'ViewModeToggle'], (FormActionComponent, ViewModeComponent) => ({ diff --git a/client/src/components/HistoryViewer/HistoryViewerVersion.js b/client/src/components/HistoryViewer/HistoryViewerVersion.js index 137b2602..5484f2cb 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersion.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersion.js @@ -4,9 +4,15 @@ import { connect } from 'react-redux'; import { inject } from 'lib/Injector'; import { versionType, defaultVersion } from 'types/versionType'; import { compareType } from 'types/compareType'; -import { showVersion, setCompareMode, setCompareFrom, setCompareTo } from 'state/historyviewer/HistoryViewerActions'; import i18n from 'i18n'; import classNames from 'classnames'; +import { + showVersion, + clearMessages, + setCompareMode, + setCompareFrom, + setCompareTo, +} from 'state/historyviewer/HistoryViewerActions'; class HistoryViewerVersion extends Component { constructor(props) { @@ -36,44 +42,52 @@ class HistoryViewerVersion extends Component { return `${member.FirstName || ''} ${member.Surname || ''}`; } + /** + * Return a string of HTML class names for the row (list item) element + * + * @returns {string} + */ + getClassNames() { + const { extraClass, isActive, compare, compare: { compareFrom, compareTo } } = this.props; + const defaultClasses = { + 'history-viewer__row': true, + 'history-viewer__row--current': isActive, + 'history-viewer__row--comparison-selected': compare && !(compareFrom && compareTo), + }; + return classNames(defaultClasses, extraClass); + } + /** * When clicking on a version, render the detail view for it via a Redux action dispatch + * passed through via a closure prop (onSelect) */ handleClick() { - const { onSelect, version, isActive, compare, onCompareSelect } = this.props; + const { onSelect, version, isActive, compare } = this.props; // If the clear button is shown, don't do anything when clicking on the row if (isActive) { return false; } - if (compare) { - onCompareSelect(version.Version, !compare.versionFrom); - } else { - onSelect(version.Version); - } - + onSelect(version, compare); return false; } + handleCompare() { + const { onCompareMode, version } = this.props; + onCompareMode(version); + } + /** * When closing the version, return back to the list view via Redux action dispatch */ handleClose() { - const { onSelect, compare, onCompareSelect, version } = this.props; - if (compare) { - onCompareSelect(0, version.Version === compare.versionFrom); - } else { - onSelect(0); + const { onSelect, version, compare, compare: { versionFrom } } = this.props; + if (versionFrom && versionFrom.Version === version.Version) { + // Ensures we set the correct thing. C.f. logic in mapDispatchToProps -> onSelect + delete compare.versionFrom; } - } - - /** - * When the compare mode button is selected, pass the selected version to the Redux store - */ - handleCompare() { - const { onCompare, version } = this.props; - onCompare(version.Version); + onSelect(0, compare); } /** @@ -84,6 +98,7 @@ class HistoryViewerVersion extends Component { */ renderCompareButton() { const { compare, FormActionComponent } = this.props; + const translatedText = i18n._t('HistoryViewerVersion.COMPARE', 'Compare'); if (compare) { return null; @@ -92,10 +107,11 @@ class HistoryViewerVersion extends Component { return ( - {i18n._t('HistoryViewerVersion.COMPARE', 'Compare')} + {translatedText} ); } @@ -118,6 +134,7 @@ class HistoryViewerVersion extends Component { onClick={this.handleClose} icon="cancel" title={null} + buttonStyle="outline-light" extraClass="history-viewer__close-button" /> ); @@ -130,9 +147,9 @@ class HistoryViewerVersion extends Component { * @returns {DOMElement} */ renderActions() { - const { isActive, compareMode } = this.props; + const { isActive, compare } = this.props; - if (!isActive && !compareMode) { + if (!isActive && !compare) { return ( ); @@ -149,15 +166,10 @@ class HistoryViewerVersion extends Component { render() { const { version, isActive, StateComponent } = this.props; - const classnames = classNames({ - 'history-viewer__row': true, - 'history-viewer__row--current': isActive, - }); - const rowTitle = i18n._t('HistoryViewerVersion.GO_TO_VERSION', 'Go to version {version}'); return ( -
  • +
  • ({ @@ -233,7 +243,6 @@ export default compose( if (version) { context += `.${version.Version}`; } - return context; } ) diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js index 0def4ec9..a564c3aa 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionDetail.js @@ -169,7 +169,6 @@ class HistoryViewerVersionDetail extends PureComponent {
    diff --git a/client/src/components/HistoryViewer/HistoryViewerVersionList.js b/client/src/components/HistoryViewer/HistoryViewerVersionList.js index 9efee42d..09edba4e 100644 --- a/client/src/components/HistoryViewer/HistoryViewerVersionList.js +++ b/client/src/components/HistoryViewer/HistoryViewerVersionList.js @@ -10,30 +10,45 @@ import { compareType } from 'types/compareType'; class HistoryViewerVersionList extends PureComponent { /** - * Return a string of HTML class names for the table element + * Return a string of HTML class names for the list element * * @returns {string} */ getClassNames() { - const { extraClass } = this.props; - return classnames({ table: true }, extraClass); + const { extraClass, showHeader } = this.props; + const classes = { + table: true, + 'history-viewer__table--headerless': !showHeader, + }; + return classnames(classes, extraClass); } /** - * "isActive" in this component indicates that the content is shown - ie. the table - * only shows the row (or rows) that are currently highlighted above the content of - * this version. + * Compares provided version object to see if it is one of the selected ones in the store. + * It can be that it is either currentVersion, the versionFrom or the versionTo comparison. + * + * We receive either a version object, or `false` as props for current/from/to + * If and only if we are NOT in compare mode: + * - compare is `false` + * - versionFrom and versionTo are `undefined` + * - currentVersion is relevant (otherwise it can be ignored, even if it is a valid version) + * + * @see {state/historyviewer/HistoryViewerReducer} for how compare is set + * + * Otherwise we simply check to see if the provided version object's version number + * is equal to one of the version numbers on the store objects. * * @param {Object} version * @returns {boolean} */ isVersionActive(version) { - const { isActive, compare } = this.props; - if (isActive) { - return true; - } + const { currentVersion, compare, compare: { versionFrom, versionTo } } = this.props; + + const isCurrent = currentVersion && currentVersion.Version === version.Version; + const isCompareFrom = versionFrom && versionFrom.Version === version.Version; + const isCompareTo = versionTo && versionTo.Version === version.Version; - return version.Version === compare.versionFrom || version.Version === compare.versionTo; + return (!compare && isCurrent) || isCompareFrom || isCompareTo; } /** @@ -64,21 +79,30 @@ class HistoryViewerVersionList extends PureComponent { ); } + /** + * Renders a HeadingComponent at the top of the list, unless it has been disabled. + * @returns {HistoryViewerHeading|null} + */ + renderHeader() { + const { showHeader, HeadingComponent } = this.props; + return showHeader ? : null; + } + render() { - const { HeadingComponent, VersionComponent, versions } = this.props; + const { VersionComponent, versions, compare } = this.props; return (
    {this.renderMessages()} -