@talxis/base-controls 1.2605.1 → 1.2606.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.
Files changed (283) hide show
  1. package/dist/components/DatasetControl/EditColumns/OptionText/OptionText.js +1 -2
  2. package/dist/components/DatasetControl/EditColumns/OptionText/OptionText.js.map +1 -1
  3. package/dist/components/Grid/cells/cell/Cell.js +2 -6
  4. package/dist/components/Grid/cells/cell/Cell.js.map +1 -1
  5. package/dist/components/Grid/column-headers/column-header/ColumnHeader.js +1 -1
  6. package/dist/components/Grid/column-headers/column-header/ColumnHeader.js.map +1 -1
  7. package/dist/components/Grid/grid/ag-grid/AgGridModel.js +1 -1
  8. package/dist/components/Grid/grid/ag-grid/AgGridModel.js.map +1 -1
  9. package/dist/components/Lookup/Lookup.js +4 -1
  10. package/dist/components/Lookup/Lookup.js.map +1 -1
  11. package/dist/components/Lookup/components/TargetSelector.js +1 -1
  12. package/dist/components/Lookup/components/TargetSelector.js.map +1 -1
  13. package/dist/components/Lookup/hooks/useLookup.d.ts +8 -0
  14. package/dist/components/Lookup/translations.d.ts +8 -0
  15. package/dist/components/Lookup/translations.js +8 -0
  16. package/dist/components/Lookup/translations.js.map +1 -1
  17. package/dist/components/TaskGrid/TaskGrid.js +5 -6
  18. package/dist/components/TaskGrid/TaskGrid.js.map +1 -1
  19. package/dist/components/TaskGrid/TaskGridDatasetControl.d.ts +18 -5
  20. package/dist/components/TaskGrid/TaskGridDatasetControl.js +63 -30
  21. package/dist/components/TaskGrid/TaskGridDatasetControl.js.map +1 -1
  22. package/dist/components/TaskGrid/TaskGridDatasetControlFactory.d.ts +3 -2
  23. package/dist/components/TaskGrid/TaskGridDatasetControlFactory.js +10 -5
  24. package/dist/components/TaskGrid/TaskGridDatasetControlFactory.js.map +1 -1
  25. package/dist/components/TaskGrid/components/grid/cell-renderers/add-task-button/AddTaskButton.js +3 -8
  26. package/dist/components/TaskGrid/components/grid/cell-renderers/add-task-button/AddTaskButton.js.map +1 -1
  27. package/dist/components/TaskGrid/components/grid/cell-renderers/lookup-many/LookupManyCellRenderer.d.ts +7 -0
  28. package/dist/components/TaskGrid/components/grid/cell-renderers/lookup-many/LookupManyCellRenderer.js +102 -0
  29. package/dist/components/TaskGrid/components/grid/cell-renderers/lookup-many/LookupManyCellRenderer.js.map +1 -0
  30. package/dist/components/TaskGrid/components/grid/cell-renderers/lookup-many/index.d.ts +1 -0
  31. package/dist/components/TaskGrid/components/grid/cell-renderers/lookup-many/index.js +2 -0
  32. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/PercentComplete.d.ts +1 -0
  33. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/PercentComplete.js +4 -5
  34. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/PercentComplete.js.map +1 -1
  35. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/index.js +1 -1
  36. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/styles.d.ts +0 -6
  37. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/styles.js +0 -6
  38. package/dist/components/TaskGrid/components/grid/cell-renderers/percent-complete/styles.js.map +1 -1
  39. package/dist/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.d.ts +2 -7
  40. package/dist/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.js +47 -16
  41. package/dist/components/TaskGrid/components/grid/grid-customizer/GridCustomizer.js.map +1 -1
  42. package/dist/components/TaskGrid/components/grid/grid-drag-handler/GridDragHandler.js.map +1 -1
  43. package/dist/components/TaskGrid/components/grid/group-cell/styles.d.ts +3 -0
  44. package/dist/components/TaskGrid/components/grid/group-cell/styles.js +3 -0
  45. package/dist/components/TaskGrid/components/grid/group-cell/styles.js.map +1 -1
  46. package/dist/components/TaskGrid/components/grid/lookup-many/LookupMany.d.ts +13 -0
  47. package/dist/components/TaskGrid/components/grid/lookup-many/LookupMany.js +84 -0
  48. package/dist/components/TaskGrid/components/grid/lookup-many/LookupMany.js.map +1 -0
  49. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/ColorfulLookupMany.d.ts +5 -0
  50. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/ColorfulLookupMany.js +12 -0
  51. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/ColorfulLookupMany.js.map +1 -0
  52. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/index.d.ts +2 -0
  53. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/index.js +13 -0
  54. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/index.js.map +1 -0
  55. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/multi-value-container/MultiValueContainer.d.ts +3 -0
  56. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/multi-value-container/MultiValueContainer.js +17 -0
  57. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/multi-value-container/MultiValueContainer.js.map +1 -0
  58. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/multi-value-container/index.d.ts +1 -0
  59. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/multi-value-container/index.js +2 -0
  60. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/Option.d.ts +3 -0
  61. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/Option.js +17 -0
  62. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/Option.js.map +1 -0
  63. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/index.d.ts +1 -0
  64. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/index.js +2 -0
  65. package/dist/components/TaskGrid/{data-providers/custom-columns-data-provider → components/grid/lookup-many/colorful-lookup-many/components/option}/index.js.map +1 -1
  66. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/styles.d.ts +14 -0
  67. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/styles.js +21 -0
  68. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/components/option/styles.js.map +1 -0
  69. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/context.d.ts +4 -0
  70. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/context.js +9 -0
  71. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/context.js.map +1 -0
  72. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/index.d.ts +1 -0
  73. package/dist/components/TaskGrid/components/grid/lookup-many/colorful-lookup-many/index.js +2 -0
  74. package/dist/components/TaskGrid/{data-providers/saved-query-data-provider → components/grid/lookup-many/colorful-lookup-many}/index.js.map +1 -1
  75. package/dist/components/TaskGrid/components/grid/lookup-many/components/components.d.ts +11 -0
  76. package/dist/components/TaskGrid/components/grid/lookup-many/components/components.js +17 -0
  77. package/dist/components/TaskGrid/components/grid/lookup-many/components/components.js.map +1 -0
  78. package/dist/components/TaskGrid/components/grid/lookup-many/components/index.d.ts +1 -0
  79. package/dist/components/TaskGrid/components/grid/lookup-many/components/index.js +2 -0
  80. package/dist/components/TaskGrid/components/grid/lookup-many/components/index.js.map +1 -0
  81. package/dist/components/TaskGrid/components/grid/lookup-many/components/menu/Menu.d.ts +3 -0
  82. package/dist/components/TaskGrid/components/grid/lookup-many/components/menu/Menu.js +10 -0
  83. package/dist/components/TaskGrid/components/grid/lookup-many/components/menu/Menu.js.map +1 -0
  84. package/dist/components/TaskGrid/components/grid/lookup-many/components/menu/index.d.ts +1 -0
  85. package/dist/components/TaskGrid/components/grid/lookup-many/components/menu/index.js +2 -0
  86. package/dist/components/TaskGrid/components/grid/lookup-many/components/menu/index.js.map +1 -0
  87. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/MultiValueContainer.d.ts +7 -0
  88. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/MultiValueContainer.js +16 -0
  89. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/MultiValueContainer.js.map +1 -0
  90. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/index.d.ts +1 -0
  91. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/index.js +2 -0
  92. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/index.js.map +1 -0
  93. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/styles.d.ts +18 -0
  94. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/styles.js +24 -0
  95. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-container/styles.js.map +1 -0
  96. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/MultiValueLabel.d.ts +3 -0
  97. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/MultiValueLabel.js +21 -0
  98. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/MultiValueLabel.js.map +1 -0
  99. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/index.d.ts +1 -0
  100. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/index.js +2 -0
  101. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/index.js.map +1 -0
  102. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/styles.d.ts +15 -0
  103. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/styles.js +22 -0
  104. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-label/styles.js.map +1 -0
  105. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-remove/MultiValueRemove.d.ts +3 -0
  106. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-remove/MultiValueRemove.js +18 -0
  107. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-remove/MultiValueRemove.js.map +1 -0
  108. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-remove/styles.d.ts +22 -0
  109. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-remove/styles.js +28 -0
  110. package/dist/components/TaskGrid/components/grid/lookup-many/components/multi-value-remove/styles.js.map +1 -0
  111. package/dist/components/TaskGrid/components/grid/lookup-many/context.d.ts +4 -0
  112. package/dist/components/TaskGrid/components/grid/lookup-many/context.js +9 -0
  113. package/dist/components/TaskGrid/components/grid/lookup-many/context.js.map +1 -0
  114. package/dist/components/TaskGrid/components/grid/lookup-many/index.d.ts +4 -0
  115. package/dist/components/TaskGrid/components/grid/lookup-many/index.js +5 -0
  116. package/dist/components/TaskGrid/components/grid/lookup-many/index.js.map +1 -0
  117. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/PeopleLookupMany.d.ts +5 -0
  118. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/PeopleLookupMany.js +12 -0
  119. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/PeopleLookupMany.js.map +1 -0
  120. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/components.d.ts +2 -0
  121. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/components.js +15 -0
  122. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/components.js.map +1 -0
  123. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/index.d.ts +1 -0
  124. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/index.js +2 -0
  125. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/index.js.map +1 -0
  126. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/MultiValueContainer.d.ts +3 -0
  127. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/MultiValueContainer.js +12 -0
  128. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/MultiValueContainer.js.map +1 -0
  129. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/index.d.ts +1 -0
  130. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/index.js +2 -0
  131. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/index.js.map +1 -0
  132. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/styles.d.ts +9 -0
  133. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/styles.js +18 -0
  134. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-container/styles.js.map +1 -0
  135. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/MultiValueLabel.d.ts +3 -0
  136. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/MultiValueLabel.js +17 -0
  137. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/MultiValueLabel.js.map +1 -0
  138. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/index.d.ts +1 -0
  139. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/index.js +2 -0
  140. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/index.js.map +1 -0
  141. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/styles.d.ts +5 -0
  142. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/styles.js +6 -0
  143. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/multi-value-label/styles.js.map +1 -0
  144. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/Option.d.ts +3 -0
  145. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/Option.js +16 -0
  146. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/Option.js.map +1 -0
  147. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/index.d.ts +1 -0
  148. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/index.js +2 -0
  149. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/index.js.map +1 -0
  150. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/styles.d.ts +10 -0
  151. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/styles.js +11 -0
  152. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/components/option/styles.js.map +1 -0
  153. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/context.d.ts +4 -0
  154. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/context.js +9 -0
  155. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/context.js.map +1 -0
  156. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/index.d.ts +1 -0
  157. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/index.js +2 -0
  158. package/dist/components/TaskGrid/components/grid/lookup-many/people-lookup-many/index.js.map +1 -0
  159. package/dist/components/TaskGrid/components/grid/multi-record-selector/MultiRecordSelector.d.ts +1 -0
  160. package/dist/components/TaskGrid/components/grid/multi-record-selector/MultiRecordSelector.js +27 -14
  161. package/dist/components/TaskGrid/components/grid/multi-record-selector/MultiRecordSelector.js.map +1 -1
  162. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-container/MultiValueContainer.d.ts +3 -0
  163. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-container/MultiValueContainer.js +13 -0
  164. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-container/MultiValueContainer.js.map +1 -0
  165. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-container/styles.d.ts +18 -0
  166. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-container/styles.js +24 -0
  167. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-container/styles.js.map +1 -0
  168. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-label/MultiValueLabel.d.ts +3 -0
  169. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-label/MultiValueLabel.js +20 -0
  170. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-label/MultiValueLabel.js.map +1 -0
  171. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-label/styles.d.ts +12 -0
  172. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-label/styles.js +19 -0
  173. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-label/styles.js.map +1 -0
  174. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-remove/MultiValueRemove.d.ts +3 -0
  175. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-remove/MultiValueRemove.js +16 -0
  176. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-remove/MultiValueRemove.js.map +1 -0
  177. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-remove/styles.d.ts +22 -0
  178. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-remove/styles.js +28 -0
  179. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/multi-value-remove/styles.js.map +1 -0
  180. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/option/Option.d.ts +3 -0
  181. package/dist/components/TaskGrid/components/grid/multi-record-selector/components/option/styles.d.ts +16 -0
  182. package/dist/components/TaskGrid/components/grid/multi-record-selector/styles.d.ts +3 -0
  183. package/dist/components/TaskGrid/components/grid/multi-record-selector/styles.js +15 -0
  184. package/dist/components/TaskGrid/components/grid/multi-record-selector/styles.js.map +1 -0
  185. package/dist/components/TaskGrid/components/header/Header.d.ts +1 -1
  186. package/dist/components/TaskGrid/components/header/Header.js +62 -47
  187. package/dist/components/TaskGrid/components/header/Header.js.map +1 -1
  188. package/dist/components/TaskGrid/components/header/edit-columns/EditColumns.js.map +1 -1
  189. package/dist/components/TaskGrid/components/header/view-switcher/create-view-dialog/CreateViewDialog.js.map +1 -1
  190. package/dist/components/TaskGrid/components/header/view-switcher/view-manager/ViewManager.js.map +1 -1
  191. package/dist/components/TaskGrid/context.d.ts +5 -4
  192. package/dist/components/TaskGrid/context.js.map +1 -1
  193. package/dist/components/TaskGrid/extensions/dataverse/DataverseCustomColumnsStrategy.d.ts +75 -0
  194. package/dist/components/TaskGrid/{data-providers/custom-columns-data-provider/TalxisCustomColumnsDataProviderStrategy.js → extensions/dataverse/DataverseCustomColumnsStrategy.js} +56 -21
  195. package/dist/components/TaskGrid/extensions/dataverse/DataverseCustomColumnsStrategy.js.map +1 -0
  196. package/dist/components/TaskGrid/extensions/dataverse/DataverseGridCustomizerStrategy.d.ts +20 -0
  197. package/dist/components/TaskGrid/extensions/dataverse/DataverseGridCustomizerStrategy.js +41 -0
  198. package/dist/components/TaskGrid/extensions/dataverse/DataverseGridCustomizerStrategy.js.map +1 -0
  199. package/dist/components/TaskGrid/extensions/dataverse/DataverseSavedQueryStrategy.d.ts +49 -0
  200. package/dist/components/TaskGrid/{data-providers/saved-query-data-provider/TalxisSavedQueryDataProvider.js → extensions/dataverse/DataverseSavedQueryStrategy.js} +41 -19
  201. package/dist/components/TaskGrid/extensions/dataverse/DataverseSavedQueryStrategy.js.map +1 -0
  202. package/dist/components/TaskGrid/extensions/dataverse/DataverseTaskGridDescriptor.d.ts +102 -0
  203. package/dist/components/TaskGrid/extensions/dataverse/DataverseTaskGridDescriptor.js +184 -0
  204. package/dist/components/TaskGrid/extensions/dataverse/DataverseTaskGridDescriptor.js.map +1 -0
  205. package/dist/components/TaskGrid/extensions/dataverse/DataverseTaskStrategy.d.ts +124 -0
  206. package/dist/components/TaskGrid/extensions/dataverse/DataverseTaskStrategy.js +498 -0
  207. package/dist/components/TaskGrid/extensions/dataverse/DataverseTaskStrategy.js.map +1 -0
  208. package/dist/components/TaskGrid/extensions/dataverse/index.d.ts +5 -0
  209. package/dist/components/TaskGrid/extensions/dataverse/index.js +6 -0
  210. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/LookupManyHandler.d.ts +65 -0
  211. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/LookupManyHandler.js +208 -0
  212. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/LookupManyHandler.js.map +1 -0
  213. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/cell-renderer/FetchXmlDataProviderFactory.d.ts +11 -0
  214. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/cell-renderer/FetchXmlDataProviderFactory.js +16 -0
  215. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/cell-renderer/FetchXmlDataProviderFactory.js.map +1 -0
  216. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/cell-renderer/FetchXmlLookupManyCellRenderer.d.ts +2 -0
  217. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/cell-renderer/FetchXmlLookupManyCellRenderer.js +35 -0
  218. package/dist/components/TaskGrid/extensions/dataverse/lookup-many/cell-renderer/FetchXmlLookupManyCellRenderer.js.map +1 -0
  219. package/dist/components/TaskGrid/interfaces.d.ts +58 -26
  220. package/dist/components/TaskGrid/labels.d.ts +1 -15
  221. package/dist/components/TaskGrid/labels.js +2 -16
  222. package/dist/components/TaskGrid/labels.js.map +1 -1
  223. package/dist/components/TaskGrid/{data-providers/custom-columns-data-provider → providers/custom-columns}/CustomColumnsDataProvider.d.ts +11 -1
  224. package/dist/components/TaskGrid/{data-providers/custom-columns-data-provider → providers/custom-columns}/CustomColumnsDataProvider.js +3 -0
  225. package/dist/components/TaskGrid/providers/custom-columns/CustomColumnsDataProvider.js.map +1 -0
  226. package/dist/components/TaskGrid/providers/custom-columns/index.d.ts +1 -0
  227. package/dist/components/TaskGrid/providers/custom-columns/index.js +2 -0
  228. package/dist/components/TaskGrid/providers/custom-columns/index.js.map +1 -0
  229. package/dist/components/TaskGrid/providers/index.d.ts +3 -0
  230. package/dist/components/TaskGrid/providers/index.js +4 -0
  231. package/dist/components/TaskGrid/providers/index.js.map +1 -0
  232. package/dist/components/TaskGrid/{data-providers/saved-query-data-provider → providers/saved-query}/SavedQueryDataProvider.d.ts +14 -9
  233. package/dist/components/TaskGrid/{data-providers/saved-query-data-provider → providers/saved-query}/SavedQueryDataProvider.js +89 -69
  234. package/dist/components/TaskGrid/providers/saved-query/SavedQueryDataProvider.js.map +1 -0
  235. package/dist/components/TaskGrid/providers/saved-query/index.d.ts +1 -0
  236. package/dist/components/TaskGrid/providers/saved-query/index.js +2 -0
  237. package/dist/components/TaskGrid/providers/saved-query/index.js.map +1 -0
  238. package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/TaskDataProvider.d.ts +25 -39
  239. package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/TaskDataProvider.js +51 -34
  240. package/dist/components/TaskGrid/providers/task/TaskDataProvider.js.map +1 -0
  241. package/dist/components/TaskGrid/providers/task/index.js.map +1 -0
  242. package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/record-tree/RecordTree.d.ts +8 -0
  243. package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/record-tree/RecordTree.js +2 -0
  244. package/dist/components/TaskGrid/providers/task/record-tree/RecordTree.js.map +1 -0
  245. package/dist/components/TaskGrid/providers/task/record-tree/index.js.map +1 -0
  246. package/dist/components/TaskGrid/providers/task/record-tree/patchDataBuilderPrepare.js.map +1 -0
  247. package/dist/index.d.ts +234 -196
  248. package/dist/index.js +1 -0
  249. package/dist/index.js.map +1 -1
  250. package/dist/utils/index.d.ts +1 -0
  251. package/dist/utils/index.js +1 -0
  252. package/dist/utils/index.js.map +1 -1
  253. package/dist/utils/localization/LocalizationService.d.ts +15 -0
  254. package/dist/utils/localization/LocalizationService.js +17 -0
  255. package/dist/utils/localization/LocalizationService.js.map +1 -0
  256. package/dist/utils/localization/index.d.ts +1 -0
  257. package/dist/utils/localization/index.js +2 -0
  258. package/dist/utils/localization/index.js.map +1 -0
  259. package/package.json +5 -4
  260. package/dist/components/TaskGrid/data-providers/custom-columns-data-provider/CustomColumnsDataProvider.js.map +0 -1
  261. package/dist/components/TaskGrid/data-providers/custom-columns-data-provider/TalxisCustomColumnsDataProviderStrategy.d.ts +0 -33
  262. package/dist/components/TaskGrid/data-providers/custom-columns-data-provider/TalxisCustomColumnsDataProviderStrategy.js.map +0 -1
  263. package/dist/components/TaskGrid/data-providers/custom-columns-data-provider/index.d.ts +0 -2
  264. package/dist/components/TaskGrid/data-providers/custom-columns-data-provider/index.js +0 -3
  265. package/dist/components/TaskGrid/data-providers/index.d.ts +0 -3
  266. package/dist/components/TaskGrid/data-providers/index.js +0 -6
  267. package/dist/components/TaskGrid/data-providers/saved-query-data-provider/SavedQueryDataProvider.js.map +0 -1
  268. package/dist/components/TaskGrid/data-providers/saved-query-data-provider/TalxisSavedQueryDataProvider.d.ts +0 -21
  269. package/dist/components/TaskGrid/data-providers/saved-query-data-provider/TalxisSavedQueryDataProvider.js.map +0 -1
  270. package/dist/components/TaskGrid/data-providers/saved-query-data-provider/index.d.ts +0 -2
  271. package/dist/components/TaskGrid/data-providers/saved-query-data-provider/index.js +0 -3
  272. package/dist/components/TaskGrid/data-providers/task-data-provider/TaskDataProvider.js.map +0 -1
  273. package/dist/components/TaskGrid/data-providers/task-data-provider/record-tree/RecordTree.js.map +0 -1
  274. package/dist/components/TaskGrid/data-providers/task-data-provider/record-tree/patchDataBuilderPrepare.js.map +0 -1
  275. /package/dist/components/TaskGrid/{data-providers/task-data-provider → components/grid/cell-renderers/lookup-many}/index.js.map +0 -0
  276. /package/dist/components/TaskGrid/{data-providers/task-data-provider/record-tree → components/grid/lookup-many/colorful-lookup-many/components/multi-value-container}/index.js.map +0 -0
  277. /package/dist/components/TaskGrid/{data-providers → extensions/dataverse}/index.js.map +0 -0
  278. /package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/index.d.ts +0 -0
  279. /package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/index.js +0 -0
  280. /package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/record-tree/index.d.ts +0 -0
  281. /package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/record-tree/index.js +0 -0
  282. /package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/record-tree/patchDataBuilderPrepare.d.ts +0 -0
  283. /package/dist/components/TaskGrid/{data-providers/task-data-provider → providers/task}/record-tree/patchDataBuilderPrepare.js +0 -0
