Skip to content

Commit

Permalink
Merge pull request fga-eps-mds#171 from Ronyell/CompleteReport
Browse files Browse the repository at this point in the history
Concluir relatório
  • Loading branch information
ThalissonMelo authored Apr 17, 2018
2 parents 943e8fd + 78fcdb3 commit 5537e00
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 33 deletions.
11 changes: 8 additions & 3 deletions src/screens/reports/DocCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ export default class DocCheckoutScreen extends React.Component {
BackHandler.removeEventListener('hardwareBackPress', backHandlerPop);
}


showPositiveCheckBox(item) {
return (
<View>
<Checkbox
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setDocReportPositive(item.key)}
onSelect={() => {
this.props.setDocReportPositive(item.key);
this.props.setStatusDoc(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -47,7 +49,10 @@ export default class DocCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setDocReportNegative(item.key)}
onSelect={() => {
this.props.setDocReportNegative(item.key);
this.props.setStatusDoc(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/FoodHandlerCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class FoodHandlerCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setFoodHandlerReportPositive(item.key)}
onSelect={() => {
this.props.setFoodHandlerReportPositive(item.key);
this.props.setStatusFoodHandler(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -46,7 +49,10 @@ export default class FoodHandlerCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setFoodHandlerReportNegative(item.key)}
onSelect={() => {
this.props.setFoodHandlerReportNegative(item.key);
this.props.setStatusFoodHandler(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/FoodPreparationCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class FoodPreparationCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setFoodPreparationReportPositive(item.key)}
onSelect={() => {
this.props.setFoodPreparationReportPositive(item.key);
this.props.setStatusFoodPreparation(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -46,7 +49,10 @@ export default class FoodPreparationCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setFoodPreparationReportNegative(item.key)}
onSelect={() => {
this.props.setFoodPreparationReportNegative(item.key);
this.props.setStatusFoodPreparation(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/FoodQualityCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class FoodQualityCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setFoodQualityReportPositive(item.key)}
onSelect={() => {
this.props.setFoodQualityReportPositive(item.key);
this.props.setStatusFoodQuality(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -46,7 +49,10 @@ export default class FoodQualityCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setFoodQualityReportNegative(item.key)}
onSelect={() => {
this.props.setFoodQualityReportNegative(item.key);
this.props.setStatusFoodQuality(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/KitchenCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class KitchenCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setKitchenReportPositive(item.key)}
onSelect={() => {
this.props.setKitchenReportPositive(item.key);
this.props.setStatusKitchen(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -51,7 +54,10 @@ export default class KitchenCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setKitchenReportNegative(item.key)}
onSelect={() => {
this.props.setKitchenReportNegative(item.key);
this.props.setStatusKitchen(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/RefectoryCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class RefectoryCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setRefectoryReportPositive(item.key)}
onSelect={() => {
this.props.setRefectoryReportPositive(item.key);
this.props.setStatusRefectory(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -46,7 +49,10 @@ export default class RefectoryCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setRefectoryReportNegative(item.key)}
onSelect={() => {
this.props.setRefectoryReportNegative(item.key);
this.props.setStatusRefectory(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/SchoolSurroundingsCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class SchoolSurroundingsCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setSchoolSurroundingsReportPositive(item.key)}
onSelect={() => {
this.props.setSchoolSurroundingsReportPositive(item.key);
this.props.setStatusSchoolSurroundings(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -46,7 +49,10 @@ export default class SchoolSurroundingsCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setSchoolSurroundingsReportNegative(item.key)}
onSelect={() => {
this.props.setSchoolSurroundingsReportNegative(item.key);
this.props.setStatusSchoolSurroundings(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/StockFoodCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export default class StockFoodCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setStockFoodReportPositive(item.key)}
onSelect={() => {
this.props.setStockFoodReportPositive(item.key);
this.props.setStatusFoodStock(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -47,7 +50,10 @@ export default class StockFoodCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setStockFoodReportNegative(item.key)}
onSelect={() => {
this.props.setStockFoodReportNegative(item.key);
this.props.setStatusFoodStock(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/screens/reports/WaterSewerSupplyCheckoutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class WaterSewerSupplyCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedYes}
selectedColor={'#008000'}
onSelect={() => this.props.setWaterSewerSupplyReportPositive(item.key)}
onSelect={() => {
this.props.setWaterSewerSupplyReportPositive(item.key);
this.props.setStatusWaterSewerSupply(false);
}}
disabled={item.markedNo}
disabledColor={null}
/>
Expand All @@ -46,7 +49,10 @@ export default class WaterSewerSupplyCheckoutScreen extends React.Component {
checkboxStyle={styles.checklist.checkBoxStyle}
selected={item.markedNo}
selectedColor={'#B22222'}
onSelect={() => this.props.setWaterSewerSupplyReportNegative(item.key)}
onSelect={() => {
this.props.setWaterSewerSupplyReportNegative(item.key);
this.props.setStatusWaterSewerSupply(false);
}}
disabled={item.markedYes}
disabledColor={null}
/>
Expand Down
32 changes: 18 additions & 14 deletions src/screens/startInspection/StartPendingInspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,29 +230,33 @@ class StartPendingInspection extends React.Component {
<View style={{ flex: 3 }}>
{this.verification(visitSchedule.content.visitListOfInvitees, visitSchedule)}
{
Object.keys(visitSchedule.content.visitListOfInvitees).length > 1 ?
this.renderPaticipantsButton(visitSchedule) : undefined
this.renderPaticipantsButton(
visitSchedule,
Object.keys(visitSchedule.content.visitListOfInvitees).length)
}
</View>
</View>
))
);
}

renderPaticipantsButton(visitSchedule) {
return (
<View style={styles.buttonInvitees}>
<TouchableOpacity
onPress={() =>
this.mountvisitListOfInvitees(visitSchedule.content.visitListOfInvitees)}
>
<Text style={styles.buttonText}>PARTICIPANTES</Text>
</TouchableOpacity>
</View>
);
renderPaticipantsButton(visitSchedule, numberOfParticipants) {
let participantsButton;
if (numberOfParticipants > 1) {
participantsButton = (
<View style={styles.buttonInvitees}>
<TouchableOpacity
onPress={() =>
this.mountvisitListOfInvitees(visitSchedule.content.visitListOfInvitees)}
>
<Text style={styles.buttonText}>PARTICIPANTES</Text>
</TouchableOpacity>
</View>
);
}
return participantsButton;
}


renderCounselorList() {
return (
this.state.invitees.map(counselor => (
Expand Down

0 comments on commit 5537e00

Please sign in to comment.