@wildo-ai/saas-frontend-lib 1.1.15 → 1.1.17

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 (241) hide show
  1. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -1
  2. package/dist/esm/components/compliance/EmbeddedSigningFrame.js +17 -6
  3. package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -1
  4. package/dist/esm/components/data-display/approval-seal.d.ts +7 -5
  5. package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -1
  6. package/dist/esm/components/data-display/approval-seal.js +10 -4
  7. package/dist/esm/components/data-display/approval-seal.js.map +1 -1
  8. package/dist/esm/components/data-display/signature-requests.d.ts +81 -0
  9. package/dist/esm/components/data-display/signature-requests.d.ts.map +1 -0
  10. package/dist/esm/components/data-display/signature-requests.js +123 -0
  11. package/dist/esm/components/data-display/signature-requests.js.map +1 -0
  12. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  13. package/dist/esm/components/flows-actors/approval.js +8 -15
  14. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  15. package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
  16. package/dist/esm/components/flows-actors/approval.labels.js +3 -0
  17. package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
  18. package/dist/esm/components/flows-actors/task-detail.d.ts +12 -1
  19. package/dist/esm/components/flows-actors/task-detail.d.ts.map +1 -1
  20. package/dist/esm/components/flows-actors/task-detail.js +2 -2
  21. package/dist/esm/components/flows-actors/task-detail.js.map +1 -1
  22. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  23. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +44 -29
  24. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  25. package/dist/esm/components/navigation/NavigationItemBadge.d.ts +16 -0
  26. package/dist/esm/components/navigation/NavigationItemBadge.d.ts.map +1 -1
  27. package/dist/esm/components/navigation/NavigationItemBadge.js +14 -2
  28. package/dist/esm/components/navigation/NavigationItemBadge.js.map +1 -1
  29. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +3 -3
  30. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +3 -3
  31. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
  32. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts +5 -13
  33. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts.map +1 -1
  34. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +30 -255
  35. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
  36. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts +22 -1
  37. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
  38. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +57 -26
  39. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
  40. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts +1 -1
  41. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
  42. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +35 -1
  43. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
  44. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts +1 -1
  45. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
  46. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +26 -4
  47. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
  48. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts +31 -0
  49. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts.map +1 -0
  50. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js +42 -0
  51. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js.map +1 -0
  52. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts +76 -0
  53. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts.map +1 -0
  54. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js +268 -0
  55. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js.map +1 -0
  56. package/dist/esm/components/navigation/command.d.ts +5 -0
  57. package/dist/esm/components/navigation/command.d.ts.map +1 -1
  58. package/dist/esm/components/navigation/command.js.map +1 -1
  59. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  60. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +5 -2
  61. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  62. package/dist/esm/components/resources/ResourceLayout_InsertedViews.d.ts.map +1 -1
  63. package/dist/esm/components/resources/ResourceLayout_InsertedViews.js +5 -1
  64. package/dist/esm/components/resources/ResourceLayout_InsertedViews.js.map +1 -1
  65. package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
  66. package/dist/esm/components/resources/ResourceLayout_List.js +4 -1
  67. package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
  68. package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts.map +1 -1
  69. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +4 -1
  70. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  71. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.d.ts.map +1 -1
  72. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js +4 -1
  73. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js.map +1 -1
  74. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
  75. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +4 -1
  76. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
  77. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.d.ts.map +1 -1
  78. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js +4 -1
  79. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js.map +1 -1
  80. package/dist/esm/components/resources/skeleton/Group.d.ts.map +1 -1
  81. package/dist/esm/components/resources/skeleton/Group.js +4 -1
  82. package/dist/esm/components/resources/skeleton/Group.js.map +1 -1
  83. package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
  84. package/dist/esm/components/sections/ContentSectionContainer.js +11 -7
  85. package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
  86. package/dist/esm/components/sections/content-section.d.ts +1 -3
  87. package/dist/esm/components/sections/content-section.d.ts.map +1 -1
  88. package/dist/esm/components/sections/content-section.js.map +1 -1
  89. package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts +79 -0
  90. package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts.map +1 -0
  91. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js +272 -0
  92. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js.map +1 -0
  93. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.d.ts +3 -0
  94. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.d.ts.map +1 -0
  95. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.js +66 -0
  96. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.js.map +1 -0
  97. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +12 -0
  98. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
  99. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +28 -6
  100. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
  101. package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
  102. package/dist/esm/components/settings/SettingsHub.js +6 -0
  103. package/dist/esm/components/settings/SettingsHub.js.map +1 -1
  104. package/dist/esm/components/typography/document-heading-level.d.ts +28 -0
  105. package/dist/esm/components/typography/document-heading-level.d.ts.map +1 -0
  106. package/dist/esm/components/typography/document-heading-level.js +63 -0
  107. package/dist/esm/components/typography/document-heading-level.js.map +1 -0
  108. package/dist/esm/components/views/chart-view/ChartView.d.ts.map +1 -1
  109. package/dist/esm/components/views/chart-view/ChartView.js +20 -16
  110. package/dist/esm/components/views/chart-view/ChartView.js.map +1 -1
  111. package/dist/esm/components/views/chart-view/ChartView.labels.d.ts.map +1 -1
  112. package/dist/esm/components/views/chart-view/ChartView.labels.js +7 -0
  113. package/dist/esm/components/views/chart-view/ChartView.labels.js.map +1 -1
  114. package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts +12 -3
  115. package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts.map +1 -1
  116. package/dist/esm/components/views/chart-view/option-builder/builder-utils.js +18 -11
  117. package/dist/esm/components/views/chart-view/option-builder/builder-utils.js.map +1 -1
  118. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.d.ts.map +1 -1
  119. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js +2 -1
  120. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js.map +1 -1
  121. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.d.ts.map +1 -1
  122. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js +7 -3
  123. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js.map +1 -1
  124. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.d.ts.map +1 -1
  125. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js +6 -2
  126. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js.map +1 -1
  127. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.d.ts.map +1 -1
  128. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js +7 -1
  129. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js.map +1 -1
  130. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.d.ts.map +1 -1
  131. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js +13 -9
  132. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js.map +1 -1
  133. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts.map +1 -1
  134. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js +2 -1
  135. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js.map +1 -1
  136. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.d.ts.map +1 -1
  137. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js +2 -1
  138. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js.map +1 -1
  139. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts.map +1 -1
  140. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js +4 -3
  141. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js.map +1 -1
  142. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.d.ts.map +1 -1
  143. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js +2 -1
  144. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js.map +1 -1
  145. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.d.ts.map +1 -1
  146. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js +5 -1
  147. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js.map +1 -1
  148. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.d.ts.map +1 -1
  149. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js +4 -3
  150. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js.map +1 -1
  151. package/dist/esm/components/views/composite-view/CompositeView.d.ts +6 -0
  152. package/dist/esm/components/views/composite-view/CompositeView.d.ts.map +1 -1
  153. package/dist/esm/components/views/composite-view/CompositeView.js +12 -2
  154. package/dist/esm/components/views/composite-view/CompositeView.js.map +1 -1
  155. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.d.ts +57 -0
  156. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.d.ts.map +1 -0
  157. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.js +136 -0
  158. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.js.map +1 -0
  159. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts +20 -0
  160. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts.map +1 -1
  161. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js +139 -22
  162. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js.map +1 -1
  163. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.labels.d.ts.map +1 -1
  164. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.labels.js +5 -0
  165. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.labels.js.map +1 -1
  166. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.d.ts +4 -0
  167. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.d.ts.map +1 -1
  168. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.js +19 -0
  169. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.js.map +1 -1
  170. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.d.ts +26 -0
  171. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.d.ts.map +1 -0
  172. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.js +3 -0
  173. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.js.map +1 -0
  174. package/dist/esm/core/app-shell/app-shell.schemas.d.ts +87 -16
  175. package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
  176. package/dist/esm/core/app-shell/app-shell.schemas.js +16 -0
  177. package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
  178. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
  179. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +1 -0
  180. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
  181. package/dist/esm/core/config/composite-view.schemas.d.ts +19 -0
  182. package/dist/esm/core/config/composite-view.schemas.d.ts.map +1 -1
  183. package/dist/esm/core/config/composite-view.schemas.js.map +1 -1
  184. package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
  185. package/dist/esm/core/config/engine-settings-destinations.js +23 -0
  186. package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
  187. package/dist/esm/core/config/settings-hub-presentation.frontend.utils.d.ts.map +1 -1
  188. package/dist/esm/core/config/settings-hub-presentation.frontend.utils.js +3 -0
  189. package/dist/esm/core/config/settings-hub-presentation.frontend.utils.js.map +1 -1
  190. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +12 -0
  191. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
  192. package/dist/esm/core/config/settings-hub.frontend.schemas.js +12 -0
  193. package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
  194. package/dist/esm/core/events/events.frontend.schemas.d.ts +16 -0
  195. package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
  196. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +10 -1
  197. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
  198. package/dist/esm/core/flows-actors/FlowsActorsContext.js +12 -3
  199. package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
  200. package/dist/esm/core/flows-actors/conversation-history.model.d.ts +19 -1
  201. package/dist/esm/core/flows-actors/conversation-history.model.d.ts.map +1 -1
  202. package/dist/esm/core/flows-actors/conversation-history.model.js +45 -4
  203. package/dist/esm/core/flows-actors/conversation-history.model.js.map +1 -1
  204. package/dist/esm/core/navigation/NavigationContentAreas.d.ts +0 -5
  205. package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
  206. package/dist/esm/core/navigation/NavigationContentAreas.js +27 -1
  207. package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
  208. package/dist/esm/core/navigation/navigation.schemas.d.ts +20 -0
  209. package/dist/esm/core/navigation/navigation.schemas.d.ts.map +1 -1
  210. package/dist/esm/core/navigation/navigation.schemas.js +4 -0
  211. package/dist/esm/core/navigation/navigation.schemas.js.map +1 -1
  212. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  213. package/dist/esm/core/navigation/useNavigationRouterSync.js +5 -1
  214. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  215. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +59 -5
  216. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  217. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +58 -1
  218. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  219. package/dist/esm/core/resources/hooks/useOperationEnabled.d.ts.map +1 -1
  220. package/dist/esm/core/resources/hooks/useOperationEnabled.js +41 -3
  221. package/dist/esm/core/resources/hooks/useOperationEnabled.js.map +1 -1
  222. package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
  223. package/dist/esm/core/resources/resources-repository.frontend.service.js +2 -0
  224. package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
  225. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  226. package/dist/esm/core/runtime/AppRouter.js +2 -1
  227. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  228. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts +6 -0
  229. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts.map +1 -1
  230. package/dist/esm/core/runtime/routes.frontend.definitions.js +7 -1
  231. package/dist/esm/core/runtime/routes.frontend.definitions.js.map +1 -1
  232. package/dist/esm/core/search/command-score.d.ts +33 -0
  233. package/dist/esm/core/search/command-score.d.ts.map +1 -0
  234. package/dist/esm/core/search/command-score.js +109 -0
  235. package/dist/esm/core/search/command-score.js.map +1 -0
  236. package/dist/esm/index.d.ts +5 -0
  237. package/dist/esm/index.d.ts.map +1 -1
  238. package/dist/esm/index.js +5 -0
  239. package/dist/esm/index.js.map +1 -1
  240. package/dist/tsconfig.build.tsbuildinfo +1 -1
  241. package/package.json +6 -6
