@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.
- package/README.md +46 -0
- package/lib/api/client-and-prospect-api.d.ts +4 -0
- package/lib/api/client-and-prospect-api.js +57 -0
- package/lib/api/client-and-prospect-api.js.map +1 -0
- package/lib/api/contract-api.d.ts +5 -0
- package/lib/api/contract-api.js +45 -0
- package/lib/api/contract-api.js.map +1 -0
- package/lib/api/equipment-api.d.ts +43 -0
- package/lib/api/equipment-api.js +212 -0
- package/lib/api/equipment-api.js.map +1 -0
- package/lib/api/equipment-family-api.d.ts +4 -0
- package/lib/api/equipment-family-api.js +28 -0
- package/lib/api/equipment-family-api.js.map +1 -0
- package/lib/api/equipment-line-api.d.ts +4 -0
- package/lib/api/equipment-line-api.js +38 -0
- package/lib/api/equipment-line-api.js.map +1 -0
- package/lib/api/equipment-picture-api.d.ts +14 -0
- package/lib/api/equipment-picture-api.js +56 -0
- package/lib/api/equipment-picture-api.js.map +1 -0
- package/lib/api/index.d.ts +9 -0
- package/lib/api/index.js +27 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/intervention-api.d.ts +34 -0
- package/lib/api/intervention-api.js +149 -0
- package/lib/api/intervention-api.js.map +1 -0
- package/lib/api/intervention-note-api.d.ts +19 -0
- package/lib/api/intervention-note-api.js +79 -0
- package/lib/api/intervention-note-api.js.map +1 -0
- package/lib/api/question-api.d.ts +14 -0
- package/lib/api/question-api.js +78 -0
- package/lib/api/question-api.js.map +1 -0
- package/lib/components/atoms/EquipmentCard/EquipmentCard.d.ts +11 -0
- package/lib/components/atoms/EquipmentCard/EquipmentCard.js +65 -0
- package/lib/components/atoms/EquipmentCard/EquipmentCard.js.map +1 -0
- package/lib/components/atoms/EquipmentLineCard/EquipmentLineCard.d.ts +12 -0
- package/lib/components/atoms/EquipmentLineCard/EquipmentLineCard.js +42 -0
- package/lib/components/atoms/EquipmentLineCard/EquipmentLineCard.js.map +1 -0
- package/lib/components/atoms/InterventionCard/InterventionCard.d.ts +15 -0
- package/lib/components/atoms/InterventionCard/InterventionCard.js +97 -0
- package/lib/components/atoms/InterventionCard/InterventionCard.js.map +1 -0
- package/lib/components/atoms/NoteCard/NoteCard.d.ts +12 -0
- package/lib/components/atoms/NoteCard/NoteCard.js +65 -0
- package/lib/components/atoms/NoteCard/NoteCard.js.map +1 -0
- package/lib/components/atoms/PictureCard/PictureCard.d.ts +10 -0
- package/lib/components/atoms/PictureCard/PictureCard.js +71 -0
- package/lib/components/atoms/PictureCard/PictureCard.js.map +1 -0
- package/lib/components/atoms/QuestionCard/QuestionCard.d.ts +10 -0
- package/lib/components/atoms/QuestionCard/QuestionCard.js +67 -0
- package/lib/components/atoms/QuestionCard/QuestionCard.js.map +1 -0
- package/lib/components/atoms/index.d.ts +6 -0
- package/lib/components/atoms/index.js +24 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.js +23 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/DropdownGeneralView/DropdownGeneralView.d.ts +9 -0
- package/lib/components/molecules/DropdownGeneralView/DropdownGeneralView.js +32 -0
- package/lib/components/molecules/DropdownGeneralView/DropdownGeneralView.js.map +1 -0
- package/lib/components/molecules/EquipmentActionCard/EquipmentActionCard.d.ts +19 -0
- package/lib/components/molecules/EquipmentActionCard/EquipmentActionCard.js +77 -0
- package/lib/components/molecules/EquipmentActionCard/EquipmentActionCard.js.map +1 -0
- package/lib/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.d.ts +3 -0
- package/lib/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.js +48 -0
- package/lib/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.js.map +1 -0
- package/lib/components/molecules/GtCard/GtCard.d.ts +11 -0
- package/lib/components/molecules/GtCard/GtCard.js +76 -0
- package/lib/components/molecules/GtCard/GtCard.js.map +1 -0
- package/lib/components/molecules/InterventionDetailCard/InterventionDetailCard.d.ts +19 -0
- package/lib/components/molecules/InterventionDetailCard/InterventionDetailCard.js +52 -0
- package/lib/components/molecules/InterventionDetailCard/InterventionDetailCard.js.map +1 -0
- package/lib/components/molecules/InterventionHeader/InterventionHeader.d.ts +6 -0
- package/lib/components/molecules/InterventionHeader/InterventionHeader.js +52 -0
- package/lib/components/molecules/InterventionHeader/InterventionHeader.js.map +1 -0
- package/lib/components/molecules/NoteDetailCard/NoteDetailCard.d.ts +19 -0
- package/lib/components/molecules/NoteDetailCard/NoteDetailCard.js +68 -0
- package/lib/components/molecules/NoteDetailCard/NoteDetailCard.js.map +1 -0
- package/lib/components/molecules/PicturesRow/PicturesRow.d.ts +10 -0
- package/lib/components/molecules/PicturesRow/PicturesRow.js +36 -0
- package/lib/components/molecules/PicturesRow/PicturesRow.js.map +1 -0
- package/lib/components/molecules/QuestionAdvancedMonitoring/QuestionAdvancedMonitoring.d.ts +9 -0
- package/lib/components/molecules/QuestionAdvancedMonitoring/QuestionAdvancedMonitoring.js +31 -0
- package/lib/components/molecules/QuestionAdvancedMonitoring/QuestionAdvancedMonitoring.js.map +1 -0
- package/lib/components/molecules/QuestionCheckbox/QuestionCheckbox.d.ts +7 -0
- package/lib/components/molecules/QuestionCheckbox/QuestionCheckbox.js +36 -0
- package/lib/components/molecules/QuestionCheckbox/QuestionCheckbox.js.map +1 -0
- package/lib/components/molecules/QuestionList/QuestionList.d.ts +9 -0
- package/lib/components/molecules/QuestionList/QuestionList.js +29 -0
- package/lib/components/molecules/QuestionList/QuestionList.js.map +1 -0
- package/lib/components/molecules/QuestionMeasure/QuestionMeasure.d.ts +9 -0
- package/lib/components/molecules/QuestionMeasure/QuestionMeasure.js +39 -0
- package/lib/components/molecules/QuestionMeasure/QuestionMeasure.js.map +1 -0
- package/lib/components/molecules/index.d.ts +12 -0
- package/lib/components/molecules/index.js +30 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/ClientProspectSearchBar/ClientProspectSearchBar.d.ts +4 -0
- package/lib/components/organisms/ClientProspectSearchBar/ClientProspectSearchBar.js +32 -0
- package/lib/components/organisms/ClientProspectSearchBar/ClientProspectSearchBar.js.map +1 -0
- package/lib/components/organisms/ContractSearchBar/ContractSearchBar.d.ts +4 -0
- package/lib/components/organisms/ContractSearchBar/ContractSearchBar.js +35 -0
- package/lib/components/organisms/ContractSearchBar/ContractSearchBar.js.map +1 -0
- package/lib/components/organisms/DropdownCards/DropdownCards.d.ts +6 -0
- package/lib/components/organisms/DropdownCards/DropdownCards.js +45 -0
- package/lib/components/organisms/DropdownCards/DropdownCards.js.map +1 -0
- package/lib/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.d.ts +4 -0
- package/lib/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.js +35 -0
- package/lib/components/organisms/EquipmentFamilySearchBar/EquipmentFamilySearchBar.js.map +1 -0
- package/lib/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.d.ts +5 -0
- package/lib/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.js +50 -0
- package/lib/components/organisms/EquipmentModeSwitch/EquipmentModeSwitch.js.map +1 -0
- package/lib/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.d.ts +8 -0
- package/lib/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.js +32 -0
- package/lib/components/organisms/InterventionNoteTypePicker/InterventionNoteTypePicker.js.map +1 -0
- package/lib/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.d.ts +4 -0
- package/lib/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.js +36 -0
- package/lib/components/organisms/PlaceEquipmentSearchBar/PlaceEquipmentSearchBar.js.map +1 -0
- package/lib/components/organisms/TypePicker/TypePicker.d.ts +4 -0
- package/lib/components/organisms/TypePicker/TypePicker.js +29 -0
- package/lib/components/organisms/TypePicker/TypePicker.js.map +1 -0
- package/lib/components/organisms/index.d.ts +8 -0
- package/lib/components/organisms/index.js +26 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/components/pages/EquipmentView/EquipmentView.d.ts +3 -0
- package/lib/components/pages/EquipmentView/EquipmentView.js +161 -0
- package/lib/components/pages/EquipmentView/EquipmentView.js.map +1 -0
- package/lib/components/pages/GeneralInformationView/GeneralInformationView.d.ts +3 -0
- package/lib/components/pages/GeneralInformationView/GeneralInformationView.js +94 -0
- package/lib/components/pages/GeneralInformationView/GeneralInformationView.js.map +1 -0
- package/lib/components/pages/HistoryView/HistoryView.d.ts +3 -0
- package/lib/components/pages/HistoryView/HistoryView.js +33 -0
- package/lib/components/pages/HistoryView/HistoryView.js.map +1 -0
- package/lib/components/pages/NoteView/NoteView.d.ts +3 -0
- package/lib/components/pages/NoteView/NoteView.js +47 -0
- package/lib/components/pages/NoteView/NoteView.js.map +1 -0
- package/lib/components/pages/SurveyView/SurveyView.d.ts +7 -0
- package/lib/components/pages/SurveyView/SurveyView.js +60 -0
- package/lib/components/pages/SurveyView/SurveyView.js.map +1 -0
- package/lib/components/pages/index.d.ts +5 -0
- package/lib/components/pages/index.js +23 -0
- package/lib/components/pages/index.js.map +1 -0
- package/lib/components/templates/InterventionsListView/InterventionsListView.d.ts +7 -0
- package/lib/components/templates/InterventionsListView/InterventionsListView.js +73 -0
- package/lib/components/templates/InterventionsListView/InterventionsListView.js.map +1 -0
- package/lib/components/templates/LinkEquipmentPopup/LinkEquipmentPopup.d.ts +7 -0
- package/lib/components/templates/LinkEquipmentPopup/LinkEquipmentPopup.js +70 -0
- package/lib/components/templates/LinkEquipmentPopup/LinkEquipmentPopup.js.map +1 -0
- package/lib/components/templates/SurveyRangeNavigation/SurveyRangeNavigation.d.ts +7 -0
- package/lib/components/templates/SurveyRangeNavigation/SurveyRangeNavigation.js +76 -0
- package/lib/components/templates/SurveyRangeNavigation/SurveyRangeNavigation.js.map +1 -0
- package/lib/components/templates/index.d.ts +3 -0
- package/lib/components/templates/index.js +21 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +9 -0
- package/lib/features/asyncFunctions-index.js +27 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/clientAndProspectSlice.d.ts +7 -0
- package/lib/features/clientAndProspectSlice.js +49 -0
- package/lib/features/clientAndProspectSlice.js.map +1 -0
- package/lib/features/contractSlice.d.ts +7 -0
- package/lib/features/contractSlice.js +49 -0
- package/lib/features/contractSlice.js.map +1 -0
- package/lib/features/equipmentFamilySlice.d.ts +7 -0
- package/lib/features/equipmentFamilySlice.js +49 -0
- package/lib/features/equipmentFamilySlice.js.map +1 -0
- package/lib/features/equipmentLineSlice.d.ts +7 -0
- package/lib/features/equipmentLineSlice.js +49 -0
- package/lib/features/equipmentLineSlice.js.map +1 -0
- package/lib/features/equipmentPictureSlice.d.ts +37 -0
- package/lib/features/equipmentPictureSlice.js +67 -0
- package/lib/features/equipmentPictureSlice.js.map +1 -0
- package/lib/features/equipmentSlice.d.ts +34 -0
- package/lib/features/equipmentSlice.js +205 -0
- package/lib/features/equipmentSlice.js.map +1 -0
- package/lib/features/index.d.ts +9 -0
- package/lib/features/index.js +27 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/interventionNoteSlice.d.ts +16 -0
- package/lib/features/interventionNoteSlice.js +114 -0
- package/lib/features/interventionNoteSlice.js.map +1 -0
- package/lib/features/interventionSlice.d.ts +21 -0
- package/lib/features/interventionSlice.js +140 -0
- package/lib/features/interventionSlice.js.map +1 -0
- package/lib/features/questionSlice.d.ts +14 -0
- package/lib/features/questionSlice.js +104 -0
- package/lib/features/questionSlice.js.map +1 -0
- package/lib/hooks/use-intervention-header-actions.d.ts +1 -0
- package/lib/hooks/use-intervention-header-actions.js +141 -0
- package/lib/hooks/use-intervention-header-actions.js.map +1 -0
- package/lib/i18n/en.json +106 -0
- package/lib/i18n/fr.json +106 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +94 -0
- package/lib/index.js.map +1 -0
- package/lib/models/forms.d.ts +2 -0
- package/lib/models/forms.js +333 -0
- package/lib/models/forms.js.map +1 -0
- package/lib/models/index.d.ts +5 -0
- package/lib/models/index.js +23 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/objectFields.d.ts +2 -0
- package/lib/models/objectFields.js +143 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +33 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +28 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/models/typeObjects.d.ts +2 -0
- package/lib/models/typeObjects.js +205 -0
- package/lib/models/typeObjects.js.map +1 -0
- package/lib/screens/equipment/CustomerParkScreen.d.ts +3 -0
- package/lib/screens/equipment/CustomerParkScreen.js +56 -0
- package/lib/screens/equipment/CustomerParkScreen.js.map +1 -0
- package/lib/screens/equipment/EquipmentFormView.d.ts +6 -0
- package/lib/screens/equipment/EquipmentFormView.js +104 -0
- package/lib/screens/equipment/EquipmentFormView.js.map +1 -0
- package/lib/screens/equipment/EquipmentInterventionListScreen.d.ts +3 -0
- package/lib/screens/equipment/EquipmentInterventionListScreen.js +43 -0
- package/lib/screens/equipment/EquipmentInterventionListScreen.js.map +1 -0
- package/lib/screens/equipment/EquipmentLineListScreen.d.ts +3 -0
- package/lib/screens/equipment/EquipmentLineListScreen.js +37 -0
- package/lib/screens/equipment/EquipmentLineListScreen.js.map +1 -0
- package/lib/screens/equipment/EquipmentPictureScreen.d.ts +3 -0
- package/lib/screens/equipment/EquipmentPictureScreen.js +113 -0
- package/lib/screens/equipment/EquipmentPictureScreen.js.map +1 -0
- package/lib/screens/equipment/index.d.ts +45 -0
- package/lib/screens/equipment/index.js +61 -0
- package/lib/screens/equipment/index.js.map +1 -0
- package/lib/screens/intervention/ActiveInterventionScreen.d.ts +3 -0
- package/lib/screens/intervention/ActiveInterventionScreen.js +72 -0
- package/lib/screens/intervention/ActiveInterventionScreen.js.map +1 -0
- package/lib/screens/intervention/DayInterventionsScreen.d.ts +3 -0
- package/lib/screens/intervention/DayInterventionsScreen.js +33 -0
- package/lib/screens/intervention/DayInterventionsScreen.js.map +1 -0
- package/lib/screens/intervention/InterventionDetailsScreen.d.ts +7 -0
- package/lib/screens/intervention/InterventionDetailsScreen.js +83 -0
- package/lib/screens/intervention/InterventionDetailsScreen.js.map +1 -0
- package/lib/screens/intervention/InterventionNoteFormScreen.d.ts +6 -0
- package/lib/screens/intervention/InterventionNoteFormScreen.js +81 -0
- package/lib/screens/intervention/InterventionNoteFormScreen.js.map +1 -0
- package/lib/screens/intervention/InterventionQuestionFormScreen.d.ts +6 -0
- package/lib/screens/intervention/InterventionQuestionFormScreen.js +114 -0
- package/lib/screens/intervention/InterventionQuestionFormScreen.js.map +1 -0
- package/lib/screens/intervention/InterventionsHistoryScreen.d.ts +3 -0
- package/lib/screens/intervention/InterventionsHistoryScreen.js +29 -0
- package/lib/screens/intervention/InterventionsHistoryScreen.js.map +1 -0
- package/lib/screens/intervention/PlannedInterventionsScreen.d.ts +3 -0
- package/lib/screens/intervention/PlannedInterventionsScreen.js +29 -0
- package/lib/screens/intervention/PlannedInterventionsScreen.js.map +1 -0
- package/lib/screens/intervention/index.d.ts +79 -0
- package/lib/screens/intervention/index.js +89 -0
- package/lib/screens/intervention/index.js.map +1 -0
- package/lib/types/equipment.d.ts +7 -0
- package/lib/types/equipment.js +25 -0
- package/lib/types/equipment.js.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +21 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/intervention.d.ts +4 -0
- package/lib/types/intervention.js +38 -0
- package/lib/types/intervention.js.map +1 -0
- package/lib/types/question.d.ts +4 -0
- package/lib/types/question.js +44 -0
- package/lib/types/question.js.map +1 -0
- package/lib/utils/form-types.d.ts +9 -0
- package/lib/utils/form-types.js +19 -0
- package/lib/utils/form-types.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface NoteCardProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
metaFile: any;
|
|
5
|
+
description: string;
|
|
6
|
+
createdOn: string;
|
|
7
|
+
updatedOn: string;
|
|
8
|
+
createdBy: any;
|
|
9
|
+
updatedBy: any;
|
|
10
|
+
}
|
|
11
|
+
declare const NoteCard: ({ style, metaFile, description, createdOn, updatedOn, createdBy, updatedBy, }: NoteCardProps) => React.JSX.Element;
|
|
12
|
+
export default NoteCard;
|
|
@@ -0,0 +1,65 @@
|
|
|
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, View } from 'react-native';
|
|
20
|
+
import { formatDate, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { ObjectCard } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const NoteCard = ({ style, metaFile, description, createdOn, updatedOn, createdBy, updatedBy, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
return (<View style={style}>
|
|
25
|
+
<ObjectCard style={styles.container} touchable={false} showArrow={false} upperTexts={{
|
|
26
|
+
items: [
|
|
27
|
+
{
|
|
28
|
+
displayText: metaFile ? metaFile.fileName : description,
|
|
29
|
+
isTitle: true,
|
|
30
|
+
style: styles.marginBottom,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
indicatorText: I18n.t('Intervention_CreatedOn'),
|
|
34
|
+
displayText: formatDate(createdOn, I18n.t('Base_DateFormat')),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
indicatorText: I18n.t('Intervention_UpdatedOn'),
|
|
38
|
+
displayText: formatDate(updatedOn, I18n.t('Base_DateFormat')),
|
|
39
|
+
hideIf: updatedOn == null,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
indicatorText: I18n.t('Intervention_CreatedBy'),
|
|
43
|
+
displayText: createdBy?.fullName,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
indicatorText: I18n.t('Intervention_UpdatedBy'),
|
|
47
|
+
displayText: updatedBy?.fullName,
|
|
48
|
+
hideIf: updatedBy?.fullName == null,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
}}/>
|
|
52
|
+
</View>);
|
|
53
|
+
};
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
minHeight: 100,
|
|
57
|
+
marginHorizontal: 1,
|
|
58
|
+
marginVertical: 1,
|
|
59
|
+
},
|
|
60
|
+
marginBottom: {
|
|
61
|
+
marginBottom: 5,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
export default NoteCard;
|
|
65
|
+
//# sourceMappingURL=NoteCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoteCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/NoteCard/NoteCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UA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AI,CAAC,CAAC,CAAC,wBAAwB,CAAC;oBAC/C,WAAW,EAAE,SAAS,EAAE,QAAQ;oBAChC,MAAM,EAAE,SAAS,EAAE,QAAQ,IAAI,IAAI;iBACpC;aACF;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,SAAS,EAAE,GAAG;QACd,gBAAgB,EAAE,CAAC;QACnB,cAAc,EAAE,CAAC;KAClB;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PictureCardProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
item: any;
|
|
5
|
+
handleDelete: () => void;
|
|
6
|
+
showDeleteIcon: any;
|
|
7
|
+
onSelectImage: (itemId: any) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const PictureCard: ({ style, item, handleDelete, showDeleteIcon, onSelectImage, }: PictureCardProps) => React.JSX.Element;
|
|
10
|
+
export default PictureCard;
|
|
@@ -0,0 +1,71 @@
|
|
|
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, { useRef } from 'react';
|
|
19
|
+
import { Animated, Dimensions, StyleSheet, TouchableOpacity, View, } from 'react-native';
|
|
20
|
+
import { AOSImage, openFileInExternalApp, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { CircleButton, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const IMAGE_HEIGHT = Dimensions.get('window').width * 0.45;
|
|
23
|
+
const PictureCard = ({ style, item, handleDelete, showDeleteIcon, onSelectImage, }) => {
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const { baseUrl, token, jsessionId } = useSelector((state) => state.auth);
|
|
27
|
+
const shakeAnimation = useRef(new Animated.Value(0)).current;
|
|
28
|
+
const handleLongPress = () => {
|
|
29
|
+
onSelectImage(item.id);
|
|
30
|
+
startShakeAnimation(shakeAnimation);
|
|
31
|
+
};
|
|
32
|
+
const startShakeAnimation = animationRef => {
|
|
33
|
+
Animated.loop(Animated.sequence([
|
|
34
|
+
Animated.timing(animationRef, {
|
|
35
|
+
toValue: 5,
|
|
36
|
+
duration: 100,
|
|
37
|
+
useNativeDriver: true,
|
|
38
|
+
}),
|
|
39
|
+
Animated.timing(animationRef, {
|
|
40
|
+
toValue: -5,
|
|
41
|
+
duration: 100,
|
|
42
|
+
useNativeDriver: true,
|
|
43
|
+
}),
|
|
44
|
+
]), { iterations: 2 }).start();
|
|
45
|
+
};
|
|
46
|
+
const handleShowFile = async () => {
|
|
47
|
+
await openFileInExternalApp({ fileName: item?.fileName, id: item?.id, isMetaFile: true }, { baseUrl: baseUrl, token: token, jsessionId: jsessionId }, I18n);
|
|
48
|
+
};
|
|
49
|
+
return (<View style={style}>
|
|
50
|
+
<TouchableOpacity onPress={handleShowFile} onLongPress={handleLongPress} delayLongPress={300}>
|
|
51
|
+
<Animated.View style={{ transform: [{ translateX: shakeAnimation }] }}>
|
|
52
|
+
<AOSImage imageSize={styles.imageSize} resizeMode="contain" metaFile={item} defaultIconSize={IMAGE_HEIGHT}/>
|
|
53
|
+
</Animated.View>
|
|
54
|
+
</TouchableOpacity>
|
|
55
|
+
{showDeleteIcon && (<CircleButton iconName="x-lg" size={30} isNeutralBackground={true} style={styles.closeIcon} onPress={handleDelete} color={Colors.importantColor} square={false}/>)}
|
|
56
|
+
</View>);
|
|
57
|
+
};
|
|
58
|
+
const styles = StyleSheet.create({
|
|
59
|
+
imageSize: {
|
|
60
|
+
height: IMAGE_HEIGHT,
|
|
61
|
+
width: IMAGE_HEIGHT,
|
|
62
|
+
},
|
|
63
|
+
closeIcon: {
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
right: -5,
|
|
66
|
+
top: -10,
|
|
67
|
+
minHeight: null,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
export default PictureCard;
|
|
71
|
+
//# sourceMappingURL=PictureCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PictureCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/PictureCard/PictureCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AACpC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAElE,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC;AAU3D,MAAM,WAAW,GAAG,CAAC,EACnB,KAAK,EACL,IAAI,EACJ,Y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;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface QuestionCardProps {
|
|
3
|
+
status: number;
|
|
4
|
+
interventionRange: any;
|
|
5
|
+
title: string;
|
|
6
|
+
isPrivate?: boolean;
|
|
7
|
+
onPress: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const QuestionCard: ({ status, interventionRange, title, isPrivate, onPress, }: QuestionCardProps) => React.JSX.Element;
|
|
10
|
+
export default QuestionCard;
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { StyleSheet } from 'react-native';
|
|
20
|
+
import { useTranslator, useTypes, useTypeHelpers } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { InfoBubble, ObjectCard, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const QuestionCard = ({ status, interventionRange, title, isPrivate = false, onPress, }) => {
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const { InterventionQuestion } = useTypes();
|
|
26
|
+
const { getItemColor } = useTypeHelpers();
|
|
27
|
+
const styles = useMemo(() => getStyles(getItemColor(InterventionQuestion?.statusSelect, status)?.background), [InterventionQuestion?.statusSelect, getItemColor, status]);
|
|
28
|
+
if (status === InterventionQuestion?.statusSelect.Hidden) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return (<ObjectCard style={styles.border} leftContainerFlex={6} onPress={onPress} upperTexts={{
|
|
32
|
+
items: [
|
|
33
|
+
{
|
|
34
|
+
displayText: interventionRange?.rangeVal?.title,
|
|
35
|
+
style: styles.details,
|
|
36
|
+
hideIfNull: true,
|
|
37
|
+
},
|
|
38
|
+
{ displayText: interventionRange?.equipment?.name, hideIfNull: true },
|
|
39
|
+
{
|
|
40
|
+
displayText: title,
|
|
41
|
+
isTitle: true,
|
|
42
|
+
hideIfNull: true,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
}} sideBadges={{
|
|
46
|
+
style: styles.badges,
|
|
47
|
+
items: [
|
|
48
|
+
isPrivate && {
|
|
49
|
+
customComponent: (<InfoBubble coloredBubble={false} iconName="lock" badgeColor={Colors.secondaryColor_dark} indication={I18n.t('Intervention_PrivateQuestion')} position="left"/>),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
}}/>);
|
|
53
|
+
};
|
|
54
|
+
const getStyles = (color) => StyleSheet.create({
|
|
55
|
+
border: {
|
|
56
|
+
borderLeftWidth: 7,
|
|
57
|
+
borderLeftColor: color,
|
|
58
|
+
},
|
|
59
|
+
badges: {
|
|
60
|
+
alignItems: 'flex-end',
|
|
61
|
+
},
|
|
62
|
+
details: {
|
|
63
|
+
fontStyle: 'italic',
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
export default QuestionCard;
|
|
67
|
+
//# sourceMappingURL=QuestionCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuestionCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/QuestionCard/QuestionCard.t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IAAI;iBACjB;gBACD,EAAC,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC;gBACnE;oBACE,WAAW,EAAE,KAAK;oBAClB,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE,IAAI;iBACjB;aACF;SACF,CAAC,CACF,UAAU,CAAC,CAAC;YACV,KAAK,EAAE,MAAM,CAAC,MAAM;YACpB,KAAK,EAAE;gBACL,SAAS,IAAI;oBACX,eAAe,EAAE,CACf,CAAC,UAAU,CACT,aAAa,CAAC,CAAC,KAAK,CAAC,CACrB,QAAQ,CAAC,MAAM,CACf,UAAU,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CACvC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CACnD,QAAQ,CAAC,MAAM,EACf,CACH;iBACF;aACF;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,eAAe,EAAE,CAAC;QAClB,eAAe,EAAE,KAAK;KACvB;IACD,MAAM,EAAE;QACN,UAAU,EAAE,UAAU;KACvB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEL,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as EquipmentCard } from './EquipmentCard/EquipmentCard';
|
|
2
|
+
export { default as EquipmentLineCard } from './EquipmentLineCard/EquipmentLineCard';
|
|
3
|
+
export { default as InterventionCard } from './InterventionCard/InterventionCard';
|
|
4
|
+
export { default as NoteCard } from './NoteCard/NoteCard';
|
|
5
|
+
export { default as PictureCard } from './PictureCard/PictureCard';
|
|
6
|
+
export { default as QuestionCard } from './QuestionCard/QuestionCard';
|
|
@@ -0,0 +1,24 @@
|
|
|
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 EquipmentCard } from './EquipmentCard/EquipmentCard';
|
|
19
|
+
export { default as EquipmentLineCard } from './EquipmentLineCard/EquipmentLineCard';
|
|
20
|
+
export { default as InterventionCard } from './InterventionCard/InterventionCard';
|
|
21
|
+
export { default as NoteCard } from './NoteCard/NoteCard';
|
|
22
|
+
export { default as PictureCard } from './PictureCard/PictureCard';
|
|
23
|
+
export { default as QuestionCard } from './QuestionCard/QuestionCard';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/atoms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 * from './atoms';
|
|
19
|
+
export * from './molecules';
|
|
20
|
+
export * from './organisms';
|
|
21
|
+
export * from './pages';
|
|
22
|
+
export * from './templates';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DropdownGeneralViewProps {
|
|
3
|
+
assignedToName?: string;
|
|
4
|
+
interventionTypeName?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
onCallManagement?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const DropdownGeneralView: ({ assignedToName, interventionTypeName, description, onCallManagement, }: DropdownGeneralViewProps) => React.JSX.Element;
|
|
9
|
+
export default DropdownGeneralView;
|
|
@@ -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 from 'react';
|
|
19
|
+
import { View } from 'react-native';
|
|
20
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { LabelText, checkNullString } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const DropdownGeneralView = ({ assignedToName, interventionTypeName, description, onCallManagement, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
return (<View>
|
|
25
|
+
{!checkNullString(assignedToName) && (<LabelText iconName="person-fill" title={I18n.t('Intervention_AssignedTo')} value={assignedToName}/>)}
|
|
26
|
+
{!checkNullString(interventionTypeName) && (<LabelText title={I18n.t('Intervention_Type')} value={interventionTypeName}/>)}
|
|
27
|
+
{!checkNullString(description) && (<LabelText title={I18n.t('Intervention_Description')} value={description}/>)}
|
|
28
|
+
<LabelText title={I18n.t('Intervention_OnCallManagement')} value={I18n.t(onCallManagement ? 'Base_Yes' : 'Base_No')}/>
|
|
29
|
+
</View>);
|
|
30
|
+
};
|
|
31
|
+
export default DropdownGeneralView;
|
|
32
|
+
//# sourceMappingURL=DropdownGeneralView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownGeneralView.js","sourceRoot":"","sources":["../../../../src/components/molecules/DropdownGeneralView/DropdownGeneralView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AASjE,MAAM,mBAAmB,GAAG,CAAC,EAC3B,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,gBAAgB,GACS,EAAE,EAAE;IAC7B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,IAAI,CACH;MAAA,CAAC,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,CACnC,CAAC,SAAS,CACR,QAAQ,CAAC,aAAa,CACtB,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CACzC,KAAK,CAAC,CAAC,cAAc,CAAC,EACtB,CACH,CACD;MAAA,CAAC,CAAC,eAAe,CAAC,oBAAoB,CAAC,IAAI,CACzC,CAAC,SAAS,CACR,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CACnC,KAAK,CAAC,CAAC,oBAAoB,CAAC,EAC5B,CACH,CACD;MAAA,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAChC,CAAC,SAAS,CACR,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAC1C,KAAK,CAAC,CAAC,WAAW,CAAC,EACnB,CACH,CACD;MAAA,CAAC,SAAS,CACR,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAC/C,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAE7D;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface EquipmentActionCardProps {
|
|
3
|
+
idEquipment: number;
|
|
4
|
+
equipmentVersion: number;
|
|
5
|
+
sequence: string;
|
|
6
|
+
name: string;
|
|
7
|
+
code: string;
|
|
8
|
+
equipmentFamily: string;
|
|
9
|
+
inService: boolean;
|
|
10
|
+
isUnlinkAction?: boolean;
|
|
11
|
+
canCopy?: boolean;
|
|
12
|
+
canEdit?: boolean;
|
|
13
|
+
canArchive?: boolean;
|
|
14
|
+
handleArchive?: () => void;
|
|
15
|
+
handleUnlink?: () => void;
|
|
16
|
+
handleDuplicate?: (equipmentId: number) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const EquipmentActionCard: ({ idEquipment, equipmentVersion, sequence, name, code, equipmentFamily, inService, isUnlinkAction, canCopy, canEdit, canArchive, handleArchive, handleUnlink, handleDuplicate, }: EquipmentActionCardProps) => React.JSX.Element;
|
|
19
|
+
export default EquipmentActionCard;
|
|
@@ -0,0 +1,77 @@
|
|
|
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, View } from 'react-native';
|
|
20
|
+
import { InfoButton, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useDispatch, useNavigation, useTranslator, } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { EquipmentCard } from '../../atoms';
|
|
23
|
+
import { archiveEquipment, copyEquipment, } from '../../../features/equipmentSlice';
|
|
24
|
+
const EquipmentActionCard = ({ idEquipment, equipmentVersion, sequence, name, code, equipmentFamily, inService, isUnlinkAction = false, canCopy = true, canEdit = true, canArchive = true, handleArchive = () => { }, handleUnlink, handleDuplicate, }) => {
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const I18n = useTranslator();
|
|
27
|
+
const navigation = useNavigation();
|
|
28
|
+
const dispatch = useDispatch();
|
|
29
|
+
return (<View style={styles.globalContainer}>
|
|
30
|
+
<EquipmentCard style={styles.objectCardContainer} sequence={sequence} name={name} code={code} equipmentFamily={equipmentFamily} inService={inService}/>
|
|
31
|
+
{(isUnlinkAction || canCopy) && (<View style={styles.flexOne}>
|
|
32
|
+
{isUnlinkAction && (<InfoButton style={styles.flexOne} iconName="x-lg" iconColor={Colors.secondaryColor_dark.background} onPress={handleUnlink} indication={I18n.t('Intervention_Unlink')}/>)}
|
|
33
|
+
{canCopy && (<InfoButton style={styles.flexOne} iconName="front" iconColor={Colors.secondaryColor_dark.background} onPress={() => dispatch(copyEquipment({
|
|
34
|
+
equipmentId: idEquipment,
|
|
35
|
+
})).then(({ payload }) => {
|
|
36
|
+
const equipmentId = payload?.id;
|
|
37
|
+
if (equipmentId != null) {
|
|
38
|
+
handleDuplicate != null
|
|
39
|
+
? handleDuplicate(equipmentId)
|
|
40
|
+
: navigation.navigate('EquipmentFormView', {
|
|
41
|
+
idEquipment: equipmentId,
|
|
42
|
+
isCreation: true,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
})} indication={I18n.t('Intervention_Duplicate')}/>)}
|
|
46
|
+
</View>)}
|
|
47
|
+
<View style={styles.flexOne}>
|
|
48
|
+
<InfoButton style={styles.flexOne} iconName={canEdit ? 'pencil-fill' : 'file-earmark-text'} iconColor={Colors.secondaryColor_dark.background} onPress={() => {
|
|
49
|
+
navigation.navigate('EquipmentFormView', {
|
|
50
|
+
idEquipment,
|
|
51
|
+
});
|
|
52
|
+
}} indication={I18n.t('Intervention_Edit')}/>
|
|
53
|
+
{canArchive && (<InfoButton style={styles.flexOne} iconName="archive-fill" iconColor={Colors.errorColor.background} onPress={() => dispatch(archiveEquipment({
|
|
54
|
+
equipmentId: idEquipment,
|
|
55
|
+
equipmentVersion,
|
|
56
|
+
})).then(() => handleArchive())} indication={I18n.t('Intervention_Archive')}/>)}
|
|
57
|
+
</View>
|
|
58
|
+
</View>);
|
|
59
|
+
};
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
globalContainer: {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
marginHorizontal: 10,
|
|
65
|
+
marginVertical: 2,
|
|
66
|
+
flex: 1,
|
|
67
|
+
},
|
|
68
|
+
objectCardContainer: {
|
|
69
|
+
flex: 7,
|
|
70
|
+
marginVertical: 2,
|
|
71
|
+
},
|
|
72
|
+
flexOne: {
|
|
73
|
+
flex: 1,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
export default EquipmentActionCard;
|
|
77
|
+
//# sourceMappingURL=EquipmentActionCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipmentActionCard.js","sourceRoot":"","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,EAAE,CAAC;KAClB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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, View } from 'react-native';
|
|
20
|
+
import { Badge, LabelText, Text } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useSelector, useTypes, useTypeHelpers } from '@axelor/aos-mobile-core';
|
|
22
|
+
const EquipmentDetailsHeader = () => {
|
|
23
|
+
const { Equipment } = useTypes();
|
|
24
|
+
const { getItemColor, getItemTitle } = useTypeHelpers();
|
|
25
|
+
const { equipment } = useSelector((state) => state.intervention_equipment);
|
|
26
|
+
return (<View style={styles.headerContainer}>
|
|
27
|
+
<View style={styles.headerChildrenContainer}>
|
|
28
|
+
<View>
|
|
29
|
+
<Text writingType="title">{equipment.sequence}</Text>
|
|
30
|
+
<Text>{equipment.code}</Text>
|
|
31
|
+
<Text>{equipment.name}</Text>
|
|
32
|
+
<LabelText iconName="palette2" title={equipment.equipmentFamily?.name}/>
|
|
33
|
+
</View>
|
|
34
|
+
<Badge color={getItemColor(Equipment?.serviceSelect, equipment.inService)} title={getItemTitle(Equipment?.serviceSelect, equipment.inService)}/>
|
|
35
|
+
</View>
|
|
36
|
+
</View>);
|
|
37
|
+
};
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
headerContainer: {
|
|
40
|
+
marginHorizontal: 24,
|
|
41
|
+
},
|
|
42
|
+
headerChildrenContainer: {
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
justifyContent: 'space-between',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
export default EquipmentDetailsHeader;
|
|
48
|
+
//# sourceMappingURL=EquipmentDetailsHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipmentDetailsHeader.js","sourceRoot":"","sources":["../../../../src/components/molecules/EquipmentDetailsHeader/EquipmentDetailsHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAE9E,MAAM,sBAAsB,GAAG,GAAG,EAAE;IAClC,MAAM,EAAC,SAAS,EAAC,GAAG,QAAQ,EAAE,CAAC;IAC/B,MAAM,EAAC,YAAY,EAAE,YAAY,EAAC,GAAG,cAAc,EAAE,CAAC;IAEtD,MAAM,EAAC,SAAS,EAAC,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAE9E,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAClC;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAC1C;QAAA,CAAC,IAAI,CACH;UAAA,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,IAAI,CACpD;UAAA,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAC5B;UAAA,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAC5B;UAAA,CAAC,SAAS,CACR,QAAQ,CAAC,UAAU,CACnB,KAAK,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,EAE3C;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,KAAK,CACJ,KAAK,CAAC,CAAC,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CACnE,KAAK,CAAC,CAAC,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAEvE;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,gBAAgB,EAAE,EAAE;KACrB;IACD,uBAAuB,EAAE;QACvB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface GtCardProps {
|
|
3
|
+
titleKey: string;
|
|
4
|
+
maxDate: string;
|
|
5
|
+
realGt: number;
|
|
6
|
+
plannedGt: number;
|
|
7
|
+
interventionStatus: number;
|
|
8
|
+
gtStatus: number;
|
|
9
|
+
}
|
|
10
|
+
declare const GtCard: ({ titleKey, maxDate, realGt, plannedGt, interventionStatus, gtStatus, }: GtCardProps) => React.JSX.Element;
|
|
11
|
+
export default GtCard;
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { StyleSheet } from 'react-native';
|
|
20
|
+
import { formatDateTime, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Card, Text, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const DURATION_NEARLY_EXPIRED_IN_HOURS = 24 * 7;
|
|
23
|
+
const GtCard = ({ titleKey, maxDate, realGt, plannedGt, interventionStatus, gtStatus, }) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const borderStyle = useMemo(() => {
|
|
27
|
+
let color = Colors.successColor;
|
|
28
|
+
if (maxDate == null) {
|
|
29
|
+
color = Colors.secondaryColor;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const _maxDate = new Date(maxDate);
|
|
33
|
+
if (interventionStatus < gtStatus) {
|
|
34
|
+
const todayDate = new Date();
|
|
35
|
+
const nearlyExpiredDate = new Date(Date.now() - DURATION_NEARLY_EXPIRED_IN_HOURS * 60 * 60 * 1000);
|
|
36
|
+
if (_maxDate < todayDate) {
|
|
37
|
+
color = Colors.errorColor;
|
|
38
|
+
}
|
|
39
|
+
else if (_maxDate < nearlyExpiredDate) {
|
|
40
|
+
color = Colors.cautionColor;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
color = Colors.progressColor;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (realGt > plannedGt) {
|
|
47
|
+
color = Colors.errorColor;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return getStyles(color.background)?.border;
|
|
51
|
+
}, [Colors, gtStatus, interventionStatus, maxDate, plannedGt, realGt]);
|
|
52
|
+
return (<Card style={[styles.container, borderStyle]}>
|
|
53
|
+
<Text writingType="title">{I18n.t(titleKey)}</Text>
|
|
54
|
+
<Text style={styles.date}>
|
|
55
|
+
{maxDate ? formatDateTime(maxDate, I18n.t('Base_DateTimeFormat')) : '-'}
|
|
56
|
+
</Text>
|
|
57
|
+
</Card>);
|
|
58
|
+
};
|
|
59
|
+
const getStyles = color => StyleSheet.create({
|
|
60
|
+
border: {
|
|
61
|
+
borderLeftWidth: 7,
|
|
62
|
+
borderLeftColor: color,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
const styles = StyleSheet.create({
|
|
66
|
+
container: {
|
|
67
|
+
width: '90%',
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
marginBottom: 5,
|
|
70
|
+
},
|
|
71
|
+
date: {
|
|
72
|
+
marginLeft: 20,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
export default GtCard;
|
|
76
|
+
//# sourceMappingURL=GtCard.js.map
|