@axelor/aos-mobile-maintenance 8.5.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 +42 -0
- package/lib/api/equipement-maintenance-api.d.ts +5 -0
- package/lib/api/equipement-maintenance-api.js +42 -0
- package/lib/api/equipement-maintenance-api.js.map +1 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +20 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/maintenance-request-api.d.ts +14 -0
- package/lib/api/maintenance-request-api.js +86 -0
- package/lib/api/maintenance-request-api.js.map +1 -0
- package/lib/components/atoms/EquipementMaintenanceCard/EquipementMaintenanceCard.d.ts +14 -0
- package/lib/components/atoms/EquipementMaintenanceCard/EquipementMaintenanceCard.js +57 -0
- package/lib/components/atoms/EquipementMaintenanceCard/EquipementMaintenanceCard.js.map +1 -0
- package/lib/components/atoms/MaintenanceRequestCard/MaintenanceRequestCard.d.ts +15 -0
- package/lib/components/atoms/MaintenanceRequestCard/MaintenanceRequestCard.js +69 -0
- package/lib/components/atoms/MaintenanceRequestCard/MaintenanceRequestCard.js.map +1 -0
- package/lib/components/atoms/index.d.ts +2 -0
- package/lib/components/atoms/index.js +20 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +21 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/ActionRadioSelect/ActionRadioSelect.d.ts +10 -0
- package/lib/components/molecules/ActionRadioSelect/ActionRadioSelect.js +46 -0
- package/lib/components/molecules/ActionRadioSelect/ActionRadioSelect.js.map +1 -0
- package/lib/components/molecules/ActionTypePicker/ActionTypePicker.d.ts +12 -0
- package/lib/components/molecules/ActionTypePicker/ActionTypePicker.js +29 -0
- package/lib/components/molecules/ActionTypePicker/ActionTypePicker.js.map +1 -0
- package/lib/components/molecules/EquipementMaintenanceActionCard/EquipementMaintenanceActionCard.d.ts +9 -0
- package/lib/components/molecules/EquipementMaintenanceActionCard/EquipementMaintenanceActionCard.js +36 -0
- package/lib/components/molecules/EquipementMaintenanceActionCard/EquipementMaintenanceActionCard.js.map +1 -0
- package/lib/components/molecules/index.d.ts +3 -0
- package/lib/components/molecules/index.js +21 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar.d.ts +15 -0
- package/lib/components/organisms/EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar.js +47 -0
- package/lib/components/organisms/EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar.js.map +1 -0
- package/lib/components/organisms/MaintenanceRequestFilters/MaintenanceRequestFilters.d.ts +12 -0
- package/lib/components/organisms/MaintenanceRequestFilters/MaintenanceRequestFilters.js +51 -0
- package/lib/components/organisms/MaintenanceRequestFilters/MaintenanceRequestFilters.js.map +1 -0
- package/lib/components/organisms/index.d.ts +2 -0
- package/lib/components/organisms/index.js +20 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +2 -0
- package/lib/features/asyncFunctions-index.js +20 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/equipementMaintenanceSlice.d.ts +7 -0
- package/lib/features/equipementMaintenanceSlice.js +50 -0
- package/lib/features/equipementMaintenanceSlice.js.map +1 -0
- package/lib/features/index.d.ts +2 -0
- package/lib/features/index.js +20 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/maintenanceRequestSlice.d.ts +22 -0
- package/lib/features/maintenanceRequestSlice.js +59 -0
- package/lib/features/maintenanceRequestSlice.js.map +1 -0
- package/lib/hooks/use-maintenance-header-actions.d.ts +1 -0
- package/lib/hooks/use-maintenance-header-actions.js +54 -0
- package/lib/hooks/use-maintenance-header-actions.js.map +1 -0
- package/lib/i18n/en.json +19 -0
- package/lib/i18n/fr.json +19 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +76 -0
- package/lib/index.js.map +1 -0
- package/lib/models/forms.d.ts +2 -0
- package/lib/models/forms.js +46 -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 +44 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +32 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +22 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/models/typeObjects.d.ts +2 -0
- package/lib/models/typeObjects.js +69 -0
- package/lib/models/typeObjects.js.map +1 -0
- package/lib/screens/MaintenanceRequestFormScreen.d.ts +5 -0
- package/lib/screens/MaintenanceRequestFormScreen.js +54 -0
- package/lib/screens/MaintenanceRequestFormScreen.js.map +1 -0
- package/lib/screens/MaintenanceRequestListScreen.d.ts +3 -0
- package/lib/screens/MaintenanceRequestListScreen.js +60 -0
- package/lib/screens/MaintenanceRequestListScreen.js.map +1 -0
- package/lib/screens/index.d.ts +24 -0
- package/lib/screens/index.js +36 -0
- package/lib/screens/index.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 ActionRadioSelect } from './ActionRadioSelect/ActionRadioSelect';
|
|
19
|
+
export { default as ActionTypePicker } from './ActionTypePicker/ActionTypePicker';
|
|
20
|
+
export { default as EquipementMaintenanceActionCard } from './EquipementMaintenanceActionCard/EquipementMaintenanceActionCard';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/molecules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,+BAA+B,EAAC,MAAM,mEAAmE,CAAC"}
|
package/lib/components/organisms/EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface EquipementMaintenanceSearchBarProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
defaultValue?: any;
|
|
6
|
+
onChange: (value?: any) => void;
|
|
7
|
+
objectState?: any;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
showDetailsPopup?: boolean;
|
|
11
|
+
navigate?: boolean;
|
|
12
|
+
oneFilter?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const EquipementMaintenanceSearchBar: (props: EquipementMaintenanceSearchBarProps) => React.JSX.Element;
|
|
15
|
+
export default EquipementMaintenanceSearchBar;
|
package/lib/components/organisms/EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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, useMemo } from 'react';
|
|
19
|
+
import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { searchEquipementMaintenance } from '../../../features/equipementMaintenanceSlice';
|
|
22
|
+
import { EquipementMaintenanceActionCard } from '../../molecules';
|
|
23
|
+
const displayEquipement = (item, I18n) => {
|
|
24
|
+
return `${item.code} - ${item.name}\n${I18n.t('Maintenance_Machine')} : ${item.machine.name}`;
|
|
25
|
+
};
|
|
26
|
+
const EquipementMaintenanceSearchBarAux = ({ style, title = 'Maintenance_MaintenanceEquipment', defaultValue, onChange, objectState, required = false, readonly = false, showDetailsPopup = true, navigate = false, oneFilter = false, }) => {
|
|
27
|
+
const I18n = useTranslator();
|
|
28
|
+
const dispatch = useDispatch();
|
|
29
|
+
const { equipementMaintenanceList, loadingEquipementMaintenances, moreLoadingEquipementMaintenance, isListEndEquipementMaintenance, } = useSelector(state => state.maintenance_equipementMaintenance);
|
|
30
|
+
const machineId = useMemo(() => objectState?.machineId, [objectState?.machineId]);
|
|
31
|
+
const fetchEquipementMaintenanceAPI = useCallback(({ page = 0, searchValue }) => {
|
|
32
|
+
dispatch(searchEquipementMaintenance({
|
|
33
|
+
page,
|
|
34
|
+
searchValue,
|
|
35
|
+
machineId,
|
|
36
|
+
}));
|
|
37
|
+
}, [dispatch, machineId]);
|
|
38
|
+
if (defaultValue != null) {
|
|
39
|
+
return (<EquipementMaintenanceActionCard onPress={() => onChange(null)} item={defaultValue} readonly={readonly}/>);
|
|
40
|
+
}
|
|
41
|
+
return (<AutoCompleteSearch style={style} title={I18n.t(title)} placeholder={I18n.t(title)} objectList={equipementMaintenanceList} loadingList={loadingEquipementMaintenances} moreLoading={moreLoadingEquipementMaintenance} isListEnd={isListEndEquipementMaintenance} value={defaultValue} onChangeValue={onChange} fetchData={fetchEquipementMaintenanceAPI} displayValue={_i => displayEquipement(_i, I18n)} readonly={readonly} required={required} showDetailsPopup={showDetailsPopup} navigate={navigate} oneFilter={oneFilter}/>);
|
|
42
|
+
};
|
|
43
|
+
const EquipementMaintenanceSearchBar = (props) => {
|
|
44
|
+
return <EquipementMaintenanceSearchBarAux {...props}/>;
|
|
45
|
+
};
|
|
46
|
+
export default EquipementMaintenanceSearchBar;
|
|
47
|
+
//# sourceMappingURL=EquipementMaintenanceSearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipementMaintenanceSearchBar.js","sourceRoot":"","sources":["../../../../src/components/organisms/EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAEL,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,2BAA2B,EAAC,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAC,+BAA+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AssignedToMe: boolean;
|
|
5
|
+
setIsAssignedToMe: SetterFunction<boolean>;
|
|
6
|
+
selectedAction: number;
|
|
7
|
+
setSelectedAction: SetterFunction<number>;
|
|
8
|
+
selectedMachine: any;
|
|
9
|
+
setSelectedMachine: SetterFunction<any>;
|
|
10
|
+
}
|
|
11
|
+
declare const MaintenanceRequestFilters: ({ isAssignedToMe, setIsAssignedToMe, selectedAction, setSelectedAction, selectedMachine, setSelectedMachine, }: MaintenanceRequestFiltersProps) => React.JSX.Element;
|
|
12
|
+
export default MaintenanceRequestFilters;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 { ToggleButton } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { MachineSearchBar } from '@axelor/aos-mobile-manufacturing';
|
|
22
|
+
import { ActionTypePicker } from '../../molecules';
|
|
23
|
+
const MaintenanceRequestFilters = ({ isAssignedToMe, setIsAssignedToMe, selectedAction, setSelectedAction, selectedMachine, setSelectedMachine, }) => {
|
|
24
|
+
return (<View style={styles.headerContainer}>
|
|
25
|
+
<ToggleButton isActive={isAssignedToMe} onPress={() => setIsAssignedToMe(current => !current)} buttonConfig={{
|
|
26
|
+
iconName: 'person-fill',
|
|
27
|
+
width: '10%',
|
|
28
|
+
style: styles.toggleButton,
|
|
29
|
+
}}/>
|
|
30
|
+
<MachineSearchBar style={styles.filter} defaultValue={selectedMachine} onChange={setSelectedMachine} showTitle={false}/>
|
|
31
|
+
<ActionTypePicker style={styles.filter} defaultValue={selectedAction} onChange={setSelectedAction} showTitle={false}/>
|
|
32
|
+
</View>);
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
headerContainer: {
|
|
36
|
+
width: '90%',
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
justifyContent: 'space-between',
|
|
39
|
+
alignSelf: 'center',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
gap: 5,
|
|
42
|
+
},
|
|
43
|
+
toggleButton: {
|
|
44
|
+
height: 40,
|
|
45
|
+
},
|
|
46
|
+
filter: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
export default MaintenanceRequestFilters;
|
|
51
|
+
//# sourceMappingURL=MaintenanceRequestFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaintenanceRequestFilters.js","sourceRoot":"","sources":["../../../../src/components/organisms/MaintenanceRequestFilters/MaintenanceRequestFilters.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAajD,MAAM,yBAAyB,GAAG,CAAC,EACjC,cAAc,EACd,iBAAiB,E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0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 EquipementMaintenanceSearchBar } from './EquipementMaintenanceSearchBar/EquipementMaintenanceSearchBar';
|
|
19
|
+
export { default as MaintenanceRequestFilters } from './MaintenanceRequestFilters/MaintenanceRequestFilters';
|
|
20
|
+
//# 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,8BAA8B,EAAC,MAAM,iEAAiE,CAAC;AAC1H,OAAO,EAAC,OAAO,IAAI,yBAAyB,EAAC,MAAM,uDAAuD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 { searchEquipementMaintenance } from './equipementMaintenanceSlice';
|
|
19
|
+
export { createMaintenanceRequest, searchMaintenanceRequests, } from './maintenanceRequestSlice';
|
|
20
|
+
//# sourceMappingURL=asyncFunctions-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncFunctions-index.js","sourceRoot":"","sources":["../../src/features/asyncFunctions-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,2BAA2B,EAAC,MAAM,8BAA8B,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const searchEquipementMaintenance: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit").AsyncThunkConfig>;
|
|
2
|
+
export declare const equipementMaintenanceReducer: import("redux").Reducer<{
|
|
3
|
+
loadingEquipementMaintenances: boolean;
|
|
4
|
+
moreLoadingEquipementMaintenance: boolean;
|
|
5
|
+
isListEndEquipementMaintenance: boolean;
|
|
6
|
+
equipementMaintenanceList: any[];
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchEquipementMaintenance as _searchEquipementMaintenance } from '../api/equipement-maintenance-api';
|
|
21
|
+
export const searchEquipementMaintenance = createAsyncThunk('maintenance_equipementMaintenance/searchEquipementMaintenance', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchEquipementMaintenance,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Maintenance_SliceAction_SearchEquipementMaintenance',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingEquipementMaintenances: false,
|
|
32
|
+
moreLoadingEquipementMaintenance: false,
|
|
33
|
+
isListEndEquipementMaintenance: false,
|
|
34
|
+
equipementMaintenanceList: [],
|
|
35
|
+
};
|
|
36
|
+
const equipementMaintenanceSlice = createSlice({
|
|
37
|
+
name: 'maintenance_equipementMaintenance',
|
|
38
|
+
initialState,
|
|
39
|
+
reducers: {},
|
|
40
|
+
extraReducers: builder => {
|
|
41
|
+
generateInifiniteScrollCases(builder, searchEquipementMaintenance, {
|
|
42
|
+
loading: 'loadingEquipementMaintenances',
|
|
43
|
+
moreLoading: 'moreLoadingEquipementMaintenance',
|
|
44
|
+
isListEnd: 'isListEndEquipementMaintenance',
|
|
45
|
+
list: 'equipementMaintenanceList',
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
export const equipementMaintenanceReducer = equipementMaintenanceSlice.reducer;
|
|
50
|
+
//# sourceMappingURL=equipementMaintenanceSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equipementMaintenanceSlice.js","sourceRoot":"","sources":["../../src/features/equipementMaintenanceSlice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,2BAA2B,IAAI,4BAA4B,EAAC,MAAM,mCAAmC,CAAC;AAE9G,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CACzD,+DAA+D,EAC/D,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,4BAA4B;QAC3C,IAAI;QACJ,MAAM,EAAE,qDAAqD;QAC7D,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,6BAA6B,EAAE,KAAK;IACpC,gCAAgC,EAAE,KAAK;IACvC,8BAA8B,EAAE,KAAK;IACrC,yBAAyB,EAAE,EAAE;CAC9B,CAAC;AAEF,MAAM,0BAA0B,GAAG,WAAW,CAAC;IAC7C,IAAI,EAAE,mCAAmC;IACzC,YAAY;IACZ,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,2BAA2B,EAAE;YACjE,OAAO,EAAE,+BAA+B;YACxC,WAAW,EAAE,kCAAkC;YAC/C,SAAS,EAAE,gCAAgC;YAC3C,IAAI,EAAE,2BAA2B;SAClC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,0BAA0B,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 { equipementMaintenanceReducer as maintenance_equipementMaintenance } from './equipementMaintenanceSlice';
|
|
19
|
+
export { maintenanceRequestReducer as maintenance_maintenanceRequest } from './maintenanceRequestSlice';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,4BAA4B,IAAI,iCAAiC,EAAC,MAAM,8BAA8B,CAAC;AAC/G,OAAO,EAAC,yBAAyB,IAAI,8BAA8B,EAAC,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const searchMaintenanceRequests: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit").AsyncThunkConfig>;
|
|
2
|
+
export declare const createMaintenanceRequest: import("@reduxjs/toolkit").AsyncThunk<import("@reduxjs/toolkit").PayloadAction<any, string, {
|
|
3
|
+
arg: void;
|
|
4
|
+
requestId: string;
|
|
5
|
+
requestStatus: "fulfilled";
|
|
6
|
+
}, never> | import("@reduxjs/toolkit").PayloadAction<unknown, string, {
|
|
7
|
+
arg: void;
|
|
8
|
+
requestId: string;
|
|
9
|
+
requestStatus: "rejected";
|
|
10
|
+
aborted: boolean;
|
|
11
|
+
condition: boolean;
|
|
12
|
+
} & ({
|
|
13
|
+
rejectedWithValue: true;
|
|
14
|
+
} | ({
|
|
15
|
+
rejectedWithValue: false;
|
|
16
|
+
} & {})), import("@reduxjs/toolkit").SerializedError>, void, import("@reduxjs/toolkit").AsyncThunkConfig>;
|
|
17
|
+
export declare const maintenanceRequestReducer: import("redux").Reducer<{
|
|
18
|
+
loadingMaintenanceRequests: boolean;
|
|
19
|
+
moreLoadingMaintenanceRequest: boolean;
|
|
20
|
+
isListEndMaintenanceRequest: boolean;
|
|
21
|
+
maintenanceRequestList: any[];
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { createMaintenanceRequest as _createMaintenanceRequest, searchMaintenanceRequests as _searchMaintenanceRequests, } from '../api/maintenance-request-api';
|
|
21
|
+
export const searchMaintenanceRequests = createAsyncThunk('maintenance_maintenanceRequest/searchMaintenanceRequests', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchMaintenanceRequests,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Maintenance_SliceAction_SearchMaintenanceRequests',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export const createMaintenanceRequest = createAsyncThunk('maintenance_maintenanceRequest/createMaintenanceRequest', async function (data, { getState, dispatch }) {
|
|
31
|
+
return handlerApiCall({
|
|
32
|
+
fetchFunction: _createMaintenanceRequest,
|
|
33
|
+
data,
|
|
34
|
+
action: 'Maintenance_SliceAction_CreateMaintenanceRequest',
|
|
35
|
+
getState,
|
|
36
|
+
responseOptions: { isArrayResponse: false, showToast: true },
|
|
37
|
+
}).then(() => dispatch(searchMaintenanceRequests()));
|
|
38
|
+
});
|
|
39
|
+
const initialState = {
|
|
40
|
+
loadingMaintenanceRequests: false,
|
|
41
|
+
moreLoadingMaintenanceRequest: false,
|
|
42
|
+
isListEndMaintenanceRequest: false,
|
|
43
|
+
maintenanceRequestList: [],
|
|
44
|
+
};
|
|
45
|
+
const maintenanceRequestSlice = createSlice({
|
|
46
|
+
name: 'maintenance_maintenanceRequest',
|
|
47
|
+
initialState,
|
|
48
|
+
reducers: {},
|
|
49
|
+
extraReducers: builder => {
|
|
50
|
+
generateInifiniteScrollCases(builder, searchMaintenanceRequests, {
|
|
51
|
+
loading: 'loadingMaintenanceRequests',
|
|
52
|
+
moreLoading: 'moreLoadingMaintenanceRequest',
|
|
53
|
+
isListEnd: 'isListEndMaintenanceRequest',
|
|
54
|
+
list: 'maintenanceRequestList',
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
export const maintenanceRequestReducer = maintenanceRequestSlice.reducer;
|
|
59
|
+
//# sourceMappingURL=maintenanceRequestSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenanceRequestSlice.js","sourceRoot":"","sources":["../../src/features/maintenanceRequestSlice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,IAAI,yBAAyB,EACrD,yBAAyB,IAAI,0BAA0B,GACxD,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAgB,CACvD,0DAA0D,EAC1D,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,0BAA0B;QACzC,IAAI;QACJ,MAAM,EAAE,mDAAmD;QAC3D,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CACtD,yDAAyD,EACzD,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC;IACxC,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,yBAAyB;QACxC,IAAI;QACJ,MAAM,EAAE,kDAAkD;QAC1D,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC;KAC3D,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,0BAA0B,EAAE,KAAK;IACjC,6BAA6B,EAAE,KAAK;IACpC,2BAA2B,EAAE,KAAK;IAClC,sBAAsB,EAAE,EAAE;CAC3B,CAAC;AAEF,MAAM,uBAAuB,GAAG,WAAW,CAAC;IAC1C,IAAI,EAAE,gCAAgC;IACtC,YAAY;IACZ,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,yBAAyB,EAAE;YAC/D,OAAO,EAAE,4BAA4B;YACrC,WAAW,EAAE,+BAA+B;YAC5C,SAAS,EAAE,6BAA6B;YACxC,IAAI,EAAE,wBAAwB;SAC/B,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMaintenanceHeaders: () => void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { useEffect } from 'react';
|
|
19
|
+
import { headerActionsProvider, useNavigation, usePermitted, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
export const useMaintenanceHeaders = () => {
|
|
22
|
+
useMaintenanceRequestListActions();
|
|
23
|
+
};
|
|
24
|
+
const useMaintenanceRequestListActions = () => {
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const Colors = useThemeColor();
|
|
27
|
+
const navigation = useNavigation();
|
|
28
|
+
const { canCreate } = usePermitted({
|
|
29
|
+
modelName: 'com.axelor.apps.maintenance.db.MaintenanceRequest',
|
|
30
|
+
});
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
headerActionsProvider.registerModel('maintenance_maintenanceRequest_list', {
|
|
33
|
+
model: 'com.axelor.apps.maintenance.db.MaintenanceRequest',
|
|
34
|
+
options: {
|
|
35
|
+
core_modelFilters: {
|
|
36
|
+
name: 'act:maintenance.root.current.maintenance.requests',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
actions: [
|
|
40
|
+
{
|
|
41
|
+
key: 'createMaintenanceRequest',
|
|
42
|
+
title: I18n.t('Maintenance_CreateMaintenanceRequest'),
|
|
43
|
+
order: 30,
|
|
44
|
+
iconName: 'plus-lg',
|
|
45
|
+
iconColor: Colors.primaryColor.background,
|
|
46
|
+
hideIf: !canCreate,
|
|
47
|
+
showInHeader: true,
|
|
48
|
+
onPress: () => navigation.navigate('MaintenanceRequestFormScreen'),
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
}, [Colors, I18n, canCreate, navigation]);
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=use-maintenance-header-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-maintenance-header-actions.js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E,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC"}
|
package/lib/i18n/en.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Maintenance_Maintenance": "Maintenance",
|
|
3
|
+
"Maintenance_MaintenanceRequests": "Maintenance requests",
|
|
4
|
+
"Maintenance_MaintenanceEquipment": "Maintenance equipment",
|
|
5
|
+
"Maintenance_Machine": "Machine",
|
|
6
|
+
"Maintenance_Deadline": "Deadline",
|
|
7
|
+
"Maintenance_RequestActionType": "Action",
|
|
8
|
+
"Maintenance_RequestActionType_Corrective": "Corrective",
|
|
9
|
+
"Maintenance_RequestActionType_Preventive": "Preventive",
|
|
10
|
+
"Maintenance_RequestStatus_Planned": "Planned",
|
|
11
|
+
"Maintenance_RequestStatus_InProgress": "In progress",
|
|
12
|
+
"Maintenance_RequestStatus_Completed": "Completed",
|
|
13
|
+
"Maintenance_RequestStatus_Canceled": "Canceled",
|
|
14
|
+
"Maintenance_CreateMaintenanceRequest": "Create maintenance request",
|
|
15
|
+
"Maintenance_CreateRequest": "Create request",
|
|
16
|
+
"Maintenance_SliceAction_SearchMaintenanceRequests": "search maintenance requests",
|
|
17
|
+
"Maintenance_SliceAction_CreateMaintenanceRequest": "create maitenance request",
|
|
18
|
+
"Maintenance_SliceAction_SearchEquipementMaintenance": "search maintenance equipments"
|
|
19
|
+
}
|
package/lib/i18n/fr.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Maintenance_Maintenance": "Maintenance",
|
|
3
|
+
"Maintenance_MaintenanceRequests": "Demandes de maintenance",
|
|
4
|
+
"Maintenance_MaintenanceEquipment": "Équipement de maintenance",
|
|
5
|
+
"Maintenance_Machine": "Machine",
|
|
6
|
+
"Maintenance_Deadline": "Échéance",
|
|
7
|
+
"Maintenance_RequestActionType": "Action",
|
|
8
|
+
"Maintenance_RequestActionType_Corrective": "Corrective",
|
|
9
|
+
"Maintenance_RequestActionType_Preventive": "Préventive",
|
|
10
|
+
"Maintenance_RequestStatus_Planned": "Planifiée",
|
|
11
|
+
"Maintenance_RequestStatus_InProgress": "En cours",
|
|
12
|
+
"Maintenance_RequestStatus_Completed": "Complétée",
|
|
13
|
+
"Maintenance_RequestStatus_Canceled": "Annulée",
|
|
14
|
+
"Maintenance_CreateMaintenanceRequest": "Créer une demande de maintenance",
|
|
15
|
+
"Maintenance_CreateRequest": "Créer une demande",
|
|
16
|
+
"Maintenance_SliceAction_SearchMaintenanceRequests": "recherche sur les demandes de maintenance",
|
|
17
|
+
"Maintenance_SliceAction_CreateMaintenanceRequest": "création de la demande de maintenance",
|
|
18
|
+
"Maintenance_SliceAction_SearchEquipementMaintenance": "recherche sur les équipements de maintenance"
|
|
19
|
+
}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 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 { getModelId, isModel } from '@axelor/aos-mobile-core';
|
|
19
|
+
import enTranslations from './i18n/en.json';
|
|
20
|
+
import frTranslations from './i18n/fr.json';
|
|
21
|
+
import MaintenanceScreens from './screens';
|
|
22
|
+
import * as maintenanceReducers from './features';
|
|
23
|
+
import { maintenance_formsRegister, maintenance_modelAPI, maintenance_searchFields, maintenance_sortFields, maintenance_typeObjects, } from './models';
|
|
24
|
+
import { useMaintenanceHeaders } from './hooks/use-maintenance-header-actions';
|
|
25
|
+
export const MaintenanceModule = {
|
|
26
|
+
name: 'app-maintenance',
|
|
27
|
+
title: 'Maintenance_Maintenance',
|
|
28
|
+
subtitle: 'Maintenance_Maintenance',
|
|
29
|
+
icon: 'wrench',
|
|
30
|
+
compatibilityAOS: {
|
|
31
|
+
moduleName: 'axelor-maintenance',
|
|
32
|
+
downToVersion: '8.5.0',
|
|
33
|
+
},
|
|
34
|
+
translations: {
|
|
35
|
+
en: enTranslations,
|
|
36
|
+
fr: frTranslations,
|
|
37
|
+
},
|
|
38
|
+
menus: {
|
|
39
|
+
maintenance_menu_maintenanceRequests: {
|
|
40
|
+
title: 'Maintenance_MaintenanceRequests',
|
|
41
|
+
icon: 'clipboard-x',
|
|
42
|
+
screen: 'MaintenanceRequestListScreen',
|
|
43
|
+
},
|
|
44
|
+
maintenance_menu_createRequest: {
|
|
45
|
+
title: 'Maintenance_CreateRequest',
|
|
46
|
+
icon: 'plus-lg',
|
|
47
|
+
screen: 'MaintenanceRequestFormScreen',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
screens: MaintenanceScreens,
|
|
51
|
+
reducers: maintenanceReducers,
|
|
52
|
+
models: {
|
|
53
|
+
formsRegister: maintenance_formsRegister,
|
|
54
|
+
objectFields: maintenance_modelAPI,
|
|
55
|
+
searchFields: maintenance_searchFields,
|
|
56
|
+
sortFields: maintenance_sortFields,
|
|
57
|
+
typeObjects: maintenance_typeObjects,
|
|
58
|
+
headerRegisters: useMaintenanceHeaders,
|
|
59
|
+
},
|
|
60
|
+
globalTools: [
|
|
61
|
+
{
|
|
62
|
+
key: 'maintenance_createRequest',
|
|
63
|
+
iconName: 'wrench',
|
|
64
|
+
onPress: ({ navigation, screenContext }) => navigation.navigate('MaintenanceRequestFormScreen', {
|
|
65
|
+
machineId: getModelId(screenContext, 'com.axelor.apps.production.db.Machine'),
|
|
66
|
+
}),
|
|
67
|
+
title: 'Maintenance_CreateMaintenanceRequest',
|
|
68
|
+
hideIf: ({ screenContext }) => !isModel(screenContext, 'com.axelor.apps.production.db.Machine'),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
export * from './api';
|
|
73
|
+
export * from './components';
|
|
74
|
+
export * from './features/asyncFunctions-index';
|
|
75
|
+
export * from './screens';
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,UAAU,EAAE,OAAO,EAAS,MAAM,yBAAyB,CAAC;AACpE,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,mBAAmB,MAAM,YAAY,CAAC;AAClD,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,qBAAqB,EAAC,MAAM,wCAAwC,CAAC;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAAW;IACvC,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,yBAAyB;IACnC,IAAI,EAAE,QAAQ;IACd,gBAAgB,EAAE;QAChB,UAAU,EAAE,oBAAoB;QAChC,aAAa,EAAE,OAAO;KACvB;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,EAAE,EAAE,cAAc;KACnB;IACD,KAAK,EAAE;QACL,oCAAoC,EAAE;YACpC,KAA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