Added work item details to activity

This commit is contained in:
John Lyon-Smith
2018-06-04 16:29:58 -07:00
parent 4ebb4341b7
commit cffa0734b8
9 changed files with 81 additions and 38 deletions

View File

@@ -27,10 +27,11 @@ import { reactAutoBind } from "auto-bind2"
import KeyboardSpacer from "react-native-keyboard-spacer"
import { isIphoneX } from "react-native-iphone-x-helper"
import { api } from "../API"
import { formatLatLng } from "../util"
import { formatLatLng, workItemTypeEnum } from "../util"
import moment from "moment"
import "url-search-params-polyfill"
import { config } from "../config"
import { FormStaticOptionStrip } from "../ui/FormStaticOptionStrip"
const styles = StyleSheet.create({
container: {
@@ -124,6 +125,8 @@ export class Activity extends React.Component {
),
location: formatLatLng(lat, lng),
dateTime: moment().format(),
details: workItem.details,
workItemType: workItem.workItemType,
})
this.region = {
@@ -288,6 +291,8 @@ export class Activity extends React.Component {
waitModal,
dateTime,
location,
details,
workItemType,
uploadPercent,
} = this.state
@@ -301,14 +306,6 @@ export class Activity extends React.Component {
rightButton={{ icon: "done", onPress: this.handleDonePress }}
/>
<ScrollView style={styles.container}>
<View style={styles.panel}>
<BoundInput
binder={binder}
name="resolution"
label="Resolution:"
message="You must supply a resolution for the activity"
/>
</View>
<View style={styles.panel}>
<BoundOptionStrip
binder={binder}
@@ -322,17 +319,34 @@ export class Activity extends React.Component {
name="status"
message="You must supply a status for the activity"
/>
</View>
<View style={styles.panel}>
<BoundInput
binder={binder}
name="resolution"
label="Resolution:"
message="You must supply a resolution for the activity"
/>
<BoundInput
binder={binder}
name="notes"
label="Notes:"
message="You must supply notes for the activity"
/>
<FormStaticInput label="Date &amp; Time:" value={dateTime} />
<BoundPhotoPanel
name="photos"
binder={binder}
onUploadStarted={this.handleUploadStarted}
onUploadProgress={this.handleUploadProgress}
onUploadEnded={this.handleUploadEnded}
/>
</View>
<View style={styles.panel}>
<FormStaticInput label="Date &amp; Time:" value={dateTime} />
<FormStaticOptionStrip
label="Work Item Type:"
options={workItemTypeEnum}
value={workItemType}
/>
<FormStaticInput label="Details:" value={details} />
<FormStaticInput label="Location:" value={location} />
<View style={{ flexDirection: "column", justifyContent: "center" }}>
<MapView
@@ -369,15 +383,6 @@ export class Activity extends React.Component {
/>
</View>
</View>
<View style={styles.panel}>
<BoundPhotoPanel
name="photos"
binder={binder}
onUploadStarted={this.handleUploadStarted}
onUploadProgress={this.handleUploadProgress}
onUploadEnded={this.handleUploadEnded}
/>
</View>
{isIphoneX ? <View style={{ height: 30, width: "100%" }} /> : null}
</ScrollView>
<ProgressModal