Skip to content
522 changes: 270 additions & 252 deletions src/Main.tsx

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions src/components/PickingShortAndReasonModal/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { StyleSheet } from 'react-native';
import Theme from '../../utils/Theme';

export default StyleSheet.create({
modalOverlay: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%',
backgroundColor: 'rgba(0, 0, 0, 0.5)'
},
modalContent: {
width: '90%',
backgroundColor: 'white',
padding: Theme.spacing.large,
borderRadius: Theme.roundness * 2
},
modalSurface: {
width: '90%',
borderRadius: 8,
padding: 16,
elevation: 4,
backgroundColor: 'white'
},
modalHeader: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 8
},
modalContainer: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0
},
modalTitleText: {
fontSize: 18,
fontWeight: 'bold',
color: Theme.colors.text,
flexShrink: 1
},
modalDescription: {
fontSize: 14,
color: Theme.colors.text,
marginBottom: Theme.spacing.medium
},
dialogActions: {
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: Theme.spacing.medium
}
});
40 changes: 40 additions & 0 deletions src/components/ProductDetails/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { StyleSheet } from 'react-native';
import Theme from '../../utils/Theme';

export default StyleSheet.create({
productDetails: {
backgroundColor: Theme.colors.surface,
padding: Theme.spacing.large,
display: 'flex',
flexDirection: 'column'
},
headerRow: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
chipDefault: {
height: 28,
justifyContent: 'flex-start',
borderRadius: 4,
alignItems: 'center'
},
chipText: {
fontSize: 12,
color: Theme.colors.text
},
fontBold: {
fontWeight: 'bold'
},
title: {
fontSize: 18,
color: Theme.colors.text,
fontWeight: 'bold'
},
divider: {
marginVertical: Theme.spacing.small
},
marginTopSmall: {
marginTop: Theme.spacing.small
}
});
16 changes: 16 additions & 0 deletions src/components/Providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { Provider } from 'react-native-paper';

import { PickingProvider } from '../screens/Picking/PickingContext';
import { ReplenishmentProvider } from '../screens/Replenishment/ReplenishmentContext';
import Theme from '../utils/Theme';

