Skip to content

Commit

Permalink
fixed did not appeared value
Browse files Browse the repository at this point in the history
  • Loading branch information
doljko committed Mar 5, 2024
1 parent a3b32a4 commit 22cb9cc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/components/DropdownActionSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const DropdownActionSheet = ({ items, onChange, title, value }) => {
<View style={tailwind('border-blue-700 py-2 pr-4 flex flex-row items-center')}>
<Text style={[tailwind('font-semibold text-blue-50 text-base'), selectedItem && tailwind('px-2')]}>{selectedItem ? selectedItem.label : title}</Text>
</View>
<View style={tailwind('flex flex-row items-center')}>{selectedItem ? '' : <FontAwesomeIcon icon={faAngleDown} style={tailwind('text-white')} />}</View>
<View style={tailwind('flex flex-row items-center')}>{<FontAwesomeIcon icon={faAngleDown} style={tailwind('text-white')} />}</View>
</View>
</TouchableOpacity>
<ActionSheet
Expand Down
7 changes: 3 additions & 4 deletions src/constant/GetIssueCategoy.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
export default function getIssueCategories(type = null, options) {
console.log('type;::', JSON.stringify(type));
const issueCategories = {
VEHICLE: ['Mechanical Problems', 'Cosmetic Damages', 'Tire Issues', 'Electronics and Instruments', 'Maintenance Alerts', 'Fuel Efficiency Issues'],
DRIVER: ['Behavior Concerns', 'Documentation', 'Time Management', 'Communication', 'Training Needs', 'Health and Safety Violations'],
ROUTE: ['Inefficient Routes', 'Safety Concerns', 'Blocked Routes', 'Environmental Considerations', 'Unfavorable Weather Conditions'],
'payload-cargo': ['Damaged Goods', 'Misplaced Goods', 'Documentation Issues', 'Temperature-Sensitive Goods', 'Incorrect Cargo Loading'],
'software-technical': ['Bugs', 'UI/UX Concerns', 'Integration Failures', 'Performance', 'Feature Requests', 'Security Vulnerabilities'],
PAYLOAD_CARGO: ['Damaged Goods', 'Misplaced Goods', 'Documentation Issues', 'Temperature-Sensitive Goods', 'Incorrect Cargo Loading'],
SOFTWARE_TECHNICAL: ['Bugs', 'UI/UX Concerns', 'Integration Failures', 'Performance', 'Feature Requests', 'Security Vulnerabilities'],
OPERATIONAL: ['Compliance', 'Resource Allocation', 'Cost Overruns', 'Communication', 'Vendor Management Issues'],
CUSTOMER: ['Service Quality', 'Billing Discrepancies', 'Communication Breakdown', 'Feedback and Suggestions', 'Order Errors'],
SECURITY: ['Unauthorized Access', 'Data Concerns', 'Physical Security', 'Data Integrity Issues'],
'environmental-sustainability': ['Fuel Consumption', 'Carbon Footprint', 'Waste Management', 'Green Initiatives Opportunities'],
ENVIRONMENTAL_SUSTAINABILITY: ['Fuel Consumption', 'Carbon Footprint', 'Waste Management', 'Green Initiatives Opportunities'],
};

if (type) {
Expand Down
31 changes: 14 additions & 17 deletions src/features/Core/screens/IssueScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const IssueScreen = ({ navigation, route }) => {
}
}, []);

useEffect(()=>{
if(!type) return;
useEffect(() => {
if (!type) return;

setCategories(getIssueCategories(type))
}, [type])
setCategories(getIssueCategories(type));
}, [type]);

const saveIssue = () => {
if (!validateInputs()) {
Expand Down Expand Up @@ -199,20 +199,17 @@ const IssueScreen = ({ navigation, route }) => {
/>
{error && !report?.trim() ? <Text style={tailwind('text-red-500 mb-2')}>{error}</Text> : null}
</View>
<View style={isEdit.isEdit ? tailwind('flex flex-row items-center justify-between pb-1') : {}}>
<View>
<Text style={tailwind('font-semibold text-base text-gray-50 mb-2')}>{translate('Core.IssueScreen.priority')}</Text>
{isEdit.isEdit ? (
<Text style={tailwind('text-white')}>{priority}</Text>
) : (
<DropdownActionSheet
value={priority}
items={Object.keys(IssuePriority).map(priority => {
return { label: IssuePriority[priority], value: priority };
})}
onChange={setPriority}
title={translate('Core.IssueScreen.selectPriority')}
/>
)}
<DropdownActionSheet
value={priority}
items={Object.keys(IssuePriority).map(priority => {
return { label: IssuePriority[priority], value: priority };
})}
onChange={setPriority}
title={translate('Core.IssueScreen.selectPriority')}
/>

{error && !priority ? <Text style={tailwind('text-red-500 mb-2')}>{error}</Text> : null}
</View>

Expand Down
2 changes: 1 addition & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"save": "Save Issue",
"delete": "Delete",
"create": "Create Issue",
"update": "Update Report"
"update": "Update Issue"
}
},
"Exceptions": {
Expand Down

0 comments on commit 22cb9cc

Please sign in to comment.