geonetwork-ui 2.5.0-dev.b51c2cb0f → 2.5.0-dev.b87edcffd

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 (246) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +11 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
  3. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +34 -28
  4. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +22 -2
  5. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  6. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  7. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +7 -4
  8. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +24 -14
  9. package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +7 -4
  10. package/esm2022/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.mjs +3 -3
  11. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +2 -2
  12. package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +2 -2
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.mjs +2 -2
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +3 -2
  15. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +2 -2
  16. package/esm2022/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.mjs +7 -23
  17. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +2 -2
  18. package/esm2022/libs/feature/editor/src/lib/models/wizard-field.type.mjs +3 -4
  19. package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-from-catalog.component.mjs +1 -1
  20. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +25 -5
  21. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +10 -7
  22. package/esm2022/libs/feature/record/src/lib/state/mdview.actions.mjs +4 -1
  23. package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +7 -2
  24. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +9 -1
  25. package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +19 -1
  26. package/esm2022/libs/feature/record/src/lib/state/mdview.selectors.mjs +6 -1
  27. package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +6 -3
  28. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +1 -1
  29. package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +46 -1
  30. package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +3 -2
  31. package/esm2022/libs/ui/elements/src/index.mjs +2 -1
  32. package/esm2022/libs/ui/elements/src/lib/application-banner/application-banner.component.mjs +78 -0
  33. package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
  34. package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +2 -1
  35. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -4
  36. package/esm2022/libs/ui/inputs/src/index.mjs +1 -2
  37. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +43 -3
  38. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +1 -6
  39. package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +2 -7
  40. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +14 -4
  41. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +10 -3
  42. package/esm2022/libs/ui/widgets/src/index.mjs +1 -2
  43. package/esm2022/libs/ui/widgets/src/lib/ui-widgets.module.mjs +5 -6
  44. package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +5 -4
  45. package/esm2022/libs/util/data-fetcher/src/lib/readers/base-cache.mjs +12 -0
  46. package/esm2022/libs/util/data-fetcher/src/lib/readers/base-file.mjs +3 -3
  47. package/esm2022/libs/util/data-fetcher/src/lib/readers/base.mjs +1 -1
  48. package/esm2022/libs/util/data-fetcher/src/lib/readers/csv.mjs +2 -2
  49. package/esm2022/libs/util/data-fetcher/src/lib/readers/excel.mjs +2 -2
  50. package/esm2022/libs/util/data-fetcher/src/lib/readers/geojson.mjs +2 -2
  51. package/esm2022/libs/util/data-fetcher/src/lib/readers/gml.mjs +5 -3
  52. package/esm2022/libs/util/data-fetcher/src/lib/readers/json.mjs +2 -2
  53. package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +19 -11
  54. package/esm2022/libs/util/data-fetcher/src/lib/utils.mjs +13 -9
  55. package/esm2022/translations/de.json +4 -76
  56. package/esm2022/translations/en.json +4 -76
  57. package/esm2022/translations/es.json +3 -75
  58. package/esm2022/translations/fr.json +16 -88
  59. package/esm2022/translations/it.json +21 -92
  60. package/esm2022/translations/nl.json +3 -75
  61. package/esm2022/translations/pt.json +3 -75
  62. package/fesm2022/geonetwork-ui.mjs +558 -880
  63. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  64. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  65. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +3 -0
  66. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  67. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +1 -0
  68. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
  69. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +2 -1
  70. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  71. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +6 -0
  72. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  73. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +2 -1
  74. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  75. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +2 -1
  76. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  77. package/libs/feature/dataviz/src/lib/service/data.service.d.ts +2 -2
  78. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  79. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +2 -1
  80. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
  81. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -1
  82. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -1
  83. package/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.d.ts +1 -3
  84. package/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.d.ts.map +1 -1
  85. package/libs/feature/editor/src/lib/models/wizard-field.type.d.ts +2 -3
  86. package/libs/feature/editor/src/lib/models/wizard-field.type.d.ts.map +1 -1
  87. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +5 -1
  88. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
  89. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +3 -2
  90. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  91. package/libs/feature/record/src/lib/state/mdview.actions.d.ts +16 -1
  92. package/libs/feature/record/src/lib/state/mdview.actions.d.ts.map +1 -1
  93. package/libs/feature/record/src/lib/state/mdview.effects.d.ts +5 -0
  94. package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
  95. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +2 -0
  96. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  97. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts +4 -1
  98. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
  99. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts +2 -0
  100. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts.map +1 -1
  101. package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts +2 -1
  102. package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts.map +1 -1
  103. package/libs/feature/search/src/lib/utils/service/fields.d.ts +10 -0
  104. package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
  105. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
  106. package/libs/ui/elements/src/index.d.ts +1 -0
  107. package/libs/ui/elements/src/index.d.ts.map +1 -1
  108. package/libs/ui/elements/src/lib/application-banner/application-banner.component.d.ts +16 -0
  109. package/libs/ui/elements/src/lib/application-banner/application-banner.component.d.ts.map +1 -0
  110. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
  111. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
  112. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  113. package/libs/ui/inputs/src/index.d.ts +0 -1
  114. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  115. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts +16 -1
  116. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
  117. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +27 -28
  118. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
  119. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts +2 -3
  120. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts.map +1 -1
  121. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +4 -2
  122. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -1
  123. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +3 -1
  124. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  125. package/libs/ui/widgets/src/index.d.ts +0 -1
  126. package/libs/ui/widgets/src/index.d.ts.map +1 -1
  127. package/libs/ui/widgets/src/lib/ui-widgets.module.d.ts +8 -9
  128. package/libs/ui/widgets/src/lib/ui-widgets.module.d.ts.map +1 -1
  129. package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts +2 -2
  130. package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts.map +1 -1
  131. package/libs/util/data-fetcher/src/lib/readers/base-cache.d.ts +8 -0
  132. package/libs/util/data-fetcher/src/lib/readers/base-cache.d.ts.map +1 -0
  133. package/libs/util/data-fetcher/src/lib/readers/base-file.d.ts +2 -2
  134. package/libs/util/data-fetcher/src/lib/readers/base-file.d.ts.map +1 -1
  135. package/libs/util/data-fetcher/src/lib/readers/base.d.ts +2 -2
  136. package/libs/util/data-fetcher/src/lib/readers/base.d.ts.map +1 -1
  137. package/libs/util/data-fetcher/src/lib/readers/gml.d.ts +5 -3
  138. package/libs/util/data-fetcher/src/lib/readers/gml.d.ts.map +1 -1
  139. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts +7 -4
  140. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -1
  141. package/libs/util/data-fetcher/src/lib/utils.d.ts +2 -2
  142. package/libs/util/data-fetcher/src/lib/utils.d.ts.map +1 -1
  143. package/package.json +1 -1
  144. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +25 -0
  145. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +4 -0
  146. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +36 -27
  147. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +41 -2
  148. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +3 -1
  149. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +4 -1
  150. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +75 -0
  151. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +4 -1
  152. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +43 -20
  153. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +2 -1
  154. package/src/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.html +1 -1
  155. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +1 -0
  156. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +1 -1
  157. package/src/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.html +0 -13
  158. package/src/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts +0 -20
  159. package/src/libs/feature/editor/src/lib/fields.config.ts +1 -1
  160. package/src/libs/feature/editor/src/lib/models/wizard-field.type.ts +0 -1
  161. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +24 -11
  162. package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +26 -4
  163. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +71 -60
  164. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +6 -3
  165. package/src/libs/feature/record/src/lib/state/mdview.actions.ts +16 -0
  166. package/src/libs/feature/record/src/lib/state/mdview.effects.ts +21 -2
  167. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +15 -0
  168. package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +30 -1
  169. package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +12 -0
  170. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -0
  171. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.ts +1 -0
  172. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +2 -0
  173. package/src/libs/feature/search/src/lib/utils/service/fields.ts +55 -0
  174. package/src/libs/ui/elements/src/index.ts +1 -0
  175. package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.css +0 -0
  176. package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.html +25 -0
  177. package/src/libs/ui/elements/src/lib/application-banner/application-banner.component.ts +70 -0
  178. package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +2 -2
  179. package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +2 -0
  180. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -0
  181. package/src/libs/ui/inputs/src/index.ts +0 -1
  182. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +48 -0
  183. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +0 -3
  184. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +1 -7
  185. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +37 -1
  186. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +8 -2
  187. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +2 -0
  188. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +6 -0
  189. package/src/libs/ui/widgets/src/index.ts +0 -1
  190. package/src/libs/ui/widgets/src/lib/ui-widgets.module.ts +2 -3
  191. package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +13 -4
  192. package/src/libs/util/data-fetcher/src/lib/readers/base-cache.ts +14 -0
  193. package/src/libs/util/data-fetcher/src/lib/readers/base-file.ts +2 -1
  194. package/src/libs/util/data-fetcher/src/lib/readers/base.ts +2 -2
  195. package/src/libs/util/data-fetcher/src/lib/readers/csv.ts +1 -1
  196. package/src/libs/util/data-fetcher/src/lib/readers/excel.ts +1 -1
  197. package/src/libs/util/data-fetcher/src/lib/readers/geojson.ts +1 -1
  198. package/src/libs/util/data-fetcher/src/lib/readers/gml.ts +7 -7
  199. package/src/libs/util/data-fetcher/src/lib/readers/json.ts +1 -1
  200. package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +34 -11
  201. package/src/libs/util/data-fetcher/src/lib/utils.ts +38 -32
  202. package/translations/de.json +4 -76
  203. package/translations/en.json +4 -76
  204. package/translations/es.json +3 -75
  205. package/translations/fr.json +16 -88
  206. package/translations/it.json +21 -92
  207. package/translations/nl.json +3 -75
  208. package/translations/pt.json +3 -75
  209. package/translations/sk.json +3 -75
  210. package/esm2022/libs/ui/inputs/src/lib/chips-input/chips-input.component.mjs +0 -78
  211. package/esm2022/libs/ui/widgets/src/lib/step-bar/step-bar.component.mjs +0 -55
  212. package/libs/ui/inputs/src/lib/chips-input/chips-input.component.d.ts +0 -33
  213. package/libs/ui/inputs/src/lib/chips-input/chips-input.component.d.ts.map +0 -1
  214. package/libs/ui/widgets/src/lib/step-bar/step-bar.component.d.ts +0 -21
  215. package/libs/ui/widgets/src/lib/step-bar/step-bar.component.d.ts.map +0 -1
  216. package/src/libs/data-access/datafeeder/src/index.ts +0 -1
  217. package/src/libs/data-access/datafeeder/src/openapi/api/api.ts +0 -11
  218. package/src/libs/data-access/datafeeder/src/openapi/api/config.api.service.ts +0 -168
  219. package/src/libs/data-access/datafeeder/src/openapi/api/dataPublishing.api.service.ts +0 -270
  220. package/src/libs/data-access/datafeeder/src/openapi/api/fileUpload.api.service.ts +0 -734
  221. package/src/libs/data-access/datafeeder/src/openapi/api.module.ts +0 -46
  222. package/src/libs/data-access/datafeeder/src/openapi/configuration.ts +0 -125
  223. package/src/libs/data-access/datafeeder/src/openapi/encoder.ts +0 -20
  224. package/src/libs/data-access/datafeeder/src/openapi/index.ts +0 -5
  225. package/src/libs/data-access/datafeeder/src/openapi/model/analysisStatusEnum.api.model.ts +0 -24
  226. package/src/libs/data-access/datafeeder/src/openapi/model/boundingBox.api.model.ts +0 -20
  227. package/src/libs/data-access/datafeeder/src/openapi/model/cRS.api.model.ts +0 -25
  228. package/src/libs/data-access/datafeeder/src/openapi/model/datasetMetadata.api.model.ts +0 -45
  229. package/src/libs/data-access/datafeeder/src/openapi/model/datasetPublishRequest.api.model.ts +0 -39
  230. package/src/libs/data-access/datafeeder/src/openapi/model/datasetPublishingStatus.api.model.ts +0 -50
  231. package/src/libs/data-access/datafeeder/src/openapi/model/datasetUploadStatus.api.model.ts +0 -39
  232. package/src/libs/data-access/datafeeder/src/openapi/model/models.ts +0 -13
  233. package/src/libs/data-access/datafeeder/src/openapi/model/property.api.model.ts +0 -17
  234. package/src/libs/data-access/datafeeder/src/openapi/model/publishJobStatus.api.model.ts +0 -33
  235. package/src/libs/data-access/datafeeder/src/openapi/model/publishRequest.api.model.ts +0 -16
  236. package/src/libs/data-access/datafeeder/src/openapi/model/publishStatusEnum.api.model.ts +0 -20
  237. package/src/libs/data-access/datafeeder/src/openapi/model/publishStepEnum.api.model.ts +0 -42
  238. package/src/libs/data-access/datafeeder/src/openapi/model/uploadJobStatus.api.model.ts +0 -33
  239. package/src/libs/data-access/datafeeder/src/openapi/variables.ts +0 -9
  240. package/src/libs/data-access/datafeeder/src/spec.yaml +0 -537
  241. package/src/libs/ui/inputs/src/lib/chips-input/chips-input.component.css +0 -36
  242. package/src/libs/ui/inputs/src/lib/chips-input/chips-input.component.html +0 -23
  243. package/src/libs/ui/inputs/src/lib/chips-input/chips-input.component.ts +0 -81
  244. package/src/libs/ui/widgets/src/lib/step-bar/step-bar.component.css +0 -3
  245. package/src/libs/ui/widgets/src/lib/step-bar/step-bar.component.html +0 -13
  246. package/src/libs/ui/widgets/src/lib/step-bar/step-bar.component.ts +0 -55
