Browse Source

updating modal error messages

master
analuizaff 3 years ago
parent
commit
ea6d2ed9d1
  1. 2
      src/app/components/AssembleModalObject.js
  2. 49
      src/app/components/MapModal.js
  3. 22
      src/app/screens/Abbout.js

2
src/app/components/AssembleModalObject.js

@ -204,7 +204,7 @@ const AssembleModalObject = async (response, name, userId, formId) => {
comments = datapluv[dtlength].values[val_length].comment; comments = datapluv[dtlength].values[val_length].comment;
} }
} }
console.log(datapluv);
// console.log(datapluv);
} }
} }
} else if (JSON.parse(response).array_to_json) { } else if (JSON.parse(response).array_to_json) {

49
src/app/components/MapModal.js

@ -98,8 +98,9 @@ function iconTextRow(props) {
color={colors.primary} color={colors.primary}
/> />
</View> </View>
<Text style={styles.text}>{props.description}</Text>
<View style={{ flexDirection: "row", flexGrow: 1}}>
<Text style={{...styles.text, flexShrink: 1}}>{props.description}</Text>
</View>
</View> </View>
); );
} }
@ -114,8 +115,11 @@ function iconInstitutionTextRow(props) {
color={colors.primary} color={colors.primary}
/> />
</View> </View>
<Text style={styles.text}>{props.description}</Text>
<View style={{ flexDirection: "row", flexGrow: 1, flex: 1 }}>
<Text style={{ ...styles.text, flexShrink: 1 }}>
{props.description}
</Text>
</View>
</View> </View>
); );
} }
@ -205,13 +209,29 @@ function moreInfo(props) {
<View <View
style={{ style={{
height: hasData ? chartHeight * 1.4 : 70, height: hasData ? chartHeight * 1.4 : 70,
paddingVertical: 20,
paddingVertical: hasData ? 20 : 10,
alignContent: "center",
}} }}
> >
{!hasData ? ( {!hasData ? (
<Text style={{ ...styles.text, alignSelf: "center" }}>
<View>
<Text
style={{
...styles.text_pluv,
alignSelf: "center",
}}
>
Não dados para este pluviômetro Não dados para este pluviômetro
</Text> </Text>
<Text
style={{
...styles.text_pluv,
alignSelf: "center",
}}
>
nos últimos 5 dias
</Text>
</View>
) : ( ) : (
<PluviometerGraphics chartHeight={chartHeight} data={props.data} /> <PluviometerGraphics chartHeight={chartHeight} data={props.data} />
)} )}
@ -224,11 +244,13 @@ function componentBody(props) {
// NOTE: This code is refered to our local SQLite solution. Revise this when implement rest API. // NOTE: This code is refered to our local SQLite solution. Revise this when implement rest API.
const pictures = JSON.parse(props.pictures); const pictures = JSON.parse(props.pictures);
const date = props.date ? props.date : "implementando..."; const date = props.date ? props.date : "implementando...";
const address = props.address ? props.address : "Erro ao carregar endereço";
const address = props.address
? props.address
: "Não foi possível carregar o endereço ";
const user = props.user ? props.user : "Usuário ativo"; const user = props.user ? props.user : "Usuário ativo";
const institution = props.institution const institution = props.institution
? props.institution ? props.institution
: "Erro ao carregar instituição";
: "Não foi possível obter o nome da instituição";
return ( return (
<View style={styles.bodyRow}> <View style={styles.bodyRow}>
@ -252,8 +274,7 @@ function componentBody(props) {
} }
function userMessage(marker) { function userMessage(marker) {
if (marker.description == "") return <></>;
if (marker.description && marker.description != "") {
return ( return (
<View> <View>
<Text <Text
@ -264,6 +285,9 @@ function userMessage(marker) {
<Text style={styles.text}>{marker.description}</Text> <Text style={styles.text}>{marker.description}</Text>
</View> </View>
); );
} else {
return <></>;
}
} }
function isPluviometer(name) { function isPluviometer(name) {
@ -422,6 +446,11 @@ const styles = StyleSheet.create({
fontWeight: "500", fontWeight: "500",
fontSize: dimensions.text.default, fontSize: dimensions.text.default,
}, },
text_pluv: {
fontWeight: "bold",
fontSize: dimensions.text.default,
color: colors.primary,
},
link: { link: {
alignSelf: "center", alignSelf: "center",
color: colors.lightBlue, color: colors.lightBlue,

22
src/app/screens/Abbout.js

@ -13,7 +13,7 @@ import logos from "../assets/logos/LogosAPP.svg";
export default function Abbout(props) { export default function Abbout(props) {
const linkWarwick = const linkWarwick =
"https://warwick.ac.uk/fac/arts/schoolforcross-facultystudies/igsd/waterproofingdata/";
" https://warwick.ac.uk/fac/arts/schoolforcross-facultystudies/igsd/waterproofingdata/";
const linkCEMADEN = "http://educacao.cemaden.gov.br/"; const linkCEMADEN = "http://educacao.cemaden.gov.br/";
@ -36,11 +36,14 @@ export default function Abbout(props) {
práticas de dados. Normalmente, os dados fluem das cidades para os práticas de dados. Normalmente, os dados fluem das cidades para os
centros de pesquisa e, em seguida, os alertas e as intervenções centros de pesquisa e, em seguida, os alertas e as intervenções
fluem de volta para os governos locais e as comunidades. O projeto fluem de volta para os governos locais e as comunidades. O projeto
é conduzido por uma equipe internacional de pesquisadores do
Brasil, Reino Unido e da Alemanha. O aplicativo Dados à Prova
d'água tem como objetivo engajar comunidades, escolas, defesas
civis e outras agências governamentais na geração e circulação de
dados relacionados à inundações. {"\n\n"}Mais informações:{"\n"}
é conduzido por uma equipe internacional de pesquisadores da
Fundação Getulio Vargas e do Centro Nacional de Monitoramento e
Alerta de Desastres Natuais (Brasil), da Universidade de Warwick e
da Universidade de Glasgow (Reino Unido) e da Universidade de
Heidelberg (Alemanha). O aplicativo Dados à Prova dÁgua tem como
objetivo engajar comunidades, escolas, defesas civis e outras
agências governamentais na geração e circulação de dados
relacionados à inundações. {"\n\n"}Mais informações:{"\n"}
<Text <Text
style={styles.url} style={styles.url}
onPress={() => Linking.openURL(linkWarwick)} onPress={() => Linking.openURL(linkWarwick)}
@ -88,10 +91,9 @@ export default function Abbout(props) {
<Text style={styles.txtTitle}>Cooperação e financiamento</Text> <Text style={styles.txtTitle}>Cooperação e financiamento</Text>
</View> </View>
<Text style={styles.txtDescription}> <Text style={styles.txtDescription}>
O aplicativo Dados à Prova d'água é parte do projeto T2S
Waterproofing Data (em inglês) que é apoiado financeiramente pelo
Belmont Forum e NORFACE Joint Research Programme on
Transformations to Sustainability (
O aplicativo nome é parte do projeto T2S Waterproofing Data (em
inglês) que é apoiado financeiramente pelo Belmont Forum e NORFACE
Joint Research Programme on Transformations to Sustainability (
<Text <Text
style={styles.url} style={styles.url}
onPress={() => Linking.openURL(linkNorface)} onPress={() => Linking.openURL(linkNorface)}

Loading…
Cancel
Save