@@ -1,21 +1,48 @@
1
- import { Attribute, DatasetConstants, Sanitizer, DataTypes, FieldValue } from '@talxis/client-libraries';
1
+ import { DatasetConstants, Attribute, Sanitizer, DataTypes } from '@talxis/client-libraries';
2
2
  import { DynamicEntityDefinition } from '@talxis/client-metadata';
3
3
 
4
4
  const ATTRIBUTE_DEFINITION_ENTITY_NAME = 'talxis_attributedefinition';
5
5
  const ATTRIBUTE_VALUE_ENTITY_NAME = 'talxis_attributevalue';
6
6
  const CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME = 'talxis_task_talxis_attributevalue_regardingobjectid';
7
- class TalxisCustomColumnsStrategy {
7
+ /**
8
+ * Work-in-progress {@link ICustomColumnsStrategy} implementation for the Dataverse / Talxis platform.
9
+ *
10
+ * Dynamic (user-defined) columns are modelled as `talxis_attributedefinition` records.
11
+ * Column values are stored as `talxis_attributevalue` records linked to the task record.
12
+ *
13
+ * WARNING: This strategy is still WIP and should not yet be used in production.
14
+ *
15
+ * Pass an instance to the `onCreateCustomColumnsStrategy` hook of your descriptor to enable the
16
+ * custom-columns feature in the TaskGrid.
17
+ */
18
+ class DataverseCustomColumnsStrategy {
19
+ /** @param parameters — see {@link IDataverseCustomColumnsStrategyParameters}. */
8
20
  constructor(parameters) {
9
21
  this._attributes = [];
10
22
  this._attributeIdsMap = new Map();
11
23
  this._entityName = parameters.entityName;
12
24
  this._recordId = parameters.recordId;
13
25
  }
26
+ /** Fetches the latest `talxis_attributedefinition` records for the entity/record scope and returns them as `IColumn[]`. */
14
27
  async onRefresh() {
15
28
  const entityDefinition = await DynamicEntityDefinition.fetchForRecord(this._entityName, this._recordId);
16
29
  this._attributes = entityDefinition.Attributes;
17
30
  return this.onGetColumns();
18
31
  }
32
+ //get all attribute values based given the
33
+ async onGetRawRecords() {
34
+ return [];
35
+ }
36
+ async onGetRawRecord(recordId) {
37
+ throw new Error('Method not implemented.');
38
+ }
39
+ getAttributeDefinitionIdFromColumnName(columnName) {
40
+ return columnName.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];
41
+ }
42
+ getNavigationPropertyName() {
43
+ return CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME;
44
+ }
45
+ /** Returns the currently cached attribute definitions as `IColumn[]` without a network fetch. */
19
46
  onGetColumns() {
20
47
  return this._attributes.map(attr => {
21
48
  const dataType = Attribute.GetDataTypeFromMetadata({ ...attr, attributeDescriptor: attr });
@@ -29,12 +56,14 @@ class TalxisCustomColumnsStrategy {
29
56
  };
30
57
  });
31
58
  }
59
+ /** Deletes the `talxis_attributedefinition` record backing `columnName`, then refreshes the column list. Returns the deleted column name. */
32
60
  async onDeleteColumn(columnName) {
33
61
  const id = columnName.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];
34
62
  await window.Xrm.WebApi.deleteRecord(ATTRIBUTE_DEFINITION_ENTITY_NAME, id);
35
63
  await this.onRefresh();
36
64
  return columnName;
37
65
  }
