box-ui-elements 24.0.0-beta.5 → 24.0.0-beta.6

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.
Files changed (85) hide show
  1. package/dist/explorer.css +1 -1
  2. package/dist/explorer.js +1 -1
  3. package/es/elements/content-explorer/Content.js +3 -1
  4. package/es/elements/content-explorer/Content.js.map +1 -1
  5. package/es/elements/content-explorer/ContentExplorer.js +16 -5
  6. package/es/elements/content-explorer/ContentExplorer.js.map +1 -1
  7. package/es/elements/content-explorer/MetadataQueryAPIHelper.js +104 -7
  8. package/es/elements/content-explorer/MetadataQueryAPIHelper.js.map +1 -1
  9. package/es/elements/content-explorer/MetadataQueryBuilder.js +115 -0
  10. package/es/elements/content-explorer/MetadataQueryBuilder.js.map +1 -0
  11. package/es/elements/content-explorer/MetadataViewContainer.js +92 -46
  12. package/es/elements/content-explorer/MetadataViewContainer.js.map +1 -1
  13. package/es/elements/content-explorer/stories/MetadataView.stories.js +3 -25
  14. package/es/elements/content-explorer/stories/MetadataView.stories.js.map +1 -1
  15. package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js +4 -16
  16. package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js.map +1 -1
  17. package/es/src/elements/common/__mocks__/mockMetadata.d.ts +8 -24
  18. package/es/src/elements/content-explorer/Content.d.ts +4 -3
  19. package/es/src/elements/content-explorer/ContentExplorer.d.ts +8 -3
  20. package/es/src/elements/content-explorer/MetadataQueryAPIHelper.d.ts +11 -2
  21. package/es/src/elements/content-explorer/MetadataQueryBuilder.d.ts +27 -0
  22. package/es/src/elements/content-explorer/MetadataViewContainer.d.ts +8 -4
  23. package/es/src/elements/content-explorer/__tests__/MetadataQueryBuilder.test.d.ts +1 -0
  24. package/i18n/bn-IN.js +1 -1
  25. package/i18n/bn-IN.properties +8 -0
  26. package/i18n/da-DK.js +1 -1
  27. package/i18n/da-DK.properties +8 -0
  28. package/i18n/de-DE.js +1 -1
  29. package/i18n/de-DE.properties +8 -0
  30. package/i18n/en-AU.js +1 -1
  31. package/i18n/en-AU.properties +8 -0
  32. package/i18n/en-CA.js +1 -1
  33. package/i18n/en-CA.properties +8 -0
  34. package/i18n/en-GB.js +1 -1
  35. package/i18n/en-GB.properties +8 -0
  36. package/i18n/es-419.js +1 -1
  37. package/i18n/es-419.properties +8 -0
  38. package/i18n/es-ES.js +1 -1
  39. package/i18n/es-ES.properties +8 -0
  40. package/i18n/fi-FI.js +1 -1
  41. package/i18n/fi-FI.properties +8 -0
  42. package/i18n/fr-CA.js +1 -1
  43. package/i18n/fr-CA.properties +8 -0
  44. package/i18n/fr-FR.js +1 -1
  45. package/i18n/fr-FR.properties +8 -0
  46. package/i18n/hi-IN.js +1 -1
  47. package/i18n/hi-IN.properties +8 -0
  48. package/i18n/it-IT.js +1 -1
  49. package/i18n/it-IT.properties +8 -0
  50. package/i18n/ja-JP.js +1 -1
  51. package/i18n/ja-JP.properties +8 -0
  52. package/i18n/ko-KR.js +1 -1
  53. package/i18n/ko-KR.properties +8 -0
  54. package/i18n/nb-NO.js +1 -1
  55. package/i18n/nb-NO.properties +8 -0
  56. package/i18n/nl-NL.js +1 -1
  57. package/i18n/nl-NL.properties +8 -0
  58. package/i18n/pl-PL.js +1 -1
  59. package/i18n/pl-PL.properties +8 -0
  60. package/i18n/pt-BR.js +1 -1
  61. package/i18n/pt-BR.properties +8 -0
  62. package/i18n/ru-RU.js +1 -1
  63. package/i18n/ru-RU.properties +8 -0
  64. package/i18n/sv-SE.js +1 -1
  65. package/i18n/sv-SE.properties +8 -0
  66. package/i18n/tr-TR.js +1 -1
  67. package/i18n/tr-TR.properties +8 -0
  68. package/i18n/zh-CN.js +1 -1
  69. package/i18n/zh-CN.properties +8 -0
  70. package/i18n/zh-TW.js +1 -1
  71. package/i18n/zh-TW.properties +8 -0
  72. package/package.json +3 -3
  73. package/src/elements/common/__mocks__/mockMetadata.ts +7 -11
  74. package/src/elements/content-explorer/Content.tsx +8 -2
  75. package/src/elements/content-explorer/ContentExplorer.tsx +208 -193
  76. package/src/elements/content-explorer/MetadataQueryAPIHelper.ts +111 -5
  77. package/src/elements/content-explorer/MetadataQueryBuilder.ts +159 -0
  78. package/src/elements/content-explorer/MetadataViewContainer.tsx +112 -37
  79. package/src/elements/content-explorer/__tests__/Content.test.tsx +1 -0
  80. package/src/elements/content-explorer/__tests__/ContentExplorer.test.tsx +2 -5
  81. package/src/elements/content-explorer/__tests__/MetadataQueryAPIHelper.test.ts +421 -8
  82. package/src/elements/content-explorer/__tests__/MetadataQueryBuilder.test.ts +419 -0
  83. package/src/elements/content-explorer/__tests__/MetadataViewContainer.test.tsx +413 -9
  84. package/src/elements/content-explorer/stories/MetadataView.stories.tsx +3 -21
  85. package/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx +2 -13
