Adding work item ticket number into to list
This commit is contained in:
@@ -3,5 +3,5 @@ import { Route, Redirect } from "react-router-native"
|
||||
|
||||
export const DefaultRoute = () => {
|
||||
// NOTE: When working on the app, change this to the page you are working on
|
||||
return <Route render={() => <Redirect to={"/workitemlist"} />} />
|
||||
return <Route render={() => <Redirect to={"/home"} />} />
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { MessageModal } from "../Modal"
|
||||
import autobind from "autobind-decorator"
|
||||
import { SwipeListView } from "react-native-swipe-list-view"
|
||||
import { api } from "../API"
|
||||
import { workItemTypeEnum, formatLatLng, parseLatLng } from "../util"
|
||||
import { workItemTypeEnum, formatLatLng, parseLatLng, pad } from "../util"
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
@@ -140,6 +140,15 @@ export class WorkItemList extends React.Component {
|
||||
onPress={() => this.handleItemSelect(item, rowMap[item._id])}>
|
||||
<View
|
||||
style={{ height: "100%", width: "100%", flexDirection: "row" }}>
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 10,
|
||||
width: 45,
|
||||
marginLeft: 5,
|
||||
alignSelf: "center",
|
||||
}}>
|
||||
{pad(item.ticketNumber, 4)}
|
||||
</Text>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: 1,
|
||||
|
||||
@@ -44,3 +44,9 @@ export const workItemTypeEnum = [
|
||||
{ value: "inspection", text: "Inspection" },
|
||||
{ value: "complaint", text: "Complaint" },
|
||||
]
|
||||
|
||||
export const pad = (num, size) => {
|
||||
var s = num + ""
|
||||
while (s.length < size) s = "0" + s
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user