export function Providers({ children }: { children: React.ReactNode }) {
return (
<Provider theme={Theme}>
<PickingProvider>
<ReplenishmentProvider>{children}</ReplenishmentProvider>
</PickingProvider>
</Provider>
);
}
3 changes: 2 additions & 1 deletion src/redux/sagas/others.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ function* getReasonCodes(action: any) {
if (action.callback) {
yield call(action.callback, {
error: true,
errorMessage: error.message
errorMessage: error.message ?? 'Failed To Load Reason Codes'
});
}
yield put(hideScreenLoading());
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/screens/Dashboard/dashboardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ const dashboardEntries: DashboardEntry[] = [
entryDescription: 'Enter a List ID to select the Cycle Count',
icon: IconInventory,
navigationScreenName: 'CycleCountListEntry'
},
{
key: 'replenishment',
screenName: 'Replenishment',
entryDescription: 'Manage inventory replenishment tasks',
icon: IconProducts,
navigationScreenName: 'ReplenishmentPickingLocation'
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Picking/PickingPickLocationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as React from 'react';
import { Alert, View } from 'react-native';
import { Divider, Paragraph, Subheading } from 'react-native-paper';

import { ProductDetails } from '../../components/ProductDetails';
import { ScannerInput } from '../../components/ScannerInput';
import { EMPTY_STRING, HYPHEN } from '../../constants';
import { navigate } from '../../NavigationService';
import { usePickingContext } from './PickingContext';
import { ProductDetails } from './ProductDetails';
import styles from './styles';

export default function PickingPickLocationScreen() {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Picking/PickingPickOutboundContainerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import * as React from 'react';
import { Alert, View } from 'react-native';
import { Divider, Paragraph, Subheading } from 'react-native-paper';

import { ProductDetails } from '../../components/ProductDetails';
import { ScannerInput } from '../../components/ScannerInput';
import { EMPTY_STRING } from '../../constants';
import { navigate } from '../../NavigationService';
import { ReasonCode } from '../../types/picking';
import { usePickingContext } from './PickingContext';
import { ProductDetails } from './ProductDetails';
import styles from './styles';
import { revalidateTaskAndProceed } from './lib';

Expand Down
2 changes: 1 addition & 1 deletion src/screens/Picking/PickingPickProductScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as React from 'react';
import { Alert, View } from 'react-native';
import { Divider, Paragraph, Subheading } from 'react-native-paper';

import { ProductDetails } from '../../components/ProductDetails';
import { ScannerInput } from '../../components/ScannerInput';
import { EMPTY_STRING, HYPHEN } from '../../constants';
import { navigate } from '../../NavigationService';
import { usePickingContext } from './PickingContext';
import { ProductDetails } from './ProductDetails';
import styles from './styles';
import { isProductBarcodeValid } from '../../utils/utils';

Expand Down
4 changes: 2 additions & 2 deletions src/screens/Picking/PickingPickQuantityScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { Alert, TextInput, View } from 'react-native';
import { Button, Divider, TextInput as PaperTextInput, Paragraph, Subheading } from 'react-native-paper';
import { useDispatch } from 'react-redux';

import PickingShortAndReasonModal from '../../components/PickingShortAndReasonModal';
import { ProductDetails } from '../../components/ProductDetails';
import { HYPHEN, INPUT_FOCUS_DELAY_TIME_IN_MS } from '../../constants';
import { navigate } from '../../NavigationService';
import { getReasonCodesAction } from '../../redux/actions/others';
import { ReasonCode } from '../../types/picking';
import { usePickingContext } from './PickingContext';
import PickingShortAndReasonModal from './PickingShortAndReasonModal';
import { ProductDetails } from './ProductDetails';
import styles from './styles';
import { revalidateTaskAndProceed } from './lib';

Expand Down
2 changes: 1 addition & 1 deletion src/screens/Picking/PickingPickStagingLocationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as React from 'react';
import { Alert, View } from 'react-native';
import { Divider, Paragraph, Subheading } from 'react-native-paper';

import { ProductDetails } from '../../components/ProductDetails';
import { ScannerInput } from '../../components/ScannerInput';
import { EMPTY_STRING } from '../../constants';
import { navigate } from '../../NavigationService';
import { usePickingContext } from './PickingContext';
import { ProductDetails } from './ProductDetails';
import styles from './styles';

export default function PickingPickStagingLocationScreen() {
Expand Down
113 changes: 17 additions & 96 deletions src/screens/Picking/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,6 @@ export default StyleSheet.create({
fontSize: 14
},

productDetails: {
backgroundColor: Theme.colors.surface,
padding: Theme.spacing.large,
display: 'flex',
flexDirection: 'column'
},
headerRow: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
chipDefault: {
height: 28,
justifyContent: 'flex-start',
borderRadius: 4,
alignItems: 'center'
},
chipText: {
fontSize: 12,
color: Theme.colors.text
},

title: {
fontSize: 18,
color: Theme.colors.text,
Expand Down Expand Up @@ -109,91 +87,34 @@ export default StyleSheet.create({
marginRight: Theme.spacing.small
},

modalOverlay: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%',
backgroundColor: 'rgba(0, 0, 0, 0.5)'
},
modalContent: {
width: '90%',
backgroundColor: 'white',
padding: Theme.spacing.large,
borderRadius: Theme.roundness * 2
},
modalSurface: {
width: '90%',
borderRadius: 8,
padding: 16,
elevation: 4,
backgroundColor: 'white'
},
modalHeader: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 8
},
modalContainer: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0
},
centeredView: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
modalTitleText: {
fontSize: 18,
fontWeight: 'bold',
color: Theme.colors.text,
flexShrink: 1
},
modalDescription: {
fontSize: 14,
color: Theme.colors.text,
marginBottom: Theme.spacing.medium
},

/** Dialog & actions **/
dialogActions: {
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: Theme.spacing.medium
},
dialogActionButton: {
marginLeft: Theme.spacing.small
},
dialogSuggestButton: {
marginVertical: Theme.spacing.medium
},
dropdownContainer: {
width: '50%',
alignSelf: 'flex-end'
},
flex1: {
flex: 1
},
fullWidth: {
width: '100%'
},
actionsWrapper: {
padding: Theme.spacing.medium,
alignItems: 'center',
borderTopWidth: 1,
borderTopColor: '#E0E0E0',
backgroundColor: 'white'
},
itemCard: {
padding: Theme.spacing.large,
backgroundColor: 'white',
marginBottom: Theme.spacing.small,
borderRadius: Theme.roundness,
elevation: 2
},

productDetails: {
backgroundColor: Theme.colors.surface,
padding: Theme.spacing.large,
display: 'flex',
flexDirection: 'column'
},
chipDefault: {
height: 28,
justifyContent: 'flex-start',
borderRadius: 4,
alignItems: 'center'
},
chipText: {
fontSize: 12,
color: Theme.colors.text
}
});
Loading