@bigbinary/neeto-team-members-frontend 2.7.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -23,7 +23,6 @@ var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
23
23
  var neetoFiltersFrontend = require('@bigbinary/neeto-filters-frontend');
24
24
  var reactRouterDom = require('react-router-dom');
25
25
  var require$$0 = require('util');
26
- var Columns = require('@bigbinary/neeto-molecules/Columns');
27
26
  var classnames = require('classnames');
28
27
  var MenuBar = require('@bigbinary/neeto-molecules/MenuBar');
29
28
 
@@ -56,11 +55,10 @@ var NeetoHeader__default = /*#__PURE__*/_interopDefaultLegacy(NeetoHeader);
56
55
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
57
56
  var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
58
57
  var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
59
- var Columns__default = /*#__PURE__*/_interopDefaultLegacy(Columns);
60
58
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
61
59
  var MenuBar__default = /*#__PURE__*/_interopDefaultLegacy(MenuBar);
62
60
 
63
- /*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */
61
+ /*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */
64
62
 
65
63
  const {
66
64
  entries,
@@ -136,7 +134,9 @@ function unconstruct(func) {
136
134
  /* Add properties to a lookup table */
137
135
 
138
136
  function addToSet(set, array, transformCaseFunc) {
139
- transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase;
137
+ var _transformCaseFunc;
138
+
139
+ transformCaseFunc = (_transformCaseFunc = transformCaseFunc) !== null && _transformCaseFunc !== void 0 ? _transformCaseFunc : stringToLowerCase;
140
140
 
141
141
  if (setPrototypeOf) {
142
142
  // Make 'in' and truthy checks like Boolean(set.constructor)
@@ -210,12 +210,12 @@ function lookupGetter(object, prop) {
210
210
  const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); // SVG
211
211
 
212
212
  const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
213
- const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default.
213
+ const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default.
214
214
  // We still need to know them so that we can do namespace
215
215
  // checks properly in case one wants to add them to
216
216
  // allow-list.
217
217
 
218
- const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
218
+ const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
219
219
  const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); // Similarly to SVG, we want to know all MathML elements,
220
220
  // even those that we disallow by default.
221
221
 
@@ -260,13 +260,13 @@ const getGlobal = () => typeof window === 'undefined' ? null : window;
260
260
  * Creates a no-op policy for internal use only.
261
261
  * Don't export this function outside this module!
262
262
  * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
263
- * @param {Document} document The document object (to determine policy name suffix)
263
+ * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
264
264
  * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
265
- * are not supported).
265
+ * are not supported or creating the policy failed).
266
266
  */
267
267
 
268
268
 
269
- const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
269
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
270
270
  if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
271
271
  return null;
272
272
  } // Allow the callers to control the unique policy name
@@ -277,8 +277,8 @@ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedType
277
277
  let suffix = null;
278
278
  const ATTR_NAME = 'data-tt-policy-suffix';
279
279
 
280
- if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
281
- suffix = document.currentScript.getAttribute(ATTR_NAME);
280
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
281
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
282
282
  }
283
283
 
284
284
  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