@@ -19,6 +19,7 @@ import { MarkdownParserComponent } from './markdown-parser/markdown-parser.compo
19
19
  import { ThumbnailComponent } from './thumbnail/thumbnail.component'
20
20
  import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
21
21
  import { UserPreviewComponent } from './user-preview/user-preview.component'
22
+ import { ApplicationBannerComponent } from './application-banner/application-banner.component'
22
23
 
23
24
  @NgModule({
24
25
  imports: [
@@ -40,6 +41,7 @@ import { UserPreviewComponent } from './user-preview/user-preview.component'
40
41
  MaxLinesComponent,
41
42
  TextInputComponent,
42
43
  ImageInputComponent,
44
+ ApplicationBannerComponent,
43
45
  ],
44
46
  providers: [
45
47
  provideNgIconsConfig({
@@ -53,6 +55,7 @@ import { UserPreviewComponent } from './user-preview/user-preview.component'
53
55
  UserPreviewComponent,
54
56
  MarkdownParserComponent,
55
57
  ImageInputComponent,
58
+ ApplicationBannerComponent,
56
59
  ],
57
60
  })
58
61
  export class UiElementsModule {}
@@ -3,7 +3,6 @@ export * from './lib/badge/badge.component'
3
3
  export * from './lib/button/button.component'
4
4
  export * from './lib/check-toggle/check-toggle.component'
5
5
  export * from './lib/checkbox/checkbox.component'
6
- export * from './lib/chips-input/chips-input.component'
7
6
  export * from './lib/copy-text-button/copy-text-button.component'
8
7
  export * from './lib/date-picker/date-picker.component'
9
8
  export * from './lib/date-range-dropdown/date-range-dropdown.component'
@@ -83,6 +83,7 @@ export class AutocompleteComponent
83
83
  @Input() minCharacterCount? = 3
84
84
  // this will show a submit button next to the input; if false, a search icon will appear on the left
85
85
  @Input() allowSubmit = false
86
+ @Input() forceTrackPosition = false
86
87
  @Output() itemSelected = new EventEmitter<AutocompleteItem>()
87
88
  @Output() inputSubmitted = new EventEmitter<string>()
88
89
  @Output() inputCleared = new EventEmitter<void>()
@@ -98,6 +99,8 @@ export class AutocompleteComponent
98
99
  error: string | null = null
99
100
  suggestions$: Observable<AutocompleteItem[]>
100
101
  subscription = new Subscription()
102
+ private lastPosition: DOMRect | null = null
103
+ private intervalIdPosition: number | undefined
101
104
 
102
105
  @Input() displayWithFn: (item: AutocompleteItem) => string = (item) =>
103
106
  item.toString()
@@ -147,6 +150,12 @@ export class AutocompleteComponent
147
150
  this.error = null
148
151
  }),
