@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,35 @@
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 React, { useCallback } from 'react';
19
+ import { displayItemName, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
20
+ import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
21
+ import { searchContract } from '../../../features/contractSlice';
22
+ const ContractSearchBarAux = ({ style = null, title = 'Intervention_Contract', defaultValue = null, onChange = () => { }, readonly = false, required = false, showDetailsPopup = true, navigate = false, oneFilter = false, showTitle = true, customerId = null, }) => {
23
+ const I18n = useTranslator();
24
+ const dispatch = useDispatch();
25
+ const { loadingList, moreLoading, isListEnd, contractList } = useSelector((state) => state.intervention_contract);
26
+ const searchContractAPI = useCallback(({ page = 0, searchValue }) => {
27
+ dispatch(searchContract({ page, partnerId: customerId, searchValue }));
28
+ }, [dispatch, customerId]);
29
+ return (<AutoCompleteSearch title={showTitle && I18n.t(title)} objectList={contractList} value={defaultValue} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchContractAPI} displayValue={displayItemName} placeholder={I18n.t(title)} showDetailsPopup={showDetailsPopup} loadingList={loadingList} moreLoading={moreLoading} isListEnd={isListEnd} navigate={navigate} oneFilter={oneFilter} style={style}/>);
30
+ };
31
+ const ContractSearchBar = ({ style = null, title = 'Intervention_Contract', defaultValue = null, onChange = () => { }, readonly = false, required = false, showDetailsPopup = true, navigate = false, oneFilter = false, showTitle = true, customerId = null, }) => {
32
+ return (<ContractSearchBarAux style={style} title={title} defaultValue={defaultValue} onChange={onChange} readonly={readonly} required={required} showDetailsPopup={showDetailsPopup} navigate={navigate} oneFilter={oneFilter} showTitle={showTitle} customerId={customerId}/>);
33
+ };
34
+ export default ContractSearchBar;
35
+ //# sourceMappingURL=ContractSearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContractSearchBar.js","sourceRoot":"","sources":["../../../../src/components/organisms/ContractSearchBar/ContractSearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CA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CAAC,EACvB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface DropdownCardsProps {
3
+ intervention: any;
4
+ }
5
+ declare const DropdownCards: ({ intervention }: DropdownCardsProps) => React.JSX.Element;
6
+ export default DropdownCards;
@@ -0,0 +1,45 @@
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 React from 'react';
19
+ import { StyleSheet } from 'react-native';
20
+ import { useTranslator } from '@axelor/aos-mobile-core';
21
+ import { DropdownCardSwitch } from '@axelor/aos-mobile-ui';
22
+ import { DropdownContactView } from '@axelor/aos-mobile-crm';
23
+ import { DropdownGeneralView } from '../../molecules';
24
+ const DropdownCards = ({ intervention }) => {
25
+ const I18n = useTranslator();
26
+ return (<DropdownCardSwitch styleTitle={styles.dropdownTitle} dropdownItems={[
27
+ {
28
+ title: I18n.t('Crm_Contact'),
29
+ childrenComp: (<DropdownContactView address={intervention.address.fullName} fixedPhone={intervention.contact?.fixedPhone} mobilePhone={intervention.contact?.mobilePhone} emailAddress={intervention.contact?.emailAddress?.address}/>),
30
+ key: 1,
31
+ },
32
+ {
33
+ title: I18n.t('Crm_GeneralInformation'),
34
+ childrenComp: (<DropdownGeneralView assignedToName={intervention.assignedTo?.fullName} interventionTypeName={intervention.interventionType?.name} description={intervention.description} onCallManagement={intervention.customerRequest?.onCallManagement}/>),
35
+ key: 2,
36
+ },
37
+ ]}/>);
38
+ };
39
+ const styles = StyleSheet.create({
40
+ dropdownTitle: {
41
+ fontWeight: 'bold',
42
+ },
43
+ });
44
+ export default DropdownCards;
45
+ //# sourceMappingURL=DropdownCards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownCards.js","sourceRoot":"","sources":["../../../../src/components/organisms/DropdownCards/DropdownCards.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAMpD,MAAM,aAAa,GAAG,CAAC,EAAC,YAAY,EAAqB,EAAE,EAAE;IAC3D,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,kBAAkB,CACjB,UAAU,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CACjC,aAAa,CAAC,CAAC;YACb;gBACE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;gBAC5B,YAAY,EAAE,CACZ,CAAC,mBAAmB,CAClB,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CACvC,UAAU,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,CAC7C,WAAW,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAC/C,YAAY,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAC1D,CACH;gBACD,GAAG,EAAE,CAAC;aACP;YACD;gBACE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC;gBACvC,YAAY,EAAE,CACZ,CAAC,mBAAmB,CAClB,cAAc,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAClD,oBAAoB,CAAC,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAC1D,WAAW,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CACtC,gBAAgB,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,gBAAgB,CAAC,EACjE,CACH;gBACD,GAAG,EAAE,CAAC;aACP;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE;QACb,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CustomComponentProps } from '../../../utils';
3
+ declare const EquipmentFamilySearchBar: ({ style, title, defaultValue, onChange, readonly, required, showDetailsPopup, navigate, oneFilter, showTitle, }: CustomComponentProps) => React.JSX.Element;
4
+ export default EquipmentFamilySearchBar;
@@ -0,0 +1,35 @@
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 React, { useCallback } from 'react';
19
+ import { displayItemName, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
20
+ import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
21
+ import { searchEquipmentFamily } from '../../../features/equipmentFamilySlice';
22
+ const EquipmentFamilySearchBarAux = ({ style = null, title = 'Intervention_EquipmentFamily', defaultValue = null, onChange = () => { }, readonly = false, required = false, showDetailsPopup = true, navigate = false, oneFilter = false, showTitle = true, }) => {
23
+ const I18n = useTranslator();
24
+ const dispatch = useDispatch();
25
+ const { loadingList, moreLoading, isListEnd, equipmentFamilyList } = useSelector((state) => state.intervention_equipmentFamily);
26
+ const searchEquipmentFamilyAPI = useCallback(({ page = 0, searchValue }) => {
27
+ dispatch(searchEquipmentFamily({ page, searchValue }));
28
+ }, [dispatch]);
29
+ return (<AutoCompleteSearch title={showTitle && I18n.t(title)} objectList={equipmentFamilyList} value={defaultValue} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchEquipmentFamilyAPI} displayValue={displayItemName} placeholder={I18n.t(title)} showDetailsPopup={showDetailsPopup} loadingList={loadingList} moreLoading={moreLoading} isListEnd={isListEnd} navigate={navigate} oneFilter={oneFilter} style={style}/>);
30
+ };
31
+ const EquipmentFamilySearchBar = ({ style = null, title = 'Intervention_EquipmentFamily', defaultValue = null, onChange = () => { }, readonly = false, required = false, showDetailsPopup = true, navigate = false, oneFilter = false, showTitle = true, }) => {
32
+ return (<EquipmentFamilySearchBarAux style={style} title={title} defaultValue={defaultValue} onChange={onChange} readonly={readonly} required={required} showDetailsPopup={showDetailsPopup} navigate={navigate} oneFilter={oneFilter} showTitle={showTitle}/>);
33
+ };
34
+ export default EquipmentFamilySearchBar;
35
+ //# sourceMappingURL=EquipmentFamilySearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EquipmentFamilySearchBar.js","sourceRoot":"","sources":["../../../../src/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WA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B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const EquipmentModeSwitch: ({ setMode }: {
3
+ setMode: (data: any) => void;
4
+ }) => React.JSX.Element;
5
+ export default EquipmentModeSwitch;
@@ -0,0 +1,50 @@
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 React, { useEffect, useMemo } from 'react';
19
+ import { StyleSheet } from 'react-native';
20
+ import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
21
+ import { NumberBubble, ToggleSwitch, useThemeColor } from '@axelor/aos-mobile-ui';
22
+ import { Equipment } from '../../../types';
23
+ import { fetchNumberClientEquipment, fetchNumberInterventionEquipment, } from '../../../features/equipmentSlice';
24
+ const EquipmentModeSwitch = ({ setMode }) => {
25
+ const I18n = useTranslator();
26
+ const Colors = useThemeColor();
27
+ const dispatch = useDispatch();
28
+ const { intervention } = useSelector((state) => state.intervention_intervention);
29
+ const { totalNumberClientEquipment, totalNumberInterventionEquipment } = useSelector((state) => state.intervention_equipment);
30
+ const idsInterventionEquipement = useMemo(() => intervention.equipmentSet.map(equipment => equipment.id), [intervention]);
31
+ useEffect(() => {
32
+ dispatch(fetchNumberInterventionEquipment({
33
+ idsInterventionEquipement,
34
+ }));
35
+ dispatch(fetchNumberClientEquipment({
36
+ partnerId: intervention.deliveredPartner?.id,
37
+ }));
38
+ }, [dispatch, idsInterventionEquipement, intervention.deliveredPartner?.id]);
39
+ return (<ToggleSwitch leftTitle={I18n.t('Intervention_Intervention')} rightTitle={I18n.t('Intervention_Customer')} leftElement={<NumberBubble style={styles.indicator} number={totalNumberInterventionEquipment} color={Colors.primaryColor} isNeutralBackground={true}/>} rigthElement={<NumberBubble style={styles.indicator} number={totalNumberClientEquipment} color={Colors.primaryColor} isNeutralBackground={true}/>} onSwitch={() => setMode(_mode => _mode === Equipment.mode.intervention
40
+ ? Equipment.mode.client
41
+ : Equipment.mode.intervention)}/>);
42
+ };
43
+ const styles = StyleSheet.create({
44
+ indicator: {
45
+ position: 'absolute',
46
+ right: 10,
47
+ },
48
+ });
49
+ export default EquipmentModeSwitch;
50
+ //# sourceMappingURL=EquipmentModeSwitch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EquipmentModeSwitch.js","sourceRoot":"","sources":["../../../../src/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAE1C,MAAM,mBAAmB,GAAG,CAAC,EAAC,OAAO,EAAiC,EAAE,EAAE;IACxE,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,QAAQ,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AC,CAAC,0BAA0B,CAAC,CACnC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC3B,mBAAmB,CAAC,CAAC,IAAI,CAAC,EAC1B,CACH,CACD,QAAQ,CAAC,CAAC,GAAG,EAAE,CACb,OAAO,CAAC,KAAK,CAAC,EAAE,CACd,KAAK,KAAK,SAAS,CAAC,IAAI,CAAC,YAAY;YACnC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM;YACvB,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAChC,CACF,EACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface InterventionNoteTypePickerProps {
3
+ defaultValue?: string;
4
+ onChange: (noteType: any) => void;
5
+ isScrollViewContainer?: boolean;
6
+ }
7
+ declare const InterventionNoteTypePicker: ({ defaultValue, onChange, isScrollViewContainer, }: InterventionNoteTypePickerProps) => React.JSX.Element;
8
+ export default InterventionNoteTypePicker;
@@ -0,0 +1,32 @@
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 React, { useEffect } from 'react';
19
+ import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
20
+ import { Picker } from '@axelor/aos-mobile-ui';
21
+ import { fetchInterventionNoteType } from '../../../features/interventionNoteSlice';
22
+ const InterventionNoteTypePicker = ({ defaultValue = null, onChange = () => { }, isScrollViewContainer = false, }) => {
23
+ const I18n = useTranslator();
24
+ const dispatch = useDispatch();
25
+ const { interventionNoteTypeList } = useSelector((state) => state.intervention_interventionNote);
26
+ useEffect(() => {
27
+ dispatch(fetchInterventionNoteType());
28
+ }, [dispatch]);
29
+ return (<Picker title={I18n.t('Intervention_Type')} listItems={interventionNoteTypeList} labelField="name" valueField="id" defaultValue={defaultValue} onValueChange={onChange} isValueItem isScrollViewContainer={isScrollViewContainer}/>);
30
+ };
31
+ export default InterventionNoteTypePicker;
32
+ //# sourceMappingURL=InterventionNoteTypePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InterventionNoteTypePicker.js","sourceRoot":"","sources":["../../../../src/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,yBAAyB,EAAC,MAAM,yCAAyC,CAAC;AAQlF,MAAM,0BAA0B,GAAG,CAAC,EAClC,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,qBAAqB,GAAG,KAAK,GACG,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,EAAC,wBAAwB,EAAC,GAAG,WAAW,CAC5C,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,6BAA6B,CACpD,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAE,yBAAiC,EAAE,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CACnC,SAAS,CAAC,CAAC,wBAAwB,CAAC,CACpC,UAAU,CAAC,MAAM,CACjB,UAAU,CAAC,IAAI,CACf,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,aAAa,CAAC,CAAC,QAAQ,CAAC,CACxB,WAAW,CACX,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,EAC7C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CustomComponentProps } from '../../../utils';
3
+ declare const PlaceEquipmentSearchBar: ({ style, title, defaultValue, onChange, readonly, required, showDetailsPopup, navigate, oneFilter, showTitle, customerId, }: CustomComponentProps) => React.JSX.Element;
4
+ export default PlaceEquipmentSearchBar;
@@ -0,0 +1,36 @@
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 React, { useCallback } from 'react';
19
+ import { displayItemName, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
20
+ import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
21
+ import { searchPlaceEquipment } from '../../../features/equipmentSlice';
22
+ const PlaceEquipmentSearchBar = ({ style = null, title = 'Intervention_ParentPlace', defaultValue = null, onChange = () => { }, readonly = false, required = false, showDetailsPopup = true, navigate = false, oneFilter = false, showTitle = false, customerId = null, }) => {
23
+ const I18n = useTranslator();
24
+ const dispatch = useDispatch();
25
+ const { loadingListEquipPlace, moreLoadingEquipPlace, isListEndEquipPlace, equipmentPlaceList, } = useSelector((state) => state.intervention_equipment);
26
+ const searchPlaceEquipmentAPI = useCallback(({ page = 0, searchValue }) => {
27
+ dispatch(searchPlaceEquipment({
28
+ page,
29
+ searchValue,
30
+ partnerId: customerId,
31
+ }));
32
+ }, [customerId, dispatch]);
33
+ return (<AutoCompleteSearch title={showTitle && I18n.t(title)} objectList={equipmentPlaceList} value={defaultValue} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchPlaceEquipmentAPI} displayValue={displayItemName} placeholder={I18n.t(title)} showDetailsPopup={showDetailsPopup} loadingList={loadingListEquipPlace} moreLoading={moreLoadingEquipPlace} isListEnd={isListEndEquipPlace} navigate={navigate} oneFilter={oneFilter} style={style}/>);
34
+ };
35
+ export default PlaceEquipmentSearchBar;
36
+ //# sourceMappingURL=PlaceEquipmentSearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaceEquipmentSearchBar.js","sourceRoot":"","sources":["../../../../src/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,oBAAoB,EAA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CAAC,eAAe,CAAC,CAC9B,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAC3B,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAC/B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CustomComponentProps } from '../../../utils';
3
+ declare const TypePicker: ({ title, defaultValue, onChange, readonly, required, }: CustomComponentProps) => React.JSX.Element;
4
+ export default TypePicker;
@@ -0,0 +1,29 @@
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 React, { useMemo } from 'react';
19
+ import { Picker } from '@axelor/aos-mobile-ui';
20
+ import { useTranslator, useTypes, useTypeHelpers } from '@axelor/aos-mobile-core';
21
+ const TypePicker = ({ title = 'Intervention_Type', defaultValue = null, onChange = () => { }, readonly = false, required = false, }) => {
22
+ const I18n = useTranslator();
23
+ const { Equipment } = useTypes();
24
+ const { getSelectionItems } = useTypeHelpers();
25
+ const equipmentTypeList = useMemo(() => getSelectionItems(Equipment?.typeSelect), [Equipment?.typeSelect, getSelectionItems]);
26
+ return (<Picker title={I18n.t(title)} defaultValue={defaultValue} listItems={equipmentTypeList} labelField="title" valueField="key" emptyValue={false} onValueChange={onChange} required={required} readonly={readonly}/>);
27
+ };
28
+ export default TypePicker;
29
+ //# sourceMappingURL=TypePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypePicker.js","sourceRoot":"","sources":["../../../../src/components/organisms/TypePicker/TypePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAGhF,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,GAAG,mBAAmB,EAC3B,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,GACK,EAAE,EAAE;IACzB,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAC,SAAS,EAAC,GAAG,QAAQ,EAAE,CAAC;IAC/B,MAAM,EAAC,iBAAiB,EAAC,GAAG,cAAc,EAAE,CAAC;IAE7C,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,EAC9C,CAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAC3C,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CACrB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAC7B,UAAU,CAAC,OAAO,CAClB,UAAU,CAAC,KAAK,CAChB,UAAU,CAAC,CAAC,KAAK,CAAC,CAClB,aAAa,CAAC,CAAC,QAAQ,CAAC,CACxB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { default as ClientProspectSearchBar } from './ClientProspectSearchBar/ClientProspectSearchBar';
2
+ export { default as ContractSearchBar } from './ContractSearchBar/ContractSearchBar';
3
+ export { default as DropdownCards } from './DropdownCards/DropdownCards';
4
+ export { default as EquipmentFamilySearchBar } from './EquipmentFamilySearchBar/EquipmentFamilySearchBar';
5
+ export { default as EquipmentModeSwitch } from './EquipmentModeSwitch/EquipmentModeSwitch';
6
+ export { default as InterventionNoteTypePicker } from './InterventionNoteTypePicker/InterventionNoteTypePicker';
7
+ export { default as PlaceEquipmentSearchBar } from './PlaceEquipmentSearchBar/PlaceEquipmentSearchBar';
8
+ export { default as TypePicker } from './TypePicker/TypePicker';
@@ -0,0 +1,26 @@
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 { default as ClientProspectSearchBar } from './ClientProspectSearchBar/ClientProspectSearchBar';
19
+ export { default as ContractSearchBar } from './ContractSearchBar/ContractSearchBar';
20
+ export { default as DropdownCards } from './DropdownCards/DropdownCards';
21
+ export { default as EquipmentFamilySearchBar } from './EquipmentFamilySearchBar/EquipmentFamilySearchBar';
22
+ export { default as EquipmentModeSwitch } from './EquipmentModeSwitch/EquipmentModeSwitch';
23
+ export { default as InterventionNoteTypePicker } from './InterventionNoteTypePicker/InterventionNoteTypePicker';
24
+ export { default as PlaceEquipmentSearchBar } from './PlaceEquipmentSearchBar/PlaceEquipmentSearchBar';
25
+ export { default as TypePicker } from './TypePicker/TypePicker';
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/organisms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,mDAAmD,CAAC;AACrG,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,wBAAwB,EAAC,MAAM,qDAAqD,CAAC;AACxG,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAC,OAAO,IAAI,0BAA0B,EAAC,MAAM,yDAAyD,CAAC;AAC9G,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,mDAAmD,CAAC;AACrG,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const EquipmentView: ({}: {}) => React.JSX.Element;
3
+ export default EquipmentView;
@@ -0,0 +1,161 @@
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 React, { useCallback, useEffect, useMemo, useState } from 'react';
19
+ import { SearchListView, useDispatch, useNavigation, usePermitted, useSelector, useTranslator, useTypes, useTypeHelpers, } from '@axelor/aos-mobile-core';
20
+ import { ChipSelect } from '@axelor/aos-mobile-ui';
21
+ import { EquipmentActionCard, InterventionHeader } from '../../molecules';
22
+ import { EquipmentModeSwitch } from '../../organisms';
23
+ import { LinkEquipmentPopup } from '../../templates';
24
+ import { fetchNumberClientEquipment, searchEquipment, searchInterventionEquipment, } from '../../../features/equipmentSlice';
25
+ import { unlinkEquipment } from '../../../features/interventionSlice';
26
+ import { Equipment as EquipmentType } from '../../../types';
27
+ const EquipmentView = ({}) => {
28
+ const I18n = useTranslator();
29
+ const navigation = useNavigation();
30
+ const dispatch = useDispatch();
31
+ const { readonly: interventionReadonly } = usePermitted({
32
+ modelName: 'com.axelor.apps.intervention.db.Intervention',
33
+ });
34
+ const { canCreate, canDelete, readonly } = usePermitted({
35
+ modelName: 'com.axelor.apps.intervention.db.Equipment',
36
+ });
37
+ const { Equipment } = useTypes();
38
+ const { getSelectionItems } = useTypeHelpers();
39
+ const { intervention } = useSelector((state) => state.intervention_intervention);
40
+ const { loadingList, moreLoading, isListEnd, equipmentList, loadingInterventionEquipmentList, moreLoadingInterventionEquipment, isInterventionEquipmentListEnd, interventionEquipmentList, } = useSelector((state) => state.intervention_equipment);
41
+ const [selectedStatus, setSelectedStatus] = useState([]);
42
+ const [mode, setMode] = useState(EquipmentType.mode.intervention);
43
+ const [alertVisible, setAlertVisible] = useState(false);
44
+ const isInterventionMode = useMemo(() => mode === EquipmentType.mode.intervention, [mode]);
45
+ const serviceStatusList = useMemo(() => getSelectionItems(Equipment?.serviceSelect, selectedStatus), [Equipment?.serviceSelect, getSelectionItems, selectedStatus]);
46
+ const actionList = useMemo(() => {
47
+ const _actionList = [];
48
+ if (interventionReadonly && isInterventionMode) {
49
+ return _actionList;
50
+ }
51
+ if (canCreate) {
52
+ _actionList.push({
53
+ iconName: 'plus',
54
+ title: I18n.t('Intervention_CreateEquipment'),
55
+ onPress: () => navigation.navigate('EquipmentFormView', {
56
+ isCreation: true,
57
+ interventionId: isInterventionMode && intervention.id,
58
+ interventionVersion: isInterventionMode && intervention.version,
59
+ }),
60
+ });
61
+ }
62
+ if (isInterventionMode) {
63
+ _actionList.push({
64
+ iconName: 'link-45deg',
65
+ title: I18n.t('Intervention_LinkEquipment'),
66
+ onPress: () => setAlertVisible(true),
67
+ });
68
+ }
69
+ return _actionList;
70
+ }, [
71
+ I18n,
72
+ canCreate,
73
+ intervention.id,
74
+ intervention.version,
75
+ isInterventionMode,
76
+ navigation,
77
+ interventionReadonly,
78
+ ]);
79
+ const idsInterventionEquipement = useMemo(() => intervention.equipmentSet.map(equipment => equipment.id), [intervention]);
80
+ const searchEquipmentData = useMemo(() => ({
81
+ idsInterventionEquipement,
82
+ partnerId: intervention.deliveredPartner?.id,
83
+ inService: selectedStatus[0]?.key,
84
+ }), [
85
+ idsInterventionEquipement,
86
+ intervention.deliveredPartner?.id,
87
+ selectedStatus,
88
+ ]);
89
+ const ObjectToDisplay = useMemo(() => {
90
+ if (isInterventionMode) {
91
+ return {
92
+ list: interventionEquipmentList,
93
+ loading: loadingInterventionEquipmentList,
94
+ moreLoading: moreLoadingInterventionEquipment,
95
+ isListEnd: isInterventionEquipmentListEnd,
96
+ sliceFunction: searchInterventionEquipment,
97
+ sliceFunctionData: searchEquipmentData,
98
+ };
99
+ }
100
+ else {
101
+ return {
102
+ list: equipmentList,
103
+ loading: loadingList,
104
+ moreLoading: moreLoading,
105
+ isListEnd: isListEnd,
106
+ sliceFunction: searchEquipment,
107
+ sliceFunctionData: searchEquipmentData,
108
+ };
109
+ }
110
+ }, [
111
+ equipmentList,
112
+ interventionEquipmentList,
113
+ isInterventionEquipmentListEnd,
114
+ isInterventionMode,
115
+ isListEnd,
116
+ loadingInterventionEquipmentList,
117
+ loadingList,
118
+ moreLoading,
119
+ moreLoadingInterventionEquipment,
120
+ searchEquipmentData,
121
+ ]);
122
+ useEffect(() => {
123
+ dispatch(searchInterventionEquipment(searchEquipmentData));
124
+ dispatch(searchEquipment(searchEquipmentData));
125
+ }, [
126
+ dispatch,
127
+ idsInterventionEquipement,
128
+ intervention.deliveredPartner.id,
129
+ searchEquipmentData,
130
+ ]);
131
+ const handleUnlinkEquipment = useCallback(equipmentId => {
132
+ dispatch(unlinkEquipment({
133
+ interventionId: intervention.id,
134
+ interventionVersion: intervention.version,
135
+ equipmentId,
136
+ }));
137
+ }, [dispatch, intervention.id, intervention.version]);
138
+ return (<>
139
+ <SearchListView {...ObjectToDisplay} searchPlaceholder={I18n.t('Base_Search')} headerTopChildren={<InterventionHeader intervention={intervention}/>} headerChildren={<EquipmentModeSwitch setMode={setMode}/>} chipComponent={<ChipSelect mode="switch" onChangeValue={setSelectedStatus} selectionItems={serviceStatusList}/>} renderListItem={({ item }) => (<EquipmentActionCard idEquipment={item.id} equipmentVersion={item.version} sequence={item.sequence} name={item.name} code={item.code} equipmentFamily={item.equipmentFamily?.name} inService={item.inService} isUnlinkAction={isInterventionMode && !interventionReadonly} handleUnlink={() => handleUnlinkEquipment(item.id)} handleArchive={() => {
140
+ if (isInterventionMode) {
141
+ handleUnlinkEquipment(item.id);
142
+ }
143
+ else {
144
+ setSelectedStatus(_current => [..._current]);
145
+ dispatch(fetchNumberClientEquipment({
146
+ partnerId: intervention.deliveredPartner?.id,
147
+ }));
148
+ }
149
+ }} handleDuplicate={isInterventionMode
150
+ ? equipmentId => navigation.navigate('EquipmentFormView', {
151
+ idEquipment: equipmentId,
152
+ isCreation: true,
153
+ interventionId: intervention.id,
154
+ interventionVersion: intervention.version,
155
+ })
156
+ : null} canArchive={canDelete} canCopy={canCreate} canEdit={!readonly}/>)} actionList={actionList}/>
157
+ <LinkEquipmentPopup visible={alertVisible} onClose={() => setAlertVisible(false)}/>
158
+ </>);
159
+ };
160
+ export default EquipmentView;
161
+ //# sourceMappingURL=EquipmentView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EquipmentView.js","sourceRoot":"","sources":["../../../../src/components/pages/EquipmentView/EquipmentView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvE,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,QAAQ,EACR,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE1D,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE;IAC3B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAC,QAAQ,EAA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,CAAC,CAAC;iBAChC;qBAAM;oBACL,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;oBAC7C,QAAQ,CACL,0BAAkC,CAAC;wBAClC,SAAS,EAAE,YAAY,CAAC,gBAAgB,EAAE,EAAE;qBAC7C,CAAC,CACH,CAAC;iBACH;YACH,CAAC,CAAC,CACF,eAAe,CAAC,CACd,kBAAkB;gBAChB,CAAC,CAAC,WAAW,CAAC,EAAE,CACZ,UAAU,CAAC,QAAQ,CAAC,mBAAmB,EAAE;oBACvC,WAAW,EAAE,WAAW;oBACxB,UAAU,EAAE,IAAI;oBAChB,cAAc,EAAE,YAAY,CAAC,EAAE;oBAC/B,mBAAmB,EAAE,YAAY,CAAC,OAAO;iBAC1C,CAAC;gBACN,CAAC,CAAC,IAAI,CACT,CACD,UAAU,CAAC,CAAC,SAAS,CAAC,CACtB,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC,CACF,UAAU,CAAC,CAAC,UAAU,CAAC,EAEzB;MAAA,CAAC,kBAAkB,CACjB,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAE1C;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const GeneralInformationView: ({}: {}) => React.JSX.Element;
3
+ export default GeneralInformationView;