Esri / storymap-crowdsource

DEPRECATED: The Story Map Crowdsource℠ app enables you to publish and manage a crowdsourced story to which anyone can contribute photos with captions. https://storymaps.arcgis.com/en/app-list/crowdsource/
https://www.esri.com/arcgis-blog/products/story-maps/announcements/story-map-crowdsource-mature-support/
Apache License 2.0
21 stars 40 forks source link

Adding custom fields #8

Closed mcordell42 closed 7 years ago

mcordell42 commented 7 years ago

I am having some issues adding an input for an email field in the Crowdsource form. I have followed all but the last of the steps here: https://developerscorner.storymaps.arcgis.com/custom-forms-in-the-story-map-crowdsource-beta-79af2014c8da I am having issues with the last step, adding the actual field to the form. I am simply unsure of how to modify the SelectedDisplay.js to add this field. If it helps, here is the way I added the Email to builderOptions.js:

Email: {
        required: true,
        type: 'email',
        fieldID: 'Email',
        label: builderText.contribute.defaultForm.email.label,
        attributeName: builderText.contribute.defaultForm.email.attribute,
        placeholder: builderText.contribute.defaultForm.email.placeholder,
        validations: ['arcgisSupportedHtml']
      }

Any help would be greatly appreciated.

ssylvia commented 7 years ago

We highly recommend not adding any fields that collect personal information, including email addresses, if you are creating a publicly accessible crowdsource story. If the story is public, all the data a user contributes is also public, searchable, and can easily be exported by other users.

When you are customizing the app, you will need to make all the changes before you actually create the story. When you first create the story, the builder will generate a new feature service and a form configuration based on these code files. Changing these after the fact will have no affect because those configurations live on ArcGIS Online. You would need to manually change the Feature Service definition (ArcDesktop or Through the REST API) and change the underlying app data (Can be done the the AGO Assistant).

I'm assuming you are not actually referring to the last step if you have are not seeing the the field show up in the form. The last step in the blog post is about showing the user's output once they click on a completed point in the map. The majority of the app is written with React and the selectedDisplay output is React Component. You should understand the basics of React to edit this "template": https://facebook.github.io/react/.

You should never show personal information in the public view of the app. It is possible to only show certain fields of the app in the builder mode for reviews to see. The main app state contains the appState.mode.isBuilder boolean variable that you can test against to selectively render those fields. Even if you do this, the data is still publicly searchable and exportable because all the data is stored in a public feature service on ArcGIS Online.

mcordell42 commented 7 years ago

Okay, that was an awesome amount of information. I was hoping my Angular knowledge transferred over to React, but I just need to delve into the code and React a little more. Thanks also for the advice on the email data. We will be changing our approach to some of this info for our photo contest app. Many thanks for your help!