@axelor/aos-mobile-quality 8.0.6 → 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 +1 -1
- package/lib/api/control-entry-sample-line-api.js +4 -4
- package/lib/api/control-entry-sample-line-api.js.map +1 -1
- package/lib/components/atoms/ControlEntryCard/ControlEntryCard.d.ts +2 -1
- package/lib/components/atoms/ControlEntryCard/ControlEntryCard.js +9 -8
- package/lib/components/atoms/ControlEntryCard/ControlEntryCard.js.map +1 -1
- package/lib/components/atoms/ControlEntryHeader/ControlEntryHeader.d.ts +2 -1
- package/lib/components/atoms/ControlEntryHeader/ControlEntryHeader.js +5 -5
- package/lib/components/atoms/ControlEntryHeader/ControlEntryHeader.js.map +1 -1
- package/lib/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.d.ts +3 -1
- package/lib/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.js +17 -14
- package/lib/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.js.map +1 -1
- package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.d.ts +2 -1
- package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.js +5 -5
- package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.js.map +1 -1
- package/lib/components/atoms/NavigationButton/NavigationButton.d.ts +2 -1
- package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.d.ts +2 -1
- package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.js +9 -3
- package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.js.map +1 -1
- package/lib/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.d.ts +2 -4
- package/lib/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.js +7 -6
- package/lib/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.js.map +1 -1
- package/lib/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.d.ts +2 -1
- package/lib/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.js +17 -10
- package/lib/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.js.map +1 -1
- package/lib/components/molecules/ControlEntryFormHeader/ControlEntryFormHeader.d.ts +2 -1
- package/lib/components/molecules/FillingMethodAlert/FillingMethodAlert.d.ts +1 -2
- package/lib/components/molecules/FillingMethodAlert/FillingMethodAlert.js +1 -2
- package/lib/components/molecules/FillingMethodAlert/FillingMethodAlert.js.map +1 -1
- package/lib/features/controlEntrySampleLineSlice.d.ts +2 -20
- package/lib/features/controlEntrySampleSlice.d.ts +1 -10
- package/lib/features/controlEntrySlice.d.ts +3 -30
- package/lib/features/controlPlanSlice.d.ts +1 -10
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/models/index.js.map +1 -1
- package/lib/models/typeObjects.d.ts +2 -0
- package/lib/models/typeObjects.js +80 -0
- package/lib/models/typeObjects.js.map +1 -0
- package/lib/screens/ControlEntryDetailsScreen.d.ts +2 -1
- package/lib/screens/ControlEntryDetailsScreen.js +13 -5
- package/lib/screens/ControlEntryDetailsScreen.js.map +1 -1
- package/lib/screens/ControlEntryFormScreen.d.ts +2 -1
- package/lib/screens/ControlEntryFormScreen.js +38 -17
- package/lib/screens/ControlEntryFormScreen.js.map +1 -1
- package/lib/screens/ControlEntryListScreen.d.ts +2 -1
- package/lib/screens/ControlEntryListScreen.js +5 -7
- package/lib/screens/ControlEntryListScreen.js.map +1 -1
- package/lib/screens/index.d.ts +1 -0
- package/lib/screens/index.js +1 -0
- package/lib/screens/index.js.map +1 -1
- package/lib/types/controlEntry.d.ts +0 -23
- package/lib/types/controlEntry.js +5 -81
- package/lib/types/controlEntry.js.map +1 -1
- package/package.json +9 -13
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Install the library :
|
|
|
23
23
|
yarn add @axelor/aos-mobile-quality
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Compatibility with React v18.2.x and React Native v0.
|
|
26
|
+
Compatibility with React v18.2.x and React Native v0.70.x.
|
|
27
27
|
|
|
28
28
|
To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.
|
|
29
29
|
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { createStandardSearch, createStandardFetch,
|
|
19
|
-
import { ControlEntry } from '../types';
|
|
18
|
+
import { axiosApiProvider, createStandardSearch, createStandardFetch, getTypes, } from '@axelor/aos-mobile-core';
|
|
20
19
|
const createControlEntrySampleLineCriteria = controlEntrySampleId => {
|
|
21
20
|
return [
|
|
22
21
|
{
|
|
@@ -62,6 +61,7 @@ export async function fetchControlEntrySampleLine({ id }) {
|
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
export async function checkComformity({ object }) {
|
|
64
|
+
const ControlEntrySample = getTypes().ControlEntrySample;
|
|
65
65
|
return axiosApiProvider
|
|
66
66
|
.post({
|
|
67
67
|
url: 'ws/action',
|
|
@@ -86,11 +86,11 @@ export async function checkComformity({ object }) {
|
|
|
86
86
|
return data[0].resultSelect;
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
return
|
|
89
|
+
return ControlEntrySample?.resultSelect.NotControlled;
|
|
90
90
|
}
|
|
91
91
|
})
|
|
92
92
|
.catch(() => {
|
|
93
|
-
return
|
|
93
|
+
return ControlEntrySample?.resultSelect.NotControlled;
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
//# sourceMappingURL=control-entry-sample-line-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-entry-sample-line-api.js","sourceRoot":"","sources":["../../src/api/control-entry-sample-line-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"control-entry-sample-line-api.js","sourceRoot":"","sources":["../../src/api/control-entry-sample-line-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,GACT,MAAM,yBAAyB,CAAC;AAEjC,MAAM,oCAAoC,GAAG,oBAAoB,CAAC,EAAE;IAClE,OAAO;QACL;YACE,SAAS,EAAE,uBAAuB;YAClC,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,oBAAoB;SAC5B;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,IAAI,GAAG,CAAC,EACR,oBAAoB,GACrB;IACC,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,iDAAiD;QACxD,QAAQ,EAAE,oCAAoC,CAAC,oBAAoB,CAAC;QACpE,QAAQ,EAAE,gCAAgC;QAC1C,OAAO,EAAE,gCAAgC;QACzC,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,sCAAsC,GAAG,cAAc,CAAC,EAAE;IAC9D,OAAO;QACL;YACE,SAAS,EAAE,oCAAoC;YAC/C,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,cAAc;SACtB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,0CAA0C,CAAC,EAC/D,cAAc,GACf;IACC,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,iDAAiD;QACxD,QAAQ,EAAE,sCAAsC,CAAC,cAAc,CAAC;QAChE,QAAQ,EAAE,gCAAgC;QAC1C,OAAO,EAAE,gCAAgC;QACzC,oBAAoB,EAAE,IAAI;QAC1B,IAAI,EAAE,CAAC;KACR,CAAC,CAAC;AACL,C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,5 +8,5 @@ interface ControlEntryCardProps {
|
|
|
7
8
|
name?: string;
|
|
8
9
|
controlEntryId?: number;
|
|
9
10
|
}
|
|
10
|
-
declare const ControlEntryCard: ({ style, onPress, sampleCount, entryDateTime, statusSelect, name, controlEntryId, }: ControlEntryCardProps) => JSX.Element;
|
|
11
|
+
declare const ControlEntryCard: ({ style, onPress, sampleCount, entryDateTime, statusSelect, name, controlEntryId, }: ControlEntryCardProps) => React.JSX.Element;
|
|
11
12
|
export default ControlEntryCard;
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
19
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
20
|
-
import { Card, ProgressBar, Text
|
|
21
|
-
import { useTranslator,
|
|
22
|
-
import { ControlEntry } from '../../../types';
|
|
20
|
+
import { Card, ProgressBar, Text } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { DateDisplay, useTranslator, useTypes, useTypeHelpers, } from '@axelor/aos-mobile-core';
|
|
23
22
|
import { searchControlEntrySampleApi } from '../../../api';
|
|
24
23
|
const ControlEntryCard = ({ style, onPress, sampleCount, entryDateTime, statusSelect, name, controlEntryId, }) => {
|
|
25
|
-
const Colors = useThemeColor();
|
|
26
24
|
const I18n = useTranslator();
|
|
25
|
+
const { ControlEntry, ControlEntrySample } = useTypes();
|
|
26
|
+
const { getItemColor } = useTypeHelpers();
|
|
27
27
|
const isMounted = useRef(true);
|
|
28
28
|
const [numberSampleFilled, setNumberSampleFilled] = useState(0);
|
|
29
29
|
useEffect(() => {
|
|
@@ -34,7 +34,8 @@ const ControlEntryCard = ({ style, onPress, sampleCount, entryDateTime, statusSe
|
|
|
34
34
|
if (Array.isArray(response?.data?.data)) {
|
|
35
35
|
const controlEntrySampleList = response.data.data;
|
|
36
36
|
const total = controlEntrySampleList.length;
|
|
37
|
-
const notControlled = controlEntrySampleList.filter(sample => sample.resultSelect ===
|
|
37
|
+
const notControlled = controlEntrySampleList.filter(sample => sample.resultSelect ===
|
|
38
|
+
ControlEntrySample?.resultSelect.NotControlled).length;
|
|
38
39
|
setNumberSampleFilled(100 - (notControlled / total) * 100);
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
@@ -50,10 +51,10 @@ const ControlEntryCard = ({ style, onPress, sampleCount, entryDateTime, statusSe
|
|
|
50
51
|
return () => {
|
|
51
52
|
isMounted.current = false;
|
|
52
53
|
};
|
|
53
|
-
}, [controlEntryId]);
|
|
54
|
+
}, [ControlEntrySample?.resultSelect, controlEntryId]);
|
|
54
55
|
const borderStyle = useMemo(() => {
|
|
55
|
-
return getStyles(ControlEntry
|
|
56
|
-
}, [
|
|
56
|
+
return getStyles(getItemColor(ControlEntry?.statusSelect, statusSelect)?.background)?.border;
|
|
57
|
+
}, [ControlEntry?.statusSelect, getItemColor, statusSelect]);
|
|
57
58
|
return (<TouchableOpacity onPress={onPress} activeOpacity={0.9}>
|
|
58
59
|
<Card style={[styles.container, borderStyle, style]}>
|
|
59
60
|
<View style={styles.childrenContainer}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntryCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntryCard/ControlEntryCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"ControlEntryCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntryCard/ControlEntryCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO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|
17
17
|
*/
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { StyleSheet, View } from 'react-native';
|
|
20
|
-
import { DateDisplay, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
-
import { Badge, Text
|
|
22
|
-
import { ControlEntry } from '../../../types';
|
|
20
|
+
import { DateDisplay, useSelector, useTranslator, useTypes, useTypeHelpers, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Badge, Text } from '@axelor/aos-mobile-ui';
|
|
23
22
|
const ControlEntryHeader = ({}) => {
|
|
24
23
|
const I18n = useTranslator();
|
|
25
|
-
const
|
|
24
|
+
const { ControlEntry } = useTypes();
|
|
25
|
+
const { getItemColor, getItemTitle } = useTypeHelpers();
|
|
26
26
|
const { controlEntry } = useSelector((state) => state.controlEntry);
|
|
27
27
|
return (<View>
|
|
28
28
|
<View style={styles.row}>
|
|
29
29
|
<Text writingType="title">{controlEntry.name}</Text>
|
|
30
|
-
<Badge color={ControlEntry
|
|
30
|
+
<Badge color={getItemColor(ControlEntry?.statusSelect, controlEntry.statusSelect)} title={getItemTitle(ControlEntry?.statusSelect, controlEntry.statusSelect)}/>
|
|
31
31
|
</View>
|
|
32
32
|
<View style={styles.row}>
|
|
33
33
|
<Text>{`${I18n.t('Quality_SampleCount')} : ${controlEntry.sampleCount}`}</Text>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntryHeader.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntryHeader/ControlEntryHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"ControlEntryHeader.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntryHeader/ControlEntryHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;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WAAW,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,EAChD;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,MACrC,YAAY,CAAC,WAAW,EAAE,IAC5B,EAAE,CAAC,EAAE,IAAI,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,cAAc,EAAE,eAAe;QAC/B,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface ControlEntrySampleCardProps {
|
|
2
3
|
style?: any;
|
|
3
4
|
controlEntrySampleId: number;
|
|
4
5
|
resultSelect: number;
|
|
5
6
|
samplefullName: string;
|
|
7
|
+
onPress: () => void;
|
|
6
8
|
}
|
|
7
|
-
declare const ControlEntrySampleCard: ({ style, controlEntrySampleId, resultSelect, samplefullName, }: ControlEntrySampleCardProps) => JSX.Element;
|
|
9
|
+
declare const ControlEntrySampleCard: ({ style, controlEntrySampleId, resultSelect, samplefullName, onPress, }: ControlEntrySampleCardProps) => React.JSX.Element;
|
|
8
10
|
export default ControlEntrySampleCard;
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
-
import { StyleSheet } from 'react-native';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
19
|
+
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
20
|
+
import { useTypes, useTypeHelpers } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Card, ProgressBar, Text } from '@axelor/aos-mobile-ui';
|
|
22
22
|
import { searchControlEntrySampleLineApi } from '../../../api';
|
|
23
|
-
const ControlEntrySampleCard = ({ style, controlEntrySampleId, resultSelect, samplefullName, }) => {
|
|
24
|
-
const
|
|
23
|
+
const ControlEntrySampleCard = ({ style, controlEntrySampleId, resultSelect, samplefullName, onPress, }) => {
|
|
24
|
+
const { ControlEntrySample } = useTypes();
|
|
25
|
+
const { getItemColor } = useTypeHelpers();
|
|
25
26
|
const isMounted = useRef(true);
|
|
26
27
|
const [numberSampleFilled, setNumberSampleFilled] = useState(0);
|
|
27
|
-
const borderStyle = useMemo(() =>
|
|
28
|
-
|
|
29
|
-
}, [Colors, resultSelect]);
|
|
28
|
+
const borderStyle = useMemo(() => getStyles(getItemColor(ControlEntrySample?.resultSelect, resultSelect)
|
|
29
|
+
?.background)?.border, [ControlEntrySample?.resultSelect, getItemColor, resultSelect]);
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
isMounted.current = true;
|
|
32
32
|
searchControlEntrySampleLineApi({ controlEntrySampleId })
|
|
@@ -35,7 +35,8 @@ const ControlEntrySampleCard = ({ style, controlEntrySampleId, resultSelect, sam
|
|
|
35
35
|
if (Array.isArray(response?.data?.data)) {
|
|
36
36
|
const controlEntrySampleLineList = response.data.data;
|
|
37
37
|
const total = controlEntrySampleLineList.length;
|
|
38
|
-
const notControlled = controlEntrySampleLineList.filter(sample => sample.resultSelect ===
|
|
38
|
+
const notControlled = controlEntrySampleLineList.filter(sample => sample.resultSelect ===
|
|
39
|
+
ControlEntrySample?.resultSelect.NotControlled).length;
|
|
39
40
|
setNumberSampleFilled(100 - (notControlled / total) * 100);
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
@@ -51,11 +52,13 @@ const ControlEntrySampleCard = ({ style, controlEntrySampleId, resultSelect, sam
|
|
|
51
52
|
return () => {
|
|
52
53
|
isMounted.current = false;
|
|
53
54
|
};
|
|
54
|
-
}, [controlEntrySampleId]);
|
|
55
|
-
return (<
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
}, [ControlEntrySample?.resultSelect, controlEntrySampleId]);
|
|
56
|
+
return (<TouchableOpacity onPress={onPress} activeOpacity={0.9}>
|
|
57
|
+
<Card style={[styles.container, borderStyle, style]}>
|
|
58
|
+
<Text>{samplefullName}</Text>
|
|
59
|
+
<ProgressBar style={styles.progressBar} value={numberSampleFilled} showPercent={false} height={15} styleTxt={styles.textProgressBar}/>
|
|
60
|
+
</Card>
|
|
61
|
+
</TouchableOpacity>);
|
|
59
62
|
};
|
|
60
63
|
const getStyles = (color) => StyleSheet.create({
|
|
61
64
|
border: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntrySampleCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ControlEntrySampleCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntrySampleCard/ControlEntrySampleCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAC,+BAA+B,EAAC,MAAM,cAAc,CAAC;AAS7D,MAAM,sBAAsB,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AAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,CAAC;QACjB,cAAc,EAAE,eAAe;KAChC;IACD,WAAW,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,KAAK,EAAE,KAAK;KACb;IACD,eAAe,EAAE;QACf,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAC;AACH,eAAe,sBAAsB,CAAC"}
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { StyleSheet, View } from 'react-native';
|
|
20
|
-
import { useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
-
import { Badge, Text
|
|
22
|
-
import { ControlEntry } from '../../../types';
|
|
20
|
+
import { useSelector, useTranslator, useTypes, useTypeHelpers, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Badge, Text } from '@axelor/aos-mobile-ui';
|
|
23
22
|
const ControlEntrySampleLineHeader = ({}) => {
|
|
24
23
|
const I18n = useTranslator();
|
|
25
|
-
const
|
|
24
|
+
const { ControlEntrySample } = useTypes();
|
|
25
|
+
const { getItemColor, getItemTitle } = useTypeHelpers();
|
|
26
26
|
const { sampleLine } = useSelector((state) => state.controlEntrySampleLine);
|
|
27
27
|
if (sampleLine?.id == null) {
|
|
28
28
|
return null;
|
|
@@ -30,7 +30,7 @@ const ControlEntrySampleLineHeader = ({}) => {
|
|
|
30
30
|
return (<View>
|
|
31
31
|
<View style={styles.row}>
|
|
32
32
|
<Text>{`${I18n.t('Quality_Sample')} : ${sampleLine.controlEntrySample?.fullName}`}</Text>
|
|
33
|
-
<Badge color={
|
|
33
|
+
<Badge color={getItemColor(ControlEntrySample?.resultSelect, sampleLine.resultSelect)} title={getItemTitle(ControlEntrySample?.resultSelect, sampleLine.resultSelect)}/>
|
|
34
34
|
</View>
|
|
35
35
|
<Text>{`${I18n.t('Quality_Characteristic')} : ${sampleLine.controlPlanLine?.name != null
|
|
36
36
|
? sampleLine.controlPlanLine?.name
|
package/lib/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntrySampleLineHeader.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"ControlEntrySampleLineHeader.js","sourceRoot":"","sources":["../../../../src/components/atoms/ControlEntrySampleLineHeader/ControlEntrySampleLineHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAElD,MAAM,4BAA4B,GAAG,CAAC,EAAE,EAAE,EAAE;IAC1C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAC,kBAAkB,EAAC,GAAG,QAAQ,EAAE,CAAC;IACxC,MAAM,EAAC,YAAY,EAAE,YAAY,EAAC,GAAG,cAAc,EAAE,CAAC;IAEtD,MAAM,EAAC,UAAU,EAAC,GAAG,WAAW,CAC9B,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAC7C,CAAC;IAEF,IAAI,UAAU,EAAE,EAAE,IAAI,IAAI,EAAE;QAC1B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,IAAI,CACH;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CACtB;QAAA,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAChC,UAAU,CAAC,kBAAkB,EAAE,QACjC,EAAE,CAAC,EAAE,IAAI,CACT;QAAA,CAAC,KAAK,CACJ,KAAK,CAAC,CAAC,YAAY,CACjB,kBAAkB,EAAE,YAAY,EAChC,UAAU,CAAC,YAAY,CACxB,CAAC,CACF,KAAK,CAAC,CAAC,YAAY,CACjB,kBAAkB,EAAE,YAAY,EAChC,UAAU,CAAC,YAAY,CACxB,CAAC,EAEN;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,MACxC,UAAU,CAAC,eAAe,EAAE,IAAI,IAAI,IAAI;YACtC,CAAC,CAAC,UAAU,CAAC,eAAe,EAAE,IAAI;YAClC,CAAC,CAAC,UAAU,CAAC,eAAe,EAAE,cAAc,EAAE,IAClD,EAAE,CAAC,EAAE,IAAI,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;KACrB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,IAAI;KACZ;CACF,CAAC,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
|
|
@@ -16,19 +16,25 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import React from 'react';
|
|
19
|
-
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
19
|
+
import { useDispatch, usePermitted, useSelector, useTranslator, useTypes, } from '@axelor/aos-mobile-core';
|
|
20
20
|
import { Button } from '@axelor/aos-mobile-ui';
|
|
21
21
|
import { updateControlEntry } from '../../../features/controlEntrySlice';
|
|
22
|
-
import { ControlEntry } from '../../../types';
|
|
23
22
|
const ControlEntryDetailsButtons = () => {
|
|
24
23
|
const dispatch = useDispatch();
|
|
25
24
|
const I18n = useTranslator();
|
|
25
|
+
const { readonly } = usePermitted({
|
|
26
|
+
modelName: 'com.axelor.apps.quality.db.ControlEntry',
|
|
27
|
+
});
|
|
28
|
+
const { ControlEntry } = useTypes();
|
|
26
29
|
const { controlEntry } = useSelector((state) => state.controlEntry);
|
|
30
|
+
if (readonly) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
27
33
|
return (<Button title={I18n.t('Quality_MarkAsCompleted')} onPress={() => {
|
|
28
34
|
dispatch(updateControlEntry({
|
|
29
35
|
controlEntry: {
|
|
30
36
|
...controlEntry,
|
|
31
|
-
statusSelect: ControlEntry.
|
|
37
|
+
statusSelect: ControlEntry?.statusSelect.Completed,
|
|
32
38
|
},
|
|
33
39
|
controlEntryId: controlEntry.id,
|
|
34
40
|
}));
|
package/lib/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntryDetailsButtons.js","sourceRoot":"","sources":["../../../../src/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"ControlEntryDetailsButtons.js","sourceRoot":"","sources":["../../../../src/components/molecules/ControlEntryDetailsButtons/ControlEntryDetailsButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,QAAQ,GACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AAEvE,MAAM,0BAA0B,GAAG,GAAG,EAAE;IACtC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAC,QAAQ,EAAC,GAAG,YAAY,CAAC;QAC9B,SAAS,EAAE,yCAAyC;KACrD,CAAC,CAAC;IACH,MAAM,EAAC,YAAY,EAAC,GAAG,QAAQ,EAAE,CAAC;IAElC,MAAM,EAAC,YAAY,EAAC,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEvE,IAAI,QAAQ,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CACzC,OAAO,CAAC,CAAC,GAAG,EAAE;YACZ,QAAQ,CACL,kBAA0B,CAAC;gBAC1B,YAAY,EAAE;oBACZ,GAAG,YAAY;oBACf,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,SAAS;iBACnD;gBACD,cAAc,EAAE,YAAY,CAAC,EAAE;aAChC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CACF,QAAQ,CAAC,UAAU,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
declare const ControlEntryDetailsHeader: ({ controlEntryId, }: ControlEntryHeaderProps) => JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const ControlEntryDetailsHeader: ({}: {}) => React.JSX.Element;
|
|
5
3
|
export default ControlEntryDetailsHeader;
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
import React, { useEffect, useState } from 'react';
|
|
19
19
|
import { StyleSheet, View } from 'react-native';
|
|
20
20
|
import { Button, ProgressBar } from '@axelor/aos-mobile-ui';
|
|
21
|
-
import { useSelector } from '@axelor/aos-mobile-core';
|
|
22
|
-
import { ControlEntry } from '../../../types';
|
|
21
|
+
import { useSelector, useTypes } from '@axelor/aos-mobile-core';
|
|
23
22
|
import { searchControlEntrySampleApi } from '../../../api';
|
|
24
23
|
import { ControlEntryHeader } from '../../atoms';
|
|
25
24
|
import { FillingMethodAlert } from '../../molecules';
|
|
26
|
-
const ControlEntryDetailsHeader = ({
|
|
25
|
+
const ControlEntryDetailsHeader = ({}) => {
|
|
27
26
|
const [numberSampleFilled, setNumberSampleFilled] = useState(0);
|
|
28
27
|
const [showAlert, setShowAlert] = useState(false);
|
|
28
|
+
const { ControlEntrySample } = useTypes();
|
|
29
29
|
const { controlEntry } = useSelector((state) => state.controlEntry);
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
searchControlEntrySampleApi({ controlEntryId: controlEntry?.id })
|
|
@@ -33,7 +33,8 @@ const ControlEntryDetailsHeader = ({ controlEntryId, }) => {
|
|
|
33
33
|
if (Array.isArray(response?.data?.data)) {
|
|
34
34
|
const controlEntrySampleList = response.data.data;
|
|
35
35
|
const total = controlEntrySampleList.length;
|
|
36
|
-
const notControlled = controlEntrySampleList.filter(sample => sample.resultSelect ===
|
|
36
|
+
const notControlled = controlEntrySampleList.filter(sample => sample.resultSelect ===
|
|
37
|
+
ControlEntrySample?.resultSelect.NotControlled).length;
|
|
37
38
|
setNumberSampleFilled(100 - (notControlled / total) * 100);
|
|
38
39
|
}
|
|
39
40
|
else {
|
|
@@ -41,14 +42,14 @@ const ControlEntryDetailsHeader = ({ controlEntryId, }) => {
|
|
|
41
42
|
}
|
|
42
43
|
})
|
|
43
44
|
.catch(() => setNumberSampleFilled(0));
|
|
44
|
-
}, [controlEntry]);
|
|
45
|
+
}, [ControlEntrySample?.resultSelect, controlEntry]);
|
|
45
46
|
return (<View style={styles.container}>
|
|
46
47
|
<ControlEntryHeader />
|
|
47
48
|
<View style={styles.row}>
|
|
48
49
|
<ProgressBar value={numberSampleFilled} style={styles.progressBar} height={38}/>
|
|
49
50
|
<Button isNeutralBackground={true} iconName="clipboard2-fill" width="10%" style={styles.button} onPress={() => setShowAlert(true)}/>
|
|
50
51
|
</View>
|
|
51
|
-
<FillingMethodAlert
|
|
52
|
+
<FillingMethodAlert visible={showAlert} setVisible={setShowAlert}/>
|
|
52
53
|
</View>);
|
|
53
54
|
};
|
|
54
55
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntryDetailsHeader.js","sourceRoot":"","sources":["../../../../src/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"ControlEntryDetailsHeader.js","sourceRoot":"","sources":["../../../../src/components/molecules/ControlEntryDetailsHeader/ControlEntryDetailsHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAC1D,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AAC,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface ControlEntryFormButtonsProps {
|
|
2
3
|
mode: string;
|
|
3
4
|
canPrevious: boolean;
|
|
@@ -8,5 +9,5 @@ interface ControlEntryFormButtonsProps {
|
|
|
8
9
|
handlePrevious: () => void;
|
|
9
10
|
onPress: () => any;
|
|
10
11
|
}
|
|
11
|
-
declare const ControlEntryFormButtons: ({ mode, canPrevious, canNext, isFirstItem, isLastItem, handleNext, handlePrevious, onPress, }: ControlEntryFormButtonsProps) => JSX.Element;
|
|
12
|
+
declare const ControlEntryFormButtons: ({ mode, canPrevious, canNext, isFirstItem, isLastItem, handleNext, handlePrevious, onPress, }: ControlEntryFormButtonsProps) => React.JSX.Element;
|
|
12
13
|
export default ControlEntryFormButtons;
|
|
@@ -17,29 +17,36 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import React, { useCallback, useMemo } from 'react';
|
|
19
19
|
import { StyleSheet, View } from 'react-native';
|
|
20
|
-
import { showToastMessage, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { showToastMessage, useSelector, useTranslator, useTypes, useTypeHelpers, } from '@axelor/aos-mobile-core';
|
|
21
21
|
import { Button, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
22
|
-
import { ControlEntry } from '../../../types';
|
|
22
|
+
import { ControlEntry as ControlEntryType } from '../../../types';
|
|
23
23
|
import { NavigationButton } from '../../atoms';
|
|
24
24
|
const ControlEntryFormButtons = ({ mode, canPrevious, canNext, isFirstItem, isLastItem, handleNext, handlePrevious, onPress, }) => {
|
|
25
25
|
const Colors = useThemeColor();
|
|
26
26
|
const I18n = useTranslator();
|
|
27
|
+
const { ControlEntry, ControlEntrySample } = useTypes();
|
|
28
|
+
const { getItemTitle } = useTypeHelpers();
|
|
27
29
|
const { controlEntry } = useSelector((state) => state.controlEntry);
|
|
28
30
|
const { sampleLine } = useSelector((state) => state.controlEntrySampleLine);
|
|
29
|
-
const isConformityButton = useMemo(() => controlEntry.statusSelect === ControlEntry.
|
|
30
|
-
controlEntry.statusSelect === ControlEntry.
|
|
31
|
-
const { categoryIcon, subCategoryIcon } = useMemo(() =>
|
|
31
|
+
const isConformityButton = useMemo(() => controlEntry.statusSelect === ControlEntry?.statusSelect.Draft ||
|
|
32
|
+
controlEntry.statusSelect === ControlEntry?.statusSelect.InProgress, [ControlEntry?.statusSelect, controlEntry.statusSelect]);
|
|
33
|
+
const { categoryIcon, subCategoryIcon } = useMemo(() => ControlEntryType.getMethodIcons(mode), [mode]);
|
|
32
34
|
const handleNotControlled = useCallback(() => {
|
|
33
|
-
if (sampleLine.resultSelect ===
|
|
35
|
+
if (sampleLine.resultSelect === ControlEntrySample?.resultSelect.NotControlled) {
|
|
34
36
|
showToastMessage({
|
|
35
|
-
type:
|
|
37
|
+
type: ControlEntryType.getSampleResultType(ControlEntrySample?.resultSelect.NotControlled),
|
|
36
38
|
position: 'bottom',
|
|
37
39
|
bottomOffset: 80,
|
|
38
|
-
text1:
|
|
39
|
-
text2:
|
|
40
|
+
text1: I18n.t('Quality_ConformityResult'),
|
|
41
|
+
text2: getItemTitle(ControlEntrySample?.resultSelect, ControlEntrySample?.resultSelect.NotControlled),
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
|
-
}, [
|
|
44
|
+
}, [
|
|
45
|
+
ControlEntrySample?.resultSelect,
|
|
46
|
+
I18n,
|
|
47
|
+
getItemTitle,
|
|
48
|
+
sampleLine.resultSelect,
|
|
49
|
+
]);
|
|
43
50
|
return (<View style={styles.container}>
|
|
44
51
|
<NavigationButton position="left" onPress={() => {
|
|
45
52
|
handleNotControlled();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlEntryFormButtons.js","sourceRoot":"","sources":["../../../../src/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,
|
|
1
|
+
{"version":3,"file":"ControlEntryFormButtons.js","sourceRoot":"","sources":["../../../../src/components/molecules/ControlEntryFormButtons/ControlEntryFormButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAC,YAAY,IAAI,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAa7C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,IAAI,EACJ,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,OAAO,GACsB,EAAE,EAAE;IACjC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAC,YAAY,EAAE,kBAAkB,EAAC,GAAG,QAAQ,EAAE,CAAC;IACtD,MAAM,EAAC,YAAY,EAAC,GAAG,cAAc,EAAE,CAAC;IAExC,MAAM,EAAC,YAAY,EAAC,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,EAAC,UAAU,EA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EAAE,CAAC;YACtB,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,CACF,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CACnD,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,EAEzB;MAAA,CAAC,gBAAgB,CACf,QAAQ,CAAC,OAAO,CAChB,OAAO,CAAC,CAAC,GAAG,EAAE;YACZ,mBAAmB,EAAE,CAAC;YACtB,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CACF,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAClD,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAErB;MAAA,CAAC,kBAAkB,IAAI,CACrB,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,UAAU,CACnB,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAC3B,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,cAAc;QAC9B,gBAAgB,EAAE,EAAE;KACrB;IACD,UAAU,EAAE;QACV,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface ControlEntryHeaderProps {
|
|
2
3
|
nbItemInCategory: number;
|
|
3
4
|
nbCategories: number;
|
|
4
5
|
mode: string;
|
|
5
6
|
progressData: any;
|
|
6
7
|
}
|
|
7
|
-
declare const ControlEntryFormHeader: ({ nbItemInCategory, nbCategories, mode, progressData, }: ControlEntryHeaderProps) => JSX.Element;
|
|
8
|
+
declare const ControlEntryFormHeader: ({ nbItemInCategory, nbCategories, mode, progressData, }: ControlEntryHeaderProps) => React.JSX.Element;
|
|
8
9
|
export default ControlEntryFormHeader;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface FillingMethodAlertProps {
|
|
3
|
-
controlEntryId: number;
|
|
4
3
|
visible: boolean;
|
|
5
4
|
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
5
|
}
|
|
7
|
-
declare const FillingMethodAlert: ({
|
|
6
|
+
declare const FillingMethodAlert: ({ visible, setVisible }: FillingMethodAlertProps) => React.JSX.Element;
|
|
8
7
|
export default FillingMethodAlert;
|
|
@@ -20,7 +20,7 @@ import { StyleSheet } from 'react-native';
|
|
|
20
20
|
import { useNavigation, useTranslator } from '@axelor/aos-mobile-core';
|
|
21
21
|
import { Alert, RadioSelect } from '@axelor/aos-mobile-ui';
|
|
22
22
|
import { ControlEntry } from '../../../types';
|
|
23
|
-
const FillingMethodAlert = ({
|
|
23
|
+
const FillingMethodAlert = ({ visible, setVisible }) => {
|
|
24
24
|
const navigation = useNavigation();
|
|
25
25
|
const I18n = useTranslator();
|
|
26
26
|
const [selectedMode, setSelectedMode] = useState(null);
|
|
@@ -37,7 +37,6 @@ const FillingMethodAlert = ({ controlEntryId, visible, setVisible, }) => {
|
|
|
37
37
|
onPress: () => {
|
|
38
38
|
setVisible(false);
|
|
39
39
|
navigation.navigate('ControlEntryFormScreen', {
|
|
40
|
-
controlEntryId: controlEntryId,
|
|
41
40
|
selectedMode: selectedMode,
|
|
42
41
|
});
|
|
43
42
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FillingMethodAlert.js","sourceRoot":"","sources":["../../../../src/components/molecules/FillingMethodAlert/FillingMethodAlert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"FillingMethodAlert.js","sourceRoot":"","sources":["../../../../src/components/molecules/FillingMethodAlert/FillingMethodAlert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAO5C,MAAM,kBAAkB,GAAG,CAAC,EAAC,OAAO,EAAE,UAAU,EAA0B,EAAE,EAAE;IAC5E,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,IAAI,CAAC,CAAC;IAE/D,OAAO,CACL,CAAC,KAAK,CACJ,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CACvC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACpB,kBAAkB,CAAC,CAAC;YAClB,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,GAAG,EAAE;gBACZ,UAAU,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;SACF,CAAC,CACF,mBAAmB,CAAC,CAAC;YACnB,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,YAAY,IAAI,IAAI;YAC9B,OAAO,EAAE,GAAG,EAAE;gBACZ,UAAU,CAAC,KAAK,CAAC,CAAC;gBAClB,UAAU,CAAC,QAAQ,CAAC,wBAAwB,EAAE;oBAC5C,YAAY,EAAE,YAAY;iBAC3B,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CACF;MAAA,CAAC,WAAW,CACV,SAAS,CAAC,QAAQ,CAClB,SAAS,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC9B,KAAK,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAC5C,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,gBAAgB,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAEzC;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,MAAM,EAAE,GAAG;KACZ;IACD,KAAK,EAAE;QACL,KAAK,EAAE,KAAK;KACb;IACD,WAAW,EAAE;QACX,KAAK,EAAE,GAAG;KACX;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
export const searchControlEntrySampleLineOfControlEntry: import("@reduxjs/toolkit").AsyncThunk<any, void,
|
|
2
|
-
|
|
3
|
-
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
-
extra?: unknown;
|
|
5
|
-
rejectValue?: unknown;
|
|
6
|
-
serializedErrorType?: unknown;
|
|
7
|
-
pendingMeta?: unknown;
|
|
8
|
-
fulfilledMeta?: unknown;
|
|
9
|
-
rejectedMeta?: unknown;
|
|
10
|
-
}>;
|
|
11
|
-
export const fetchControlEntrySampleLine: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
12
|
-
state?: unknown;
|
|
13
|
-
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
14
|
-
extra?: unknown;
|
|
15
|
-
rejectValue?: unknown;
|
|
16
|
-
serializedErrorType?: unknown;
|
|
17
|
-
pendingMeta?: unknown;
|
|
18
|
-
fulfilledMeta?: unknown;
|
|
19
|
-
rejectedMeta?: unknown;
|
|
20
|
-
}>;
|
|
1
|
+
export const searchControlEntrySampleLineOfControlEntry: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
|
|
2
|
+
export const fetchControlEntrySampleLine: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
|
|
21
3
|
export const controlEntrySampleLineReducer: import("redux").Reducer<{
|
|
22
4
|
loadingSampleLines: boolean;
|
|
23
5
|
sampleLineOfEntryList: any[];
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export const searchControlEntrySample: import("@reduxjs/toolkit").AsyncThunk<any, void,
|
|
2
|
-
state?: unknown;
|
|
3
|
-
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
-
extra?: unknown;
|
|
5
|
-
rejectValue?: unknown;
|
|
6
|
-
serializedErrorType?: unknown;
|
|
7
|
-
pendingMeta?: unknown;
|
|
8
|
-
fulfilledMeta?: unknown;
|
|
9
|
-
rejectedMeta?: unknown;
|
|
10
|
-
}>;
|
|
1
|
+
export const searchControlEntrySample: import("@reduxjs/toolkit").AsyncThunk<any, void, import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkConfig>;
|
|
11
2
|
export const controlEntrySampleReducer: import("redux").Reducer<{
|
|
12
3
|
loadingControlEntrySampleList: boolean;
|
|
13
4
|
moreLoading: boolean;
|