@@ -1,4 +1,4 @@
1
- const _excluded = ["currentCollection", "features", "fieldsToShow", "gridColumnCount", "metadataTemplate", "metadataViewProps", "onMetadataUpdate", "onSortChange", "view", "viewMode"];
1
+ const _excluded = ["currentCollection", "features", "fieldsToShow", "gridColumnCount", "metadataTemplate", "metadataViewProps", "onMetadataFilter", "onMetadataUpdate", "onSortChange", "view", "viewMode"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -35,6 +35,7 @@ const Content = _ref => {
35
35
  gridColumnCount,
36
36
  metadataTemplate,
37
37
  metadataViewProps,
38
+ onMetadataFilter,
38
39
  onMetadataUpdate,
39
40
  onSortChange,
40
41
  view,
@@ -68,6 +69,7 @@ const Content = _ref => {
68
69
  isLoading: percentLoaded !== 100,
69
70
  hasError: view === VIEW_ERROR,
70
71
  metadataTemplate: metadataTemplate,
72
+ onMetadataFilter: onMetadataFilter,
71
73
  onSortChange: onSortChange
72
74
  }, metadataViewProps)), !isViewEmpty && isListView && /*#__PURE__*/React.createElement(ItemList, _extends({
73
75
  items: items,
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","names":["React","EmptyView","ItemGrid","ItemList","ProgressBar","MetadataBasedItemList","MetadataViewContainer","isFeatureEnabled","VIEW_ERROR","VIEW_METADATA","VIEW_MODE_LIST","VIEW_MODE_GRID","VIEW_SELECTED","isEmpty","view","currentCollection","fieldsToShow","items","length","Content","_ref","features","gridColumnCount","metadataTemplate","metadataViewProps","onMetadataUpdate","onSortChange","viewMode","rest","_objectWithoutProperties","_excluded","percentLoaded","sortBy","sortDirection","isViewEmpty","isMetadataBasedView","isListView","isGridView","isMetadataViewV2Feature","createElement","className","percent","isLoading","_extends","hasError"],"sources":["../../../src/elements/content-explorer/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport EmptyView from '../common/empty-view';\nimport ItemGrid from '../common/item-grid';\nimport ItemList from '../common/item-list';\nimport ProgressBar from '../common/progress-bar';\nimport MetadataBasedItemList from '../../features/metadata-based-view';\nimport MetadataViewContainer, { MetadataViewContainerProps } from './MetadataViewContainer';\nimport { isFeatureEnabled, type FeatureConfig } from '../common/feature-checking';\nimport { VIEW_ERROR, VIEW_METADATA, VIEW_MODE_LIST, VIEW_MODE_GRID, VIEW_SELECTED } from '../../constants';\nimport type { ViewMode } from '../common/flowTypes';\nimport type { ItemAction, ItemEventHandlers, ItemEventPermissions } from '../common/item';\nimport type { FieldsToShow } from '../../common/types/metadataQueries';\nimport type { BoxItem, Collection, View } from '../../common/types/core';\nimport type { MetadataFieldValue, MetadataTemplate } from '../../common/types/metadata';\nimport './Content.scss';\n\n/**\n * Determines if we should show the empty state\n *\n * @param {string} view the current view\n * @param {Object} currentCollection the current collection\n * @param {FieldsToShow} fieldsToShow list of metadata template fields to show\n * @return {boolean} empty or not\n */\nfunction isEmpty(view: View, currentCollection: Collection, fieldsToShow: FieldsToShow): boolean {\n const { items = [] }: Collection = currentCollection;\n return view === VIEW_ERROR || !items.length || (view === VIEW_METADATA && !fieldsToShow.length);\n}\n\nexport interface ContentProps extends Required<ItemEventHandlers>, Required<ItemEventPermissions> {\n currentCollection: Collection;\n features?: FeatureConfig;\n fieldsToShow?: FieldsToShow;\n gridColumnCount?: number;\n isMedium: boolean;\n isSmall: boolean;\n isTouch: boolean;\n itemActions?: ItemAction[];\n metadataTemplate?: MetadataTemplate;\n metadataViewProps?: Omit<MetadataViewContainerProps, 'currentCollection'>;\n onMetadataUpdate: (\n item: BoxItem,\n field: string,\n currentValue: MetadataFieldValue,\n editedValue: MetadataFieldValue,\n ) => void;\n onSortChange: (sortBy: string, sortDirection: string) => void;\n portalElement: HTMLElement;\n view: View;\n viewMode?: ViewMode;\n}\n\nconst Content = ({\n currentCollection,\n features,\n fieldsToShow = [],\n gridColumnCount,\n metadataTemplate,\n metadataViewProps,\n onMetadataUpdate,\n onSortChange,\n view,\n viewMode = VIEW_MODE_LIST,\n ...rest\n}: ContentProps) => {\n const { items, percentLoaded, sortBy, sortDirection } = currentCollection;\n\n const isViewEmpty = isEmpty(view, currentCollection, fieldsToShow);\n const isMetadataBasedView = view === VIEW_METADATA;\n const isListView = !isMetadataBasedView && viewMode === VIEW_MODE_LIST; // Folder view or Recents view\n const isGridView = !isMetadataBasedView && viewMode === VIEW_MODE_GRID; // Folder view or Recents view\n const isMetadataViewV2Feature = isFeatureEnabled(features, 'contentExplorer.metadataViewV2');\n return (\n <div className=\"bce-content\">\n {view === VIEW_ERROR || view === VIEW_SELECTED ? null : <ProgressBar percent={percentLoaded} />}\n\n {!isMetadataViewV2Feature && isViewEmpty && <EmptyView view={view} isLoading={percentLoaded !== 100} />}\n {!isMetadataViewV2Feature && !isViewEmpty && isMetadataBasedView && (\n <MetadataBasedItemList\n currentCollection={currentCollection}\n fieldsToShow={fieldsToShow}\n onMetadataUpdate={onMetadataUpdate}\n {...rest}\n />\n )}\n {isMetadataViewV2Feature && isMetadataBasedView && (\n <MetadataViewContainer\n currentCollection={currentCollection}\n isLoading={percentLoaded !== 100}\n hasError={view === VIEW_ERROR}\n metadataTemplate={metadataTemplate}\n onSortChange={onSortChange}\n {...metadataViewProps}\n />\n )}\n {!isViewEmpty && isListView && (\n <ItemList\n items={items}\n onSortChange={onSortChange}\n sortBy={sortBy}\n sortDirection={sortDirection}\n view={view}\n {...rest}\n />\n )}\n {!isViewEmpty && isGridView && (\n <ItemGrid gridColumnCount={gridColumnCount} items={items} view={view} {...rest} />\n )}\n </div>\n );\n};\n\nexport default Content;\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,sBAAsB;AAC5C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,WAAW,MAAM,wBAAwB;AAChD,OAAOC,qBAAqB,MAAM,oCAAoC;AACtE,OAAOC,qBAAqB,MAAsC,yBAAyB;AAC3F,SAASC,gBAAgB,QAA4B,4BAA4B;AACjF,SAASC,UAAU,EAAEC,aAAa,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,QAAQ,iBAAiB;AAM1G,OAAO,gBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAOA,CAACC,IAAU,EAAEC,iBAA6B,EAAEC,YAA0B,EAAW;EAC7F,MAAM;IAAEC,KAAK,GAAG;EAAe,CAAC,GAAGF,iBAAiB;EACpD,OAAOD,IAAI,KA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BAAuB,IAAI,CAACJ,WAAW,IAAIC,mBAAmB,iBAC5DnC,KAAA,CAAAuC,aAAA,CAAClC,qBAAqB,EAAAsC,QAAA;IAClB5B,iBAAiB,EAAEA,iBAAkB;IACrCC,YAAY,EAAEA,YAAa;IAC3BS,gBAAgB,EAAEA;EAAiB,GAC/BG,IAAI,CACX,CACJ,EACAU,uBAAuB,IAAIH,mBAAmB,iBAC3CnC,KAAA,CAAAuC,aAAA,CAACjC,qBAAqB,EAAAqC,QAAA;IAClB5B,iBAAiB,EAAEA,iBAAkB;IACrC2B,SAAS,EAAEX,aAAa,KAAK,GAAI;IACjCa,QAAQ,EAAE9B,IAAI,KAAKN,UAAW;IAC9Be,gBAAgB,EAAEA,gBAAiB;IACnCG,YAAY,EAAEA;EAAa,GACvBF,iBAAiB,CACxB,CACJ,EACA,CAACU,WAAW,IAAIE,UAAU,iBACvBpC,KAAA,CAAAuC,aAAA,CAACpC,QAAQ,EAAAwC,QAAA;IACL1B,KAAK,EAAEA,KAAM;IACbS,YAAY,EAAEA,YAAa;IAC3BM,MAAM,EAAEA,MAAO;IACfC,aAAa,EAAEA,aAAc;IAC7BnB,IAAI,EAAEA;EAAK,GACPc,IAAI,CACX,CACJ,EACA,CAACM,WAAW,IAAIG,UAAU,iBACvBrC,KAAA,CAAAuC,aAAA,CAACrC,QAAQ,EAAAyC,QAAA;IAACrB,eAAe,EAAEA,eAAgB;IAACL,KAAK,EAAEA,KAAM;IAACH,IAAI,EAAEA;EAAK,GAAKc,IAAI,CAAG,CAEpF,CAAC;AAEd,CAAC;AAED,eAAeT,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"Content.js","names":["React","EmptyView","ItemGrid","ItemList","ProgressBar","MetadataBasedItemList","MetadataViewContainer","isFeatureEnabled","VIEW_ERROR","VIEW_METADATA","VIEW_MODE_LIST","VIEW_MODE_GRID","VIEW_SELECTED","isEmpty","view","currentCollection","fieldsToShow","items","length","Content","_ref","features","gridColumnCount","metadataTemplate","metadataViewProps","onMetadataFilter","onMetadataUpdate","onSortChange","viewMode","rest","_objectWithoutProperties","_excluded","percentLoaded","sortBy","sortDirection","isViewEmpty","isMetadataBasedView","isListView","isGridView","isMetadataViewV2Feature","createElement","className","percent","isLoading","_extends","hasError"],"sources":["../../../src/elements/content-explorer/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport EmptyView from '../common/empty-view';\nimport ItemGrid from '../common/item-grid';\nimport ItemList from '../common/item-list';\nimport ProgressBar from '../common/progress-bar';\nimport MetadataBasedItemList from '../../features/metadata-based-view';\nimport MetadataViewContainer, { ExternalFilterValues, MetadataViewContainerProps } from './MetadataViewContainer';\nimport { isFeatureEnabled, type FeatureConfig } from '../common/feature-checking';\nimport { VIEW_ERROR, VIEW_METADATA, VIEW_MODE_LIST, VIEW_MODE_GRID, VIEW_SELECTED } from '../../constants';\nimport type { ViewMode } from '../common/flowTypes';\nimport type { ItemAction, ItemEventHandlers, ItemEventPermissions } from '../common/item';\nimport type { FieldsToShow } from '../../common/types/metadataQueries';\nimport type { BoxItem, Collection, View } from '../../common/types/core';\nimport type { MetadataFieldValue, MetadataTemplate } from '../../common/types/metadata';\nimport './Content.scss';\n\n/**\n * Determines if we should show the empty state\n *\n * @param {string} view the current view\n * @param {Object} currentCollection the current collection\n * @param {FieldsToShow} fieldsToShow list of metadata template fields to show\n * @return {boolean} empty or not\n */\nfunction isEmpty(view: View, currentCollection: Collection, fieldsToShow: FieldsToShow): boolean {\n const { items = [] }: Collection = currentCollection;\n return view === VIEW_ERROR || !items.length || (view === VIEW_METADATA && !fieldsToShow.length);\n}\n\nexport interface ContentProps extends Required<ItemEventHandlers>, Required<ItemEventPermissions> {\n currentCollection: Collection;\n features?: FeatureConfig;\n fieldsToShow?: FieldsToShow;\n gridColumnCount?: number;\n isMedium: boolean;\n isSmall: boolean;\n isTouch: boolean;\n itemActions?: ItemAction[];\n metadataTemplate?: MetadataTemplate;\n metadataViewProps?: Omit<\n MetadataViewContainerProps,\n 'hasError' | 'currentCollection' | 'metadataTemplate' | 'onMetadataFilter'\n >;\n onMetadataFilter?: (fields: ExternalFilterValues) => void;\n onMetadataUpdate: (\n item: BoxItem,\n field: string,\n currentValue: MetadataFieldValue,\n editedValue: MetadataFieldValue,\n ) => void;\n onSortChange: (sortBy: string, sortDirection: string) => void;\n portalElement: HTMLElement;\n view: View;\n viewMode?: ViewMode;\n}\n\nconst Content = ({\n currentCollection,\n features,\n fieldsToShow = [],\n gridColumnCount,\n metadataTemplate,\n metadataViewProps,\n onMetadataFilter,\n onMetadataUpdate,\n onSortChange,\n view,\n viewMode = VIEW_MODE_LIST,\n ...rest\n}: ContentProps) => {\n const { items, percentLoaded, sortBy, sortDirection } = currentCollection;\n\n const isViewEmpty = isEmpty(view, currentCollection, fieldsToShow);\n const isMetadataBasedView = view === VIEW_METADATA;\n const isListView = !isMetadataBasedView && viewMode === VIEW_MODE_LIST; // Folder view or Recents view\n const isGridView = !isMetadataBasedView && viewMode === VIEW_MODE_GRID; // Folder view or Recents view\n const isMetadataViewV2Feature = isFeatureEnabled(features, 'contentExplorer.metadataViewV2');\n return (\n <div className=\"bce-content\">\n {view === VIEW_ERROR || view === VIEW_SELECTED ? null : <ProgressBar percent={percentLoaded} />}\n\n {!isMetadataViewV2Feature && isViewEmpty && <EmptyView view={view} isLoading={percentLoaded !== 100} />}\n {!isMetadataViewV2Feature && !isViewEmpty && isMetadataBasedView && (\n <MetadataBasedItemList\n currentCollection={currentCollection}\n fieldsToShow={fieldsToShow}\n onMetadataUpdate={onMetadataUpdate}\n {...rest}\n />\n )}\n {isMetadataViewV2Feature && isMetadataBasedView && (\n <MetadataViewContainer\n currentCollection={currentCollection}\n isLoading={percentLoaded !== 100}\n hasError={view === VIEW_ERROR}\n metadataTemplate={metadataTemplate}\n onMetadataFilter={onMetadataFilter}\n onSortChange={onSortChange}\n {...metadataViewProps}\n />\n )}\n {!isViewEmpty && isListView && (\n <ItemList\n items={items}\n onSortChange={onSortChange}\n sortBy={sortBy}\n sortDirection={sortDirection}\n view={view}\n {...rest}\n />\n )}\n {!isViewEmpty && isGridView && (\n <ItemGrid gridColumnCount={gridColumnCount} items={items} view={view} {...rest} />\n )}\n </div>\n );\n};\n\nexport default Content;\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,sBAAsB;AAC5C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,WAAW,MAAM,wBAAwB;AAChD,OAAOC,qBAAqB,MAAM,oCAAoC;AACtE,OAAOC,qBAAqB,MAA4D,yBAAyB;AACjH,SAASC,gBAAgB,QAA4B,4BAA4B;AACjF,SAASC,UAAU,EAAEC,aAAa,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,QAAQ,iBAAiB;AAM1G,OAAO,gBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAOA,CAACC,IAAU,EAAEC,iBAA6B,EAAEC,YAA0B,EAAW;EAC7F,MAAM;IAAEC,KAAK,GAAG;EAAe,CAAC,GAAGF,iBAAiB;EACpD,OAAOD,IAAI,KAAKN,UAAU,IAAI,CAACS,KAAK,CAACC,MAAM,IAAKJ,IAAI,KAAKL,aAAa,IAAI,CAACO,YAAY,CAACE,MAAO;AACnG;AA6BA,MAAMC,OAAO,GAAGC,IAAA,IAaI;EAAA,IAbH;MACbL,iBAAiB;MACjBM,QAAQ;MACRL,YAAY,GAAG,EAAE;MACjBM,eAAe;MACfC,gBAAgB;MAChBC,iBAAiB;MACjBC,gBAAgB;MAChBC,gBAAgB;MAChBC,YAAY;MACZb,IAAI;MACJc,QAAQ,GAAGlB;IAED,CAAC,GAAAU,IAAA;IADRS,IAAI,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA;EAEP,MAAM;IAAEd,KAAK;IAAEe,aAAa;IAAEC,MAAM;IAAEC;EAAc,CAAC,GAAGnB,iBAAiB;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AiB;IACnCE,YAAY,EAAEA;EAAa,GACvBH,iBAAiB,CACxB,CACJ,EACA,CAACW,WAAW,IAAIE,UAAU,iBACvBrC,KAAA,CAAAwC,aAAA,CAACrC,QAAQ,EAAAyC,QAAA;IACL3B,KAAK,EAAEA,KAAM;IACbU,YAAY,EAAEA,YAAa;IAC3BM,MAAM,EAAEA,MAAO;IACfC,aAAa,EAAEA,aAAc;IAC7BpB,IAAI,EAAEA;EAAK,GACPe,IAAI,CACX,CACJ,EACA,CAACM,WAAW,IAAIG,UAAU,iBACvBtC,KAAA,CAAAwC,aAAA,CAACtC,QAAQ,EAAA0C,QAAA;IAACtB,eAAe,EAAEA,eAAgB;IAACL,KAAK,EAAEA,KAAM;IAACH,IAAI,EAAEA;EAAK,GAAKe,IAAI,CAAG,CAEpF,CAAC;AAEd,CAAC;AAED,eAAeV,OAAO","ignoreList":[]}
@@ -14,7 +14,6 @@ import getProp from 'lodash/get';
14
14
  import noop from 'lodash/noop';
15
15
  import throttle from 'lodash/throttle';
16
16
  import uniqueid from 'lodash/uniqueId';
17
- import { Notification, TooltipProvider } from '@box/blueprint-web';
18
17
  import CreateFolderDialog from '../common/create-folder-dialog';
19
18
  import UploadDialog from '../common/upload-dialog';
20
19
  import Header from '../common/header';
@@ -46,6 +45,7 @@ import '../common/base.scss';
46
45
  import '../common/modal.scss';
47
46
  import './ContentExplorer.scss';
48
47
  import { withBlueprintModernization } from '../common/withBlueprintModernization';
48
+ import Providers from '../common/Providers';
49
49
  const GRID_VIEW_MAX_COLUMNS = 7;
50
50
  const GRID_VIEW_MIN_COLUMNS = 1;
51
51
  const localStoreViewMode = 'bce.defaultViewMode';
@@ -66,6 +66,7 @@ class ContentExplorer extends Component {
66
66
  *
67
67
  * @private
68
68
  * @param {Object} metadataQueryCollection - Metadata query response collection
69
+ * @param {Object} metadataTemplate - Metadata template object
69
70
  * @return {void}
70
71
  */
71
72
  _defineProperty(this, "showMetadataQueryResultsSuccessCallback", (metadataQueryCollection, metadataTemplate) => {
@@ -1204,6 +1205,11 @@ class ContentExplorer extends Component {
1204
1205
  isMetadataSidePanelOpen: false
1205
1206
  });
1206
1207
  });
1208
+ _defineProperty(this, "filterMetadata", fields => {
1209
+ this.setState({
1210
+ metadataFilters: fields
1211
+ }, this.refreshCollection);
1212
+ });
1207
1213
  const {
1208
1214
  apiHost,
1209
1215
  initialPage,
@@ -1249,6 +1255,7 @@ class ContentExplorer extends Component {
1249
1255
  isShareModalOpen: false,
1250
1256
  isUploadModalOpen: false,
1251
1257
  markers: [],
1258
+ metadataFilters: {},
1252
1259
  metadataTemplate: {},
1253
1260
  rootName: '',
1254
1261
  selectedItemIds: new Set(),
@@ -1346,6 +1353,7 @@ class ContentExplorer extends Component {
1346
1353
  const {
1347
1354
  currentPageNumber,
1348
1355
  markers,
1356
+ metadataFilters,
1349
1357
  sortBy,
1350
1358
  sortDirection
1351
1359
  } = this.state;
@@ -1376,14 +1384,15 @@ class ContentExplorer extends Component {
1376
1384
  direction: sortDirection
1377
1385
  }];
1378
1386
  this.metadataQueryAPIHelper = new MetadataQueryAPIHelperV2(this.api);
1387
+ this.metadataQueryAPIHelper.fetchMetadataQueryResults(metadataQueryClone, this.showMetadataQueryResultsSuccessCallback, this.errorCallback, metadataFilters);
1379
1388
  } else {
1380
1389
  metadataQueryClone.order_by = [{
1381
1390
  field_key: sortBy,
1382
1391
  direction: sortDirection
1383
1392
  }];
1384
1393
  this.metadataQueryAPIHelper = new MetadataQueryAPIHelper(this.api);
1394
+ this.metadataQueryAPIHelper.fetchMetadataQueryResults(metadataQueryClone, this.showMetadataQueryResultsSuccessCallback, this.errorCallback);
1385
1395
  }
1386
- this.metadataQueryAPIHelper.fetchMetadataQueryResults(metadataQueryClone, this.showMetadataQueryResultsSuccessCallback, this.errorCallback);
1387
1396
  }
1388
1397
  /**
1389
1398
  * Resets the collection so that the loading bar starts showing
@@ -1586,6 +1595,7 @@ class ContentExplorer extends Component {
1586
1595
  contentUploaderProps,
1587
1596
  defaultView,
1588
1597
  features,
1598
+ hasProviders,
1589
1599
  isMedium,
1590
1600
  isSmall,
1591
1601
  isTouch,
@@ -1658,8 +1668,8 @@ class ContentExplorer extends Component {
1658
1668
  return /*#__PURE__*/React.createElement(Internationalize, {
1659
1669
  language: language,
1660
1670
  messages: messages
1661
- }, /*#__PURE__*/React.createElement(Notification.Provider, null, /*#__PURE__*/React.createElement(Notification.Viewport, null), /*#__PURE__*/React.createElement(TooltipProvider, {
1662
- container: this.rootElement
1671
+ }, /*#__PURE__*/React.createElement(Providers, {
1672
+ hasProviders: hasProviders
1663
1673
  }, /*#__PURE__*/React.createElement("div", {
1664
1674
  id: this.id,
1665
1675
  className: styleClassName,
@@ -1726,6 +1736,7 @@ class ContentExplorer extends Component {
1726
1736
  onItemRename: this.rename,
1727
1737
  onItemSelect: this.select,
1728
1738
  onItemShare: this.share,
1739
+ onMetadataFilter: this.filterMetadata,
1729
1740
  onMetadataUpdate: this.updateMetadata,
1730
1741
  onSortChange: this.sort,
1731
1742
  portalElement: this.rootElement,
@@ -1819,7 +1830,7 @@ class ContentExplorer extends Component {
1819
1830
  contentPreviewProps: contentPreviewProps,
1820
1831
  requestInterceptor: requestInterceptor,
1821
1832
  responseInterceptor: responseInterceptor
1822
- }) : null))));
1833
+ }) : null)));
1823
1834
  /* eslint-enable jsx-a11y/no-static-element-interactions */
1824
1835
  /* eslint-enable jsx-a11y/no-noninteractive-tabindex */
1825
1836
  }