FeatureEditor - automatic field input from user value

53 views
Skip to first unread message
Assigned to tobia....@geosolutionsgroup.com by lorenzo...@geosolutionsgroup.com

gaetan....@gmail.com

unread,
Jan 22, 2024, 4:41:23 AMJan 22
to mapstore-users
Hi,

I would like to propose a new FeatureEditor improvement.

  • The need
According to a user improvement request, we would like to contribute some FeatureEditor change to allow automatic input field from authenticated user value (e.g name or id).

  • Use case

"As data manager,
I need that operator_name field must be completed automatically, 
To find out who has modified a feature"

  • Technical proposal
- I think that security selector allow to get user info from FeatureEditor plugin
- We can change FeatureEditor config to add editorProps.fromUser property that will  map layer field to user field as : 

                    {
                      "regex": {
                        "attribute": "operator",
                        "typeName": "^economic_area:area_rental$"
                      },
                      "allowEdit": false,
                      "editorProps": {
                        "fromUser": "name"
                      }
                    },

- In addition, a Redux Epics will catch a feature modification to insert user info (some already exists). This point is not yet clear and I need to analyse the mapstore code further. I'm ready to listen good practice about this specific point to use or re-use the best Redux flow as possible.

So, what do you thing about this improvement and technical proprosal ?

Thank you very mutch for your advice and feedback.

Gaëtan Bruel (JDev)

gaetan....@gmail.com

unread,
Jan 22, 2024, 4:43:41 AMJan 22
to mapstore-users
Just to be clear, allowEdit config is another improvement not already contributed -> another google group mail will follow ;)

Gaëtan Bruel (JDev)
Message has been deleted

gaetan....@gmail.com

unread,
Jan 26, 2024, 5:49:46 AMJan 26
to mapstore-users
Hi,
To be technically more specific, i have tested to manipulate FeatureGrid changes filed in an existing Redux Epics :

https://github.com/geo2france/MapStore2/blob/013a2742775792644c9195acccab4b121aa910bf/web/client/epics/featuregrid.js#L757

This works fully with this config :

{
  "regex": {
    "attribute": "operateur",
    "typeName": "^terrain_eco_light$"
  },
  "allowEdit": false,
  "getValueFrom": {
    "user": "name"
  }
},

Is this a good solution according to mapstore2 good practice ?


Gaëtan Bruel
Répondre à tous
Répondre à l'auteur
Transférer

Lorenzo Natali

unread,
Jan 30, 2024, 3:41:47 AMJan 30
to mapstore-users
Hi Gaethan, 
Thank you for your contribution. It can be interesting and we can discuss all your proposal. 
I have to ask you to send these emails to the developers mailing list.  
This is the mapstore users mailing lists and should not contain discussions on development stuff. 

Thank you in advance. 

harry cr7

unread,
Jan 31, 2024, 1:22:10 AMJan 31
to mapstor...@googlegroups.com
Hello Dear,
can you expand more on how you tested your improvement?
if i clearly understand your point, we have to :
1-create a file "featuregrid.js" in web/client directory
2-add the below code into localConfig.json file where we have ""FeatureEditor","

{
              "name": "FeatureEditor",
              "cfg": {
                "editingAttributesAllowedGroups": ["attributesEditor"],
                "editingAttributesAllowedRoles": ["ATTRIBUTES_EDITOR"],
                "editingAllowedRoles": [
                  "ADMIN",
                  "USER"
                ],
                "customEditorsOptions": {
                  "rules": [
                    {
                      "regex": {
                        "attribute": "nom",
                        "typeName": "^tabou:commune_emprise$"
                      },
                      "allowEdit": false,
                      "editor": "FromHeaderEditor",
                      "editorProps": {
                        "headerField": "name"
                      }
                    }
                  ]
                }
              }
            },

Am I right? 
Does this configuration automatically create the attribute "name" for any layer????





--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/489ae4e4-2056-4b71-944c-421fdbde443cn%40googlegroups.com.

Lorenzo Natali

unread,
Feb 1, 2024, 5:22:48 AMFeb 1
to mapstor...@googlegroups.com
Hi Harry,
Please wait for Gaetan to move this discussion to mapstore-developers.
It's important to separate developers' discussions from user's one. 
Thank you

gaetan....@gmail.com

unread,
Feb 1, 2024, 6:13:52 AMFeb 1
to mapstore-users
Hi Lorenzo,
All discussions was already moved to https://groups.google.com/u/1/g/mapstore-developers/c/d2QwLpXEHZI

To reply to Harry, this improvent don't create field but just input value from user's infos to a given layer field. So, the field needs to already exists. No fields are created.

Thanks.
Gaetan B

Lorenzo Natali

unread,
Feb 1, 2024, 6:25:25 AMFeb 1
to mapstor...@googlegroups.com
Thank you Gaethan,
I also asked a colleague to check your suggestions .

harry cr7

unread,
Feb 1, 2024, 11:26:51 AMFeb 1
to mapstor...@googlegroups.com
ok i ,get the point now

Tobia Di Pisa

unread,
Jul 1, 2024, 8:46:08 AMJul 1
to mapstor...@googlegroups.com
Hi,

further exchanges are available in another mail thread:

Best Regards,
     Tobia Di Pisa



--


==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.
==
Dott. Ing. Tobia Di Pisa
Technical Lead / Project Manager


GeoSolutions Group
phone: +39 0584 962313

mobile: +39 340 1781783
fax:      +39 0584 1660272

https://www.geosolutionsgroup.com/
http://twitter.com/geosolutions_it
-------------------------------------------------------


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Reply all
Reply to author
Forward
0 new messages