66
+ /** Opens the `talxis_attributedefinition` entity record form in a side dialog. Returns the new column name (with the custom-column suffix) when the record is saved, or `null` when the dialog is dismissed. */
38
67
  async onCreateColumn() {
39
68
  const { savedEntityReference } = await window.Xrm.Navigation.navigateTo({
40
69
  entityName: ATTRIBUTE_DEFINITION_ENTITY_NAME,
@@ -55,6 +84,12 @@ class TalxisCustomColumnsStrategy {
55
84
  else
56
85
  return null;
57
86
  }
87
+ getExpand() {
88
+ return `${CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME}(
89
+ $select=talxis_serialized_value,talxis_text_value,talxis_int_value,talxis_decimal_value,_talxis_choice_value_value,talxis_bit_value,talxis_date_value,talxis_datetime_userlocal_value,talxis_datetime_tzi_value,_talxis_attributedefinitionid_value
90
+ )`;
91
+ }
92
+ /** Opens the existing `talxis_attributedefinition` record in a side dialog for editing, then refreshes columns. Returns `columnName` unchanged. */
58
93
  async onUpdateColumn(columnName) {
59
94
  const attributeDefinitionId = columnName.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];
60
95
  await window.Xrm.Navigation.navigateTo({
@@ -67,31 +102,26 @@ class TalxisCustomColumnsStrategy {
67
102
  await this.onRefresh();
68
103
  return columnName;
69
104
  }
70
- async saveValueToCustomColumn(record) {
71
- const dirtyField = record.getFields().find(field => field.isDirty());
72
- const column = dirtyField?.getColumn();
73
- if (!column?.name.endsWith(DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX)) {
74
- return {
75
- success: true,
76
- fields: [],
77
- recordId: record.getRecordId(),
78
- };
79
- }
105
+ /**
106
+ * Upserts the `talxis_attributevalue` record for the dirty custom-column field on `record`.
107
+ * Creates a new record when no value exists yet; updates the existing one otherwise.
108
+ * @returns A save-operation result indicating success or the encountered error.
109
+ */
110
+ async onSaveValue(regardingRecordId, column, value) {
80
111
  const attributeDefinitionId = column.name.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];
81
- const regardingObjectId = record.getRecordId();
82
- const attributeValueId = this._attributeIdsMap.get(`${regardingObjectId}_${attributeDefinitionId}`);
112
+ const attributeValueId = this._attributeIdsMap.get(`${regardingRecordId}_${attributeDefinitionId}`);
83
113
  const payload = {
84
- [this._getFieldNameForColumn(column)]: this._getValueForPayload(record.getValue(column.name), column),
85
- 'talxis_serialized_value': this._getSerializedValue(record.getValue(column.name)),
114
+ [this._getFieldNameForColumn(column)]: this._getValueForPayload(value, column),
115
+ 'talxis_serialized_value': this._getSerializedValue(value),
86
116
  };
87
117
  try {
88
118
  if (!attributeValueId) {
89
119
  const result = await window.Xrm.WebApi.createRecord(ATTRIBUTE_VALUE_ENTITY_NAME, {
90
120
  ...payload,
91
121
  'talxis_attributedefinitionid@odata.bind': `/talxis_attributedefinitions(${attributeDefinitionId})`,
92
- 'talxis_regardingobjectid_task@odata.bind': `/tasks(${regardingObjectId})`,
122
+ 'talxis_regardingobjectid_task@odata.bind': `/tasks(${regardingRecordId})`,
93
123
  });
94
- this._attributeIdsMap.set(`${regardingObjectId}_${attributeDefinitionId}`, result.id);
124
+ this._attributeIdsMap.set(`${regardingRecordId}_${attributeDefinitionId}`, result.id);
95
125
  return {
96
126
  success: true,
97
127
  recordId: result.id,
@@ -121,6 +151,11 @@ class TalxisCustomColumnsStrategy {
121
151
  };
122
152
  }
123
153
  }
154
+ /**
155
+ * Resolves the typed value for `column` from the embedded `talxis_attributevalue` collection inside `rawRecord`.
156
+ * Also caches the `talxis_attributevalueid` for subsequent upsert calls in {@link saveValueToCustomColumn}.
157
+ * @returns The typed column value, or `null` when no matching attribute value record is found.
158
+ */
124
159
  getValueFromRawRecord(recordId, rawRecord, column) {
125
160
  const attribute = this._getAttributeFromRawRecord(recordId, rawRecord, column);
126
161
  if (attribute == null) {
@@ -133,7 +168,7 @@ class TalxisCustomColumnsStrategy {
133
168
  const option = optionSet.find((option) => option.OptionId == attribute['_talxis_choice_value_value']);
134
169
  return option ? option.Value : null;
135
170
  }
136
- return new FieldValue(attribute[fieldName], column.dataType).getValue();
171
+ return attribute[fieldName];
137
172
  }
138
173
  _getAttributeFromRawRecord(recordId, rawRecord, column) {
139
174
  const attributes = rawRecord[CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME] ?? [];
@@ -223,5 +258,5 @@ class TalxisCustomColumnsStrategy {
223
258
  }
224
259
  }
225
260
 
226
- export { ATTRIBUTE_DEFINITION_ENTITY_NAME, ATTRIBUTE_VALUE_ENTITY_NAME, CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME, TalxisCustomColumnsStrategy };
227
- //# sourceMappingURL=TalxisCustomColumnsDataProviderStrategy.js.map
261
+ export { ATTRIBUTE_DEFINITION_ENTITY_NAME, ATTRIBUTE_VALUE_ENTITY_NAME, DataverseCustomColumnsStrategy };
262
+ //# sourceMappingURL=DataverseCustomColumnsStrategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataverseCustomColumnsStrategy.js","sources":["../../../../../src/components/TaskGrid/extensions/dataverse/DataverseCustomColumnsStrategy.ts"],"sourcesContent":["import { Attribute, DatasetConstants, DataType, DataTypes, FieldValue, IColumn, IEventEmitter, IRawRecord, IRecord, IRecordSaveOperationResult, Sanitizer } from \"@talxis/client-libraries\";\nimport { DynamicEntityDefinition } from \"@talxis/client-metadata\";\nimport { Attribute as IAttribute } from '@talxis/client-metadata/dist/interfaces/entity/IEntityDefinition';\nimport { ICustomColumnsStrategy } from \"../../providers/custom-columns/CustomColumnsDataProvider\";\n\nexport const ATTRIBUTE_DEFINITION_ENTITY_NAME = 'talxis_attributedefinition';\nexport const ATTRIBUTE_VALUE_ENTITY_NAME = 'talxis_attributevalue';\nconst CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME = 'talxis_task_talxis_attributevalue_regardingobjectid';\n\n/** Constructor parameters for {@link DataverseCustomColumnsStrategy}. */\ninterface IDataverseCustomColumnsStrategyParameters {\n /** Logical name of the entity for which dynamic attribute definitions are managed (e.g. `\"task\"`). */\n entityName: string;\n /** Optional record ID used to scope attribute definitions to a specific parent record. */\n recordId?: string;\n}\n\n/**\n * Extends {@link ICustomColumnsStrategy} with Dataverse-specific accessors needed to persist\n * custom column values through the `talxis_attributevalue` entity.\n */\nexport interface IDataverseCustomColumnsStrategy extends ICustomColumnsStrategy {\n getNavigationPropertyName: () => string;\n getAttributeDefinitionIdFromColumnName: (columnName: string) => string;\n /** Returns the `$expand` query parameter needed to fetch the related `talxis_attributevalue` records. */\n getExpand: () => string;\n /** Reads and returns the typed value for `column` from the raw attribute-value payload embedded in `rawRecord`. */\n getValueFromRawRecord: (recordId: string, rawRecord: IRawRecord, column: IColumn) => any;\n}\n\n/**\n * Work-in-progress {@link ICustomColumnsStrategy} implementation for the Dataverse / Talxis platform.\n *\n * Dynamic (user-defined) columns are modelled as `talxis_attributedefinition` records.\n * Column values are stored as `talxis_attributevalue` records linked to the task record.\n *\n * WARNING: This strategy is still WIP and should not yet be used in production.\n *\n * Pass an instance to the `onCreateCustomColumnsStrategy` hook of your descriptor to enable the\n * custom-columns feature in the TaskGrid.\n */\nexport class DataverseCustomColumnsStrategy implements IDataverseCustomColumnsStrategy {\n private _entityName: string;\n private _recordId?: string;\n private _attributes: IAttribute[] = [];\n private _attributeIdsMap: Map<string, string> = new Map();\n\n /** @param parameters — see {@link IDataverseCustomColumnsStrategyParameters}. */\n constructor(parameters: IDataverseCustomColumnsStrategyParameters) {\n this._entityName = parameters.entityName;\n this._recordId = parameters.recordId;\n }\n\n /** Fetches the latest `talxis_attributedefinition` records for the entity/record scope and returns them as `IColumn[]`. */\n public async onRefresh(): Promise<IColumn[]> {\n const entityDefinition = await DynamicEntityDefinition.fetchForRecord(this._entityName, this._recordId);\n this._attributes = entityDefinition.Attributes;\n return this.onGetColumns();\n }\n\n //get all attribute values based given the \n public async onGetRawRecords(): Promise<IRawRecord[]> {\n return [];\n }\n\n public async onGetRawRecord(recordId: string): Promise<IRawRecord> {\n throw new Error('Method not implemented.');\n }\n\n public getAttributeDefinitionIdFromColumnName(columnName: string): string {\n return columnName.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];\n }\n\n public getNavigationPropertyName(): string {\n return CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME;\n }\n\n /** Returns the currently cached attribute definitions as `IColumn[]` without a network fetch. */\n public onGetColumns(): IColumn[] {\n return this._attributes.map(attr => {\n const dataType = Attribute.GetDataTypeFromMetadata({ ...attr as any, attributeDescriptor: attr });\n return {\n name: `${attr.LogicalName}${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`,\n isVirtual: true,\n displayName: attr.DisplayName,\n dataType: dataType,\n visualSizeFactor: 200,\n metadata: this._getMetadataForDataType(dataType, attr) as any\n }\n })\n }\n\n /** Deletes the `talxis_attributedefinition` record backing `columnName`, then refreshes the column list. Returns the deleted column name. */\n public async onDeleteColumn(columnName: string): Promise<string | null> {\n const id = columnName.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];\n await window.Xrm.WebApi.deleteRecord(ATTRIBUTE_DEFINITION_ENTITY_NAME, id);\n await this.onRefresh();\n return columnName\n }\n\n /** Opens the `talxis_attributedefinition` entity record form in a side dialog. Returns the new column name (with the custom-column suffix) when the record is saved, or `null` when the dialog is dismissed. */\n public async onCreateColumn(): Promise<string | null> {\n const { savedEntityReference } = await window.Xrm.Navigation.navigateTo({\n entityName: ATTRIBUTE_DEFINITION_ENTITY_NAME,\n pageType: 'entityrecord',\n data: {\n 'talxis_entityname': this._entityName,\n 'talxis_recordid': this._recordId,\n }\n }, {\n target: 2,\n });\n if (savedEntityReference && savedEntityReference.length > 0) {\n const entityReference = savedEntityReference[0];\n const id = Sanitizer.Guid.removeGuidBrackets(entityReference.id);\n await this.onRefresh();\n return `${id}${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`;\n }\n else return null\n }\n\n public getExpand(): string {\n return `${CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME}(\n $select=talxis_serialized_value,talxis_text_value,talxis_int_value,talxis_decimal_value,_talxis_choice_value_value,talxis_bit_value,talxis_date_value,talxis_datetime_userlocal_value,talxis_datetime_tzi_value,_talxis_attributedefinitionid_value\n )`\n }\n\n /** Opens the existing `talxis_attributedefinition` record in a side dialog for editing, then refreshes columns. Returns `columnName` unchanged. */\n public async onUpdateColumn(columnName: string): Promise<string | null> {\n const attributeDefinitionId = columnName.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];\n await window.Xrm.Navigation.navigateTo({\n entityName: ATTRIBUTE_DEFINITION_ENTITY_NAME,\n pageType: 'entityrecord',\n entityId: attributeDefinitionId\n }, {\n target: 2,\n });\n await this.onRefresh();\n return columnName;\n }\n\n /**\n * Upserts the `talxis_attributevalue` record for the dirty custom-column field on `record`.\n * Creates a new record when no value exists yet; updates the existing one otherwise.\n * @returns A save-operation result indicating success or the encountered error.\n */\n public async onSaveValue(regardingRecordId: string, column: IColumn, value: any): Promise<IRecordSaveOperationResult> {\n const attributeDefinitionId = column.name.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];\n const attributeValueId = this._attributeIdsMap.get(`${regardingRecordId}_${attributeDefinitionId}`);\n const payload = {\n [this._getFieldNameForColumn(column)]: this._getValueForPayload(value, column),\n 'talxis_serialized_value': this._getSerializedValue(value),\n }\n\n try {\n\n if (!attributeValueId) {\n const result = await window.Xrm.WebApi.createRecord(ATTRIBUTE_VALUE_ENTITY_NAME, {\n ...payload,\n 'talxis_attributedefinitionid@odata.bind': `/talxis_attributedefinitions(${attributeDefinitionId})`,\n 'talxis_regardingobjectid_task@odata.bind': `/tasks(${regardingRecordId})`,\n });\n this._attributeIdsMap.set(`${regardingRecordId}_${attributeDefinitionId}`, result.id);\n return {\n success: true,\n recordId: result.id,\n fields: [column.name]\n }\n }\n\n else {\n await window.Xrm.WebApi.updateRecord(ATTRIBUTE_VALUE_ENTITY_NAME, attributeValueId, {\n ...payload\n });\n return {\n success: true,\n recordId: attributeValueId,\n fields: [column.name]\n }\n }\n }\n catch (err: any) {\n return {\n success: false,\n recordId: attributeValueId ?? '',\n fields: [column.name],\n errors: [{\n message: err.message,\n fieldName: column.name\n }]\n }\n }\n }\n\n /**\n * Resolves the typed value for `column` from the embedded `talxis_attributevalue` collection inside `rawRecord`.\n * Also caches the `talxis_attributevalueid` for subsequent upsert calls in {@link saveValueToCustomColumn}.\n * @returns The typed column value, or `null` when no matching attribute value record is found.\n */\n public getValueFromRawRecord(recordId: string, rawRecord: IRawRecord, column: IColumn) {\n const attribute = this._getAttributeFromRawRecord(recordId, rawRecord, column);\n if (attribute == null) {\n return null;\n }\n const fieldName = this._getFieldNameForColumn(column);\n\n if (column.dataType === DataTypes.OptionSet) {\n const metadata = column.metadata as any;\n const optionSet = metadata.OptionSet as any;\n const option = optionSet.find((option: any) => option.OptionId == attribute['_talxis_choice_value_value']);\n return option ? option.Value : null;\n }\n return attribute[fieldName];\n }\n\n private _getAttributeFromRawRecord(recordId: string, rawRecord: IRawRecord, column: IColumn) {\n const attributes: any[] = rawRecord[CUSTOM_COLUMNS_REFERENED_ENTITY_NAVIGATION_NAME] ?? [];\n if (attributes.length === 0) {\n return null;\n }\n const attributeDefinitionId = column.name.split(`${DatasetConstants.CUSTOM_COLUMN_NAME_SUFFIX}`)[0];\n const attribute = attributes.find(attr => attr['_talxis_attributedefinitionid_value'] === attributeDefinitionId);\n if (attribute) {\n this._attributeIdsMap.set(`${recordId}_${attributeDefinitionId}`, attribute['talxis_attributevalueid']);\n }\n return attribute;\n }\n\n private _getFieldNameForColumn(column: IColumn): string {\n switch (column.dataType) {\n case DataTypes.WholeNone:\n case DataTypes.WholeDuration:\n case DataTypes.WholeLanguage:\n case DataTypes.WholeTimeZone:\n return 'talxis_int_value';\n case DataTypes.Decimal:\n return 'talxis_decimal_value';\n case DataTypes.OptionSet:\n return 'talxis_choice_value@odata.bind';\n case DataTypes.TwoOptions:\n return 'talxis_bit_value';\n case DataTypes.DateAndTimeDateOnly:\n return 'talxis_date_value';\n case DataTypes.DateAndTimeDateAndTime: {\n return column.metadata?.Behavior === 3 ? 'talxis_datetime_tzi_value' : 'talxis_datetime_userlocal_value';\n }\n default:\n return 'talxis_text_value';\n }\n }\n\n private _getValueForPayload(value: any, column: IColumn): any {\n switch (column.dataType) {\n case 'TwoOptions': {\n return value == '1' ? true : false;\n }\n case 'OptionSet': {\n const attribute: IAttribute = column.metadata as any;\n const optionSet = attribute.OptionSet as any;\n const optionId = optionSet.find((option: any) => option.Value == value)?.OptionId;\n if (optionId) {\n return `/talxis_attributeoptions(${optionId})`;\n }\n return null;\n }\n case 'DateAndTime.DateAndTime':\n case 'DateAndTime.DateOnly': {\n return value;\n }\n default: {\n return value;\n }\n }\n }\n\n //this is wrong, but it has been developed as part of dynamic attributes like this\n private _getSerializedValue(value: any) {\n return JSON.stringify({\n raw: value,\n error: false,\n errorMessage: ''\n })\n }\n\n private _getMetadataForDataType(dataType: DataType, attr: IAttribute) {\n switch (dataType) {\n case DataTypes.OptionSet:\n case DataTypes.TwoOptions: {\n return {\n ...attr,\n OptionSet: attr.OptionSet?.Options.map(option => {\n return {\n Label: option.Label,\n Value: option.Value,\n Color: option.Color,\n OptionId: option.talxis_OptionId\n }\n })\n }\n }\n default: {\n return attr;\n }\n }\n }\n}"],"names":[],"mappings":";;;AAKO,MAAM,gCAAgC,GAAG,6BAA6B;AACtE,MAAM,2BAA2B,GAAG,wBAAwB;AACnE,MAAM,+CAA+C,GAAG,qDAAqD,CAAC;AAuB9G;;;;;;;;;;AAUG;MACU,8BAA8B,CAAA;;AAOvC,IAAA,WAAA,CAAY,UAAqD,EAAA;QAJzD,IAAW,CAAA,WAAA,GAAiB,EAAE,CAAC;AAC/B,QAAA,IAAA,CAAA,gBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;AAItD,QAAA,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AACzC,QAAA,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;KACxC;;AAGM,IAAA,MAAM,SAAS,GAAA;AAClB,QAAA,MAAM,gBAAgB,GAAG,MAAM,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;AACxG,QAAA,IAAI,CAAC,WAAW,GAAG,gBAAgB,CAAC,UAAU,CAAC;AAC/C,QAAA,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;KAC9B;;AAGM,IAAA,MAAM,eAAe,GAAA;AACxB,QAAA,OAAO,EAAE,CAAC;KACb;I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J,SAAA;KACJ;;AAGO,IAAA,mBAAmB,CAAC,KAAU,EAAA;QAClC,OAAO,IAAI,CAAC,SAAS,CAAC;AAClB,YAAA,GAAG,EAAE,KAAK;AACV,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA,CAAC,CAAA;KACL;IAEO,uBAAuB,CAAC,QAAkB,EAAE,IAAgB,EAAA;AAChE,QAAA,QAAQ,QAAQ;YACZ,KAAK,SAAS,CAAC,SAAS,CAAC;AACzB,YAAA,KAAK,SAAS,CAAC,UAAU,EAAE;gBACvB,OAAO;AACH,oBAAA,GAAG,IAAI;oBACP,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAG;wBAC5C,OAAO;4BACH,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,QAAQ,EAAE,MAAM,CAAC,eAAe;yBACnC,CAAA;AACL,qBAAC,CAAC;iBACL,CAAA;AACJ,aAAA;AACD,YAAA,SAAS;AACL,gBAAA,OAAO,IAAI,CAAC;AACf,aAAA;AACJ,SAAA;KACJ;AACJ;;;;"}
@@ -0,0 +1,20 @@
1
+ import { ColDef, IGridCustomizer, IGridCustomizerStrategy } from "../../components/grid";
2
+ /**
3
+ * Ready-to-use {@link IGridCustomizerStrategy} for the Dataverse / Talxis platform.
4
+ *
5
+ * Automatically applies custom cell renderers to lookup-many columns (columns whose
6
+ * `metadata.LookupMany` is set). Returned by {@link DataverseTaskGridDescriptor} by default.
7
+ *
8
+ * Extend or replace this class via `onCreateGridCustomizerStrategy` on your descriptor when
9
+ * you need additional AG Grid column, editor, or row-class customizations.
10
+ */
11
+ export declare class DataverseGridCustomizerStrategy implements IGridCustomizerStrategy {
12
+ private _customizer;
13
+ private _provider?;
14
+ private _gridApi;
15
+ /** Stores references to the customizer, task data provider, and grid API. Called once by the internal `GridCustomizer` after the AG Grid instance is ready. */
16
+ onInitialize(customizer: IGridCustomizer): void;
17
+ /** Injects the lookup-many {@link CellRenderer} and sets `autoHeight`/non-editable flags for any column whose `metadata.LookupMany` is set. */
18
+ onGetColumnDefinitions(colDefs: ColDef[]): ColDef[];
19
+ private _getProvider;
20
+ }
@@ -0,0 +1,41 @@
1
+ import { FetchXmlLookupManyCellRenderer } from './lookup-many/cell-renderer/FetchXmlLookupManyCellRenderer.js';
2
+
3
+ /**
4
+ * Ready-to-use {@link IGridCustomizerStrategy} for the Dataverse / Talxis platform.
5
+ *
6
+ * Automatically applies custom cell renderers to lookup-many columns (columns whose
7
+ * `metadata.LookupMany` is set). Returned by {@link DataverseTaskGridDescriptor} by default.
8
+ *
9
+ * Extend or replace this class via `onCreateGridCustomizerStrategy` on your descriptor when
10
+ * you need additional AG Grid column, editor, or row-class customizations.
11
+ */
12
+ class DataverseGridCustomizerStrategy {
13
+ /** Stores references to the customizer, task data provider, and grid API. Called once by the internal `GridCustomizer` after the AG Grid instance is ready. */
14
+ onInitialize(customizer) {
15
+ this._customizer = customizer;
16
+ this._provider = customizer.getTaskDataProvider();
17
+ this._gridApi = customizer.getGridApi();
18
+ }
19
+ /** Injects the lookup-many {@link CellRenderer} and sets `autoHeight`/non-editable flags for any column whose `metadata.LookupMany` is set. */
20
+ onGetColumnDefinitions(colDefs) {
21
+ for (const colDef of colDefs) {
22
+ const column = this._getProvider().getColumnsMap()[colDef.field];
23
+ if (column?.metadata?.LookupMany) {
24
+ colDef.cellRenderer = FetchXmlLookupManyCellRenderer;
25
+ colDef.autoHeight = true;
26
+ colDef.editable = false;
27
+ colDef.suppressKeyboardEvent = () => true;
28
+ }
29
+ }
30
+ return colDefs;
31
+ }
32
+ _getProvider() {
33
+ if (!this._provider) {
34
+ throw new Error('TaskDataProvider is not available in GridCustomizerStrategy. Have you called onInitialize?');
35
+ }
36
+ return this._provider;
37
+ }
38
+ }
39
+
40
+ export { DataverseGridCustomizerStrategy };
41
+ //# sourceMappingURL=DataverseGridCustomizerStrategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataverseGridCustomizerStrategy.js","sources":["../../../../../src/components/TaskGrid/extensions/dataverse/DataverseGridCustomizerStrategy.ts"],"sourcesContent":["import { ColDef, GridApi, IGridCustomizer, IGridCustomizerStrategy } from \"../../components/grid\";\nimport { ITaskDataProvider } from \"../../providers\";\nimport { FetchXmlLookupManyCellRenderer } from \"./lookup-many/cell-renderer/FetchXmlLookupManyCellRenderer\";\n\n/**\n * Ready-to-use {@link IGridCustomizerStrategy} for the Dataverse / Talxis platform.\n *\n * Automatically applies custom cell renderers to lookup-many columns (columns whose\n * `metadata.LookupMany` is set). Returned by {@link DataverseTaskGridDescriptor} by default.\n *\n * Extend or replace this class via `onCreateGridCustomizerStrategy` on your descriptor when\n * you need additional AG Grid column, editor, or row-class customizations.\n */\nexport class DataverseGridCustomizerStrategy implements IGridCustomizerStrategy {\n private _customizer!: IGridCustomizer;\n private _provider?: ITaskDataProvider;\n private _gridApi!: GridApi;\n\n /** Stores references to the customizer, task data provider, and grid API. Called once by the internal `GridCustomizer` after the AG Grid instance is ready. */\n public onInitialize(customizer: IGridCustomizer): void {\n this._customizer = customizer;\n this._provider = customizer.getTaskDataProvider();\n this._gridApi = customizer.getGridApi();\n }\n\n /** Injects the lookup-many {@link CellRenderer} and sets `autoHeight`/non-editable flags for any column whose `metadata.LookupMany` is set. */\n public onGetColumnDefinitions(colDefs: ColDef[]): ColDef[] {\n for (const colDef of colDefs) {\n const column = this._getProvider().getColumnsMap()[colDef.field!];\n if (column?.metadata?.LookupMany) {\n colDef.cellRenderer = FetchXmlLookupManyCellRenderer;\n colDef.autoHeight = true;\n colDef.editable = false;\n colDef.suppressKeyboardEvent = () => true;\n }\n }\n return colDefs;\n }\n\n private _getProvider(): ITaskDataProvider {\n if (!this._provider) {\n throw new Error('TaskDataProvider is not available in GridCustomizerStrategy. Have you called onInitialize?');\n }\n return this._provider;\n }\n\n}"],"names":[],"mappings":";;AAIA;;;;;;;;AAQG;MACU,+BAA+B,CAAA;;AAMjC,IAAA,YAAY,CAAC,UAA2B,EAAA;AAC3C,QAAA,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;AAC9B,QAAA,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,mBAAmB,EAAE,CAAC;AAClD,QAAA,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;KAC3C;;AAGM,IAAA,sBAAsB,CAAC,OAAiB,EAAA;AAC3C,QAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AAC1B,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,KAAM,CAAC,CAAC;AAClE,YAAA,IAAI,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE;AAC9B,gBAAA,MAAM,CAAC,YAAY,GAAG,8BAA8B,CAAC;AACrD,gBAAA,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;AACzB,gBAAA,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;AACxB,gBAAA,MAAM,CAAC,qBAAqB,GAAG,MAAM,IAAI,CAAC;AAC7C,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,OAAO,CAAC;KAClB;IAEO,YAAY,GAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACjB,YAAA,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;AACjH,SAAA;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;KACzB;AAEJ;;;;"}
@@ -0,0 +1,49 @@
1
+ import { FetchXmlDataProvider } from "@talxis/client-libraries";
2
+ import { IDeletedUserQueriesResult, ISavedQuery, ISavedQueryStrategy } from "../../providers/saved-query/SavedQueryDataProvider";
3
+ /**
4
+ * Parameters for constructing a {@link DataverseSavedQueryStrategy}.
5
+ */
6
+ interface IDataverseSavedQueryStrategyParameters {
7
+ /** Callback that retrieves the system (shared) saved queries. */
8
+ onGetSystemQueries: () => Promise<ISavedQuery[]>;
9
+ /** Logical name of the entity whose queries are managed (used as `talxis_returnedtypecode`). */
10
+ entityName: string;
11
+ /** Optional record ID used to scope queries to a specific record (`talxis_recordid`). When omitted, only queries with a null `talxis_recordid` are returned. */
12
+ recordId?: string;
13
+ /** Optional owner ID used to filter queries by owner (`ownerid`). */
14
+ ownerId?: string;
15
+ }
16
+ /**
17
+ * Ready-to-use {@link ISavedQueryStrategy} implementation for the Dataverse / Talxis platform.
18
+ *
19
+ * Persists user-defined saved views as `talxis_userquery` records, optionally scoped to a
20
+ * specific parent record (`talxis_recordid`) and/or owner (`ownerid`).
21
+ * System queries are supplied via the `onGetSystemQueries` callback and are never persisted.
22
+ *
23
+ * Also acts as an `IDataProvider` (extends `FetchXmlDataProvider`) so it can be passed directly
24
+ * to the user-query creation dialog.
25
+ */
26
+ export declare class DataverseSavedQueryStrategy extends FetchXmlDataProvider implements ISavedQueryStrategy {
27
+ private _recordId?;
28
+ private _parentEntityName;
29
+ private _onGetSystemQueries;
30
+ constructor(parameters: IDataverseSavedQueryStrategyParameters);
31
+ /** Fetches all `talxis_userquery` records matching the configured entity/record/owner scope and maps them to {@link ISavedQuery}. */
32
+ onGetUserQueries(): Promise<ISavedQuery[]>;
33
+ /** Delegates to the `onGetSystemQueries` callback supplied at construction time. */
34
+ onGetSystemQueries(): Promise<ISavedQuery[]>;
35
+ /** Deletes the specified `talxis_userquery` records and returns a per-query success/failure result. */
36
+ onDeleteUserQueries(queryIds: string[]): Promise<IDeletedUserQueriesResult>;
37
+ /** Serialises the current query metadata (columns, filters, sorting, …) to `talxis_layoutjson` and saves the record. Returns the query ID on success. */
38
+ onUpdateUserQuery(currentQuery: ISavedQuery): Promise<string | null>;
39
+ /**
40
+ * Creates a new `talxis_userquery` record that captures the current grid state (columns, filters, sorting, …).
41
+ * A deterministic ID is generated with a `00001111` prefix so it sorts predictably alongside Dataverse-native GUIDs.
42
+ * @returns The new record ID on success.
43
+ */
44
+ onCreateUserQuery(newQuery: {
45
+ name: string;
46
+ description?: string;
47
+ }, currentQuery: ISavedQuery): Promise<string | null>;
48
+ }
49
+ export {};
@@ -1,4 +1,5 @@
1
- import { FetchXmlDataProvider, FetchXmlBuilder } from '@talxis/client-libraries';
1
+ import { FetchXmlDataProvider } from '@talxis/client-libraries';
2
+ import { Liquid } from 'liquidjs';
2
3
  import { ErrorHelper } from '../../../../utils/error-handling/ErrorHelper.js';
3
4
 
4
5
  const FETCH_XML = `
@@ -8,31 +9,44 @@ const FETCH_XML = `
8
9
  <attribute name="talxis_name" />
9
10
  <attribute name="talxis_description" />
10
11
  <attribute name="talxis_layoutjson" />
12
+ <filter type="and">
13
+ <condition attribute="talxis_returnedtypecode" operator="eq" value="{{ entityName }}" />
14
+ {% if ownerId %}
15
+ <condition attribute="ownerid" operator="eq" value="{{ ownerId }}" />
16
+ {% endif %}
17
+ {% if recordId %}
18
+ <condition attribute="talxis_recordid" operator="eq" value="{{ recordId }}" />
19
+ {% else %}
20
+ <condition attribute="talxis_recordid" operator="null" />
21
+ {% endif %}
22
+ </filter>
11
23
  <order attribute="talxis_name" />
12
24
  </entity>
13
25
  </fetch>
14
26
  `;
15
- const _getFetchXml = (recordId, ownerId) => {
16
- const fetch = FetchXmlBuilder.fetch.fromXml(FETCH_XML);
17
- if (recordId || ownerId) {
18
- const filter = new FetchXmlBuilder.filter("and");
19
- if (recordId) {
20
- filter.addCondition(new FetchXmlBuilder.condition("talxis_recordid", FetchXmlBuilder.Operator.Equal, [new FetchXmlBuilder.value(recordId)]));
21
- }
22
- if (ownerId) {
23
- filter.addCondition(new FetchXmlBuilder.condition("ownerid", FetchXmlBuilder.Operator.Equal, [new FetchXmlBuilder.value(ownerId)]));
24
- }
25
- fetch.entity.addFilter(filter);
26
- }
27
- return fetch.toXml();
27
+ const LIQUID = new Liquid();
28
+ const _getFetchXml = (entityName, recordId, ownerId) => {
29
+ return LIQUID.parseAndRenderSync(FETCH_XML, { entityName, recordId, ownerId });
28
30
  };
29
- class TalxisSavedQueryStrategy extends FetchXmlDataProvider {
31
+ /**
32
+ * Ready-to-use {@link ISavedQueryStrategy} implementation for the Dataverse / Talxis platform.
33
+ *
34
+ * Persists user-defined saved views as `talxis_userquery` records, optionally scoped to a
35
+ * specific parent record (`talxis_recordid`) and/or owner (`ownerid`).
36
+ * System queries are supplied via the `onGetSystemQueries` callback and are never persisted.
37
+ *
38
+ * Also acts as an `IDataProvider` (extends `FetchXmlDataProvider`) so it can be passed directly
39
+ * to the user-query creation dialog.
40
+ */
41
+ class DataverseSavedQueryStrategy extends FetchXmlDataProvider {
30
42
  constructor(parameters) {
31
- const fetchXml = _getFetchXml(parameters.recordId, parameters.ownerId);
43
+ const fetchXml = _getFetchXml(parameters.entityName, parameters.recordId, parameters.ownerId);
32
44
  super({ fetchXml });
45
+ this._parentEntityName = parameters.entityName;
33
46
  this._recordId = parameters.recordId;
34
47
  this._onGetSystemQueries = parameters.onGetSystemQueries;
35
48
  }
49
+ /** Fetches all `talxis_userquery` records matching the configured entity/record/owner scope and maps them to {@link ISavedQuery}. */
36
50
  async onGetUserQueries() {
37
51
  const result = await this.refresh();
38
52
  return result.map(r => {
@@ -44,9 +58,11 @@ class TalxisSavedQueryStrategy extends FetchXmlDataProvider {
44
58
  };
45
59
  });
46
60
  }
61
+ /** Delegates to the `onGetSystemQueries` callback supplied at construction time. */
47
62
  async onGetSystemQueries() {
48
63
  return this._onGetSystemQueries();
49
64
  }
65
+ /** Deletes the specified `talxis_userquery` records and returns a per-query success/failure result. */
50
66
  async onDeleteUserQueries(queryIds) {
51
67
  const result = await this.deleteRecords(queryIds);
52
68
  if (result.success) {
@@ -63,6 +79,7 @@ class TalxisSavedQueryStrategy extends FetchXmlDataProvider {
63
79
  };
64
80
  }
65
81
  }
82
+ /** Serialises the current query metadata (columns, filters, sorting, …) to `talxis_layoutjson` and saves the record. Returns the query ID on success. */
66
83
  async onUpdateUserQuery(currentQuery) {
67
84
  const record = this.getRecordsMap()[currentQuery.id];
68
85
  if (!record) {
@@ -76,6 +93,11 @@ class TalxisSavedQueryStrategy extends FetchXmlDataProvider {
76
93
  }
77
94
  return currentQuery.id;
78
95
  }
96
+ /**
97
+ * Creates a new `talxis_userquery` record that captures the current grid state (columns, filters, sorting, …).
98
+ * A deterministic ID is generated with a `00001111` prefix so it sorts predictably alongside Dataverse-native GUIDs.
99
+ * @returns The new record ID on success.
100
+ */
79
101
  async onCreateUserQuery(newQuery, currentQuery) {
80
102
  const userqueryid = `00001111${crypto.randomUUID().substring(8)}`;
81
103
  const { name, description } = newQuery;
@@ -85,7 +107,7 @@ class TalxisSavedQueryStrategy extends FetchXmlDataProvider {
85
107
  'talxis_layoutjson': JSON.stringify(queryMetadata),
86
108
  'talxis_name': name,
87
109
  'talxis_description': description,
88
- 'talxis_returnedtypecode': this.getEntityName(),
110
+ 'talxis_returnedtypecode': this._parentEntityName,
89
111
  'talxis_recordid': this._recordId ?? null,
90
112
  };
91
113
  const result = await window.Xrm.WebApi.createRecord('talxis_userquery', rawData);
@@ -93,5 +115,5 @@ class TalxisSavedQueryStrategy extends FetchXmlDataProvider {
93
115
  }
94
116
  }
95
117
 
96
- export { TalxisSavedQueryStrategy };
97
- //# sourceMappingURL=TalxisSavedQueryDataProvider.js.map
118
+ export { DataverseSavedQueryStrategy };
119
+ //# sourceMappingURL=DataverseSavedQueryStrategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataverseSavedQueryStrategy.js","sources":["../../../../../src/components/TaskGrid/extensions/dataverse/DataverseSavedQueryStrategy.ts"],"sourcesContent":["import { FetchXmlDataProvider } from \"@talxis/client-libraries\";\nimport { Liquid } from \"liquidjs\";\nimport { IDeletedUserQueriesResult, ISavedQuery, ISavedQueryStrategy } from \"../../providers/saved-query/SavedQueryDataProvider\";\nimport { ErrorHelper } from \"../../../../utils/error-handling\";\n\nconst FETCH_XML = `\n<fetch count=\"5000\" page=\"1\">\n <entity name=\"talxis_userquery\">\n <attribute name=\"talxis_userqueryid\" />\n <attribute name=\"talxis_name\" />\n <attribute name=\"talxis_description\" />\n <attribute name=\"talxis_layoutjson\" />\n <filter type=\"and\">\n <condition attribute=\"talxis_returnedtypecode\" operator=\"eq\" value=\"{{ entityName }}\" />\n {% if ownerId %}\n <condition attribute=\"ownerid\" operator=\"eq\" value=\"{{ ownerId }}\" />\n {% endif %}\n {% if recordId %}\n <condition attribute=\"talxis_recordid\" operator=\"eq\" value=\"{{ recordId }}\" />\n {% else %}\n <condition attribute=\"talxis_recordid\" operator=\"null\" />\n {% endif %}\n </filter>\n <order attribute=\"talxis_name\" />\n </entity>\n</fetch>\n`\n\nconst LIQUID = new Liquid();\n\nconst _getFetchXml = (entityName: string, recordId?: string, ownerId?: string) => {\n return LIQUID.parseAndRenderSync(FETCH_XML, { entityName, recordId, ownerId });\n}\n\n/**\n * Parameters for constructing a {@link DataverseSavedQueryStrategy}.\n */\ninterface IDataverseSavedQueryStrategyParameters {\n /** Callback that retrieves the system (shared) saved queries. */\n onGetSystemQueries: () => Promise<ISavedQuery[]>;\n /** Logical name of the entity whose queries are managed (used as `talxis_returnedtypecode`). */\n entityName: string;\n /** Optional record ID used to scope queries to a specific record (`talxis_recordid`). When omitted, only queries with a null `talxis_recordid` are returned. */\n recordId?: string;\n /** Optional owner ID used to filter queries by owner (`ownerid`). */\n ownerId?: string;\n}\n\n/**\n * Ready-to-use {@link ISavedQueryStrategy} implementation for the Dataverse / Talxis platform.\n *\n * Persists user-defined saved views as `talxis_userquery` records, optionally scoped to a\n * specific parent record (`talxis_recordid`) and/or owner (`ownerid`).\n * System queries are supplied via the `onGetSystemQueries` callback and are never persisted.\n *\n * Also acts as an `IDataProvider` (extends `FetchXmlDataProvider`) so it can be passed directly\n * to the user-query creation dialog.\n */\nexport class DataverseSavedQueryStrategy extends FetchXmlDataProvider implements ISavedQueryStrategy {\n private _recordId?: string;\n private _parentEntityName: string;\n private _onGetSystemQueries: () => Promise<ISavedQuery[]>;\n\n constructor(parameters: IDataverseSavedQueryStrategyParameters) {\n const fetchXml = _getFetchXml(parameters.entityName, parameters.recordId, parameters.ownerId);\n super({ fetchXml });\n this._parentEntityName = parameters.entityName;\n this._recordId = parameters.recordId;\n this._onGetSystemQueries = parameters.onGetSystemQueries;\n }\n\n /** Fetches all `talxis_userquery` records matching the configured entity/record/owner scope and maps them to {@link ISavedQuery}. */\n public async onGetUserQueries(): Promise<ISavedQuery[]> {\n const result = await this.refresh();\n return result.map(r => {\n return {\n id: r.getValue('talxis_userqueryid'),\n name: r.getValue('talxis_name'),\n description: r.getValue('talxis_description'),\n ...JSON.parse(r.getValue('talxis_layoutjson'))\n }\n });\n }\n\n /** Delegates to the `onGetSystemQueries` callback supplied at construction time. */\n public async onGetSystemQueries(): Promise<ISavedQuery[]> {\n return this._onGetSystemQueries();\n }\n\n /** Deletes the specified `talxis_userquery` records and returns a per-query success/failure result. */\n public async onDeleteUserQueries(queryIds: string[]): Promise<IDeletedUserQueriesResult> {\n const result = await this.deleteRecords(queryIds);\n if (result.success) {\n return {\n success: true,\n deletedQueryIds: queryIds\n }\n }\n else {\n return {\n success: false,\n deletedQueryIds: result.results.filter(r => r.success).map(r => r.recordId),\n errors: result.results.filter(r => !r.success).map(r => ({ queryId: r.recordId, error: r.errorMessage }))\n }\n }\n }\n\n /** Serialises the current query metadata (columns, filters, sorting, …) to `talxis_layoutjson` and saves the record. Returns the query ID on success. */\n public async onUpdateUserQuery(currentQuery: ISavedQuery): Promise<string | null> {\n const record = this.getRecordsMap()[currentQuery.id];\n if (!record) {\n throw new Error(`Query record with id ${currentQuery.id} not found`);\n }\n const { name, id, ...queryMetadata } = currentQuery;\n record.setValue('talxis_layoutjson', JSON.stringify(queryMetadata));\n const result = await record.save();\n if (!result.success) {\n throw new Error(`Failed to update query with id ${currentQuery.id}: ${ErrorHelper.getMessageFromError(result.errors?.map((e: any) => e.message).join('\\n'))}`);\n }\n return currentQuery.id;\n }\n\n /**\n * Creates a new `talxis_userquery` record that captures the current grid state (columns, filters, sorting, …).\n * A deterministic ID is generated with a `00001111` prefix so it sorts predictably alongside Dataverse-native GUIDs.\n * @returns The new record ID on success.\n */\n public async onCreateUserQuery(newQuery: { name: string; description?: string; }, currentQuery: ISavedQuery): Promise<string | null> {\n const userqueryid = `00001111${crypto.randomUUID().substring(8)}`;\n const { name, description } = newQuery;\n const { id, name: queryName, ...queryMetadata } = currentQuery;\n\n const rawData = {\n 'talxis_userqueryid': userqueryid,\n 'talxis_layoutjson': JSON.stringify(queryMetadata),\n 'talxis_name': name,\n 'talxis_description': description,\n 'talxis_returnedtypecode': this._parentEntityName,\n 'talxis_recordid': this._recordId ?? null,\n }\n const result = await window.Xrm.WebApi.createRecord('talxis_userquery', rawData);\n\n return result.id;\n }\n}"],"names":[],"mappings":";;;;AAKA,MAAM,SAAS,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqBjB,CAAA;AAED,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAE5B,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAE,QAAiB,EAAE,OAAgB,KAAI;AAC7E,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AACnF,CAAC,CAAA;AAgBD;;;;;;;;;AASG;AACG,MAAO,2BAA4B,SAAQ,oBAAoB,CAAA;AAKjE,IAAA,WAAA,CAAY,UAAkD,EAAA;AAC1D,QAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AAC9F,QAAA,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;AACpB,QAAA,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC;AAC/C,QAAA,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ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AG,QAAQ,CAAC;AACvC,QAAA,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,GAAG,YAAY,CAAC;AAE/D,QAAA,MAAM,OAAO,GAAG;AACZ,YAAA,oBAAoB,EAAE,WAAW;AACjC,YAAA,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;AAClD,YAAA,aAAa,EAAE,IAAI;AACnB,YAAA,oBAAoB,EAAE,WAAW;YACjC,yBAAyB,EAAE,IAAI,CAAC,iBAAiB;AACjD,YAAA,iBAAiB,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;SAC5C,CAAA;AACD,QAAA,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAEjF,OAAO,MAAM,CAAC,EAAE,CAAC;KACpB;AACJ;;;;"}
@@ -0,0 +1,102 @@
1
+ import { IDataProvider, ISingleRecord } from "@talxis/client-libraries";
2
+ import { ICustomColumnsStrategy, ISavedQuery, ISavedQueryStrategy, ITaskDataProviderStrategy } from "../../providers";
3
+ import { IFieldMapping as IFieldMappingBase, ITaskGridDescriptor, ITaskGridParameters, ITaskStrategyDeps } from "../../interfaces";
4
+ import { IGridCustomizerStrategy } from "../../components/grid";
5
+ /** Dataverse-specific field mapping. Extends the base with an optional project lookup column. */
6
+ export interface IFieldMapping extends Omit<IFieldMappingBase, 'stateCode'> {
7
+ /** Logical name of the lookup attribute that points to the parent project record. Required when `projectRecord` is set on the descriptor. */
8
+ projectId?: string;
9
+ }
10
+ /** Lightweight entity reference shape used when only logical name + id are available. */
11
+ export interface IEntityRecordReference {
12
+ entityName: string;
13
+ id: string;
14
+ }
15
+ /** Input accepted for source/project: either a fully hydrated record or an entity reference. */
16
+ export type RecordInput = IEntityRecordReference | ISingleRecord;
17
+ /** Constructor parameters for {@link DataverseTaskGridDescriptor}. */
18
+ export interface IDataverseTaskGridDescriptorParams {
19
+ /** FetchXML that drives the initial data load. May use Liquid template variables (e.g. `{{ projectId }}`). */
20
+ baseFetchXml: string;
21
+ /** Maps logical entity attribute names to the roles expected by TaskGrid (e.g. `statecode` → `stateCode`). */
22
+ fieldMapping: IFieldMapping;
23
+ /** System (non-deletable) views exposed in the view switcher. At least one is required. */
24
+ systemQueries: ISavedQuery[];
25
+ /** Optional source record. If provided, it's data will be propagated into liquid fetch XML templates. */
26
+ sourceRecord?: RecordInput;
27
+ projectRecord?: RecordInput;
28
+ height?: string;
29
+ /** Fine-grained feature flags forwarded to the grid. See {@link ITaskGridParameters}. */
30
+ gridParameters?: ITaskGridParameters;
31
+ /** When set, the hierarchy is rooted at this task ID instead of showing all top-level tasks. */
32
+ rootTaskId?: string;
33
+ /** ID of the currently logged-in user. Used to scope user queries to the current owner. */
34
+ userId?: string;
35
+ /** Form ID to open when editing a single existing task. */
36
+ editFormId?: string;
37
+ /** Form ID to open when creating a new task via the dialog flow (non-inline). */
38
+ createFormId?: string;
39
+ /** Form ID to open for bulk-editing multiple selected tasks. */
40
+ bulkEditFormId?: string;
41
+ /** Set to `true` to enable cascade delete when deleting tasks with children. Defaults to `false`. */
42
+ enableCascadeDelete?: boolean;
43
+ /** Set to `true` to allow deletion of tasks that have child tasks. When `false`, such tasks are excluded from deletion and an error is returned. Defaults to `false`. */
44
+ enableDeletingTasksWithChildren?: boolean;
45
+ }
46
+ /**
47
+ * Ready-to-use {@link ITaskGridDescriptor} implementation for the Dataverse / Talxis platform.
48
+ *
49
+ * Wires together all required strategies — task CRUD, saved queries, grid customization — from
50
+ * a single constructor parameter object. Pass an instance to `TaskGridDatasetControlFactory.createInstance`.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const descriptor = new DataverseTaskGridDescriptor({
55
+ * baseFetchXml: myFetchXml,
56
+ * fieldMapping: { parentId: 'talxis_parenttaskid', subject: 'subject', stackRank: 'talxis_stackrank' },
57
+ * systemQueries: [myDefaultView],
58
+ * });
59
+ * const control = await TaskGridDatasetControlFactory.createInstance({ taskGridDescriptor: descriptor, ... });
60
+ * ```
61
+ */
62
+ export declare class DataverseTaskGridDescriptor implements ITaskGridDescriptor {
63
+ private _fetchXml;
64
+ private _fieldMapping;
65
+ private _systemQueries;
66
+ private _taskEntityName;
67
+ private _editFormId?;
68
+ private _createFormId?;
69
+ private _bulkEditFormId?;
70
+ private _userId?;
71
+ private _rootTaskId?;
72
+ private _projectRecord?;
73
+ private _sourceRecord?;
74
+ private _params;
75
+ private _gridParameters?;
76
+ private _height?;
77
+ private _onInitialize;
78
+ /** @param params — see {@link IDataverseTaskGridDescriptorParams} for full documentation of each option. */
79
+ constructor(params: {
80
+ onInitialize: () => Promise<IDataverseTaskGridDescriptorParams>;
81
+ height?: string;
82
+ });
83
+ /** Resolves the project entity reference (fetches display name when not supplied). Called once by the factory before any strategy is created. */
84
+ onLoadDependencies(): Promise<void>;
85
+ /** Returns the field mapping with `stateCode` hard-coded to `"statecode"` (standard Dataverse attribute name). */
86
+ onGetFieldMapping(): IFieldMappingBase;
87
+ onGetHeight(): string | undefined;
88
+ /** Returns a {@link DataverseSavedQueryStrategy} when `enableUserQueries` is `true`, otherwise a read-only stub that exposes only the system queries. */
89
+ onCreateSavedQueryStrategy(): ISavedQueryStrategy;
90
+ onCreateCustomColumnsStrategy(): ICustomColumnsStrategy | undefined;
91
+ /** Returns a {@link DataverseTaskStrategy} configured with the descriptor's FetchXML, form IDs, and project reference. */
92
+ onCreateTaskStrategy(deps: ITaskStrategyDeps): ITaskDataProviderStrategy;
93
+ /** Returns a {@link DataverseSavedQueryStrategy} pre-configured as a data provider for the user-query creation/update dialog, with `talxis_name` and `talxis_description` columns. */
94
+ onCreateUserQueryDataProvider(): IDataProvider;
95
+ /** Returns the feature flags supplied at construction time, or an empty object (all features enabled) when omitted. */
96
+ onGetGridParameters(): ITaskGridParameters;
97
+ /** Returns a {@link DataverseGridCustomizerStrategy} that adds lookup-many cell renderers for columns whose name ends with the lookup-many suffix. */
98
+ onCreateGridCustomizerStrategy(): IGridCustomizerStrategy;
99
+ private _getProjectRecord;
100
+ private _getSourceRecord;
101
+ private _getTaskEntityNameFromFetchXml;
102
+ }