149
152
  switchMap((value) => this.action(value)),
153
+ tap((suggestions) => {
154
+ // forcing the panel to open if there are suggestions
155
+ if (suggestions.length > 0) {
156
+ this.triggerRef?.openPanel()
157
+ }
158
+ }),
150
159
  catchError((error: Error) => {
151
160
  this.error = error.message
152
161
  return of([])
@@ -191,10 +200,49 @@ export class AutocompleteComponent
191
200
  this.inputRef.nativeElement.focus()
192
201
  this.cdRef.detectChanges()
193
202
  }
203
+
204
+ this.startTrackingPosition()
205
+ }
206
+
207
+ /**
208
+ * !!! This function is used only for web component mode,
209
+ * the autocomplete dropdown may not update its position
210
+ * if the page or container is disabling wind scroll.
211
+ */
212
+ private trackPosition = () => {
213
+ const dropdownOpened = this.triggerRef && this.triggerRef.panelOpen
214
+ const rect = this.inputRef.nativeElement.getBoundingClientRect()
215
+
216
+ if (
217
+ dropdownOpened &&
218
+ (!this.lastPosition ||
219
+ rect.top !== this.lastPosition.top ||
220
+ rect.left !== this.lastPosition.left)
221
+ ) {
222
+ this.triggerRef.updatePosition()
223
+ }
224
+
225
+ this.lastPosition = rect
226
+ requestAnimationFrame(this.trackPosition)
227
+ }
228
+
229
+ /**
230
+ * !!! This function is used only for web component mode,
231
+ * the autocomplete dropdown may not update its position
232
+ * if the page or container is disabling wind scroll.
233
+ */
234
+ startTrackingPosition() {
235
+ if (this.forceTrackPosition) {
236
+ requestAnimationFrame(this.trackPosition)
237
+ }
194
238
  }
