cluedin-widget
Version:
557 lines (453 loc) • 22.2 kB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[27],{
/***/ 2322:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(0);
var react_default = /*#__PURE__*/__webpack_require__.n(react);
// EXTERNAL MODULE: ./node_modules/react-redux/es/index.js + 18 modules
var es = __webpack_require__(8);
// EXTERNAL MODULE: ./node_modules/react-intl/lib/index.es.js
var index_es = __webpack_require__(4);
// EXTERNAL MODULE: ./core/modules/core/components/composites/MainWidgetForPage.js
var MainWidgetForPage = __webpack_require__(210);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
var classCallCheck = __webpack_require__(12);
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
var createClass = __webpack_require__(13);
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
var possibleConstructorReturn = __webpack_require__(14);
var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
var getPrototypeOf = __webpack_require__(15);
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
var inherits = __webpack_require__(16);
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/assertThisInitialized.js
var assertThisInitialized = __webpack_require__(27);
var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized);
// EXTERNAL MODULE: ./node_modules/lodash/take.js
var take = __webpack_require__(405);
var take_default = /*#__PURE__*/__webpack_require__.n(take);
// EXTERNAL MODULE: ./node_modules/uxi/Input/index.js
var Input = __webpack_require__(35);
// EXTERNAL MODULE: ./node_modules/uxi/Base/index.js
var Base = __webpack_require__(72);
// EXTERNAL MODULE: ./node_modules/uxi/Alert/index.js
var Alert = __webpack_require__(24);
var Alert_default = /*#__PURE__*/__webpack_require__.n(Alert);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js
var taggedTemplateLiteral = __webpack_require__(7);
var taggedTemplateLiteral_default = /*#__PURE__*/__webpack_require__.n(taggedTemplateLiteral);
// EXTERNAL MODULE: ./node_modules/uxi/DataGrid/index.js
var DataGrid = __webpack_require__(144);
var DataGrid_default = /*#__PURE__*/__webpack_require__.n(DataGrid);
// EXTERNAL MODULE: ./node_modules/uxi/Button/index.js
var Button = __webpack_require__(18);
// EXTERNAL MODULE: ./node_modules/styled-components/dist/styled-components.browser.es.js
var styled_components_browser_es = __webpack_require__(5);
// CONCATENATED MODULE: ./core/modules/dataModeling/components/composites/lists/SchemaList.js
function _templateObject() {
var data = taggedTemplateLiteral_default()(["\n /* displayName */\n th:nth-of-type(1),\n thead td:nth-of-type(1) {\n width: 260px;\n }\n /* data type */\n th:nth-of-type(3),\n thead td:nth-of-type(3) {\n width: 180px;\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var DataGridWrapper = styled_components_browser_es["default"].div(_templateObject());
var SchemaList_SelectValueComponent = function SelectValueComponent(onSelectSchema) {
return function (_ref) {
var entity = _ref.entity;
return react_default.a.createElement(Button["ButtonLink"], {
onClick: function onClick() {
onSelectSchema(entity);
},
text: entity.DisplayName
});
};
};
var SchemaList_SchemaList = function SchemaList(_ref2) {
var _ref2$items = _ref2.items,
items = _ref2$items === void 0 ? [] : _ref2$items,
onSelectSchema = _ref2.onSelectSchema;
return react_default.a.createElement(DataGridWrapper, null, react_default.a.createElement(DataGrid_default.a, {
data: items || [],
properties: [{
property: 'DisplayName',
Component: SchemaList_SelectValueComponent(onSelectSchema),
isComputed: true,
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-displayName",
defaultMessage: "Display Name"
})
}, {
property: 'Key',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-key",
defaultMessage: "Key"
})
}, {
property: 'DataType',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-dataType",
defaultMessage: "Data Type"
})
}, {
property: 'VocabularyName',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-vocabularyName",
defaultMessage: "Vocabular Name"
})
}]
}));
};
/* harmony default export */ var lists_SchemaList = (SchemaList_SchemaList);
// EXTERNAL MODULE: ./core/modules/core/components/Hocs/ListWithPaging.js
var ListWithPaging = __webpack_require__(557);
// EXTERNAL MODULE: ./core/modules/integration/components/composites/IntegrationDropdown.jsx + 1 modules
var IntegrationDropdown = __webpack_require__(861);
// EXTERNAL MODULE: ./core/modules/integration/selector.js
var selector = __webpack_require__(101);
// CONCATENATED MODULE: ./core/modules/dataModeling/components/composites/SchemaListWithFilters.js
var SchemaListWithPaging = Object(ListWithPaging["a" /* default */])(lists_SchemaList);
var sortByName = function sortByName(a, b) {
if (a.DisplayName < b.DisplayName) {
return -1;
}
if (a.DisplayName > b.DisplayName) {
return 1;
}
return 0;
};
var formatName = function formatName() {
var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return str.replace(' ', '').toLowerCase();
};
var SchemaListWithFilters_SchemaListWithFilters =
/*#__PURE__*/
function (_Component) {
inherits_default()(SchemaListWithFilters, _Component);
function SchemaListWithFilters(props) {
var _this;
classCallCheck_default()(this, SchemaListWithFilters);
_this = possibleConstructorReturn_default()(this, getPrototypeOf_default()(SchemaListWithFilters).call(this, props));
var shemaSorted = (props.schema || []).sort(sortByName);
var visibleSchema = take_default()(shemaSorted || [], 100);
_this.state = {
schema: shemaSorted || [],
visibleSchema: visibleSchema,
pageNumber: 0,
integration: null
};
_this.onLoadMoreHandler = _this.onLoadMoreHandler.bind(assertThisInitialized_default()(assertThisInitialized_default()(_this)));
_this.onSearchChange = _this.onSearchChange.bind(assertThisInitialized_default()(assertThisInitialized_default()(_this)));
_this.onIntegrationChange = _this.onIntegrationChange.bind(assertThisInitialized_default()(assertThisInitialized_default()(_this)));
return _this;
}
createClass_default()(SchemaListWithFilters, [{
key: "onIntegrationChange",
value: function onIntegrationChange(e, value) {
this.setState({
integration: value,
pageNumber: 0
});
}
}, {
key: "onSearchChange",
value: function onSearchChange(e, value) {
this.setState({
query: value,
pageNumber: 0
});
}
}, {
key: "onLoadMoreHandler",
value: function onLoadMoreHandler(pageNumber) {
var schema = this.state.schema;
this.setState({
pageNumber: pageNumber,
visibleSchema: take_default()(schema, 100 * (pageNumber + 1))
});
}
}, {
key: "filterSchema",
value: function filterSchema() {
var _this$state = this.state,
query = _this$state.query,
schema = _this$state.schema,
pageNumber = _this$state.pageNumber,
integration = _this$state.integration;
var integrations = this.props.integrations;
var filtered = query ? (schema || []).filter(function (c) {
return c.Key.match(new RegExp(query, 'i')) || (c.DisplayName || '').match(new RegExp(query, 'i'));
}) : schema;
if (integration) {
filtered = filtered.filter(function (schemaKey) {
var source = Object(selector["a" /* findSource */])(schemaKey.Key, integrations);
if (!source || !source.name) {
return false;
}
return formatName(source.name).indexOf(formatName(integration.Name)) > -1;
});
}
return take_default()(filtered, 100 * (pageNumber + 1));
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
integrations = _this$props.integrations,
onSelectSchema = _this$props.onSelectSchema;
var _this$state2 = this.state,
pageNumber = _this$state2.pageNumber,
query = _this$state2.query;
var items = this.filterSchema();
return react_default.a.createElement("div", null, react_default.a.createElement(Base["DivPadding"], {
padding: "S",
style: {
display: 'flex',
alignItems: 'flex-start'
}
}, react_default.a.createElement("div", {
style: {
flex: 1,
display: 'flex'
}
}, react_default.a.createElement(IntegrationDropdown["a" /* default */], {
integrations: integrations,
onChange: this.onIntegrationChange
})), react_default.a.createElement("div", null, react_default.a.createElement(Input["SearchForm"], {
onChange: this.onSearchChange,
onSubmit: this.onSearchChange,
value: query,
placeholder: "Search"
}))), react_default.a.createElement(SchemaListWithPaging, {
items: items || [],
take: 100,
pageNumber: pageNumber,
onSelectSchema: onSelectSchema,
onLoadMore: this.onLoadMoreHandler
}), (!items || items.length === 0) && react_default.a.createElement(Alert_default.a, null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-noSchema",
defaultMessage: "No corresponding Schema"
})));
}
}]);
return SchemaListWithFilters;
}(react["Component"]);
/* harmony default export */ var composites_SchemaListWithFilters = (SchemaListWithFilters_SchemaListWithFilters);
// EXTERNAL MODULE: ./core/modules/dataModeling/actions.js + 1 modules
var actions = __webpack_require__(235);
// EXTERNAL MODULE: ./node_modules/recompose/es/Recompose.js
var Recompose = __webpack_require__(6);
// EXTERNAL MODULE: ./core/modules/integration/actions.js + 1 modules
var integration_actions = __webpack_require__(55);
// CONCATENATED MODULE: ./core/modules/integration/components/hocs/withIntegration.js
var mapToSelectProps = function mapToSelectProps(_ref) {
var _ref$integration = _ref.integration,
allIntegrations = _ref$integration.allIntegrations,
isFetchingAllIntegrations = _ref$integration.isFetchingAllIntegrations;
return {
integrations: allIntegrations,
isFetchingIntegrations: isFetchingAllIntegrations
};
};
var withIntegration_mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
fetchProviders: function fetchProviders() {
dispatch(Object(integration_actions["n" /* shouldFetchAllIntegrations */])());
}
};
};
var withIntegration_withIntegration = function withIntegration(Comp) {
var EnhancedComp = Object(Recompose["b" /* compose */])(Object(Recompose["c" /* lifecycle */])({
componentDidMount: function componentDidMount() {
var fetchProviders = this.props.fetchProviders;
fetchProviders();
}
}))(Comp);
return Object(es["connect"])(mapToSelectProps, withIntegration_mapDispatchToProps)(EnhancedComp);
};
/* harmony default export */ var hocs_withIntegration = (withIntegration_withIntegration);
// EXTERNAL MODULE: ./node_modules/uxi/Table/index.js
var Table = __webpack_require__(30);
// EXTERNAL MODULE: ./core/modules/core/components/composites/QuickViewWithErrorAndLoading.js
var QuickViewWithErrorAndLoading = __webpack_require__(338);
// CONCATENATED MODULE: ./core/modules/dataModeling/components/composites/quickViews/SchemaQuickView.js
var SchemaQuickView_SchemaQuickView = function SchemaQuickView(_ref) {
var schema = _ref.schema,
onClose = _ref.onClose;
return react_default.a.createElement(QuickViewWithErrorAndLoading["a" /* default */], {
open: !!schema,
onClose: onClose,
title: "".concat(schema.DisplayName, " Details"),
invalid: false,
isFetching: false
}, react_default.a.createElement("div", null, react_default.a.createElement(Table["Table"], null, react_default.a.createElement(Table["TableBody"], null, react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-displayName",
defaultMessage: "DisplayName"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.DisplayName)), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-key",
defaultMessage: "Key"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.Key)), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-dataType",
defaultMessage: "Data Type"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.DataType)), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-vocabularyName",
defaultMessage: "Vocabulary Name"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.VocabularyName)), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-isObsolete",
defaultMessage: "Is obsolete"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.IsObsolete ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-showInApplication",
defaultMessage: "Show in application"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.ShowInApplication ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-usedInProcessing",
defaultMessage: "Used in processing"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.UsedInProcessing ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-personallyIdentifying",
defaultMessage: "Personally Identifying"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.PersonallyIdentifying ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-hiddenInApplication",
defaultMessage: "Hidden in application"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.HiddenInApplication ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-isObsoleteSinceVersion",
defaultMessage: "Is obsolete since version"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.IsObsoleteSinceVersion ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-editable",
defaultMessage: "Editable"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.Editable ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-removable",
defaultMessage: "Removable"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.Removable ? 'True' : 'False')), react_default.a.createElement(Table["TableRow"], null, react_default.a.createElement(Table["TableRowColumn"], null, react_default.a.createElement("strong", null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-visibility",
defaultMessage: "Visibility"
}))), react_default.a.createElement(Table["TableRowColumn"], {
style: {
textAlign: 'right',
paddingRight: '15px'
}
}, schema.Visibility))))));
};
/* harmony default export */ var quickViews_SchemaQuickView = (SchemaQuickView_SchemaQuickView);
// CONCATENATED MODULE: ./core/modules/dataModeling/components/containers/SchemaPropertyListContainer.js
var SchemaPropertyListContainer_ShemaPropertyListContainer = function ShemaPropertyListContainer(_ref) {
var _ref$schema = _ref.schema,
schema = _ref$schema === void 0 ? [] : _ref$schema,
integrations = _ref.integrations,
isFetching = _ref.isFetching,
selectedSchema = _ref.selectedSchema,
onClose = _ref.onClose,
onSelectSchema = _ref.onSelectSchema;
return react_default.a.createElement(MainWidgetForPage["a" /* default */], {
isLoading: isFetching,
title: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-dataModeling-schema",
defaultMessage: "Data Catalog"
})
}, react_default.a.createElement(composites_SchemaListWithFilters, {
schema: schema,
integrations: integrations,
onSelectSchema: onSelectSchema
}), selectedSchema ? react_default.a.createElement(quickViews_SchemaQuickView, {
schema: selectedSchema,
onClose: onClose
}) : null);
};
var ShemaPropertyListContainerWithIntegrations = withIntegration_withIntegration(SchemaPropertyListContainer_ShemaPropertyListContainer);
var mapToStateProps = function mapToStateProps(_ref2, _ref3) {
var selectedSchema = _ref2.dataModeling.selectedSchema,
_ref2$entity = _ref2.entity,
schema = _ref2$entity.schema,
isFetchingSchema = _ref2$entity.isFetchingSchema;
var integrations = _ref3.integrations,
isFetchingIntegrations = _ref3.isFetchingIntegrations;
return {
schema: schema,
isFetching: isFetchingSchema || isFetchingIntegrations,
integrations: integrations,
selectedSchema: selectedSchema
};
};
var SchemaPropertyListContainer_mapToDispatchToProps = function mapToDispatchToProps(dispatch) {
return {
onSelectSchema: function onSelectSchema(schema) {
dispatch(Object(actions["d" /* selectSchema */])(schema));
},
onClose: function onClose() {
dispatch(Object(actions["b" /* clearSelectedSchema */])());
}
};
};
/* harmony default export */ var SchemaPropertyListContainer = (Object(es["connect"])(mapToStateProps, SchemaPropertyListContainer_mapToDispatchToProps)(ShemaPropertyListContainerWithIntegrations));
// CONCATENATED MODULE: ./core/modules/dataModeling/components/pages/SchemaStructurePage.js
var SchemaStructurePage_SchemaStructurePage = function SchemaStructurePage() {
return react_default.a.createElement(SchemaPropertyListContainer, null);
};
/* harmony default export */ var pages_SchemaStructurePage = __webpack_exports__["default"] = (SchemaStructurePage_SchemaStructurePage);
/***/ })
}]);