@@ -16,11 +16,12 @@
16
16
  * });
17
17
  * ```
18
18
  */
19
- import { useMemo } from 'react';
19
+ import { useContext, useMemo } from 'react';
20
20
  import { useResourceRegistry } from '../../../core/resources/useResourceRegistry.js';
21
21
  import { useUserOrgs } from '../../../core/security/useUserOrgs.js';
22
22
  import { evaluateEnabledCondition, getOperationContextNeeds, } from '../../../core/resources/utils/operation-enabled-condition.frontend.utils.js';
23
- import { FeatureUnavailabilityBehavior, ResourcesConfig_OperationPathUtils, bulkOperationRunsInBackground } from '@wildo-ai/saas-models';
23
+ import { FeatureUnavailabilityBehavior, ResourcesConfig_OperationPathUtils, bulkOperationRunsInBackground, requiredRequestFieldWithheldForRow } from '@wildo-ai/saas-models';
24
+ import { ApplicationContext } from '../../../core/runtime/ApplicationContext.shared.js';
24
25
  import { useState, useEffect } from 'react';
25
26
  import { useFeatures } from '../../../core/features/useFeatures.js';
26
27
  import { resolveOperationFeatureAvailability, } from '../../../core/features/useOperationFeatureAvailability.js';
@@ -41,8 +42,26 @@ function requiresFeaturesBeforeSubmission(operation) {
41
42
  return false;
42
43
  return Array.isArray(required) || !required.appliesWhen;
43
44
  }
45
+ /**
46
+ * Whether the operation's request cannot be filled for this row (#4059): a field its request DTO requires is one its
47
+ * `requestFieldOffers` leave out for the row, so every submission would be refused. Such an operation is unavailable,
48
+ * exactly as if its `enabledCondition` had answered false, so a `WHEN_AVAILABLE` action is hidden rather than opening a
49
+ * form that can only fail. See `requiredRequestFieldWithheldForRow`, which owns the rule.
50
+ *
51
+ * Judged only for a single-row operation with its row loaded: a bulk operation has no one row to judge it against, and
52
+ * while the row loads nothing is known, so both stay available and the form (or the backend) decides.
53
+ */
54
+ function requestUnfillableForRow(operation, currentObject, appConfig) {
55
+ if (operation.isBulkOperation === true || !currentObject || typeof currentObject !== 'object')
56
+ return false;
57
+ return requiredRequestFieldWithheldForRow(operation, {
58
+ appConfig,
59
+ currentObject: currentObject,
60
+ }) !== undefined;
61
+ }
44
62
  function operationNeedsDeferredGate(operation) {
45
- return Boolean(operation.enabledCondition || operation.requiredFeatures);
63
+ // An operation with request-field offers may be unavailable for the row too (#4059), so it is held until judged.
64
+ return Boolean(operation.enabledCondition || operation.requiredFeatures || operation.requestFieldOffers);
46
65
  }
47
66
  /**
48
67
  * Derives a value-stable {@link ExecutionContext_InitiatorIds} from the
@@ -84,6 +103,9 @@ export function useOperationEnabled(params) {
84
103
  const { getResourcesRegistry, doOperation } = useResourceRegistry();
85
104
  const { user, permissions } = useUserOrgs();
86
105
  const appScope = useAppScopeSafe();
106
+ // The application's shared configuration, which a request-field offer decides from (#4059). Absent outside an
107
+ // application, where every offer narrows nothing.
108
+ const appConfig = useContext(ApplicationContext)?.appConfig;
87
109
  const billing = useBillingSafe();
88
110
  const resourcesRegistry = getResourcesRegistry();
89
111
  const { resolvedFeatures, resolvedFeaturesResponse, featureDefinitions, unavailabilityPolicy, isLoading: featuresLoading, } = useFeatures();
@@ -133,6 +155,12 @@ export function useOperationEnabled(params) {
133
155
  setIsLoading(false);
134
156
  return;
135
157
  }
158
+ // A request whose required field cannot be offered for this row can only be refused (#4059).
159
+ if (requestUnfillableForRow(operation, currentObject, appConfig)) {
160
+ setIsEnabled(false);
161
+ setIsLoading(false);
162
+ return;
163
+ }
136
164
  // Check if operation has enabledCondition
137
165
  if (!('enabledCondition' in operation) || !operation.enabledCondition) {
138
166
  // No enabledCondition means always enabled
@@ -182,6 +210,7 @@ export function useOperationEnabled(params) {
182
210
  contextNeeds.needsUserContext,
183
211
  doOperation,
184
212
  featureAvailability,
213
+ appConfig,
185
214
  ]);
186
215
  return {
187
216
  isEnabled,
@@ -253,6 +282,9 @@ export function useOperationsEnabled(operations, params = {}) {
253
282
  const { getResourcesRegistry, doOperation } = useResourceRegistry();
254
283
  const { user, permissions } = useUserOrgs();
255
284
  const appScope = useAppScopeSafe();
285
+ // The application's shared configuration, which a request-field offer decides from (#4059). Absent outside an
286
+ // application, where every offer narrows nothing.
287
+ const appConfig = useContext(ApplicationContext)?.appConfig;
256
288
  const billing = useBillingSafe();
257
289
  const resourcesRegistry = getResourcesRegistry();
258
290
  const { resolvedFeatures, resolvedFeaturesResponse, featureDefinitions, unavailabilityPolicy, isLoading: featuresLoading, } = useFeatures();
@@ -292,6 +324,11 @@ export function useOperationsEnabled(operations, params = {}) {
292
324
  results.set(operationKey, { isEnabled: false, featureAvailability });
293
325
  return;
294
326
  }
327
+ // A request whose required field cannot be offered for this row can only be refused (#4059).
328
+ if (requestUnfillableForRow(operation, currentObject, appConfig)) {
329
+ results.set(operationKey, { isEnabled: false, featureAvailability });
330
+ return;
331
+ }
295
332
  if (!('enabledCondition' in operation) || !operation.enabledCondition) {
296
333
  results.set(operationKey, { isEnabled: true, featureAvailability });
297
334
  return;
@@ -365,6 +402,7 @@ export function useOperationsEnabled(operations, params = {}) {
365
402
  unavailabilityPolicy,
366
403
  featuresLoading,
367
404
  billing?.isEnabled,
405
+ appConfig,
368
406
  ]);
369
407
  return enabledMap;
370
408
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useOperationEnabled.js","sourceRoot":"","sources":["../../../../../src/core/resources/hooks/useOperationEnabled.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAA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AC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC,CAAC;gBACvE,CAAC;YACH,CAAC,CAAC,CACH,CAAC;YAEF,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACxF,CAAC;QACH,CAAC,CAAC;QAEF,WAAW,EAAE,CAAC;QAEd,OAAO,GAAG,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,EAAE;QACD,OAAO;QACP,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,QAAQ;QACR,qBAAqB;QACrB,IAAI;QACJ,YAAY;QACZ,WAAW;QACX,QAAQ,EAAE,qBAAqB;QAC/B,iBAAiB;QACjB,YAAY;QACZ,WAAW;QACX,gBAAgB;QAChB,wBAAwB;QACxB,kBAAkB;QAClB,oBAAoB;QACpB,eAAe;QACf,OAAO,EAAE,SAAS;KACnB,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * React hook for checking if an operation is enabled.\n * \n * This hook evaluates the enabledCondition for an operation based on:\n * - Current object (for READ/UPDATE/DELETE)\n * - Input DTO (for CREATE)\n * - User context (from UserOrgsContext)\n * - Object context (fetched if needed)\n * \n * Usage:\n * ```tsx\n * const { isEnabled, isLoading } = useOperationEnabled({\n * operation: myOperation,\n * currentObject: myObject,\n * resourceType: 'TODOS'\n * });\n * ```\n */\n\nimport { useMemo } from 'react';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { useUserOrgs } from '~wildo-frontend-lib/core/security/useUserOrgs';\nimport {\n evaluateEnabledCondition,\n type EvaluateEnabledConditionParams,\n getOperationContextNeeds,\n} from '~wildo-frontend-lib/core/resources/utils/operation-enabled-condition.frontend.utils';\nimport type { FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport {\n type ResourceType,\n type ExecutionContext_InitiatorIds,\n type DataMode,\n FeatureUnavailabilityBehavior,\n ResourcesConfig_OperationPathUtils, bulkOperationRunsInBackground, ResourceOperation_ServiceRuntimeMode } from '@wildo-ai/saas-models';\nimport { useState, useEffect } from 'react';\nimport { useFeatures } from '~wildo-frontend-lib/core/features/useFeatures';\nimport {\n resolveOperationFeatureAvailability,\n type FeatureAvailability,\n} from '~wildo-frontend-lib/core/features/useOperationFeatureAvailability';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useBillingSafe } from '~wildo-frontend-lib/core/billing/useBilling';\nimport { buildFeaturePolicyRoles } from '~wildo-frontend-lib/core/features/feature-unavailability.frontend.utils';\n\nexport type { FeatureAvailability };\n\nexport interface UseOperationEnabledParams<TMainSchema = any> {\n /** The operation to evaluate */\n operation: FrontendResourceConfiguration_Operation<any, any, any>;\n /** Current object (for READ/UPDATE/DELETE operations) */\n currentObject?: TMainSchema;\n /** Input DTO (for CREATE operations) */\n inputDto?: Partial<TMainSchema>;\n /** Object context (parent/child relationships) - optional, will be fetched if needed */\n objectContext?: any;\n /** Resource type */\n resourceType: ResourceType;\n /** Whether to enable evaluation (default: true) */\n enabled?: boolean;\n}\n\nexport interface UseOperationEnabledResult {\n /** Whether the operation is enabled */\n isEnabled: boolean;\n /** Whether evaluation is in progress */\n isLoading: boolean;\n /** Error if evaluation failed */\n error: Error | null;\n /** Context needs for the operation */\n contextNeeds: {\n needsObjectContext: boolean;\n needsUserContext: boolean;\n };\n /** Feature availability information (undefined if no requiredFeatures on operation) */\n featureAvailability?: FeatureAvailability;\n}\n\n/** Result type for the batch useOperationsEnabled hook */\nexport interface OperationEnabledEntry {\n isEnabled: boolean;\n featureAvailability?: FeatureAvailability;\n /**\n * For a BULK operation judged row by row (`selectionObjects`): the indices, in `selectionObjects`,\n * of the rows that FAIL its condition. Present only when some do. It is what lets the bar say\n * \"2 of 5 selected can't…\" and offer to keep only the eligible rows, instead of a bare greyed button.\n */\n ineligibleSelectionIndices?: readonly number[];\n}\n\nexport interface UseOperationsEnabledParams<TMainSchema = any> {\n currentObject?: TMainSchema;\n inputDto?: Partial<TMainSchema>;\n objectContext?: EvaluateEnabledConditionParams<TMainSchema>['objectContext'];\n resourceType?: ResourceType;\n enabled?: boolean;\n /**\n * The rows a BULK operation would act on. A bulk twin inherits its single-row variant's\n * `enabledCondition`, which reads `currentObject` — so it is judged against EACH selected row.\n * An INLINE twin is enabled only when every row passes. That is the backend's rule\n * (`ServicesRegistryHandlerBackendService`, the multi-row branch of the enabled-state gate): the\n * write is one write over the whole selection, so offering it on \"most rows qualify\" would only\n * trade a disabled button for a refusal after the click. A BACKGROUND twin is enabled while at least\n * one row passes: its run changes the eligible rows and reports each refused one.\n *\n * Ignored for a non-bulk operation, which keeps `currentObject`. When absent, a bulk operation is\n * judged against `currentObject` as before.\n */\n selectionObjects?: readonly TMainSchema[];\n /**\n * The data mode `currentObject` and `selectionObjects` were fetched in, when the caller knows it: a collection list\n * passes its LIST data mode (`SUMMARY` by default). Forwarded to `evaluateEnabledCondition`, where a development build\n * names a condition that reads a field a SUMMARY row cannot carry (#2467).\n */\n subjectDataMode?: DataMode;\n /**\n * The organization the evaluated operations' requests will name, when the caller knows it — an\n * action surface reads it from its own route context. It becomes `initiatorIds.organizationId`, the\n * value the backend's evaluation of the same condition sees. When absent, the ambient selection\n * (`appScope.primaryScopeValues.organizationId`) is used, as before (#1461).\n */\n organizationId?: string;\n}\n\nexport function buildOperationEnabledKey(\n operation: FrontendResourceConfiguration_Operation<any, any, any>,\n): string {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation as any);\n}\n\n/**\n * Whether the operation requires a feature before anything is submitted: a requirement that is not conditional on\n * the request body. While the resolved features load, such an operation is held disabled; one whose requirement\n * carries `appliesWhen` is not, because only the submitted body can decide it.\n */\nfunction requiresFeaturesBeforeSubmission(\n operation: FrontendResourceConfiguration_Operation<any, any, any> | null | undefined,\n): boolean {\n const required = operation?.requiredFeatures;\n if (!required) return false;\n return Array.isArray(required) || !required.appliesWhen;\n}\n\nfunction operationNeedsDeferredGate(\n operation: FrontendResourceConfiguration_Operation<any, any, any>,\n): boolean {\n return Boolean(operation.enabledCondition || operation.requiredFeatures);\n}\n\n/**\n * Derives a value-stable {@link ExecutionContext_InitiatorIds} from the\n * individual initiator primitives.\n *\n * Both enabled-condition hooks below feed `initiatorIds` into an effect's\n * dependency array. Building it directly from the `user` object and the\n * `appScope.primaryScopeValues` object made its identity churn whenever EITHER\n * source object's reference changed — most notably an access-token refresh,\n * which rebuilds `primaryScopeValues` (the access token is one of its `useMemo`\n * dependencies) even when the decoded user / organization / application ids are\n * unchanged. That needlessly re-fired the (async) evaluation effect. Keying the\n * memo on the three extracted primitives keeps the returned object\n * referentially stable until an id genuinely changes.\n */\nfunction useStableInitiatorIds(\n userId: string | null | undefined,\n organizationId: string | null | undefined,\n applicationId: string | null | undefined,\n): ExecutionContext_InitiatorIds | undefined {\n return useMemo((): ExecutionContext_InitiatorIds | undefined => {\n const ids: ExecutionContext_InitiatorIds = {};\n if (userId) ids.userId = userId;\n if (organizationId) ids.organizationId = organizationId;\n if (applicationId) ids.applicationId = applicationId;\n return Object.keys(ids).length > 0 ? ids : undefined;\n }, [userId, organizationId, applicationId]);\n}\n\n/**\n * Hook to check if an operation is enabled based on enabledCondition.\n * \n * Automatically handles:\n * - Context needs extraction\n * - User context from UserOrgsContext\n * - Object context fetching (if needed)\n * - Caching based on operation, object, and user\n */\nexport function useOperationEnabled<TMainSchema = any>(\n params: UseOperationEnabledParams<TMainSchema>\n): UseOperationEnabledResult {\n const {\n operation,\n currentObject,\n inputDto,\n objectContext: providedObjectContext,\n resourceType,\n enabled = true,\n } = params;\n\n const { getResourcesRegistry, doOperation } = useResourceRegistry();\n const { user, permissions } = useUserOrgs();\n const appScope = useAppScopeSafe();\n const billing = useBillingSafe();\n const resourcesRegistry = getResourcesRegistry();\n const {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n isLoading: featuresLoading,\n } = useFeatures();\n\n // Extract context needs (static, doesn't need to be in effect)\n const contextNeeds = useMemo(\n () => getOperationContextNeeds(operation),\n [operation]\n );\n\n const initiatorIds = useStableInitiatorIds(\n user?._id,\n appScope?.primaryScopeValues?.organizationId,\n appScope?.primaryScopeValues?.applicationId,\n );\n\n // ── Feature availability check (synchronous, from context) ──\n const featureAvailability = useMemo((): FeatureAvailability | undefined => {\n if (featuresLoading) {\n return requiresFeaturesBeforeSubmission(operation)\n ? { isAvailable: false, behavior: FeatureUnavailabilityBehavior.DISABLE }\n : undefined;\n }\n const userRoles = buildFeaturePolicyRoles(\n permissions,\n appScope?.currentOrganizationId ?? null,\n );\n\n return resolveOperationFeatureAvailability(operation, {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n userRoles,\n billingEnabled: billing?.isEnabled ?? false,\n });\n }, [\n operation,\n featuresLoading,\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n permissions,\n appScope?.currentOrganizationId,\n billing?.isEnabled,\n ]);\n\n const [isEnabled, setIsEnabled] = useState<boolean>(() => !operationNeedsDeferredGate(operation));\n const [isLoading, setIsLoading] = useState<boolean>(() => operationNeedsDeferredGate(operation));\n const [error, setError] = useState<Error | null>(null);\n\n useEffect(() => {\n // Skip evaluation if disabled or no operation\n if (!enabled || !operation) {\n setIsEnabled(true);\n setIsLoading(false);\n return;\n }\n\n // ── Feature check first (fast, synchronous) ──\n if (featureAvailability && !featureAvailability.isAvailable) {\n setIsEnabled(false);\n setIsLoading(false);\n return;\n }\n\n // Check if operation has enabledCondition\n if (!('enabledCondition' in operation) || !operation.enabledCondition) {\n // No enabledCondition means always enabled\n setIsEnabled(true);\n setIsLoading(false);\n return;\n }\n\n // If needsUserContext but no user, operation is disabled\n if (contextNeeds.needsUserContext && !user) {\n setIsEnabled(false);\n setIsLoading(false);\n return;\n }\n\n // Evaluate enabledCondition\n setIsLoading(true);\n setError(null);\n\n evaluateEnabledCondition({\n operation,\n currentObject,\n inputDto,\n userContext: user || undefined,\n initiatorIds,\n objectContext: providedObjectContext,\n resourcesRegistry,\n resourceType,\n doOperation,\n })\n .then((enabled) => {\n setIsEnabled(enabled);\n setIsLoading(false);\n })\n .catch((err) => {\n setError(err instanceof Error ? err : new Error('Unknown error'));\n setIsEnabled(false); // Default to disabled on error for safety\n setIsLoading(false);\n });\n }, [\n enabled,\n operation,\n currentObject,\n inputDto,\n providedObjectContext,\n user,\n initiatorIds,\n resourcesRegistry,\n resourceType,\n contextNeeds.needsUserContext,\n doOperation,\n featureAvailability,\n ]);\n\n return {\n isEnabled,\n isLoading,\n error,\n contextNeeds,\n featureAvailability,\n };\n}\n\n/**\n * Hook to check if multiple operations are enabled.\n * Useful for filtering operation lists.\n * \n * Evaluation order per operation:\n * 1. Feature check (fast, synchronous from context) — if failed, isEnabled=false with featureAvailability\n * 2. enabledCondition (may be async) — if failed, isEnabled=false, featureAvailability=undefined (not a feature issue)\n * \n * @param operations - Array of operations to check\n * @param currentObject - Current object (optional)\n * @param resourceType - Resource type\n * @returns Map of operation-path keys to { isEnabled, featureAvailability? }\n */\n/** Shallow value-equality for a single feature-availability descriptor. */\nfunction featureAvailabilityEqual(\n a: FeatureAvailability | undefined,\n b: FeatureAvailability | undefined,\n): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n const ka = Object.keys(a) as (keyof FeatureAvailability)[];\n const kb = Object.keys(b);\n if (ka.length !== kb.length) return false;\n for (const k of ka) {\n if (a[k] !== b[k]) return false;\n }\n return true;\n}\n\n/**\n * Value-equality for the operations-enabled map. The async evaluation rebuilds a\n * fresh `Map` on every run, and its effect re-fires whenever any input identity\n * churns (e.g. a recomputed `operations`/`filteredOps` array). Without this guard\n * `setEnabledMap(freshMap)` re-renders on every commit even when nothing changed —\n * the recomputed map feeds the action-bar `items` memo, which re-renders the row\n * operations (and their Radix tooltips/menus) in a tight loop that pegs the CPU.\n * Comparing by value lets `setEnabledMap` bail when the enabled-states are\n * unchanged, breaking the loop while still propagating any real change.\n */\nfunction operationsEnabledMapsEqual(\n a: Map<string, OperationEnabledEntry>,\n b: Map<string, OperationEnabledEntry>,\n): boolean {\n if (a === b) return true;\n if (a.size !== b.size) return false;\n for (const [key, av] of a) {\n const bv = b.get(key);\n if (!bv) return false;\n if (av.isEnabled !== bv.isEnabled) return false;\n if ((av.ineligibleSelectionIndices ?? []).join(',') !== (bv.ineligibleSelectionIndices ?? []).join(',')) return false;\n if (!featureAvailabilityEqual(av.featureAvailability, bv.featureAvailability)) return false;\n }\n return true;\n}\n\nexport function useOperationsEnabled<TMainSchema = any>(\n operations: FrontendResourceConfiguration_Operation<any, any, any>[],\n params: UseOperationsEnabledParams<TMainSchema> = {},\n): Map<string, OperationEnabledEntry> {\n const {\n currentObject,\n inputDto,\n objectContext: providedObjectContext,\n resourceType,\n enabled = true,\n selectionObjects,\n organizationId: addressedOrganizationId,\n subjectDataMode,\n } = params;\n const { getResourcesRegistry, doOperation } = useResourceRegistry();\n const { user, permissions } = useUserOrgs();\n const appScope = useAppScopeSafe();\n const billing = useBillingSafe();\n const resourcesRegistry = getResourcesRegistry();\n const {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n isLoading: featuresLoading,\n } = useFeatures();\n\n const initiatorIds = useStableInitiatorIds(\n user?._id,\n addressedOrganizationId ?? appScope?.primaryScopeValues?.organizationId,\n appScope?.primaryScopeValues?.applicationId,\n );\n\n const [enabledMap, setEnabledMap] = useState<Map<string, OperationEnabledEntry>>(new Map());\n\n useEffect(() => {\n if (!enabled) {\n const bypassMap = new Map<string, OperationEnabledEntry>();\n operations.forEach((operation) => {\n bypassMap.set(buildOperationEnabledKey(operation), { isEnabled: true });\n });\n setEnabledMap((prev) => (operationsEnabledMapsEqual(prev, bypassMap) ? prev : bypassMap));\n return;\n }\n\n if (!operations.length || !resourceType) {\n setEnabledMap((prev) => (prev.size === 0 ? prev : new Map()));\n return;\n }\n\n let cancelled = false;\n\n const userRoles = buildFeaturePolicyRoles(\n permissions,\n appScope?.currentOrganizationId ?? null,\n );\n\n const featureCtx = {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n userRoles,\n billingEnabled: billing?.isEnabled ?? false,\n };\n\n const evaluateAll = async () => {\n const results = new Map<string, OperationEnabledEntry>();\n\n await Promise.all(\n operations.map(async (operation) => {\n const operationKey = buildOperationEnabledKey(operation);\n\n const featureAvailability = featuresLoading\n ? (requiresFeaturesBeforeSubmission(operation) ? { isAvailable: false as const, behavior: FeatureUnavailabilityBehavior.DISABLE } : undefined)\n : resolveOperationFeatureAvailability(operation, featureCtx);\n\n if (featureAvailability && !featureAvailability.isAvailable) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n return;\n }\n\n if (!('enabledCondition' in operation) || !operation.enabledCondition) {\n results.set(operationKey, { isEnabled: true, featureAvailability });\n return;\n }\n\n const needs = getOperationContextNeeds(operation);\n if (needs.needsUserContext && !user) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n return;\n }\n\n try {\n const evaluateFor = (subject: TMainSchema | undefined) => evaluateEnabledCondition({\n operation,\n currentObject: subject,\n inputDto,\n userContext: user || undefined,\n initiatorIds,\n objectContext: providedObjectContext,\n resourcesRegistry,\n resourceType,\n doOperation,\n ...(subjectDataMode ? { subjectDataMode } : {}),\n });\n if (operation.isBulkOperation === true && selectionObjects && selectionObjects.length > 0) {\n const perRow = await Promise.all(selectionObjects.map((row) => evaluateFor(row)));\n const ineligible = perRow.flatMap((passes, index) => (passes ? [] : [index]));\n results.set(operationKey, {\n // INLINE: one atomic write, so every selected row must be allowed — the backend's rule. A\n // BACKGROUND run applies to the eligible rows and reports each refused one in its summary,\n // so it is offered while at least one row passes; the bar still says how many will be refused\n // (`ineligibleSelectionIndices`). Disabling it on any refusal hid the very behaviour the\n // background lane exists for (#2062 review M2).\n isEnabled: bulkOperationRunsInBackground(operation as { serviceRuntimeMode?: ResourceOperation_ServiceRuntimeMode })\n ? ineligible.length < perRow.length\n : ineligible.length === 0,\n featureAvailability,\n ...(ineligible.length > 0 ? { ineligibleSelectionIndices: ineligible } : {}),\n });\n } else {\n results.set(operationKey, { isEnabled: await evaluateFor(currentObject), featureAvailability });\n }\n } catch (error) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n }\n })\n );\n\n if (!cancelled) {\n setEnabledMap((prev) => (operationsEnabledMapsEqual(prev, results) ? prev : results));\n }\n };\n\n evaluateAll();\n\n return () => { cancelled = true; };\n }, [\n enabled,\n operations,\n currentObject,\n selectionObjects,\n subjectDataMode,\n inputDto,\n providedObjectContext,\n user,\n initiatorIds,\n permissions,\n appScope?.currentOrganizationId,\n resourcesRegistry,\n resourceType,\n doOperation,\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n featuresLoading,\n billing?.isEnabled,\n ]);\n\n return enabledMap;\n}\n"]}
1
+ {"version":3,"file":"useOperationEnabled.js","sourceRoot":"","sources":["../../../../../src/core/resources/hooks/useOperationEnabled.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EACL,wBAAwB,EAExB,wBAAwB,GACzB,MAAM,qFAAqF,CAAC;AAE7F,OAAO,EAKL,6BAA6B,EAC7B,kCAAkC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CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACxF,CAAC;QACH,CAAC,CAAC;QAEF,WAAW,EAAE,CAAC;QAEd,OAAO,GAAG,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,EAAE;QACD,OAAO;QACP,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,QAAQ;QACR,qBAAqB;QACrB,IAAI;QACJ,YAAY;QACZ,WAAW;QACX,QAAQ,EAAE,qBAAqB;QAC/B,iBAAiB;QACjB,YAAY;QACZ,WAAW;QACX,gBAAgB;QAChB,wBAAwB;QACxB,kBAAkB;QAClB,oBAAoB;QACpB,eAAe;QACf,OAAO,EAAE,SAAS;QAClB,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * React hook for checking if an operation is enabled.\n * \n * This hook evaluates the enabledCondition for an operation based on:\n * - Current object (for READ/UPDATE/DELETE)\n * - Input DTO (for CREATE)\n * - User context (from UserOrgsContext)\n * - Object context (fetched if needed)\n * \n * Usage:\n * ```tsx\n * const { isEnabled, isLoading } = useOperationEnabled({\n * operation: myOperation,\n * currentObject: myObject,\n * resourceType: 'TODOS'\n * });\n * ```\n */\n\nimport { useContext, useMemo } from 'react';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { useUserOrgs } from '~wildo-frontend-lib/core/security/useUserOrgs';\nimport {\n evaluateEnabledCondition,\n type EvaluateEnabledConditionParams,\n getOperationContextNeeds,\n} from '~wildo-frontend-lib/core/resources/utils/operation-enabled-condition.frontend.utils';\nimport type { FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport {\n type ResourceType,\n type ExecutionContext_InitiatorIds,\n type DataMode,\n type AppConfiguration_Shared,\n FeatureUnavailabilityBehavior,\n ResourcesConfig_OperationPathUtils, bulkOperationRunsInBackground, ResourceOperation_ServiceRuntimeMode,\n requiredRequestFieldWithheldForRow } from '@wildo-ai/saas-models';\nimport { ApplicationContext } from '~wildo-frontend-lib/core/runtime/ApplicationContext.shared';\nimport { useState, useEffect } from 'react';\nimport { useFeatures } from '~wildo-frontend-lib/core/features/useFeatures';\nimport {\n resolveOperationFeatureAvailability,\n type FeatureAvailability,\n} from '~wildo-frontend-lib/core/features/useOperationFeatureAvailability';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useBillingSafe } from '~wildo-frontend-lib/core/billing/useBilling';\nimport { buildFeaturePolicyRoles } from '~wildo-frontend-lib/core/features/feature-unavailability.frontend.utils';\n\nexport type { FeatureAvailability };\n\nexport interface UseOperationEnabledParams<TMainSchema = any> {\n /** The operation to evaluate */\n operation: FrontendResourceConfiguration_Operation<any, any, any>;\n /** Current object (for READ/UPDATE/DELETE operations) */\n currentObject?: TMainSchema;\n /** Input DTO (for CREATE operations) */\n inputDto?: Partial<TMainSchema>;\n /** Object context (parent/child relationships) - optional, will be fetched if needed */\n objectContext?: any;\n /** Resource type */\n resourceType: ResourceType;\n /** Whether to enable evaluation (default: true) */\n enabled?: boolean;\n}\n\nexport interface UseOperationEnabledResult {\n /** Whether the operation is enabled */\n isEnabled: boolean;\n /** Whether evaluation is in progress */\n isLoading: boolean;\n /** Error if evaluation failed */\n error: Error | null;\n /** Context needs for the operation */\n contextNeeds: {\n needsObjectContext: boolean;\n needsUserContext: boolean;\n };\n /** Feature availability information (undefined if no requiredFeatures on operation) */\n featureAvailability?: FeatureAvailability;\n}\n\n/** Result type for the batch useOperationsEnabled hook */\nexport interface OperationEnabledEntry {\n isEnabled: boolean;\n featureAvailability?: FeatureAvailability;\n /**\n * For a BULK operation judged row by row (`selectionObjects`): the indices, in `selectionObjects`,\n * of the rows that FAIL its condition. Present only when some do. It is what lets the bar say\n * \"2 of 5 selected can't…\" and offer to keep only the eligible rows, instead of a bare greyed button.\n */\n ineligibleSelectionIndices?: readonly number[];\n}\n\nexport interface UseOperationsEnabledParams<TMainSchema = any> {\n currentObject?: TMainSchema;\n inputDto?: Partial<TMainSchema>;\n objectContext?: EvaluateEnabledConditionParams<TMainSchema>['objectContext'];\n resourceType?: ResourceType;\n enabled?: boolean;\n /**\n * The rows a BULK operation would act on. A bulk twin inherits its single-row variant's\n * `enabledCondition`, which reads `currentObject` — so it is judged against EACH selected row.\n * An INLINE twin is enabled only when every row passes. That is the backend's rule\n * (`ServicesRegistryHandlerBackendService`, the multi-row branch of the enabled-state gate): the\n * write is one write over the whole selection, so offering it on \"most rows qualify\" would only\n * trade a disabled button for a refusal after the click. A BACKGROUND twin is enabled while at least\n * one row passes: its run changes the eligible rows and reports each refused one.\n *\n * Ignored for a non-bulk operation, which keeps `currentObject`. When absent, a bulk operation is\n * judged against `currentObject` as before.\n */\n selectionObjects?: readonly TMainSchema[];\n /**\n * The data mode `currentObject` and `selectionObjects` were fetched in, when the caller knows it: a collection list\n * passes its LIST data mode (`SUMMARY` by default). Forwarded to `evaluateEnabledCondition`, where a development build\n * names a condition that reads a field a SUMMARY row cannot carry (#2467).\n */\n subjectDataMode?: DataMode;\n /**\n * The organization the evaluated operations' requests will name, when the caller knows it — an\n * action surface reads it from its own route context. It becomes `initiatorIds.organizationId`, the\n * value the backend's evaluation of the same condition sees. When absent, the ambient selection\n * (`appScope.primaryScopeValues.organizationId`) is used, as before (#1461).\n */\n organizationId?: string;\n}\n\nexport function buildOperationEnabledKey(\n operation: FrontendResourceConfiguration_Operation<any, any, any>,\n): string {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation as any);\n}\n\n/**\n * Whether the operation requires a feature before anything is submitted: a requirement that is not conditional on\n * the request body. While the resolved features load, such an operation is held disabled; one whose requirement\n * carries `appliesWhen` is not, because only the submitted body can decide it.\n */\nfunction requiresFeaturesBeforeSubmission(\n operation: FrontendResourceConfiguration_Operation<any, any, any> | null | undefined,\n): boolean {\n const required = operation?.requiredFeatures;\n if (!required) return false;\n return Array.isArray(required) || !required.appliesWhen;\n}\n\n/**\n * Whether the operation's request cannot be filled for this row (#4059): a field its request DTO requires is one its\n * `requestFieldOffers` leave out for the row, so every submission would be refused. Such an operation is unavailable,\n * exactly as if its `enabledCondition` had answered false, so a `WHEN_AVAILABLE` action is hidden rather than opening a\n * form that can only fail. See `requiredRequestFieldWithheldForRow`, which owns the rule.\n *\n * Judged only for a single-row operation with its row loaded: a bulk operation has no one row to judge it against, and\n * while the row loads nothing is known, so both stay available and the form (or the backend) decides.\n */\nfunction requestUnfillableForRow(\n operation: FrontendResourceConfiguration_Operation<any, any, any>,\n currentObject: unknown,\n appConfig: Partial<AppConfiguration_Shared> | undefined,\n): boolean {\n if (operation.isBulkOperation === true || !currentObject || typeof currentObject !== 'object') return false;\n return requiredRequestFieldWithheldForRow(operation as never, {\n appConfig,\n currentObject: currentObject as Record<string, unknown>,\n }) !== undefined;\n}\n\nfunction operationNeedsDeferredGate(\n operation: FrontendResourceConfiguration_Operation<any, any, any>,\n): boolean {\n // An operation with request-field offers may be unavailable for the row too (#4059), so it is held until judged.\n return Boolean(operation.enabledCondition || operation.requiredFeatures || operation.requestFieldOffers);\n}\n\n/**\n * Derives a value-stable {@link ExecutionContext_InitiatorIds} from the\n * individual initiator primitives.\n *\n * Both enabled-condition hooks below feed `initiatorIds` into an effect's\n * dependency array. Building it directly from the `user` object and the\n * `appScope.primaryScopeValues` object made its identity churn whenever EITHER\n * source object's reference changed — most notably an access-token refresh,\n * which rebuilds `primaryScopeValues` (the access token is one of its `useMemo`\n * dependencies) even when the decoded user / organization / application ids are\n * unchanged. That needlessly re-fired the (async) evaluation effect. Keying the\n * memo on the three extracted primitives keeps the returned object\n * referentially stable until an id genuinely changes.\n */\nfunction useStableInitiatorIds(\n userId: string | null | undefined,\n organizationId: string | null | undefined,\n applicationId: string | null | undefined,\n): ExecutionContext_InitiatorIds | undefined {\n return useMemo((): ExecutionContext_InitiatorIds | undefined => {\n const ids: ExecutionContext_InitiatorIds = {};\n if (userId) ids.userId = userId;\n if (organizationId) ids.organizationId = organizationId;\n if (applicationId) ids.applicationId = applicationId;\n return Object.keys(ids).length > 0 ? ids : undefined;\n }, [userId, organizationId, applicationId]);\n}\n\n/**\n * Hook to check if an operation is enabled based on enabledCondition.\n * \n * Automatically handles:\n * - Context needs extraction\n * - User context from UserOrgsContext\n * - Object context fetching (if needed)\n * - Caching based on operation, object, and user\n */\nexport function useOperationEnabled<TMainSchema = any>(\n params: UseOperationEnabledParams<TMainSchema>\n): UseOperationEnabledResult {\n const {\n operation,\n currentObject,\n inputDto,\n objectContext: providedObjectContext,\n resourceType,\n enabled = true,\n } = params;\n\n const { getResourcesRegistry, doOperation } = useResourceRegistry();\n const { user, permissions } = useUserOrgs();\n const appScope = useAppScopeSafe();\n // The application's shared configuration, which a request-field offer decides from (#4059). Absent outside an\n // application, where every offer narrows nothing.\n const appConfig = useContext(ApplicationContext)?.appConfig as Partial<AppConfiguration_Shared> | undefined;\n const billing = useBillingSafe();\n const resourcesRegistry = getResourcesRegistry();\n const {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n isLoading: featuresLoading,\n } = useFeatures();\n\n // Extract context needs (static, doesn't need to be in effect)\n const contextNeeds = useMemo(\n () => getOperationContextNeeds(operation),\n [operation]\n );\n\n const initiatorIds = useStableInitiatorIds(\n user?._id,\n appScope?.primaryScopeValues?.organizationId,\n appScope?.primaryScopeValues?.applicationId,\n );\n\n // ── Feature availability check (synchronous, from context) ──\n const featureAvailability = useMemo((): FeatureAvailability | undefined => {\n if (featuresLoading) {\n return requiresFeaturesBeforeSubmission(operation)\n ? { isAvailable: false, behavior: FeatureUnavailabilityBehavior.DISABLE }\n : undefined;\n }\n const userRoles = buildFeaturePolicyRoles(\n permissions,\n appScope?.currentOrganizationId ?? null,\n );\n\n return resolveOperationFeatureAvailability(operation, {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n userRoles,\n billingEnabled: billing?.isEnabled ?? false,\n });\n }, [\n operation,\n featuresLoading,\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n permissions,\n appScope?.currentOrganizationId,\n billing?.isEnabled,\n ]);\n\n const [isEnabled, setIsEnabled] = useState<boolean>(() => !operationNeedsDeferredGate(operation));\n const [isLoading, setIsLoading] = useState<boolean>(() => operationNeedsDeferredGate(operation));\n const [error, setError] = useState<Error | null>(null);\n\n useEffect(() => {\n // Skip evaluation if disabled or no operation\n if (!enabled || !operation) {\n setIsEnabled(true);\n setIsLoading(false);\n return;\n }\n\n // ── Feature check first (fast, synchronous) ──\n if (featureAvailability && !featureAvailability.isAvailable) {\n setIsEnabled(false);\n setIsLoading(false);\n return;\n }\n\n // A request whose required field cannot be offered for this row can only be refused (#4059).\n if (requestUnfillableForRow(operation, currentObject, appConfig)) {\n setIsEnabled(false);\n setIsLoading(false);\n return;\n }\n\n // Check if operation has enabledCondition\n if (!('enabledCondition' in operation) || !operation.enabledCondition) {\n // No enabledCondition means always enabled\n setIsEnabled(true);\n setIsLoading(false);\n return;\n }\n\n // If needsUserContext but no user, operation is disabled\n if (contextNeeds.needsUserContext && !user) {\n setIsEnabled(false);\n setIsLoading(false);\n return;\n }\n\n // Evaluate enabledCondition\n setIsLoading(true);\n setError(null);\n\n evaluateEnabledCondition({\n operation,\n currentObject,\n inputDto,\n userContext: user || undefined,\n initiatorIds,\n objectContext: providedObjectContext,\n resourcesRegistry,\n resourceType,\n doOperation,\n })\n .then((enabled) => {\n setIsEnabled(enabled);\n setIsLoading(false);\n })\n .catch((err) => {\n setError(err instanceof Error ? err : new Error('Unknown error'));\n setIsEnabled(false); // Default to disabled on error for safety\n setIsLoading(false);\n });\n }, [\n enabled,\n operation,\n currentObject,\n inputDto,\n providedObjectContext,\n user,\n initiatorIds,\n resourcesRegistry,\n resourceType,\n contextNeeds.needsUserContext,\n doOperation,\n featureAvailability,\n appConfig,\n ]);\n\n return {\n isEnabled,\n isLoading,\n error,\n contextNeeds,\n featureAvailability,\n };\n}\n\n/**\n * Hook to check if multiple operations are enabled.\n * Useful for filtering operation lists.\n * \n * Evaluation order per operation:\n * 1. Feature check (fast, synchronous from context) — if failed, isEnabled=false with featureAvailability\n * 2. enabledCondition (may be async) — if failed, isEnabled=false, featureAvailability=undefined (not a feature issue)\n * \n * @param operations - Array of operations to check\n * @param currentObject - Current object (optional)\n * @param resourceType - Resource type\n * @returns Map of operation-path keys to { isEnabled, featureAvailability? }\n */\n/** Shallow value-equality for a single feature-availability descriptor. */\nfunction featureAvailabilityEqual(\n a: FeatureAvailability | undefined,\n b: FeatureAvailability | undefined,\n): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n const ka = Object.keys(a) as (keyof FeatureAvailability)[];\n const kb = Object.keys(b);\n if (ka.length !== kb.length) return false;\n for (const k of ka) {\n if (a[k] !== b[k]) return false;\n }\n return true;\n}\n\n/**\n * Value-equality for the operations-enabled map. The async evaluation rebuilds a\n * fresh `Map` on every run, and its effect re-fires whenever any input identity\n * churns (e.g. a recomputed `operations`/`filteredOps` array). Without this guard\n * `setEnabledMap(freshMap)` re-renders on every commit even when nothing changed —\n * the recomputed map feeds the action-bar `items` memo, which re-renders the row\n * operations (and their Radix tooltips/menus) in a tight loop that pegs the CPU.\n * Comparing by value lets `setEnabledMap` bail when the enabled-states are\n * unchanged, breaking the loop while still propagating any real change.\n */\nfunction operationsEnabledMapsEqual(\n a: Map<string, OperationEnabledEntry>,\n b: Map<string, OperationEnabledEntry>,\n): boolean {\n if (a === b) return true;\n if (a.size !== b.size) return false;\n for (const [key, av] of a) {\n const bv = b.get(key);\n if (!bv) return false;\n if (av.isEnabled !== bv.isEnabled) return false;\n if ((av.ineligibleSelectionIndices ?? []).join(',') !== (bv.ineligibleSelectionIndices ?? []).join(',')) return false;\n if (!featureAvailabilityEqual(av.featureAvailability, bv.featureAvailability)) return false;\n }\n return true;\n}\n\nexport function useOperationsEnabled<TMainSchema = any>(\n operations: FrontendResourceConfiguration_Operation<any, any, any>[],\n params: UseOperationsEnabledParams<TMainSchema> = {},\n): Map<string, OperationEnabledEntry> {\n const {\n currentObject,\n inputDto,\n objectContext: providedObjectContext,\n resourceType,\n enabled = true,\n selectionObjects,\n organizationId: addressedOrganizationId,\n subjectDataMode,\n } = params;\n const { getResourcesRegistry, doOperation } = useResourceRegistry();\n const { user, permissions } = useUserOrgs();\n const appScope = useAppScopeSafe();\n // The application's shared configuration, which a request-field offer decides from (#4059). Absent outside an\n // application, where every offer narrows nothing.\n const appConfig = useContext(ApplicationContext)?.appConfig as Partial<AppConfiguration_Shared> | undefined;\n const billing = useBillingSafe();\n const resourcesRegistry = getResourcesRegistry();\n const {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n isLoading: featuresLoading,\n } = useFeatures();\n\n const initiatorIds = useStableInitiatorIds(\n user?._id,\n addressedOrganizationId ?? appScope?.primaryScopeValues?.organizationId,\n appScope?.primaryScopeValues?.applicationId,\n );\n\n const [enabledMap, setEnabledMap] = useState<Map<string, OperationEnabledEntry>>(new Map());\n\n useEffect(() => {\n if (!enabled) {\n const bypassMap = new Map<string, OperationEnabledEntry>();\n operations.forEach((operation) => {\n bypassMap.set(buildOperationEnabledKey(operation), { isEnabled: true });\n });\n setEnabledMap((prev) => (operationsEnabledMapsEqual(prev, bypassMap) ? prev : bypassMap));\n return;\n }\n\n if (!operations.length || !resourceType) {\n setEnabledMap((prev) => (prev.size === 0 ? prev : new Map()));\n return;\n }\n\n let cancelled = false;\n\n const userRoles = buildFeaturePolicyRoles(\n permissions,\n appScope?.currentOrganizationId ?? null,\n );\n\n const featureCtx = {\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n userRoles,\n billingEnabled: billing?.isEnabled ?? false,\n };\n\n const evaluateAll = async () => {\n const results = new Map<string, OperationEnabledEntry>();\n\n await Promise.all(\n operations.map(async (operation) => {\n const operationKey = buildOperationEnabledKey(operation);\n\n const featureAvailability = featuresLoading\n ? (requiresFeaturesBeforeSubmission(operation) ? { isAvailable: false as const, behavior: FeatureUnavailabilityBehavior.DISABLE } : undefined)\n : resolveOperationFeatureAvailability(operation, featureCtx);\n\n if (featureAvailability && !featureAvailability.isAvailable) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n return;\n }\n\n // A request whose required field cannot be offered for this row can only be refused (#4059).\n if (requestUnfillableForRow(operation, currentObject, appConfig)) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n return;\n }\n\n if (!('enabledCondition' in operation) || !operation.enabledCondition) {\n results.set(operationKey, { isEnabled: true, featureAvailability });\n return;\n }\n\n const needs = getOperationContextNeeds(operation);\n if (needs.needsUserContext && !user) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n return;\n }\n\n try {\n const evaluateFor = (subject: TMainSchema | undefined) => evaluateEnabledCondition({\n operation,\n currentObject: subject,\n inputDto,\n userContext: user || undefined,\n initiatorIds,\n objectContext: providedObjectContext,\n resourcesRegistry,\n resourceType,\n doOperation,\n ...(subjectDataMode ? { subjectDataMode } : {}),\n });\n if (operation.isBulkOperation === true && selectionObjects && selectionObjects.length > 0) {\n const perRow = await Promise.all(selectionObjects.map((row) => evaluateFor(row)));\n const ineligible = perRow.flatMap((passes, index) => (passes ? [] : [index]));\n results.set(operationKey, {\n // INLINE: one atomic write, so every selected row must be allowed — the backend's rule. A\n // BACKGROUND run applies to the eligible rows and reports each refused one in its summary,\n // so it is offered while at least one row passes; the bar still says how many will be refused\n // (`ineligibleSelectionIndices`). Disabling it on any refusal hid the very behaviour the\n // background lane exists for (#2062 review M2).\n isEnabled: bulkOperationRunsInBackground(operation as { serviceRuntimeMode?: ResourceOperation_ServiceRuntimeMode })\n ? ineligible.length < perRow.length\n : ineligible.length === 0,\n featureAvailability,\n ...(ineligible.length > 0 ? { ineligibleSelectionIndices: ineligible } : {}),\n });\n } else {\n results.set(operationKey, { isEnabled: await evaluateFor(currentObject), featureAvailability });\n }\n } catch (error) {\n results.set(operationKey, { isEnabled: false, featureAvailability });\n }\n })\n );\n\n if (!cancelled) {\n setEnabledMap((prev) => (operationsEnabledMapsEqual(prev, results) ? prev : results));\n }\n };\n\n evaluateAll();\n\n return () => { cancelled = true; };\n }, [\n enabled,\n operations,\n currentObject,\n selectionObjects,\n subjectDataMode,\n inputDto,\n providedObjectContext,\n user,\n initiatorIds,\n permissions,\n appScope?.currentOrganizationId,\n resourcesRegistry,\n resourceType,\n doOperation,\n resolvedFeatures,\n resolvedFeaturesResponse,\n featureDefinitions,\n unavailabilityPolicy,\n featuresLoading,\n billing?.isEnabled,\n appConfig,\n ]);\n\n return enabledMap;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resources-repository.frontend.service.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resources-repository.frontend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,EAAE,gCAAgC,EAAE,MAAM,gFAAgF,CAAC;AAOlI,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAKxG,OAAO,EAGL,2CAA2C,EAE3C,oBAAoB,EAqBU,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAEV,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAGV,yBAAyB,EAE1B,MAAM,+DAA+D,CAAC;AAoZvE,qBAAa,kCAAkC;IAiB3C,OAAO,CAAC,UAAU;IAhBpB,OAAO,CAAC,QAAQ,CAA0C;IAC1D,OAAO,CAAC,aAAa,CAAS;IAC9B;;;OAGG;IACH,OAAO,CAAC,gCAAgC,CAA0C;IAClF;;;;OAIG;IACH,OAAO,CAAC,mCAAmC,CAA8D;IACzG,OAAO,CAAC,mBAAmB,CAAiD;gBAGlE,UAAU,EAAE,sBAAsB;IAG5C;;;OAG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I,gCAAgC;IAUjE;;;;;;;;;;;;OAYG;IACI,wBAAwB,IAAI,sBAAsB;IAIzD;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B;IA0CpC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,kCAAkC;IAwD1C;;;;;;OAMG;IACH,OAAO,CAAC,sCAAsC;CAkC/C"}
1
+ {"version":3,"file":"resources-repository.frontend.service.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resources-repository.frontend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAC9G,OAAO,EAAE,gCAAgC,EAAE,MAAM,gFAAgF,CAAC;AAOlI,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAKxG,OAAO,EAGL,2CAA2C,EAE3C,oBAAoB,EAqBU,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAEV,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAGV,yBAAyB,EAE1B,MAAM,+DAA+D,CAAC;AAoZvE,qBAAa,kCAAkC;IAiB3C,OAAO,CAAC,UAAU;IAhBpB,OAAO,CAAC,QAAQ,CAA0C;IAC1D,OAAO,CAAC,aAAa,CAAS;IAC9B;;;OAGG;IACH,OAAO,CAAC,gCAAgC,CAA0C;IAClF;;;;OAIG;IACH,OAAO,CAAC,mCAAmC,CAA8D;IACzG,OAAO,CAAC,mBAAmB,CAAiD;gBAGlE,UAAU,EAAE,sBAAsB;IAG5C;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;;;;;;;;OASG;IACU,mBAAmB,CAC9B,8CAA8C,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,2CAA2C,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;KAAE,EAC9H,oCAAoC,CAAC,EAAE;QAAE,CAAC,GAAG,EAA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 @@ export class ResourcesRepositoryFrontendService {
1024
1024
  sectionRefs: authoredView.sectionRefs,
1025
1025
  viewComponent: authoredView.viewComponent,
1026
1026
  icon: authoredView.icon,
1027
+ // The conversations it hosts on its record: how a link to one finds this view (#4043).
1028
+ ...(authoredView.conversationSystemRef ? { conversationSystemRef: authoredView.conversationSystemRef } : {}),
1027
1029
  }));
1028
1030
  }
1029
1031
  buildResourceExecutionViewDefinitions(primaryScope, executionViews) {