Skip to content

Commit

Permalink
feat: restore ControlEntryDetailsScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
gca-axelor committed Feb 1, 2024
1 parent f388451 commit 9162bd0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@

import React, {useEffect, useState} from 'react';
import {StyleSheet, View} from 'react-native';
import {DateDisplay, useTranslator} from '@axelor/aos-mobile-core';
import {
DateDisplay,
useNavigation,
useTranslator,
} from '@axelor/aos-mobile-core';
import {
Alert,
Badge,
Button,
ProgressBar,
RadioSelect,
Text,
useThemeColor,
} from '@axelor/aos-mobile-ui';
Expand All @@ -46,10 +52,13 @@ const ControlEntryDetailsHeader = ({
controlPlanName,
entryDateTime,
}: ControlEntryHeaderProps) => {
const navigation = useNavigation();
const I18n = useTranslator();
const Colors = useThemeColor();

const [numberSampleFilled, setNumberSampleFilled] = useState<number>(0);
const [showAlert, setShowAlert] = useState(false);
const [selectedMode, setSelectedMode] = useState(null);

useEffect(() => {
searchControlEntrySampleApi({controlEntryId: controlEntryId})
Expand Down Expand Up @@ -96,8 +105,43 @@ const ControlEntryDetailsHeader = ({
iconName="clipboard2-fill"
width="10%"
style={styles.button}
onPress={() => setShowAlert(true)}
/>
</View>
<Alert
visible={showAlert}
cancelButtonConfig={{
hide: false,
width: '15%',
styleTxt: {display: 'none'},
onPress: () => {
setShowAlert(false);
},
}}
confirmButtonConfig={{
hide: false,
width: '15%',
styleTxt: {display: 'none'},
disabled: selectedMode == null,
onPress: () => {
setShowAlert(false);
navigation.navigate('ControlEntryFormScreen', {
controlEntryId: controlEntryId,
selectedMode: selectedMode,
});
},
}}>
<RadioSelect
direction="column"
question="Filling method"
itemStyle={styles.radioSelect}
items={[
{id: '1', title: 'By Sample'},
{id: '2', title: 'By Characteristic'},
]}
onChange={setSelectedMode}
/>
</Alert>
</View>
);
};
Expand All @@ -121,6 +165,9 @@ const styles = StyleSheet.create({
height: 40,
borderWidth: 1,
},
radioSelect: {
height: 150,
},
});

export default ControlEntryDetailsHeader;

This file was deleted.

1 change: 0 additions & 1 deletion packages/apps/quality/src/components/molecules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ export {default as ControlEntryDetailsButtons} from './ControlEntryDetailsButton
export {default as ControlEntryDetailsHeader} from './ControlEntryDetailsHeader/ControlEntryDetailsHeader';
export {default as ControlEntryFormButtons} from './ControlEntryFormButtons/ControlEntryFormButtons';
export {default as ControlEntryFormHeader} from './ControlEntryFormHeader/ControlEntryFormHeader';
export {default as ControlEntryHeader} from './ControlEntryHeader/ControlEntryHeader';
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const ControlEntryDetailsScreen = ({route}) => {

const dispatch = useDispatch();
const I18n = useTranslator();
const Colors = useThemeColor();

const {
controlEntrySampleList,
Expand Down

0 comments on commit 9162bd0

Please sign in to comment.