Browse Source

adding 'admin@wpd.com' as user informer for all forms

master
analuizaff 3 years ago
parent
commit
96fc21ba0a
  1. 2
      src/app/components/AssembleModalObject.js
  2. 2
      src/app/components/MapMarkerList.js
  3. 6
      src/app/components/forms/AssembleIngestionObject.js
  4. 14
      src/app/hooks/useFiltering.js
  5. 4
      src/app/screens/MapFeedScreen.js

2
src/app/components/AssembleModalObject.js

@ -134,7 +134,7 @@ const AssembleModalObject = (response, name) => {
return { return {
name: name, name: name,
title: situation, title: situation,
user: user,
user: null,
institution: institution, institution: institution,
address: address, address: address,
date: date + " | " + time, date: date + " | " + time,

2
src/app/components/MapMarkerList.js

@ -7,7 +7,7 @@ function isRequestedValue(item, renderOptions) {
renderOptions.oficial.automaticPluviometer) || renderOptions.oficial.automaticPluviometer) ||
(item.name == "rain" && renderOptions.citzen.rain) || (item.name == "rain" && renderOptions.citzen.rain) ||
(item.name == "riverFlood" && renderOptions.citzen.riverFlood) || (item.name == "riverFlood" && renderOptions.citzen.riverFlood) ||
(item.name == "floodZones" && renderOptions.citzen.floodRisk) ||
(item.name == "floodZones" && renderOptions.citzen.floodZones) ||
(item.name == "susceptibilityAreas" && renderOptions.oficial.susceptibilityAreas) (item.name == "susceptibilityAreas" && renderOptions.oficial.susceptibilityAreas)
); );
} }

6
src/app/components/forms/AssembleIngestionObject.js

@ -17,7 +17,7 @@ const AssembleIngestionObject = (
array_to_json: [ array_to_json: [
{ {
formcode: code, formcode: code,
formsanswersuserinformer: user.id,
formsanswersuserinformer: "admin@wpd.com",//user.id,
fieldsanswerslongitude: location["longitude"], fieldsanswerslongitude: location["longitude"],
fieldsanswerslatitude: location["latitude"], fieldsanswerslatitude: location["latitude"],
fields: [ fields: [
@ -49,7 +49,7 @@ const AssembleIngestionPluviometer = ({
array_to_json: [ array_to_json: [
{ {
formcode: "PLUVIOMETERS_FORM", formcode: "PLUVIOMETERS_FORM",
formsanswersuserinformer: user.id,
formsanswersuserinformer: "admin@wpd.com",//user.id,
fias: [ fias: [
{ {
fieldsanswersdate: moment(date).format("DD-MM-YYYY"), fieldsanswersdate: moment(date).format("DD-MM-YYYY"),
@ -72,7 +72,7 @@ const AssembleIngestionPluvRegistration = ( date, time, user, address, coordinat
array_to_json: [ array_to_json: [
{ {
formcode: "PLUVIOMETER_REGISTRATION", formcode: "PLUVIOMETER_REGISTRATION",
formsanswersuserinformer: user.id,
formsanswersuserinformer: "admin@wpd.com",//user.id,
fieldsanswerslongitude: coordinates["longitude"], fieldsanswerslongitude: coordinates["longitude"],
fieldsanswerslatitude: coordinates["latitude"], fieldsanswerslatitude: coordinates["latitude"],
fields: [ fields: [

14
src/app/hooks/useFiltering.js

@ -6,49 +6,49 @@ function useFiltering(location) {
const initialDate = moment().add(1, "days").format("YYYY-MM-DDTHH:mm:ss"); const initialDate = moment().add(1, "days").format("YYYY-MM-DDTHH:mm:ss");
const finalDate = moment().subtract(2, "days").format("YYYY-MM-DDTHH:mm:ss"); const finalDate = moment().subtract(2, "days").format("YYYY-MM-DDTHH:mm:ss");
// console.log(initialDate+"/"+finalDate);
console.log(initialDate+"/"+finalDate);
const filters = [ const filters = [
{ {
name: "floodZones", name: "floodZones",
socketUrl: new WebSocket( socketUrl: new WebSocket(
endpoint + endpoint +
`type=FLOODZONES_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15`
`type=FLOODZONES_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50`
), ),
}, },
{ {
name: "rain", name: "rain",
socketUrl: new WebSocket( socketUrl: new WebSocket(
endpoint + endpoint +
`type=RAIN_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15`
`type=RAIN_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50`
), ),
}, },
{ {
name: "riverFlood", name: "riverFlood",
socketUrl: new WebSocket( socketUrl: new WebSocket(
endpoint + endpoint +
`type=RIVERFLOOD_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15`
`type=RIVERFLOOD_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50`
), ),
}, },
{ {
name: "pluviometer", name: "pluviometer",
socketUrl: new WebSocket( socketUrl: new WebSocket(
endpoint + endpoint +
`type=PLUVIOMETER_REGISTRATION&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15`
`type=PLUVIOMETER_REGISTRATION&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50`
), ),
}, },
{ {
name: "susceptibilityAreas", name: "susceptibilityAreas",
socketUrl: new WebSocket( socketUrl: new WebSocket(
endpoint + endpoint +
`type=FLOODZONES_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=10`
`type=FLOODZONES_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=20`
), ),
}, },
{ {
name: "automaticPluviometer", name: "automaticPluviometer",
socketUrl: new WebSocket( socketUrl: new WebSocket(
endpoint + endpoint +
`type=PLUVIOMETERS_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15`
`type=PLUVIOMETERS_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=20`
), ),
}, },
]; ];

4
src/app/screens/MapFeedScreen.js

@ -13,12 +13,12 @@ export default function MapFeedScreen(props) {
const [dataOptionsToShow, setDataOptionsToShow] = useState({ const [dataOptionsToShow, setDataOptionsToShow] = useState({
oficial: { oficial: {
automaticPluviometer: true,
automaticPluviometer: false,
susceptibilityAreas: false, susceptibilityAreas: false,
}, },
citzen: { citzen: {
floodRisk: true, floodRisk: true,
pluviometer: false,
pluviometer: true,
rain: true, rain: true,
floodZones: true, floodZones: true,
riverFlood: true, riverFlood: true,

Loading…
Cancel
Save