@@ -313,7 +313,7 @@ function createDOMPurify() {
313
313
  */
314
314
 
315
315
 
316
- DOMPurify.version = '3.0.2';
316
+ DOMPurify.version = '3.0.3';
317
317
  /**
318
318
  * Array of elements that DOMPurify removed during sanitation.
319
319
  * Empty if nothing was removed.
@@ -329,6 +329,7 @@ function createDOMPurify() {
329
329
  }
330
330
 
331
331
  const originalDocument = window.document;
332
+ const currentScript = originalDocument.currentScript;
332
333
  let {
333
334
  document
334
335
  } = window;
@@ -362,9 +363,8 @@ function createDOMPurify() {
362
363
  }
363
364
  }
364
365
 
365
- const trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
366
-
367
- const emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : '';
366
+ let trustedTypesPolicy;
367
+ let emptyHTML = '';
368
368
  const {
369
369
  implementation,
370
370
  createNodeIterator,
@@ -379,7 +379,7 @@ function createDOMPurify() {
379
379
  * Expose whether this browser supports running the full DOMPurify.
380
380
  */
381
381
 
382
- DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined';
382
+ DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
383
383
  const {
384
384
  MUSTACHE_EXPR,
385
385
  ERB_EXPR,
@@ -726,6 +726,31 @@ function createDOMPurify() {
726
726
  if (ALLOWED_TAGS.table) {
727
727
  addToSet(ALLOWED_TAGS, ['tbody']);
728
728
  delete FORBID_TAGS.tbody;
729
+ }
730
+
731
+ if (cfg.TRUSTED_TYPES_POLICY) {
732
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
733
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
734
+ }
735
+
736
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
737
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
738
+ } // Overwrite existing TrustedTypes policy.
739
+
740
+
741
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; // Sign local variables required by `sanitize`.
742
+
743
+ emptyHTML = trustedTypesPolicy.createHTML('');
744
+ } else {
745
+ // Uninitialized policy, attempt to initialize the internal dompurify policy.
746
+ if (trustedTypesPolicy === undefined) {
747
+ trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
748
+ } // If creating the internal policy succeeded sign internal variables.
749
+
750
+
751
+ if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
752
+ emptyHTML = trustedTypesPolicy.createHTML('');
753
+ }
729
754
  } // Prevent further manipulation of configuration.
730
755
  // Not available in IE8, Safari 5, etc.
731
756
 
@@ -1162,9 +1187,9 @@ function createDOMPurify() {
1162
1187
  }
1163
1188
  /* Check value is safe. First, is attr inert? If so, is safe */
1164
1189
 
1165
- } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (!value) ; else {
1190
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
1166
1191
  return false;
1167
- }
1192
+ } else ;
1168
1193
 
1169
1194
  return true;
1170
1195
  };
@@ -1294,12 +1319,16 @@ function createDOMPurify() {
1294
1319
  if (namespaceURI) ; else {
1295
1320
  switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1296
1321
  case 'TrustedHTML':
1297
- value = trustedTypesPolicy.createHTML(value);
1298
- break;
1322
+ {
1323
+ value = trustedTypesPolicy.createHTML(value);
1324
+ break;
1325
+ }
1299
1326
 
1300
1327
  case 'TrustedScriptURL':
1301
- value = trustedTypesPolicy.createScriptURL(value);
1302
- break;
1328
+ {
1329
+ value = trustedTypesPolicy.createScriptURL(value);
1330
+ break;
1331
+ }
1303
1332
  }
1304
1333
  }
1305
1334
  }
