@axelor/aos-mobile-intervention 8.1.0

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 (271) hide show
  1. package/README.md +46 -0
  2. package/lib/api/client-and-prospect-api.d.ts +4 -0
  3. package/lib/api/client-and-prospect-api.js +57 -0
  4. package/lib/api/client-and-prospect-api.js.map +1 -0
  5. package/lib/api/contract-api.d.ts +5 -0
  6. package/lib/api/contract-api.js +45 -0
  7. package/lib/api/contract-api.js.map +1 -0
  8. package/lib/api/equipment-api.d.ts +43 -0
  9. package/lib/api/equipment-api.js +212 -0
  10. package/lib/api/equipment-api.js.map +1 -0
  11. package/lib/api/equipment-family-api.d.ts +4 -0
  12. package/lib/api/equipment-family-api.js +28 -0
  13. package/lib/api/equipment-family-api.js.map +1 -0
  14. package/lib/api/equipment-line-api.d.ts +4 -0
  15. package/lib/api/equipment-line-api.js +38 -0
  16. package/lib/api/equipment-line-api.js.map +1 -0
  17. package/lib/api/equipment-picture-api.d.ts +14 -0
  18. package/lib/api/equipment-picture-api.js +56 -0
  19. package/lib/api/equipment-picture-api.js.map +1 -0
  20. package/lib/api/index.d.ts +9 -0
  21. package/lib/api/index.js +27 -0
  22. package/lib/api/index.js.map +1 -0
  23. package/lib/api/intervention-api.d.ts +34 -0
  24. package/lib/api/intervention-api.js +149 -0
  25. package/lib/api/intervention-api.js.map +1 -0
  26. package/lib/api/intervention-note-api.d.ts +19 -0
  27. package/lib/api/intervention-note-api.js +79 -0
  28. package/lib/api/intervention-note-api.js.map +1 -0
  29. package/lib/api/question-api.d.ts +14 -0
  30. package/lib/api/question-api.js +78 -0
  31. package/lib/api/question-api.js.map +1 -0
  32. package/lib/components/atoms/EquipmentCard/EquipmentCard.d.ts +11 -0
  33. package/lib/components/atoms/EquipmentCard/EquipmentCard.js +65 -0
  34. package/lib/components/atoms/EquipmentCard/EquipmentCard.js.map +1 -0
  35. package/lib/components/atoms/EquipmentLineCard/EquipmentLineCard.d.ts +12 -0
  36. package/lib/components/atoms/EquipmentLineCard/EquipmentLineCard.js +42 -0
  37. package/lib/components/atoms/EquipmentLineCard/EquipmentLineCard.js.map +1 -0
  38. package/lib/components/atoms/InterventionCard/InterventionCard.d.ts +15 -0
  39. package/lib/components/atoms/InterventionCard/InterventionCard.js +97 -0
  40. package/lib/components/atoms/InterventionCard/InterventionCard.js.map +1 -0
  41. package/lib/components/atoms/NoteCard/NoteCard.d.ts +12 -0
  42. package/lib/components/atoms/NoteCard/NoteCard.js +65 -0
  43. package/lib/components/atoms/NoteCard/NoteCard.js.map +1 -0
  44. package/lib/components/atoms/PictureCard/PictureCard.d.ts +10 -0
  45. package/lib/components/atoms/PictureCard/PictureCard.js +71 -0
  46. package/lib/components/atoms/PictureCard/PictureCard.js.map +1 -0
  47. package/lib/components/atoms/QuestionCard/QuestionCard.d.ts +10 -0
  48. package/lib/components/atoms/QuestionCard/QuestionCard.js +67 -0
  49. package/lib/components/atoms/QuestionCard/QuestionCard.js.map +1 -0
  50. package/lib/components/atoms/index.d.ts +6 -0
  51. package/lib/components/atoms/index.js +24 -0
  52. package/lib/components/atoms/index.js.map +1 -0
  53. package/lib/components/index.d.ts +5 -0
  54. package/lib/components/index.js +23 -0
  55. package/lib/components/index.js.map +1 -0
  56. package/lib/components/molecules/DropdownGeneralView/DropdownGeneralView.d.ts +9 -0
  57. package/lib/components/molecules/DropdownGeneralView/DropdownGeneralView.js +32 -0
  58. package/lib/components/molecules/DropdownGeneralView/DropdownGeneralView.js.map +1 -0
  59. package/lib/components/molecules/EquipmentActionCard/EquipmentActionCard.d.ts +19 -0
  60. package/lib/components/molecules/EquipmentActionCard/EquipmentActionCard.js +77 -0
  61. package/lib/components/molecules/EquipmentActionCard/EquipmentActionCard.js.map +1 -0
  62. package/lib/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.d.ts +3 -0
  63. package/lib/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.js +48 -0
  64. package/lib/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.js.map +1 -0
  65. package/lib/components/molecules/GtCard/GtCard.d.ts +11 -0
  66. package/lib/components/molecules/GtCard/GtCard.js +76 -0
  67. package/lib/components/molecules/GtCard/GtCard.js.map +1 -0
  68. package/lib/components/molecules/InterventionDetailCard/InterventionDetailCard.d.ts +19 -0
  69. package/lib/components/molecules/InterventionDetailCard/InterventionDetailCard.js +52 -0
  70. package/lib/components/molecules/InterventionDetailCard/InterventionDetailCard.js.map +1 -0
  71. package/lib/components/molecules/InterventionHeader/InterventionHeader.d.ts +6 -0
  72. package/lib/components/molecules/InterventionHeader/InterventionHeader.js +52 -0
  73. package/lib/components/molecules/InterventionHeader/InterventionHeader.js.map +1 -0
  74. package/lib/components/molecules/NoteDetailCard/NoteDetailCard.d.ts +19 -0
  75. package/lib/components/molecules/NoteDetailCard/NoteDetailCard.js +68 -0
  76. package/lib/components/molecules/NoteDetailCard/NoteDetailCard.js.map +1 -0
  77. package/lib/components/molecules/PicturesRow/PicturesRow.d.ts +10 -0
  78. package/lib/components/molecules/PicturesRow/PicturesRow.js +36 -0
  79. package/lib/components/molecules/PicturesRow/PicturesRow.js.map +1 -0
  80. package/lib/components/molecules/QuestionAdvancedMonitoring/QuestionAdvancedMonitoring.d.ts +9 -0
  81. package/lib/components/molecules/QuestionAdvancedMonitoring/QuestionAdvancedMonitoring.js +31 -0
  82. package/lib/components/molecules/QuestionAdvancedMonitoring/QuestionAdvancedMonitoring.js.map +1 -0
  83. package/lib/components/molecules/QuestionCheckbox/QuestionCheckbox.d.ts +7 -0
  84. package/lib/components/molecules/QuestionCheckbox/QuestionCheckbox.js +36 -0
  85. package/lib/components/molecules/QuestionCheckbox/QuestionCheckbox.js.map +1 -0
  86. package/lib/components/molecules/QuestionList/QuestionList.d.ts +9 -0
  87. package/lib/components/molecules/QuestionList/QuestionList.js +29 -0
  88. package/lib/components/molecules/QuestionList/QuestionList.js.map +1 -0
  89. package/lib/components/molecules/QuestionMeasure/QuestionMeasure.d.ts +9 -0
  90. package/lib/components/molecules/QuestionMeasure/QuestionMeasure.js +39 -0
  91. package/lib/components/molecules/QuestionMeasure/QuestionMeasure.js.map +1 -0
  92. package/lib/components/molecules/index.d.ts +12 -0
  93. package/lib/components/molecules/index.js +30 -0
  94. package/lib/components/molecules/index.js.map +1 -0
  95. package/lib/components/organisms/ClientProspectSearchBar/ClientProspectSearchBar.d.ts +4 -0
  96. package/lib/components/organisms/ClientProspectSearchBar/ClientProspectSearchBar.js +32 -0
  97. package/lib/components/organisms/ClientProspectSearchBar/ClientProspectSearchBar.js.map +1 -0
  98. package/lib/components/organisms/ContractSearchBar/ContractSearchBar.d.ts +4 -0
  99. package/lib/components/organisms/ContractSearchBar/ContractSearchBar.js +35 -0
  100. package/lib/components/organisms/ContractSearchBar/ContractSearchBar.js.map +1 -0
  101. package/lib/components/organisms/DropdownCards/DropdownCards.d.ts +6 -0
  102. package/lib/components/organisms/DropdownCards/DropdownCards.js +45 -0
  103. package/lib/components/organisms/DropdownCards/DropdownCards.js.map +1 -0
  104. package/lib/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.d.ts +4 -0
  105. package/lib/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.js +35 -0
  106. package/lib/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.js.map +1 -0
  107. package/lib/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.d.ts +5 -0
  108. package/lib/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.js +50 -0
  109. package/lib/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.js.map +1 -0
  110. package/lib/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.d.ts +8 -0
  111. package/lib/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.js +32 -0
  112. package/lib/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.js.map +1 -0
  113. package/lib/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.d.ts +4 -0
  114. package/lib/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.js +36 -0
  115. package/lib/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.js.map +1 -0
  116. package/lib/components/organisms/TypePicker/TypePicker.d.ts +4 -0
  117. package/lib/components/organisms/TypePicker/TypePicker.js +29 -0
  118. package/lib/components/organisms/TypePicker/TypePicker.js.map +1 -0
  119. package/lib/components/organisms/index.d.ts +8 -0
  120. package/lib/components/organisms/index.js +26 -0
  121. package/lib/components/organisms/index.js.map +1 -0
  122. package/lib/components/pages/EquipmentView/EquipmentView.d.ts +3 -0
  123. package/lib/components/pages/EquipmentView/EquipmentView.js +161 -0
  124. package/lib/components/pages/EquipmentView/EquipmentView.js.map +1 -0
  125. package/lib/components/pages/GeneralInformationView/GeneralInformationView.d.ts +3 -0
  126. package/lib/components/pages/GeneralInformationView/GeneralInformationView.js +94 -0
  127. package/lib/components/pages/GeneralInformationView/GeneralInformationView.js.map +1 -0
  128. package/lib/components/pages/HistoryView/HistoryView.d.ts +3 -0
  129. package/lib/components/pages/HistoryView/HistoryView.js +33 -0
  130. package/lib/components/pages/HistoryView/HistoryView.js.map +1 -0
  131. package/lib/components/pages/NoteView/NoteView.d.ts +3 -0
  132. package/lib/components/pages/NoteView/NoteView.js +47 -0
  133. package/lib/components/pages/NoteView/NoteView.js.map +1 -0
  134. package/lib/components/pages/SurveyView/SurveyView.d.ts +7 -0
  135. package/lib/components/pages/SurveyView/SurveyView.js +60 -0
  136. package/lib/components/pages/SurveyView/SurveyView.js.map +1 -0
  137. package/lib/components/pages/index.d.ts +5 -0
  138. package/lib/components/pages/index.js +23 -0
  139. package/lib/components/pages/index.js.map +1 -0
  140. package/lib/components/templates/InterventionsListView/InterventionsListView.d.ts +7 -0
  141. package/lib/components/templates/InterventionsListView/InterventionsListView.js +73 -0
  142. package/lib/components/templates/InterventionsListView/InterventionsListView.js.map +1 -0
  143. package/lib/components/templates/LinkEquipmentPopup/LinkEquipmentPopup.d.ts +7 -0
  144. package/lib/components/templates/LinkEquipmentPopup/LinkEquipmentPopup.js +70 -0
  145. package/lib/components/templates/LinkEquipmentPopup/LinkEquipmentPopup.js.map +1 -0
  146. package/lib/components/templates/SurveyRangeNavigation/SurveyRangeNavigation.d.ts +7 -0
  147. package/lib/components/templates/SurveyRangeNavigation/SurveyRangeNavigation.js +76 -0
  148. package/lib/components/templates/SurveyRangeNavigation/SurveyRangeNavigation.js.map +1 -0
  149. package/lib/components/templates/index.d.ts +3 -0
  150. package/lib/components/templates/index.js +21 -0
  151. package/lib/components/templates/index.js.map +1 -0
  152. package/lib/features/asyncFunctions-index.d.ts +9 -0
  153. package/lib/features/asyncFunctions-index.js +27 -0
  154. package/lib/features/asyncFunctions-index.js.map +1 -0
  155. package/lib/features/clientAndProspectSlice.d.ts +7 -0
  156. package/lib/features/clientAndProspectSlice.js +49 -0
  157. package/lib/features/clientAndProspectSlice.js.map +1 -0
  158. package/lib/features/contractSlice.d.ts +7 -0
  159. package/lib/features/contractSlice.js +49 -0
  160. package/lib/features/contractSlice.js.map +1 -0
  161. package/lib/features/equipmentFamilySlice.d.ts +7 -0
  162. package/lib/features/equipmentFamilySlice.js +49 -0
  163. package/lib/features/equipmentFamilySlice.js.map +1 -0
  164. package/lib/features/equipmentLineSlice.d.ts +7 -0
  165. package/lib/features/equipmentLineSlice.js +49 -0
  166. package/lib/features/equipmentLineSlice.js.map +1 -0
  167. package/lib/features/equipmentPictureSlice.d.ts +37 -0
  168. package/lib/features/equipmentPictureSlice.js +67 -0
  169. package/lib/features/equipmentPictureSlice.js.map +1 -0
  170. package/lib/features/equipmentSlice.d.ts +34 -0
  171. package/lib/features/equipmentSlice.js +205 -0
  172. package/lib/features/equipmentSlice.js.map +1 -0
  173. package/lib/features/index.d.ts +9 -0
  174. package/lib/features/index.js +27 -0
  175. package/lib/features/index.js.map +1 -0
  176. package/lib/features/interventionNoteSlice.d.ts +16 -0
  177. package/lib/features/interventionNoteSlice.js +114 -0
  178. package/lib/features/interventionNoteSlice.js.map +1 -0
  179. package/lib/features/interventionSlice.d.ts +21 -0
  180. package/lib/features/interventionSlice.js +140 -0
  181. package/lib/features/interventionSlice.js.map +1 -0
  182. package/lib/features/questionSlice.d.ts +14 -0
  183. package/lib/features/questionSlice.js +104 -0
  184. package/lib/features/questionSlice.js.map +1 -0
  185. package/lib/hooks/use-intervention-header-actions.d.ts +1 -0
  186. package/lib/hooks/use-intervention-header-actions.js +141 -0
  187. package/lib/hooks/use-intervention-header-actions.js.map +1 -0
  188. package/lib/i18n/en.json +106 -0
  189. package/lib/i18n/fr.json +106 -0
  190. package/lib/index.d.ts +7 -0
  191. package/lib/index.js +94 -0
  192. package/lib/index.js.map +1 -0
  193. package/lib/models/forms.d.ts +2 -0
  194. package/lib/models/forms.js +333 -0
  195. package/lib/models/forms.js.map +1 -0
  196. package/lib/models/index.d.ts +5 -0
  197. package/lib/models/index.js +23 -0
  198. package/lib/models/index.js.map +1 -0
  199. package/lib/models/objectFields.d.ts +2 -0
  200. package/lib/models/objectFields.js +143 -0
  201. package/lib/models/objectFields.js.map +1 -0
  202. package/lib/models/searchFields.d.ts +2 -0
  203. package/lib/models/searchFields.js +33 -0
  204. package/lib/models/searchFields.js.map +1 -0
  205. package/lib/models/sortFields.d.ts +2 -0
  206. package/lib/models/sortFields.js +28 -0
  207. package/lib/models/sortFields.js.map +1 -0
  208. package/lib/models/typeObjects.d.ts +2 -0
  209. package/lib/models/typeObjects.js +205 -0
  210. package/lib/models/typeObjects.js.map +1 -0
  211. package/lib/screens/equipment/CustomerParkScreen.d.ts +3 -0
  212. package/lib/screens/equipment/CustomerParkScreen.js +56 -0
  213. package/lib/screens/equipment/CustomerParkScreen.js.map +1 -0
  214. package/lib/screens/equipment/EquipmentFormView.d.ts +6 -0
  215. package/lib/screens/equipment/EquipmentFormView.js +104 -0
  216. package/lib/screens/equipment/EquipmentFormView.js.map +1 -0
  217. package/lib/screens/equipment/EquipmentInterventionListScreen.d.ts +3 -0
  218. package/lib/screens/equipment/EquipmentInterventionListScreen.js +43 -0
  219. package/lib/screens/equipment/EquipmentInterventionListScreen.js.map +1 -0
  220. package/lib/screens/equipment/EquipmentLineListScreen.d.ts +3 -0
  221. package/lib/screens/equipment/EquipmentLineListScreen.js +37 -0
  222. package/lib/screens/equipment/EquipmentLineListScreen.js.map +1 -0
  223. package/lib/screens/equipment/EquipmentPictureScreen.d.ts +3 -0
  224. package/lib/screens/equipment/EquipmentPictureScreen.js +113 -0
  225. package/lib/screens/equipment/EquipmentPictureScreen.js.map +1 -0
  226. package/lib/screens/equipment/index.d.ts +45 -0
  227. package/lib/screens/equipment/index.js +61 -0
  228. package/lib/screens/equipment/index.js.map +1 -0
  229. package/lib/screens/intervention/ActiveInterventionScreen.d.ts +3 -0
  230. package/lib/screens/intervention/ActiveInterventionScreen.js +72 -0
  231. package/lib/screens/intervention/ActiveInterventionScreen.js.map +1 -0
  232. package/lib/screens/intervention/DayInterventionsScreen.d.ts +3 -0
  233. package/lib/screens/intervention/DayInterventionsScreen.js +33 -0
  234. package/lib/screens/intervention/DayInterventionsScreen.js.map +1 -0
  235. package/lib/screens/intervention/InterventionDetailsScreen.d.ts +7 -0
  236. package/lib/screens/intervention/InterventionDetailsScreen.js +83 -0
  237. package/lib/screens/intervention/InterventionDetailsScreen.js.map +1 -0
  238. package/lib/screens/intervention/InterventionNoteFormScreen.d.ts +6 -0
  239. package/lib/screens/intervention/InterventionNoteFormScreen.js +81 -0
  240. package/lib/screens/intervention/InterventionNoteFormScreen.js.map +1 -0
  241. package/lib/screens/intervention/InterventionQuestionFormScreen.d.ts +6 -0
  242. package/lib/screens/intervention/InterventionQuestionFormScreen.js +114 -0
  243. package/lib/screens/intervention/InterventionQuestionFormScreen.js.map +1 -0
  244. package/lib/screens/intervention/InterventionsHistoryScreen.d.ts +3 -0
  245. package/lib/screens/intervention/InterventionsHistoryScreen.js +29 -0
  246. package/lib/screens/intervention/InterventionsHistoryScreen.js.map +1 -0
  247. package/lib/screens/intervention/PlannedInterventionsScreen.d.ts +3 -0
  248. package/lib/screens/intervention/PlannedInterventionsScreen.js +29 -0
  249. package/lib/screens/intervention/PlannedInterventionsScreen.js.map +1 -0
  250. package/lib/screens/intervention/index.d.ts +79 -0
  251. package/lib/screens/intervention/index.js +89 -0
  252. package/lib/screens/intervention/index.js.map +1 -0
  253. package/lib/types/equipment.d.ts +7 -0
  254. package/lib/types/equipment.js +25 -0
  255. package/lib/types/equipment.js.map +1 -0
  256. package/lib/types/index.d.ts +3 -0
  257. package/lib/types/index.js +21 -0
  258. package/lib/types/index.js.map +1 -0
  259. package/lib/types/intervention.d.ts +4 -0
  260. package/lib/types/intervention.js +38 -0
  261. package/lib/types/intervention.js.map +1 -0
  262. package/lib/types/question.d.ts +4 -0
  263. package/lib/types/question.js +44 -0
  264. package/lib/types/question.js.map +1 -0
  265. package/lib/utils/form-types.d.ts +9 -0
  266. package/lib/utils/form-types.js +19 -0
  267. package/lib/utils/form-types.js.map +1 -0
  268. package/lib/utils/index.d.ts +1 -0
  269. package/lib/utils/index.js +19 -0
  270. package/lib/utils/index.js.map +1 -0
  271. package/package.json +47 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equipmentSlice.js","sourceRoot":"","sources":["../../src/features/equipmentSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,aAAa,IAAI,cAAc,EAC/B,eAAe,IAAI,gBAAgB,EACnC,gBAAgB,IAAI,iBAAiB,EACrC,aAAa,IAAI,cAAc,EAC/B,eAAe,IAAI,gBAAgB,EACnC,qBAAqB,IAAI,sBAAsB,EAC/C,2BAA2B,IAAI,4BAA4B,EAC3D,oBAAoB,IAAI,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AAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,sBAAsB;YACjC,IAAI,EAAE,qBAAqB;SAC5B,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAC,cAAc,EAAC,GAAG,cAAc,CAAC,OAAO,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { clientAndProspectReducer as intervention_clientAndProspect } from "./clientAndProspectSlice";
