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 {
name: name,
title: situation,
user: user,
user: null,
institution: institution,
address: address,
date: date + " | " + time,

2
src/app/components/MapMarkerList.js

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

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

@ -17,7 +17,7 @@ const AssembleIngestionObject = (
array_to_json: [
{
formcode: code,
formsanswersuserinformer: user.id,
formsanswersuserinformer: "admin@wpd.com",//user.id,
fieldsanswerslongitude: location["longitude"],
fieldsanswerslatitude: location["latitude"],
fields: [
@ -49,7 +49,7 @@ const AssembleIngestionPluviometer = ({
array_to_json: [
{
formcode: "PLUVIOMETERS_FORM",
formsanswersuserinformer: user.id,
formsanswersuserinformer: "admin@wpd.com",//user.id,
fias: [
{
fieldsanswersdate: moment(date).format("DD-MM-YYYY"),
@ -72,7 +72,7 @@ const AssembleIngestionPluvRegistration = ( date, time, user, address, coordinat
array_to_json: [
{
formcode: "PLUVIOMETER_REGISTRATION",
formsanswersuserinformer: user.id,
formsanswersuserinformer: "admin@wpd.com",//user.id,
fieldsanswerslongitude: coordinates["longitude"],
fieldsanswerslatitude: coordinates["latitude"],
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 finalDate = moment().subtract(2, "days").format("YYYY-MM-DDTHH:mm:ss");
// console.log(initialDate+"/"+finalDate);
console.log(initialDate+"/"+finalDate);
const filters = [
{
name: "floodZones",
socketUrl: new WebSocket(
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",
socketUrl: new WebSocket(
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",
socketUrl: new WebSocket(
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",
socketUrl: new WebSocket(
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",
socketUrl: new WebSocket(
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",
socketUrl: new WebSocket(
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({
oficial: {
automaticPluviometer: true,
automaticPluviometer: false,
susceptibilityAreas: false,
},
citzen: {
floodRisk: true,
pluviometer: false,
pluviometer: true,
rain: true,
floodZones: true,
riverFlood: true,

Loading…
Cancel
Save