cluedin-widget
Version:
510 lines (406 loc) • 19 kB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[8],{
/***/ 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);
/***/ }),
/***/ 2325:
/***/ (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/rc-tooltip/es/index.js + 36 modules
var rc_tooltip_es = __webpack_require__(56);
// 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/DataGrid/index.js
var DataGrid = __webpack_require__(144);
var DataGrid_default = /*#__PURE__*/__webpack_require__.n(DataGrid);
// EXTERNAL MODULE: ./node_modules/uxi/Text/index.js
var Text = __webpack_require__(36);
var Text_default = /*#__PURE__*/__webpack_require__.n(Text);
// EXTERNAL MODULE: ./node_modules/react-router-dom/es/Link.js
var Link = __webpack_require__(554);
// 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: ./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/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);
// EXTERNAL MODULE: ./node_modules/uxi/internal/PopOver.js
var PopOver = __webpack_require__(565);
var PopOver_default = /*#__PURE__*/__webpack_require__.n(PopOver);
// EXTERNAL MODULE: ./node_modules/uxi/Panel/index.js
var Panel = __webpack_require__(34);
// EXTERNAL MODULE: ./core/modules/integration/components/composites/IntegrationNameWithLogo.jsx
var IntegrationNameWithLogo = __webpack_require__(116);
// CONCATENATED MODULE: ./core/modules/consent/components/composites/lists/internals/DataProcessorCell.js
function _templateObject() {
var data = taggedTemplateLiteral_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_browser_es["default"].div(_templateObject());
var DataProcessorCell_DataProcessorCell = function DataProcessorCell(_ref) {
var _ref$processors = _ref.processors,
processors = _ref$processors === void 0 ? [] : _ref$processors;
if (!processors || processors.length === 0) {
return react_default.a.createElement("div", {
style: {
fontStyle: 'italic',
color: '#ccc'
}
}, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-noProcessor"
}));
}
return react_default.a.createElement("div", {
style: {
marginTop: '15px',
marginBottom: '15px'
}
}, react_default.a.createElement("div", {
style: {
marginTop: '5px',
marginBottom: '5px'
}
}, react_default.a.createElement(PopOver_default.a, {
itemsStyle: {
maxHeight: '70vh',
border: 'none'
},
anchor: 'center',
main: react_default.a.createElement("div", null, react_default.a.createElement(Button["ButtonLink"], {
text: react_default.a.createElement("span", null, processors.length, "\xA0", react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-dataProcessor",
defaultMessage: "Data Processor(s)"
}))
}))
}, [react_default.a.createElement(Wrapper, {
key: "singleWrapper"
}, react_default.a.createElement(Panel["LightPanel"], null, react_default.a.createElement("div", {
style: {
padding: '16px'
}
}, processors.map(function (p) {
return react_default.a.createElement("div", {
style: {
marginTop: '5px',
marginBottom: '5px'
}
}, react_default.a.createElement(IntegrationNameWithLogo["a" /* default */], {
integration: p.integration
}));
}))))])));
};
/* harmony default export */ var internals_DataProcessorCell = (DataProcessorCell_DataProcessorCell);
// CONCATENATED MODULE: ./core/modules/consent/components/composites/lists/ConsentFormList.js
var ConsentFormList_DataProcessorsComponent = function DataProcessorsComponent(_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? [] : _ref$value;
return react_default.a.createElement(internals_DataProcessorCell, {
processors: value
});
};
var ConsentFormList_UniqueIdentifiersComponent = function UniqueIdentifiersComponent(_ref2) {
var _ref2$value = _ref2.value,
value = _ref2$value === void 0 ? [] : _ref2$value;
var allIdentifiers = [];
value.forEach(function (p) {
(p.identifiers || []).forEach(function (i) {
allIdentifiers.push(i);
});
});
return react_default.a.createElement(IdentifierCell["a" /* default */], {
identifiers: allIdentifiers
});
};
var ConsentFormList_PrivacyLinkComponent = function PrivacyLinkComponent(_ref3) {
var value = _ref3.value;
if (!value) {
return react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-noPrivacyLink"
});
}
return react_default.a.createElement("a", {
href: value,
target: "_blank",
rel: "noopener noreferrer"
}, value);
};
var ConsentFormList_ShowExplanationComponent = function ShowExplanationComponent(_ref4) {
var value = _ref4.value;
if (!value) {
return react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-noShortExplanation"
});
}
return react_default.a.createElement("div", null, react_default.a.createElement(rc_tooltip_es["default"], {
placement: "bottomLeft",
trigger: "hover",
overlay: react_default.a.createElement("div", {
style: {
maxWidth: '400px',
padding: '6px'
}
}, value)
}, react_default.a.createElement("span", {
style: {
cursor: 'zoom-in'
}
}, react_default.a.createElement(Text_default.a, {
type: "caption"
}, value))));
};
var ConsentFormList_ConsentFormLink = function ConsentFormLink(_ref5) {
var entity = _ref5.entity;
return react_default.a.createElement(Link["a" /* default */], {
to: "/consent/forms/detail/edit/".concat(entity.id)
}, entity.title);
};
var ConsentFormList_ConsentFormList = function ConsentFormList(_ref6) {
var navigateToConsentForm = _ref6.navigateToConsentForm,
items = _ref6.items,
addConsent = _ref6.addConsent;
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-addConsent",
defaultMessage: "Add manual consent entry"
}),
onClick: function onClick(e, value) {
addConsent(value.id);
}
}, {
icon: react_default.a.createElement(Icons["Pencil"], null),
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-edit",
defaultMessage: "Edit Form"
}),
onClick: function onClick(e, value) {
navigateToConsentForm(value.id);
}
}],
properties: [{
isComputed: true,
property: 'title',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-title",
defaultMessage: "Title"
}),
Component: ConsentFormList_ConsentFormLink
}, {
property: 'shortExplanation',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-shortExplanation",
defaultMessage: "Short Explanation"
}),
Component: ConsentFormList_ShowExplanationComponent
}, {
property: 'processors',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-dataProcessors",
defaultMessage: "Data Processors"
}),
Component: ConsentFormList_DataProcessorsComponent
}, {
property: 'processors',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-uniqueIdentifiers",
defaultMessage: "All Unique Identifiers"
}),
Component: ConsentFormList_UniqueIdentifiersComponent
}, {
property: 'privacyLink',
displayName: react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-privayLink",
defaultMessage: "Privacy Link"
}),
Component: ConsentFormList_PrivacyLinkComponent
}]
}), items && items.length === 0 && react_default.a.createElement(Alert_default.a, null, react_default.a.createElement(index_es["FormattedMessage"], {
id: "module-consent-noConsentFormAdded",
defaultMessage: "No consent form has been added"
})));
};
/* harmony default export */ var lists_ConsentFormList = (ConsentFormList_ConsentFormList);
// 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/ConsentFormListContainer.js
var ConsentFormListEnhanced = Object(Recompose["b" /* compose */])(Object(Recompose["c" /* lifecycle */])({
componentDidMount: function componentDidMount() {
this.props.fetchAllConsentForms();
}
}), 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_ConsentFormList));
var ConsentFormListContainer_mapToStateProps = function mapToStateProps(_ref3) {
var _ref3$consent = _ref3.consent,
consentForms = _ref3$consent.consentForms,
isFetchingAllconsentForms = _ref3$consent.isFetchingAllconsentForms,
fetchAllConsentFormsError = _ref3$consent.fetchAllConsentFormsError,
isFetchingMoreAllConsentForms = _ref3$consent.isFetchingMoreAllConsentForms,
fetchAllConsentFormsfilterOptions = _ref3$consent.fetchAllConsentFormsfilterOptions,
_ref3$integration = _ref3.integration,
allIntegrations = _ref3$integration.allIntegrations,
isFetchingAllIntegrations = _ref3$integration.isFetchingAllIntegrations;
var isFetching = isFetchingAllconsentForms || isFetchingAllIntegrations;
var consentFormViewModel = !isFetching ? (consentForms || []).map(function (consent) {
return Object(converter["c" /* toConsentFormViewModel */])(consent, allIntegrations || []);
}) : [];
return {
items: consentFormViewModel,
isFetching: isFetching,
isFetchingMore: isFetchingMoreAllConsentForms,
pageNumber: fetchAllConsentFormsfilterOptions.page,
invalid: fetchAllConsentFormsError
};
};
var ConsentFormListContainer_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/forms/detail/result/".concat(id)));
},
fetchAllConsentForms: function fetchAllConsentForms() {
dispatch(Object(actions["j" /* shouldFetchAllConsentForms */])());
dispatch(Object(integration_actions["n" /* shouldFetchAllIntegrations */])());
},
onLoadMore: function onLoadMore(pageNumber) {
dispatch(Object(actions["x" /* shouldLoadMoreAllConsentForms */])({
page: pageNumber
}));
},
addConsent: function addConsent(formId) {
dispatch(Object(actions["b" /* addConsentEntryForForm */])(formId));
}
};
};
/* harmony default export */ var ConsentFormListContainer = (Object(es["connect"])(ConsentFormListContainer_mapToStateProps, ConsentFormListContainer_mapDispatchToProps)(ConsentFormListEnhanced));
// CONCATENATED MODULE: ./core/modules/consent/components/pages/ConsentFormListPage.js
var ConsentFormListPage_ConsentFormListPage = function ConsentFormListPage() {
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-consentForm",
defaultMessage: "All consent"
})
}, react_default.a.createElement(ConsentFormListContainer, null)));
};
/* harmony default export */ var pages_ConsentFormListPage = __webpack_exports__["default"] = (ConsentFormListPage_ConsentFormListPage);
/***/ })
}]);