UNPKG

cluedin-widget

Version:
338 lines (267 loc) • 13.4 kB
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[9],{ /***/ 1899: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7); /* harmony import */ var _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var uxi_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); /* harmony import */ var uxi_Button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(uxi_Button__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5); /* harmony import */ var uxi_internal_PopOver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(565); /* harmony import */ var uxi_internal_PopOver__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(uxi_internal_PopOver__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var uxi_Panel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(34); /* harmony import */ var uxi_Panel__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(uxi_Panel__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4); function _templateObject() { var data = _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default()(["\n min-width: 280px;\n max-width: 98vw;\n max-height: 360px;\n max-height: 70vh;\n box-shadow: rgba(0, 0, 0, 0.25) 0px 0px 10px, rgba(0, 0, 0, 0.19) 0px 0px 3px;\n"]); _templateObject = function _templateObject() { return data; }; return data; } var Wrapper = styled_components__WEBPACK_IMPORTED_MODULE_3__["default"].div(_templateObject()); var IdentifierComponent = function IdentifierComponent(_ref) { var _ref$identifiers = _ref.identifiers, identifiers = _ref$identifiers === void 0 ? [] : _ref$identifiers; var identifiersWithoutEmpty = (identifiers || []).filter(function (i) { return i; }); if (identifiersWithoutEmpty.length === 0) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { style: { fontStyle: 'italic', color: '#ccc' } }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_6__["FormattedMessage"], { id: "module-consent-noIdentifier", defaultMessage: "No identifier" })); } return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { style: { marginTop: '15px', marginBottom: '15px' } }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { style: { marginTop: '5px', marginBottom: '5px' } }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(uxi_internal_PopOver__WEBPACK_IMPORTED_MODULE_4___default.a, { itemsStyle: { maxHeight: '70vh', border: 'none' }, anchor: 'center', main: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(uxi_Button__WEBPACK_IMPORTED_MODULE_2__["ButtonLink"], { text: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("span", null, identifiersWithoutEmpty.length, "\xA0", react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_6__["FormattedMessage"], { id: "module-consent-identifiers", defaultMessage: "Identifier(s)" })) })) }, [react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Wrapper, null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(uxi_Panel__WEBPACK_IMPORTED_MODULE_5__["LightPanel"], null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { style: { padding: '16px' } }, identifiersWithoutEmpty.map(function (i) { return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { style: { padding: '6px' } }, i); }))))]))); }; /* harmony default export */ __webpack_exports__["a"] = (IdentifierComponent); /***/ }), /***/ 2334: /***/ (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/uxi/Widget/index.js var Widget = __webpack_require__(40); // EXTERNAL MODULE: ./node_modules/react-intl/lib/index.es.js var index_es = __webpack_require__(4); // EXTERNAL MODULE: ./node_modules/react-redux/es/index.js + 18 modules var es = __webpack_require__(8); // EXTERNAL MODULE: ./node_modules/connected-react-router/lib/index.js var lib = __webpack_require__(25); // EXTERNAL MODULE: ./node_modules/recompose/es/Recompose.js var Recompose = __webpack_require__(6); // 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/Alert/index.js var Alert = __webpack_require__(24); var Alert_default = /*#__PURE__*/__webpack_require__.n(Alert); // EXTERNAL MODULE: ./node_modules/uxi/Icons/index.js var Icons = __webpack_require__(9); // EXTERNAL MODULE: ./core/modules/consent/components/composites/lists/internals/IdentifierCell.js var IdentifierCell = __webpack_require__(1899); // EXTERNAL MODULE: ./core/modules/integration/components/composites/IntegrationNameWithLogo.jsx var IntegrationNameWithLogo = __webpack_require__(116); // CONCATENATED MODULE: ./core/modules/consent/components/composites/lists/ConsentsList.js var ConsentsList_IntegrationComponent = function IntegrationComponent(_ref) { var entity = _ref.entity; return react_default.a.createElement(IntegrationNameWithLogo["a" /* default */], { integration: entity.integration }); }; var ConsentsList_IdentifierComponent = function IdentifierComponent(_ref2) { var entity = _ref2.entity; return react_default.a.createElement("div", null, react_default.a.createElement(IdentifierCell["a" /* default */], { identifiers: entity.Identifiers })); }; var IsRequiredComponent = function IsRequiredComponent(_ref3) { var value = _ref3.value; return value ? 'Yes' : 'No'; }; var ConsentsList_ConsentsList = function ConsentsList(_ref4) { var navigateToConsentResult = _ref4.navigateToConsentResult, addConsent = _ref4.addConsent, items = _ref4.items; return react_default.a.createElement("div", null, react_default.a.createElement(DataGrid_default.a, { data: items || [], propertyKey: "id", actions: [{ icon: react_default.a.createElement(Icons["Add"], null), displayName: react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-addConsentEntryForUser", defaultMessage: "Add manual consent entry" }), onClick: function onClick(e, value) { addConsent(value); } }, { icon: react_default.a.createElement(Icons["List"], null), displayName: react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-allResult", defaultMessage: "All result" }), onClick: function onClick(e, value) { navigateToConsentResult(value.Id); } }], properties: [{ displayName: 'Name', property: 'Name' }, { isComputed: true, displayName: react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-integrationSource", defaultMessage: "Integration Source" }), Component: ConsentsList_IntegrationComponent }, { property: 'identifiers', isComputed: true, displayName: react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-personalIdentifier", defaultMessage: "Personal Identifeir" }), Component: ConsentsList_IdentifierComponent }, { property: 'IsRequired', displayName: react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-isRequired", defaultMessage: "Is Required" }), Component: IsRequiredComponent }] }), items && items.length === 0 && react_default.a.createElement(Alert_default.a, null, react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-noConsentAdded", defaultMessage: "No consent has been added" }))); }; ConsentsList_ConsentsList.defaultProps = { items: [] }; /* harmony default export */ var lists_ConsentsList = (ConsentsList_ConsentsList); // EXTERNAL MODULE: ./core/modules/core/components/composites/PageLoader.js var PageLoader = __webpack_require__(38); // EXTERNAL MODULE: ./core/modules/core/components/composites/alerts/DefaultAlert.js var DefaultAlert = __webpack_require__(115); // EXTERNAL MODULE: ./core/modules/consent/actions.js + 1 modules var actions = __webpack_require__(42); // EXTERNAL MODULE: ./core/modules/integration/actions.js + 1 modules var integration_actions = __webpack_require__(55); // EXTERNAL MODULE: ./core/modules/consent/converter.js var converter = __webpack_require__(267); // EXTERNAL MODULE: ./core/modules/core/components/Hocs/ListWithPaging.js var ListWithPaging = __webpack_require__(557); // CONCATENATED MODULE: ./core/modules/consent/components/containers/ConsentListContainer.js var ConsentListEnhanced = Object(Recompose["b" /* compose */])(Object(Recompose["c" /* lifecycle */])({ componentDidMount: function componentDidMount() { this.props.fetchAllConsent(); } }), Object(Recompose["a" /* branch */])(function (_ref) { var isFetching = _ref.isFetching; return isFetching; }, Object(Recompose["e" /* renderComponent */])(PageLoader["a" /* default */])), Object(Recompose["a" /* branch */])(function (_ref2) { var invalid = _ref2.invalid; return invalid; }, Object(Recompose["e" /* renderComponent */])(DefaultAlert["a" /* default */])))(Object(ListWithPaging["a" /* default */])(lists_ConsentsList)); var ConsentListContainer_mapToStateProps = function mapToStateProps(_ref3) { var _ref3$consent = _ref3.consent, consents = _ref3$consent.consents, isFetchingAllconsent = _ref3$consent.isFetchingAllconsent, fetchAllConsentsError = _ref3$consent.fetchAllConsentsError, allConsentFilterOption = _ref3$consent.allConsentFilterOption, _ref3$integration = _ref3.integration, allIntegrations = _ref3$integration.allIntegrations, isFetchingAllIntegrations = _ref3$integration.isFetchingAllIntegrations; var isFetching = isFetchingAllIntegrations || isFetchingAllconsent; return { items: !isFetching ? Object(converter["d" /* toConsentViewModel */])(consents || [], allIntegrations || []) : [], isFetching: isFetching, invalid: fetchAllConsentsError, // isFetchingMore: isFetchingMoreAllConsent, pageNumber: allConsentFilterOption ? allConsentFilterOption.page : 0, isFetchingMore: allConsentFilterOption ? allConsentFilterOption.isFetchingMore : false }; }; var ConsentListContainer_mapDispatchToProps = function mapDispatchToProps(dispatch) { return { navigateToConsentForm: function navigateToConsentForm(id) { dispatch(Object(lib["push"])("/consent/forms/detail/edit/".concat(id))); }, navigateToConsentResult: function navigateToConsentResult(id) { dispatch(Object(lib["push"])("/consent/consents/result/".concat(id))); }, fetchAllConsent: function fetchAllConsent() { dispatch(Object(actions["h" /* shouldFetchAllConsent */])()); dispatch(Object(integration_actions["n" /* shouldFetchAllIntegrations */])()); }, onLoadMore: function onLoadMore(pageNumber) { dispatch(Object(actions["t" /* shouldFetchMoreAllConsent */])({ page: pageNumber })); }, addConsent: function addConsent(consent) { dispatch(Object(actions["a" /* addConsentEntryForConsent */])(consent)); } }; }; /* harmony default export */ var ConsentListContainer = (Object(es["connect"])(ConsentListContainer_mapToStateProps, ConsentListContainer_mapDispatchToProps)(ConsentListEnhanced)); // CONCATENATED MODULE: ./core/modules/consent/components/pages/ConsentListPage.js var ConsentListPage_ConsentListPage = function ConsentListPage() { return react_default.a.createElement("div", { style: { margin: '30px 0', background: '#fff' } }, react_default.a.createElement(Widget["Widget"], { title: react_default.a.createElement(index_es["FormattedMessage"], { id: "module-consent-allConsent", defaultMessage: "All consent" }) }, react_default.a.createElement(ConsentListContainer, null))); }; /* harmony default export */ var pages_ConsentListPage = __webpack_exports__["default"] = (ConsentListPage_ConsentListPage); /***/ }) }]);