2
+ export { contractReducer as intervention_contract } from "./contractSlice";
3
+ export { equipmentFamilyReducer as intervention_equipmentFamily } from "./equipmentFamilySlice";
4
+ export { equipmentLineReducer as intervention_equipmentLine } from "./equipmentLineSlice";
5
+ export { equipmentPictureReducer as intervention_equipmentPicture } from "./equipmentPictureSlice";
6
+ export { equipmentReducer as intervention_equipment } from "./equipmentSlice";
7
+ export { interventionNoteReducer as intervention_interventionNote } from "./interventionNoteSlice";
8
+ export { interventionReducer as intervention_intervention } from "./interventionSlice";
9
+ export { questionReducer as intervention_question } from "./questionSlice";
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { clientAndProspectReducer as intervention_clientAndProspect } from './clientAndProspectSlice';
19
+ export { contractReducer as intervention_contract } from './contractSlice';
20
+ export { equipmentFamilyReducer as intervention_equipmentFamily } from './equipmentFamilySlice';
21
+ export { equipmentLineReducer as intervention_equipmentLine } from './equipmentLineSlice';
22
+ export { equipmentPictureReducer as intervention_equipmentPicture } from './equipmentPictureSlice';
23
+ export { equipmentReducer as intervention_equipment } from './equipmentSlice';
24
+ export { interventionNoteReducer as intervention_interventionNote } from './interventionNoteSlice';
25
+ export { interventionReducer as intervention_intervention } from './interventionSlice';
26
+ export { questionReducer as intervention_question } from './questionSlice';
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,wBAAwB,IAAI,8BAA8B,EAAC,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAC,eAAe,IAAI,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAC,sBAAsB,IAAI,4BAA4B,EAAC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAC,oBAAoB,IAAI,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAC,uBAAuB,IAAI,6BAA6B,EAAC,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAC,gBAAgB,IAAI,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAC,uBAAuB,IAAI,6BAA6B,EAAC,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAC,mBAAmB,IAAI,yBAAyB,EAAC,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAC,eAAe,IAAI,qBAAqB,EAAC,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export const fetchInterventionNote: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
2
+ export const fetchInterventionNoteById: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
3
+ export const fetchInterventionNoteType: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
4
+ export const createInterventionNote: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
5
+ export const updateInterventionNote: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
6
+ export const deleteInterventionNote: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
7
+ export const interventionNoteReducer: import("redux").Reducer<{
8
+ loading: boolean;
9
+ moreLoading: boolean;
10
+ isListEnd: boolean;
11
+ interventionNoteList: any[];
12
+ loadingInterventionNote: boolean;
13
+ interventionNote: {};
14
+ loadingInterventionNoteTypeList: boolean;
15
+ interventionNoteTypeList: any[];
16
+ }>;
@@ -0,0 +1,114 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
19
+ import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
20
+ import { createInterventionNote as _createInterventionNote, deleteInterventionNote as _deleteInterventionNote, fetchInterventionNote as _fetchInterventionNote, fetchInterventionNoteById as _fetchInterventionNoteById, fetchInterventionNoteType as _fetchInterventionNoteType, updateInterventionNote as _updateInterventionNote, } from '../api/intervention-note-api';
21
+ export const fetchInterventionNote = createAsyncThunk('intervention_interventionNote/fetchInterventionNote', async function (data, { getState }) {
22
+ return handlerApiCall({
23
+ fetchFunction: _fetchInterventionNote,
24
+ data,
25
+ action: 'Intervention_SliceAction_FetchInterventionNote',
26
+ getState,
27
+ responseOptions: { isArrayResponse: true },
28
+ });
29
+ });
30
+ export const fetchInterventionNoteById = createAsyncThunk('intervention_interventionNote/fetchInterventionNoteById', async function (data, { getState }) {
31
+ return handlerApiCall({
32
+ fetchFunction: _fetchInterventionNoteById,
33
+ data,
34
+ action: 'Intervention_SliceAction_FetchInterventionNoteById',
35
+ getState,
36
+ responseOptions: { isArrayResponse: false },
37
+ });
38
+ });
39
+ export const fetchInterventionNoteType = createAsyncThunk('intervention_interventionNote/fetchInterventionNoteType', async function (data, { getState }) {
40
+ return handlerApiCall({
41
+ fetchFunction: _fetchInterventionNoteType,
42
+ data,
43
+ action: 'Intervention_SliceAction_FetchInterventionNoteType',
44
+ getState,
45
+ responseOptions: { isArrayResponse: true },
46
+ });
47
+ });
48
+ export const createInterventionNote = createAsyncThunk('intervention_interventionNote/createInterventionNote', async function (data, { getState, dispatch }) {
49
+ return handlerApiCall({
50
+ fetchFunction: _createInterventionNote,
51
+ data,
52
+ action: 'Intervention_SliceAction_CreateInterventionNote',
53
+ getState,
54
+ responseOptions: { isArrayResponse: false, showToast: true },
55
+ });
56
+ });
57
+ export const updateInterventionNote = createAsyncThunk('intervention_interventionNote/updateInterventionNote', async function (data, { getState, dispatch }) {
58
+ return handlerApiCall({
59
+ fetchFunction: _updateInterventionNote,
60
+ data,
61
+ action: 'Intervention_SliceAction_UpdateInterventionNote',
62
+ getState,
63
+ responseOptions: { isArrayResponse: false, showToast: true },
64
+ });
65
+ });
66
+ export const deleteInterventionNote = createAsyncThunk('intervention_interventionNote/deleteInterventionNote', async function (data, { getState, dispatch }) {
67
+ return handlerApiCall({
68
+ fetchFunction: _deleteInterventionNote,
69
+ data,
70
+ action: 'Intervention_SliceAction_DeleteInterventionNote',
71
+ getState,
72
+ responseOptions: { isArrayResponse: false, showToast: true },
73
+ }).then(() => {
74
+ dispatch(fetchInterventionNote({ deliveredPartnerId: data.deliveredPartnerId }));
75
+ });
76
+ });
77
+ const initialState = {
78
+ loading: true,
79
+ moreLoading: false,
80
+ isListEnd: false,
81
+ interventionNoteList: [],
82
+ loadingInterventionNote: true,
83
+ interventionNote: {},
84
+ loadingInterventionNoteTypeList: true,
85
+ interventionNoteTypeList: [],
86
+ };
87
+ const interventionNoteSlice = createSlice({
88
+ name: 'intervention_interventionNote',
89
+ initialState,
90
+ extraReducers: builder => {
91
+ generateInifiniteScrollCases(builder, fetchInterventionNote, {
92
+ loading: 'loading',
93
+ moreLoading: 'moreLoading',
94
+ isListEnd: 'isListEnd',
95
+ list: 'interventionNoteList',
96
+ });
97
+ builder.addCase(fetchInterventionNoteById.pending, state => {
98
+ state.loadingInterventionNote = true;
99
+ });
100
+ builder.addCase(fetchInterventionNoteById.fulfilled, (state, action) => {
101
+ state.loadingInterventionNote = false;
102
+ state.interventionNote = action.payload;
103
+ });
104
+ builder.addCase(fetchInterventionNoteType.pending, state => {
105
+ state.loadingInterventionNoteTypeList = true;
106
+ });
107
+ builder.addCase(fetchInterventionNoteType.fulfilled, (state, action) => {
108
+ state.loadingInterventionNoteTypeList = false;
109
+ state.interventionNoteTypeList = action.payload;
110
+ });
111
+ },
112
+ });
113
+ export const interventionNoteReducer = interventionNoteSlice.reducer;
114
+ //# sourceMappingURL=interventionNoteSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interventionNoteSlice.js","sourceRoot":"","sources":["../../src/features/interventionNoteSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,C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js/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
2
+ export const fetchInterventionById: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
3
+ export const searchHistoryInterventionByEquipment: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
4
+ export const fetchActiveIntervention: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
5
+ export const updateInterventionStatus: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
6
+ export const unlinkEquipment: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
7
+ export const linkEquipment: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
8
+ export const interventionReducer: import("redux").Reducer<{
9
+ loading: boolean;
10
+ moreLoading: boolean;
11
+ isListEnd: boolean;
12
+ interventionList: any[];
13
+ loadingHistoryList: boolean;
14
+ moreLoadingHistory: boolean;
15
+ isListEndHistory: boolean;
16
+ interventionHistoryList: any[];
17
+ loadingIntervention: boolean;
18
+ intervention: {};
19
+ loadingActiveIntervention: boolean;
20
+ activeIntervention: {};
21
+ }>;
@@ -0,0 +1,140 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
19
+ import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
20
+ import { fetchActiveIntervention as _fetchActiveIntervention, fetchIntervention as _fetchIntervention, fetchInterventionById as _fetchInterventionById, linkEquipment as _linkEquipment, searchHistoryInterventionByEquipment as _searchHistoryInterventionByEquipment, unlinkEquipment as _unlinkEquipment, updateInterventionStatus as _updateInterventionStatus, } from '../api/intervention-api';
21
+ export const fetchIntervention = createAsyncThunk('intervention_intervention/fetchIntervention', async function (data, { getState }) {
22
+ return handlerApiCall({
23
+ fetchFunction: _fetchIntervention,
24
+ data,
25
+ action: 'Intervention_SliceAction_FetchIntervention',
26
+ getState,
27
+ responseOptions: { isArrayResponse: true },
28
+ });
29
+ });
30
+ export const fetchInterventionById = createAsyncThunk('intervention_intervention/fetchInterventionById', async function (data, { getState }) {
31
+ return handlerApiCall({
32
+ fetchFunction: _fetchInterventionById,
33
+ data,
34
+ action: 'Intervention_SliceAction_FetchInterventionById',
35
+ getState,
36
+ responseOptions: { isArrayResponse: false },
37
+ });
38
+ });
39
+ export const searchHistoryInterventionByEquipment = createAsyncThunk('intervention_intervention/searchHistoryInterventionByEquipment', async function (data, { getState }) {
40
+ return handlerApiCall({
41
+ fetchFunction: _searchHistoryInterventionByEquipment,
42
+ data,
43
+ action: 'Intervention_SliceAction_SearchHistoryInterventionByEquipment',
44
+ getState,
45
+ responseOptions: { isArrayResponse: true },
46
+ });
47
+ });
48
+ export const fetchActiveIntervention = createAsyncThunk('intervention_intervention/fetchActiveIntervention', async function (data, { getState }) {
49
+ return handlerApiCall({
50
+ fetchFunction: _fetchActiveIntervention,
51
+ data,
52
+ action: 'Intervention_SliceAction_FetchActiveIntervention',
53
+ getState,
54
+ responseOptions: { isArrayResponse: false },
55
+ });
56
+ });
57
+ export const updateInterventionStatus = createAsyncThunk('intervention_intervention/updateInterventionStatus', async function (data, { getState, dispatch }) {
58
+ return handlerApiCall({
59
+ fetchFunction: _updateInterventionStatus,
60
+ data,
61
+ action: 'Intervention_SliceAction_UpdateInterventionStatus',
62
+ getState,
63
+ responseOptions: { isArrayResponse: false, showToast: true },
64
+ }).then(() => {
65
+ dispatch(fetchInterventionById({ interventionId: data.interventionId }));
66
+ });
67
+ });
68
+ export const unlinkEquipment = createAsyncThunk('intervention_intervention/unlinkEquipment', async function (data, { getState, dispatch }) {
69
+ return handlerApiCall({
70
+ fetchFunction: _unlinkEquipment,
71
+ data,
72
+ action: 'Intervention_SliceAction_UnlinkEquipment',
73
+ getState,
74
+ responseOptions: { isArrayResponse: false, showToast: true },
75
+ }).then(() => {
76
+ dispatch(fetchInterventionById(data));
77
+ });
78
+ });
79
+ export const linkEquipment = createAsyncThunk('intervention_intervention/linkEquipment', async function (data, { getState, dispatch }) {
80
+ return handlerApiCall({
81
+ fetchFunction: _linkEquipment,
82
+ data,
83
+ action: 'Intervention_SliceAction_LinkEquipment',
84
+ getState,
85
+ responseOptions: { isArrayResponse: false, showToast: true },
86
+ }).then(() => {
87
+ dispatch(fetchInterventionById(data));
88
+ });
89
+ });
90
+ const initialState = {
91
+ loading: true,
92
+ moreLoading: false,
93
+ isListEnd: false,
94
+ interventionList: [],
95
+ loadingHistoryList: true,
96
+ moreLoadingHistory: false,
97
+ isListEndHistory: false,
98
+ interventionHistoryList: [],
99
+ loadingIntervention: true,
100
+ intervention: {},
101
+ loadingActiveIntervention: false,
102
+ activeIntervention: {},
103
+ };
104
+ const interventionSlice = createSlice({
105
+ name: 'intervention_intervention',
106
+ initialState,
107
+ extraReducers: builder => {
108
+ generateInifiniteScrollCases(builder, fetchIntervention, {
109
+ loading: 'loading',
110
+ moreLoading: 'moreLoading',
111
+ isListEnd: 'isListEnd',
112
+ list: 'interventionList',
113
+ });
114
+ generateInifiniteScrollCases(builder, searchHistoryInterventionByEquipment, {
115
+ loading: 'loadingHistoryList',
116
+ moreLoading: 'moreLoadingHistory',
117
+ isListEnd: 'isListEndHistory',
118
+ list: 'interventionHistoryList',
119
+ });
120
+ builder.addCase(fetchInterventionById.pending, state => {
121
+ state.loadingIntervention = true;
122
+ });
123
+ builder.addCase(fetchInterventionById.fulfilled, (state, action) => {
124
+ state.loadingIntervention = false;
125
+ state.intervention = action.payload;
126
+ });
127
+ builder.addCase(fetchActiveIntervention.pending, state => {
128
+ state.loadingActiveIntervention = true;
129
+ });
130
+ builder.addCase(fetchActiveIntervention.fulfilled, (state, action) => {
131
+ state.loadingActiveIntervention = false;
132
+ state.activeIntervention = action.payload;
133
+ });
134
+ builder.addCase(fetchActiveIntervention.rejected, state => {
135
+ state.loadingActiveIntervention = false;
136
+ });
137
+ },
138
+ });
139
+ export const interventionReducer = interventionSlice.reducer;
140
+ //# sourceMappingURL=interventionSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interventionSlice.js","sourceRoot":"","sources":["../../src/features/interventionSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,IAAI,wBAAwB,EACnD,iBAAiB,IAAI,kBAAkB,EACvC,qBAAqB,IAAI,sBAAsB,EAC/C,aAAa,IAAI,cAAc,EAC/B,oCAAoC,IAAI,qCAAqC,EAC7E,eAAe,IAAI,gBAAgB,EACnC,wBAAwB,IAAI,yBAAyB,GACtD,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAC/C,6CAA6C,EAC7C,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,kBAAkB;QACjC,IAAI;QACJ,MAAM,E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O,CAAC,uBAAuB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACnE,KAAK,CAAC,yBAAyB,GAAG,KAAK,CAAC;YACxC,KAAK,CAAC,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE;YACxD,KAAK,CAAC,yBAAyB,GAAG,KAAK,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,OAAO,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const fetchQuestion: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
2
+ export const fetchQuestionById: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
3
+ export const updateQuestion: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
4
+ export const fetchRange: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
5
+ export const questionReducer: import("redux").Reducer<{
6
+ loading: boolean;
7
+ moreLoading: boolean;
8
+ isListEnd: boolean;
9
+ questionlist: any[];
10
+ loadingQuestion: boolean;
11
+ question: {};
12
+ loadingRangeList: boolean;
13
+ rangeList: any[];
14
+ }>;
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
19
+ import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
20
+ import { fetchQuestion as _fetchQuestion, fetchQuestionById as _fetchQuestionById, fetchRange as _fetchRange, updateQuestion as _updateQuestion, } from '../api/question-api';
21
+ export const fetchQuestion = createAsyncThunk('intervention_question/fetchQuestion', async function (data, { getState, dispatch }) {
22
+ return handlerApiCall({
23
+ fetchFunction: _fetchQuestion,
24
+ data,
25
+ action: 'Intervention_SliceAction_FetchQuestion',
26
+ getState,
27
+ responseOptions: { isArrayResponse: true },
28
+ }).then(res => {
29
+ if (data.rangeId == null && data.page === 0) {
30
+ dispatch(fetchRange({ interventionId: data.interventionId }));
31
+ }
32
+ return res;
33
+ });
34
+ });
35
+ export const fetchQuestionById = createAsyncThunk('intervention_question/fetchQuestionById', async function (data, { getState }) {
36
+ return handlerApiCall({
37
+ fetchFunction: _fetchQuestionById,
38
+ data,
39
+ action: 'Intervention_SliceAction_FetchQuestionById',
40
+ getState,
41
+ responseOptions: { isArrayResponse: false },
42
+ });
43
+ });
44
+ export const updateQuestion = createAsyncThunk('intervention_question/updateQuestion', async function (data, { getState, dispatch }) {
45
+ return handlerApiCall({
46
+ fetchFunction: _updateQuestion,
47
+ data,
48
+ action: 'Intervention_SliceAction_UpdateQuestion',
49
+ getState,
50
+ responseOptions: { isArrayResponse: false, showToast: true },
51
+ }).then(() => {
52
+ dispatch(fetchQuestion({
53
+ interventionId: data.interventionId,
54
+ rangeId: data.rangeId,
55
+ }));
56
+ });
57
+ });
58
+ export const fetchRange = createAsyncThunk('intervention_question/fetchRange', async function (data, { getState }) {
59
+ return handlerApiCall({
60
+ fetchFunction: _fetchRange,
61
+ data,
62
+ action: 'Intervention_SliceAction_FetchRange',
63
+ getState,
64
+ responseOptions: { isArrayResponse: true },
65
+ });
66
+ });
67
+ const initialState = {
68
+ loading: true,
69
+ moreLoading: false,
70
+ isListEnd: false,
71
+ questionlist: [],
72
+ loadingQuestion: true,
73
+ question: {},
74
+ loadingRangeList: true,
75
+ rangeList: [],
76
+ };
77
+ const questionSlice = createSlice({
78
+ name: 'intervention_question',
79
+ initialState,
80
+ extraReducers: builder => {
81
+ generateInifiniteScrollCases(builder, fetchQuestion, {
82
+ loading: 'loading',
83
+ moreLoading: 'moreLoading',
84
+ isListEnd: 'isListEnd',
85
+ list: 'questionlist',
86
+ });
87
+ builder.addCase(fetchQuestionById.pending, state => {
88
+ state.loadingQuestion = true;
89
+ });
90
+ builder.addCase(fetchQuestionById.fulfilled, (state, action) => {
91
+ state.loadingQuestion = false;
92
+ state.question = action.payload;
93
+ });
94
+ builder.addCase(fetchRange.pending, state => {
95
+ state.loadingRangeList = true;
96
+ });
97
+ builder.addCase(fetchRange.fulfilled, (state, action) => {
98
+ state.loadingRangeList = false;
99
+ state.rangeList = action.payload;
100
+ });
101
+ },
102
+ });
103
+ export const questionReducer = questionSlice.reducer;
104
+ //# sourceMappingURL=questionSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questionSlice.js","sourceRoot":"","sources":["../../src/features/questionSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,IAAI,cAAc,EAC/B,iBAAiB,IAAI,kBAAkB,EACvC,UAAU,IAAI,WAAW,EACzB,cAAc,IAAI,eAAe,GAClC,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,MAAM,aAAa,G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M,CAAC,OAAO,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;YAC1C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACtD,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC;YAC/B,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const useInterventionHeaders: () => void;
@@ -0,0 +1,141 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { useEffect } from 'react';
19
+ import { headerActionsProvider, useDispatch, useNavigation, useSelector, useTranslator, useTypes, } from '@axelor/aos-mobile-core';
20
+ import { useThemeColor } from '@axelor/aos-mobile-ui';
21
+ import { fetchInterventionById } from '../features/interventionSlice';
22
+ export const useInterventionHeaders = () => {
23
+ useEquipmentFormActions();
24
+ useInterventionDetailsActions();
25
+ useActiveInterventionActions();
26
+ };
27
+ const useEquipmentFormActions = () => {
28
+ const I18n = useTranslator();
29
+ const navigation = useNavigation();
30
+ const { Equipment } = useTypes();
31
+ const { mobileSettings } = useSelector((state) => state.appConfig);
32
+ const { equipment } = useSelector((state) => state.intervention_equipment);
33
+ useEffect(() => {
34
+ headerActionsProvider.registerModel('intervention_equipment_form', {
35
+ model: 'com.axelor.apps.intervention.db.Equipment',
36
+ modelId: equipment?.id,
37
+ disableMailMessages: !mobileSettings?.isTrackerMessageEnabled,
38
+ attachedFileScreenTitle: equipment?.name,
39
+ actions: [
40
+ {
41
+ key: 'openEquipmentLine',
42
+ title: I18n.t('Intervention_OpenEquipmentLine'),
43
+ order: 10,
44
+ iconName: 'card-list',
45
+ hideIf: equipment?.id == null ||
46
+ equipment?.typeSelect === Equipment?.typeSelect.Place,
47
+ onPress: () => navigation.navigate('EquipmentLineListScreen'),
48
+ },
49
+ {
50
+ key: 'openEquipmentPictures',
51
+ title: I18n.t('Intervention_OpenEquipmentPictures'),
52
+ order: 20,
53
+ iconName: 'images',
54
+ hideIf: equipment?.id == null,
55
+ onPress: () => navigation.navigate('EquipmentPictureScreen'),
56
+ },
57
+ {
58
+ key: 'openEquipmentIntervention',
59
+ title: I18n.t('Intervention_OpenEquipmentIntervention'),
60
+ order: 30,
61
+ iconName: 'car-front-fill',
62
+ hideIf: equipment?.id == null ||
63
+ equipment?.typeSelect === Equipment?.typeSelect.Place,
64
+ onPress: () => navigation.navigate('EquipmentInterventionListScreen'),
65
+ },
66
+ ],
67
+ });
68
+ }, [mobileSettings, equipment, I18n, navigation, Equipment?.typeSelect]);
69
+ };
70
+ const useInterventionDetailsActions = () => {
71
+ const I18n = useTranslator();
72
+ const Colors = useThemeColor();
73
+ const dispatch = useDispatch();
74
+ const { mobileSettings } = useSelector((state) => state.appConfig);
75
+ const { intervention } = useSelector((state) => state.intervention_intervention);
76
+ useEffect(() => {
77
+ headerActionsProvider.registerModel('intervention_intervention_details', {
78
+ model: 'com.axelor.apps.intervention.db.Intervention',
79
+ modelId: intervention?.id,
80
+ disableMailMessages: !mobileSettings?.isTrackerMessageEnabled,
81
+ attachedFileScreenTitle: intervention?.sequence,
82
+ actions: [
83
+ {
84
+ key: 'refreshIntervention',
85
+ order: 0,
86
+ iconName: 'arrow-repeat',
87
+ title: I18n.t('Intervention_RefreshIntervention'),
88
+ iconColor: Colors.primaryColor.background,
89
+ onPress: () => {
90
+ dispatch(fetchInterventionById({ interventionId: intervention.id }));
91
+ },
92
+ showInHeader: true,
93
+ },
94
+ ],
95
+ });
96
+ }, [
97
+ I18n,
98
+ Colors,
99
+ dispatch,
100
+ intervention,
101
+ mobileSettings?.isTrackerMessageEnabled,
102
+ ]);
103
+ };
104
+ const useActiveInterventionActions = () => {
105
+ const I18n = useTranslator();
106
+ const Colors = useThemeColor();
107
+ const dispatch = useDispatch();
108
+ const { mobileSettings } = useSelector((state) => state.appConfig);
109
+ const { intervention, activeIntervention } = useSelector((state) => state.intervention_intervention);
110
+ useEffect(() => {
111
+ headerActionsProvider.registerModel('intervention_active_intervention', {
112
+ model: 'com.axelor.apps.intervention.db.Intervention',
113
+ modelId: activeIntervention?.id,
114
+ disableMailMessages: !mobileSettings?.isTrackerMessageEnabled,
115
+ attachedFileScreenTitle: intervention?.sequence,
116
+ actions: [
117
+ {
118
+ key: 'refreshIntervention',
119
+ order: 0,
120
+ iconName: 'arrow-repeat',
121
+ title: I18n.t('Intervention_RefreshIntervention'),
122
+ iconColor: Colors.primaryColor.background,
123
+ hideIf: activeIntervention?.id == null ||
124
+ intervention?.id !== activeIntervention?.id,
125
+ onPress: () => {
126
+ dispatch(fetchInterventionById({ interventionId: intervention.id }));
127
+ },
128
+ showInHeader: true,
129
+ },
130
+ ],
131
+ });
132
+ }, [
133
+ I18n,
134
+ Colors,
135
+ dispatch,
136
+ intervention,
137
+ mobileSettings?.isTrackerMessageEnabled,
138
+ activeIntervention?.id,
139
+ ]);
140
+ };
141
+ //# sourceMappingURL=use-intervention-header-actions.js.map