@@ -1392,15 +1421,14 @@ function createDOMPurify() {
1392
1421
 
1393
1422
 
1394
1423
  if (typeof dirty !== 'string' && !_isNode(dirty)) {
1395
- // eslint-disable-next-line no-negated-condition
1396
- if (typeof dirty.toString !== 'function') {
1397
- throw typeErrorCreate('toString is not a function');
1398
- } else {
1424
+ if (typeof dirty.toString === 'function') {
1399
1425
  dirty = dirty.toString();
1400
1426
 
1401
1427
  if (typeof dirty !== 'string') {
1402
1428
  throw typeErrorCreate('dirty is not a string, aborting');
1403
1429
  }
1430
+ } else {
1431
+ throw typeErrorCreate('toString is not a function');
1404
1432
  }
1405
1433
  }
1406
1434
  /* Return dirty HTML if DOMPurify cannot run */
@@ -5371,8 +5399,6 @@ var common$1 = {
5371
5399
  addNew_: "Add new {{what}}",
5372
5400
  all: "All",
5373
5401
  all_: "All {{what}}",
5374
- column_one: "Column",
5375
- column_other: "Columns",
5376
5402
  deactivate: "Deactivate",
5377
5403
  deactivate_: "Deactivate {{what}}",
5378
5404
  deactivated: "Deactivated",
@@ -9415,6 +9441,7 @@ var getDefaultColumns = function getDefaultColumns(_ref5) {
9415
9441
  permissions = _ref5.permissions;
9416
9442
  return [{
9417
9443
  dataIndex: "name",
9444
+ fixed: "left",
9418
9445
  key: "name",
9419
9446
  render: function render(_, tableData) {
9420
9447
  return renderNameColumn({
@@ -10136,9 +10163,6 @@ var useTeams = function useTeams(_ref) {
10136
10163
  };
10137
10164
 
10138
10165
  var FIXED_COLUMNS = ["name", "actions"];
10139
- var COLUMNS_DROPDOWN_PROPS = {
10140
- label: instance.t("common.column", PLURAL)
10141
- };
10142
10166
  var COLUMNS_SEARCH_PROPS = {
10143
10167
  placeholder: instance.t("columns.search")
10144
10168
  };
@@ -10391,20 +10415,22 @@ var Right = function Right(_ref2) {
10391
10415
  isFiltersPaneOpen = _ref2.isFiltersPaneOpen;
10392
10416
  var _useTranslation2 = useTranslation(),
10393
10417
  t = _useTranslation2.t;
10394
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Columns__default["default"], {
10395
- columnData: columns,
10396
- dropdownProps: COLUMNS_DROPDOWN_PROPS,
10397
- fixedColumns: FIXED_COLUMNS,
10398
- localStorageKey: "TEAM_MEMBERS_TABLE_HIDDEN_COLUMNS",
10399
- noColumnMessage: t("columns.noColumnsFound"),
10400
- searchProps: COLUMNS_SEARCH_PROPS,
10401
- onChange: setColumnData
10402
- }), /*#__PURE__*/React__default["default"].createElement(neetoFiltersFrontend.Filters, {
10403
- columns: filterColumns,
10404
- isOpen: isFiltersPaneOpen,
10405
- setIsOpen: setIsFiltersPaneOpen,
10406
- onChange: handleNeetoFilterChange
10407
- }));
10418
+ return /*#__PURE__*/React__default["default"].createElement(SubHeader__default["default"].RightBlock, {
10419
+ columnsButtonProps: {
10420
+ columnData: columns,
10421
+ fixedColumns: FIXED_COLUMNS,
10422
+ localStorageKey: "TEAM_MEMBERS_TABLE_HIDDEN_COLUMNS",
10423
+ noColumnMessage: t("columns.noColumnsFound"),
10424
+ searchProps: COLUMNS_SEARCH_PROPS,
10425
+ onChange: setColumnData
10426
+ },
10427
+ filterProps: {
10428
+ columns: filterColumns,
10429
+ isOpen: isFiltersPaneOpen,
10430
+ setIsOpen: setIsFiltersPaneOpen,
10431
+ onChange: handleNeetoFilterChange
10432
+ }
10433
+ });
10408
10434
  };
10409
10435
  var SubHeader = {
10410
10436
  Left: Left,
@@ -10430,7 +10456,7 @@ var AppList = function AppList(_ref) {
10430
10456
  var selectedEmail = ramda.pluck("value", emails);
10431
10457
  React.useEffect(function () {
10432
10458
  if (savedStateRef.current.isAppListEnabled !== isAppListEnabled) {
10433
- appRoles.forEach(function (appRole, index) {
10459
+ appRoles === null || appRoles === void 0 ? void 0 : appRoles.forEach(function (appRole, index) {
10434
10460
  var _globalProps$appName;
10435
10461
  if ((appRole === null || appRole === void 0 ? void 0 : appRole.appName) === ((_globalProps$appName = initializers.globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.substring(5))) {
10436
10462
  setFieldValue("appRoles[".concat(index, "].isEnabled"), true);
@@ -10828,8 +10854,9 @@ var RolesRadioGroup = function RolesRadioGroup(_ref) {
10828
10854
  values = _useFormikContext.values,
10829
10855
  setFieldValue = _useFormikContext.setFieldValue;
10830
10856
  var setDefaultSelection = function setDefaultSelection(currentRole) {
10857
+ var _values$appRoles;
10831
10858
  var condition = isAdminRole(currentRole);
10832
- values.appRoles.forEach(function (_ref2, index) {
10859
+ (_values$appRoles = values.appRoles) === null || _values$appRoles === void 0 ? void 0 : _values$appRoles.forEach(function (_ref2, index) {
10833
10860
  var _globalProps$appName;
10834
10861
  var appName = _ref2.appName,
10835
10862
  activeRole = _ref2.activeRole;