195
239
 
196
240
  ngOnDestroy(): void {
197
241
  this.subscription?.unsubscribe()
242
+
243
+ if (this.intervalIdPosition) {
244
+ clearInterval(this.intervalIdPosition)
245
+ }
198
246
  }
199
247
 
200
248
  updateInputValue(value: AutocompleteItem) {
@@ -28,7 +28,6 @@ import { BadgeComponent } from './badge/badge.component'
28
28
  import { ButtonComponent } from './button/button.component'
29
29
  import { CheckToggleComponent } from './check-toggle/check-toggle.component'
30
30
  import { CheckboxComponent } from './checkbox/checkbox.component'
31
- import { ChipsInputComponent } from './chips-input/chips-input.component'
32
31
  import { DateRangePickerComponent } from './date-range-picker/date-range-picker.component'
33
32
  import { DragAndDropFileInputComponent } from './drag-and-drop-file-input/drag-and-drop-file-input.component'
34
33
  import { DropdownMultiselectComponent } from './dropdown-multiselect/dropdown-multiselect.component'
@@ -40,7 +39,6 @@ import { ViewportIntersectorComponent } from './viewport-intersector/viewport-in
40
39
  @NgModule({
41
40
  declarations: [
42
41
  DragAndDropFileInputComponent,
43
- ChipsInputComponent,
44
42
  DropdownMultiselectComponent,
45
43
  ViewportIntersectorComponent,
46
44
  CheckboxComponent,
@@ -86,7 +84,6 @@ import { ViewportIntersectorComponent } from './viewport-intersector/viewport-in
86
84
  ButtonComponent,
87
85
  DragAndDropFileInputComponent,
88
86
  TextAreaComponent,
89
- ChipsInputComponent,
90
87
  DropdownMultiselectComponent,
91
88
  ViewportIntersectorComponent,
92
89
  CheckToggleComponent,
@@ -31,7 +31,7 @@ import { iconoirArrowUp, iconoirLink } from '@ng-icons/iconoir'
31
31
  ],
32
32
  changeDetection: ChangeDetectionStrategy.OnPush,
33
33
  })
34
- export class UrlInputComponent implements OnChanges {
34
+ export class UrlInputComponent {
35
35
  @Input() set value(v: string) {
36
36
  // we're making sure to only update the input if the URL representation of it has changed; otherwise we keep it identical
37
37
  // to avoid glitches when starting to write a URL and having some characters added/replaced automatically
@@ -59,12 +59,6 @@ export class UrlInputComponent implements OnChanges {
59
59
 
60
60
  constructor(private cd: ChangeDetectorRef) {}
61
61
 
62
- ngOnChanges(changes: SimpleChanges) {
63
- if (changes['value']) {
64
- this.inputValue = changes['value'].currentValue
65
- }
66
- }
67
-
68
62
  handleInput(event: Event) {
69
63
  const value = (event.target as HTMLInputElement).value
70
64
  this.inputValue = value
@@ -6,6 +6,7 @@
6
6
  >
7
7
  <ul class="flex flex-col gap-2 w-full">
8
8
  <gn-ui-button
9
+ *ngIf="!isDraftPage"
9
10
  type="light"
10
11
  extraClass="flex flex-row items-center gap-2 w-full justify-start"
11
12
  (buttonClick)="duplicate.emit()"
@@ -23,7 +24,10 @@
23
24
  (buttonClick)="displayDeleteMenu()"
24
25
  [disabled]="!canDelete"
25
26
  data-test="record-menu-delete-button"
26
- ><span translate>record.action.delete</span></gn-ui-button
27
+ ><span *ngIf="!isDraftPage" translate>record.action.delete</span>
28
+ <span *ngIf="isDraftPage" translate
29
+ >record.action.rollback</span
30
+ ></gn-ui-button
27
31
  >
28
32
  </ul>
29
33
  </div>
@@ -60,4 +64,36 @@
60
64
  </div>
61
65
  </div>
62
66
  </ng-container>
67
+ <ng-container *ngSwitchCase="'rollbackMenu'">
68
+ <div
69
+ data-test="rollbackMenuSection"
70
+ class="w-80 p-6 flex flex-col gap-3 mt-2 border border-gray-100 bg-white shadow-2xl rounded-2xl"
71
+ >
72
+ <span class="text-lg font-bold text-center">{{
73
+ 'editor.record.undo.confirmation.title' | translate
74
+ }}</span>
75
+ <span class="text-center">{{
76
+ 'editor.record.undo.confirmation.message' | translate
77
+ }}</span>
78
+ <div class="flex flex-row gap-8 justify-center">
79
+ <gn-ui-button
80
+ (buttonClick)="rollback.emit()"
81
+ cdkFocusInitial
82
+ type="primary"
83
+ data-cy="confirm-button"
84
+ [style.--gn-ui-button-width]="'120px'"
85
+ >{{
86
+ 'editor.record.undo.confirmation.confirmText' | translate
87
+ }}</gn-ui-button
88
+ >
89
+ <gn-ui-button
90
+ [style.--gn-ui-button-width]="'120px'"
91
+ (buttonClick)="closeActionMenu.emit()"
92
+ >{{
93
+ 'editor.record.undo.confirmation.cancelText' | translate
94
+ }}</gn-ui-button
95
+ >
96
+ </div>
97
+ </div>
98
+ </ng-container>
63
99
  </ng-container>
@@ -13,7 +13,7 @@ import { ConfirmationDialogComponent } from '../../../../../../../libs/ui/elemen
13
13
  import { ButtonComponent } from '../../../../../../../libs/ui/inputs/src'
14
14
  import { TranslateModule } from '@ngx-translate/core'
15
15
 
16
- type ActionMenuPage = 'mainMenu' | 'deleteMenu'
16
+ type ActionMenuPage = 'mainMenu' | 'deleteMenu' | 'rollbackMenu'
17
17
 
18
18
  @Component({
19
19
  selector: 'gn-ui-action-menu',
@@ -32,9 +32,11 @@ type ActionMenuPage = 'mainMenu' | 'deleteMenu'
32
32
  export class ActionMenuComponent {
33
33
  @Input() canDuplicate: boolean
34
34
  @Input() canDelete: boolean
35
+ @Input() isDraftPage: boolean
35
36
  @Output() duplicate = new EventEmitter<void>()
36
37
  @Output() delete = new EventEmitter<void>()
37
38
  @Output() closeActionMenu = new EventEmitter<void>()
39
+ @Output() rollback = new EventEmitter<void>()
38
40
 
39
41
  @ViewChild(MatMenuTrigger) trigger: MatMenuTrigger
40
42
 
@@ -55,7 +57,11 @@ export class ActionMenuComponent {
55
57
  }
56
58
 
57
59
  displayDeleteMenu() {
58
- this.sectionDisplayed = 'deleteMenu'
60
+ if (this.isDraftPage) {
61
+ this.sectionDisplayed = 'rollbackMenu'
62
+ } else {
63
+ this.sectionDisplayed = 'deleteMenu'
64
+ }
59
65
  this.cdr.markForCheck()
60
66
  }
61
67
  }
@@ -162,9 +162,11 @@
162
162
  <gn-ui-action-menu
163
163
  [canDuplicate]="canDuplicate(item) && !isDuplicating"
164
164
  [canDelete]="canDelete(item)"
165
+ [isDraftPage]="isDraftPage"
165
166
  (duplicate)="handleDuplicate(item)"
166
167
  (delete)="handleDelete(item)"
167
168
  (closeActionMenu)="closeActionMenu()"
169
+ (rollback)="handleRollback(item)"
168
170
  >
169
171
  </gn-ui-action-menu>
170
172
  </ng-template>
@@ -74,6 +74,7 @@ export class ResultsTableComponent {
74
74
  @Output() recordClick = new EventEmitter<CatalogRecord>()
75
75
  @Output() duplicateRecord = new EventEmitter<CatalogRecord>()
76
76
  @Output() deleteRecord = new EventEmitter<CatalogRecord>()
77
+ @Output() rollbackDraft = new EventEmitter<CatalogRecord>()
77
78
  @Output() recordsSelectedChange = new EventEmitter<
78
79
  [CatalogRecord[], boolean]
79
80
  >()
@@ -186,6 +187,11 @@ export class ResultsTableComponent {
186
187
  this.closeActionMenu()
187
188
  }
188
189
 
190
+ handleRollback(item: unknown) {
191
+ this.rollbackDraft.emit(item as CatalogRecord)
192
+ this.closeActionMenu()
193
+ }
194
+
189
195
  setSortBy(col: string, order: 'asc' | 'desc') {
190
196
  this.sortByChange.emit([col, order])
191
197
  }
@@ -5,4 +5,3 @@ export * from './lib/loading-mask/loading-mask.component'
5
5
  export * from './lib/color-scale/color-scale.component'
6
6
  export * from './lib/popup-alert/popup-alert.component'
7
7
  export * from './lib/spinning-loader/spinning-loader.component'
8
- export * from './lib/step-bar/step-bar.component'
@@ -3,14 +3,13 @@ import { UtilSharedModule } from '../../../../../libs/util/shared/src'
3
3
  import { TranslateModule } from '@ngx-translate/core'
4
4
  import { NgxDropzoneModule } from 'ngx-dropzone'
5
5
  import { ColorScaleComponent } from './color-scale/color-scale.component'
6
- import { StepBarComponent } from './step-bar/step-bar.component'
7
6
  import { TagInputModule } from 'ngx-chips'
8
7
  import { FormsModule, ReactiveFormsModule } from '@angular/forms'
9
8
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'
10
9
  import { CommonModule } from '@angular/common'
11
10
 
12
11
  @NgModule({
13
- declarations: [ColorScaleComponent, StepBarComponent],
12
+ declarations: [ColorScaleComponent],
14
13
  imports: [
15
14
  CommonModule,
16
15
  TranslateModule.forChild(),
@@ -21,6 +20,6 @@ import { CommonModule } from '@angular/common'
21
20
  UtilSharedModule,
22
21
  MatProgressSpinnerModule,
23
22
  ],
24
- exports: [StepBarComponent],
23
+ exports: [],
25
24
  })
26
25
  export class UiWidgetsModule {}
@@ -17,10 +17,17 @@ export async function openDataset(
17
17
  namespace?: string
18
18
  wfsVersion?: WfsVersion
19
19
  wfsFeatureType?: string
20
- }
20
+ },
21
+ cacheActive?: boolean
21
22
  ): Promise<BaseReader> {
22
23
  const fileType = await inferDatasetType(url, typeHint)
23
- let reader: BaseReader
24
+ let reader:
25
+ | CsvReader
26
+ | JsonReader
27
+ | GeojsonReader
28
+ | ExcelReader
29
+ | GmlReader
30
+ | WfsReader
24
31
  try {
25
32
  switch (fileType) {
26
33
  case 'csv':
@@ -42,6 +49,7 @@ export async function openDataset(
42
49
  reader = await WfsReader.createReader(url, options.wfsFeatureType)
43
50
  break
44
51
  }
52
+ reader.setCacheActive(cacheActive)
45
53
  reader.load()
46
54
  return reader
47
55
  } catch (e: any) {
@@ -61,9 +69,10 @@ export async function openDataset(
61
69
  export async function readDataset(
62
70
  url: string,
63
71
  typeHint?: SupportedType,
64
- options?: any
72
+ options?: any,
73
+ cacheActive = true
65
74
  ): Promise<DataItem[]> {
66
- const reader = await openDataset(url, typeHint, options)
75
+ const reader = await openDataset(url, typeHint, options, cacheActive)
67
76
  try {
68
77
  return await reader.read()
69
78
  } catch (e: any) {
@@ -0,0 +1,14 @@
1
+ import { BaseReader } from './base'
2
+
3
+ export abstract class BaseCacheReader extends BaseReader {
4
+ constructor(
5
+ protected url: string,
6
+ protected cacheActive = true
7
+ ) {
8
+ super(url)
9
+ }
10
+
11
+ setCacheActive(value: boolean) {
12
+ this.cacheActive = value
13
+ }
14
+ }
@@ -2,13 +2,14 @@ import { BaseReader } from './base'
2
2
  import { DataItem, DatasetInfo, PropertyInfo } from '../model'
3
3
  import { getJsonDataItemsProxy, jsonToGeojsonFeature } from '../utils'
4
4
  import { generateSqlQuery } from '../sql-utils'
5
+ import { BaseCacheReader } from './base-cache'
5
6
 
6
7
  type ParseResult = {
7
8
  items: DataItem[]
8
9
  properties: PropertyInfo[]
9
10
  }
10
11
 
11
- export class BaseFileReader extends BaseReader {
12
+ export class BaseFileReader extends BaseCacheReader {
12
13
  private parseResult_: Promise<ParseResult>
13
14
 
14
15
  protected getData(): Promise<ParseResult> {
@@ -11,8 +11,8 @@ import {
11
11
 
12
12
  export class BaseReader {
13
13
  protected selected: FieldName[] = null
14
- protected groupedBy: FieldGroupBy[] = null
15
- protected aggregations: FieldAggregation[] = null
14
+ public groupedBy: FieldGroupBy[] = null
15
+ public aggregations: FieldAggregation[] = null
16
16
  protected filter: FieldFilter = null
17
17
  protected sort: FieldSort[] = null
18
18
  protected startIndex: number = null
@@ -47,6 +47,6 @@ export function parseCsv(text: string): {
47
47
 
48
48
  export class CsvReader extends BaseFileReader {
49
49
  getData() {
50
- return fetchDataAsText(this.url).then(parseCsv)
50
+ return fetchDataAsText(this.url, this.cacheActive).then(parseCsv)
51
51
  }
52
52
  }
@@ -28,6 +28,6 @@ export function parseExcel(buffer: ArrayBuffer): Promise<{
28
28
 
29
29
  export class ExcelReader extends BaseFileReader {
30
30
  getData() {
31
- return fetchDataAsArrayBuffer(this.url).then(parseExcel)
31
+ return fetchDataAsArrayBuffer(this.url, this.cacheActive).then(parseExcel)
32
32
  }
33
33
  }
@@ -24,6 +24,6 @@ export function parseGeojson(text: string): {
24
24
 
25
25
  export class GeojsonReader extends BaseFileReader {
26
26
  getData() {
27
- return fetchDataAsText(this.url).then(parseGeojson)
27
+ return fetchDataAsText(this.url, this.cacheActive).then(parseGeojson)
28
28
  }
29
29
  }
@@ -37,17 +37,17 @@ export function parseGml(
37
37
  }
38
38
 
39
39
  export class GmlReader extends BaseFileReader {
40
- namespace: string
41
- version: WfsVersion
42
-
43
- constructor(url, namespace, version) {
40
+ constructor(
41
+ protected url: string,
42
+ protected namespace: string,
43
+ protected version: WfsVersion,
44
+ protected cacheActive = true
45
+ ) {
44
46
  super(url)
45
- this.namespace = namespace
46
- this.version = version
47
47
  }
48
48
 
49
49
  protected getData() {
50
- return fetchDataAsText(this.url).then((text) =>
50
+ return fetchDataAsText(this.url, this.cacheActive).then((text) =>
51
51
  parseGml(text, this.namespace, this.version)
52
52
  )
53
53
  }
@@ -23,6 +23,6 @@ export function parseJson(text: string): {
23
23
 
24
24
  export class JsonReader extends BaseFileReader {
25
25
  getData() {
26
- return fetchDataAsText(this.url).then(parseJson)
26
+ return fetchDataAsText(this.url, this.cacheActive).then(parseJson)
27
27
  }
28
28
  }
@@ -1,18 +1,24 @@
1
1
  import { WfsEndpoint, WfsVersion } from '@camptocamp/ogc-client'
2
2
  import { DataItem, DatasetInfo, PropertyInfo } from '../model'
3
3
  import { fetchDataAsText } from '../utils'
4
- import { BaseReader } from './base'
5
4
  import { GmlReader, parseGml } from './gml'
6
5
  import { GeojsonReader, parseGeojson } from './geojson'
7
- import { marker } from '@biesbjerg/ngx-translate-extract-marker'
6
+ import { BaseCacheReader } from './base-cache'
7
+ import { getJsonDataItemsProxy, jsonToGeojsonFeature } from '../utils'
8
+ import { generateSqlQuery } from '../sql-utils'
8
9
 
9
- export class WfsReader extends BaseReader {
10
+ export class WfsReader extends BaseCacheReader {
10
11
  endpoint: WfsEndpoint
11
12
  featureTypeName: string
12
13
  version: WfsVersion
13
14
 
14
- constructor(url: string, wfsEndpoint: WfsEndpoint, featureTypeName: string) {
15
- super(url)
15
+ constructor(
16
+ url: string,
17
+ wfsEndpoint: WfsEndpoint,
18
+ featureTypeName: string,
19
+ cacheActive?: boolean
20
+ ) {
21
+ super(url, cacheActive)
16
22
  this.endpoint = wfsEndpoint
17
23
  this.featureTypeName = featureTypeName
18
24
  this.version = this.endpoint.getVersion()
@@ -90,11 +96,10 @@ export class WfsReader extends BaseReader {
90
96
  }
91
97
  }
92
98
 
93
- protected getData() {
94
- if (this.aggregations || this.groupedBy) {
95
- throw new Error(marker('wfs.aggregations.notsupported'))
99
+ public async getData(aggregation?, groupedBy?) {
100
+ if (aggregation || groupedBy) {
101
+ return { items: await this.getQueryData() }
96
102
  }
97
-
98
103
  const asJson = this.endpoint.supportsJson(this.featureTypeName)
99
104
  const attributes = this.selected ?? undefined
100
105
  let url = this.endpoint.getFeatureUrl(this.featureTypeName, {
@@ -117,18 +122,36 @@ export class WfsReader extends BaseReader {
117
122
  url = `${url}${finalUrl.search ? '&' : ''}SORTBY=${sorts}`
118
123
  }
119
124
 
120
- return fetchDataAsText(url).then((text) =>
125
+ return fetchDataAsText(url, this.cacheActive).then((text) =>
121
126
  asJson
122
127
  ? parseGeojson(text)
123
128
  : parseGml(text, this.featureTypeName, this.version)
124
129
  )
125
130
  }
126
131
 
132
+ public async getQueryData() {
133
+ const items = (await this.getData()).items
134
+ const jsonItems = getJsonDataItemsProxy(items)
135
+ const query = generateSqlQuery(
136
+ this.selected,
137
+ this.filter,
138
+ this.sort,
139
+ this.startIndex,
140
+ this.count,
141
+ this.groupedBy,
142
+ this.aggregations
143
+ )
144
+ const result = await import('alasql').then((module) =>
145
+ module.default(query, [jsonItems])
146
+ )
147
+ return result.map(jsonToGeojsonFeature)
148
+ }
149
+
127
150
  load() {
128
151
  // Nothing to load for Wfs
129
152
  }
130
153
 
131
154
  async read(): Promise<DataItem[]> {
132
- return (await this.getData()).items
155
+ return (await this.getData(this.aggregations, this.groupedBy)).items
133
156
  }
134
157
  }
@@ -51,39 +51,45 @@ export function fetchHeaders(url: string): Promise<DatasetHeaders> {
51
51
  })
52
52
  }
53
53
 
54
- export function fetchDataAsText(url: string): Promise<string> {
55
- return useCache(
56
- () =>
57
- sharedFetch(url)
58
- .catch((error) => {
59
- throw FetchError.corsOrNetwork(error.message)
60
- })
61
- .then(async (response) => {
62
- if (!response.ok) {
63
- throw FetchError.http(response.status, await response.text())
64
- }
65
- return response.text()
66
- }),
67
- url,
68
- 'asText'
69
- )
54
+ export function fetchDataAsText(
55
+ url: string,
56
+ cacheActive: boolean
57
+ ): Promise<string> {
58
+ const fetchFactory = () =>
59
+ sharedFetch(url)
60
+ .catch((error) => {
61
+ throw FetchError.corsOrNetwork(error.message)
62
+ })
63
+ .then(async (response) => {
64
+ if (!response.ok) {
65
+ const clonedResponse = response.clone()
66
+ throw FetchError.http(response.status, await clonedResponse.text())
67
+ }
68
+ const clonedResponse = response.clone()
69
+ return clonedResponse.text()
70
+ })
71
+
72
+ return cacheActive ? useCache(fetchFactory, url, 'asText') : fetchFactory()
70
73
  }
71
- export function fetchDataAsArrayBuffer(url: string): Promise<ArrayBuffer> {
72
- return useCache(
73
- () =>
74
- sharedFetch(url)
75
- .catch((error) => {
76
- throw FetchError.corsOrNetwork(error.message)
77
- })
78
- .then(async (response) => {
79
- if (!response.ok) {
80
- throw FetchError.http(response.status, await response.text())
81
- }
82
- // convert to a numeric array so that we can store the response in cache
83
- return Array.from(new Uint8Array(await response.arrayBuffer()))
84
- }),
85
- url,
86
- 'asArrayBuffer'
74
+ export function fetchDataAsArrayBuffer(
75
+ url: string,
76
+ cacheActive: boolean
77
+ ): Promise<ArrayBuffer> {
78
+ const fetchFactory = () =>
79
+ sharedFetch(url)
80
+ .catch((error) => {
81
+ throw FetchError.corsOrNetwork(error.message)
82
+ })
83
+ .then(async (response) => {
84
+ if (!response.ok) {
85
+ throw FetchError.http(response.status, await response.text())
86
+ }
87
+ // convert to a numeric array so that we can store the response in cache
88
+ return Array.from(new Uint8Array(await response.arrayBuffer()))
89
+ })
90
+
91
+ return (
92
+ cacheActive ? useCache(fetchFactory, url, 'asArrayBuffer') : fetchFactory()
87
93
  ).then((array) => {
88
94
  return new Uint8Array(array).buffer
89
95
  })