Coder Social home page Coder Social logo

esri / adopta Goto Github PK

View Code? Open in Web Editor NEW
5.0 32.0 4.0 1.66 MB

Development repo for the AdoptA application

License: Apache License 2.0

HTML 8.16% JavaScript 58.51% CSS 5.00% Python 28.32%
web-development solutions local-government adopta-widget web-appbuilder javascript python government

adopta's People

Contributors

arcgislocalgov avatar chris-fox avatar chrisbuscaglia avatar ctlocalgovteam avatar lindsaythomas avatar mikemillergis avatar miketschudi avatar pleblanc93 avatar sumitzarkar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adopta's Issues

Signup is failing using a SQL Server user table

For some reason, the field length check is failing (for what seem intermittently).

Commenting out the code for this resolves the issue, but a more permanent fix is needed.

check email field length

table_fields = arcpy.Describe(user_table).fields
email_field = [field for field in table_fields if field.name == user_email_field][0]

if len(input_user_email) > email_field.length:
send_msg("Email address too long. Only {0} characters allowed.".format(
email_field.length), "error")
return None, None

Error thrown was an index out of range error.

I haven't had time to look into further and need to move on to other things, was able to get through it for a demo.

Bulk emailer failing when there assets without valid users

I'm getting an error when executing the bulk email service.

I have purposely cleaned up my User_Table to simulate new users. When doing so, I'm orphaning assets. I've since validated logins for new users (2) and adopted new assets.

The older assets are being reported as orphans - that's OK, but is failing to notify the 2 valid users with valid assets.

Asset adopted {6fd2fa79-b925-46c4-9124-fd0c0a94e6b7}, but user not found in table
Asset adopted {742b5e59-39ef-474f-8863-89482af97767}, but user not found in table
Asset adopted {85da2d8b-4547-45e9-8e03-833f539aea2f}, but user not found in table
Asset adopted {5493a1c4-fcd8-4d97-b170-205b7ed75d4f}, but user not found in table
Asset adopted {7d778953-c7c2-4d0e-abf5-11833b4f0105}, but user not found in table
Asset adopted {3ac6352a-c39d-4738-a453-bc7ac834f03a}, but user not found in table
Asset adopted {d3ab8320-7545-4a22-9c3a-3d1894dce4ac}, but user not found in table
Asset adopted {52287416-1875-45c6-97f4-68ee7baafcb0}, but user not found in table
Asset adopted {c65c0e81-77f2-4f50-ba09-8cff6530680e}, but user not found in table
Asset adopted {93c372eb-90b9-47ff-baad-608bcb0dc674}, but user not found in table
Asset adopted {f35dc899-c575-4c97-a287-a1a24efa42ec}, but user not found in table
Failed. Incorrect usertable or asset layer. None of the assets have owners.

Adoption summary statistics

Total registered users: 2
Users with adoptions: 0
Users without adoptions: 2
Orphans (adopted but owner not found): 11

0 email(s) will be sent.

Adoptions per user

Completed script Bulkemail...
Failed to execute (Bulkemail).
Failed at Tue Jun 07 15:56:01 2016 (Elapsed Time: 30.91 seconds)

User cannot go back to login screen if he mistypes email address

@ChrisBuscaglia

We think this is going to be a common occurrence. When an existing user mistypes his email address, he is taken to the signup screen with no option to go back to login screen. The only way is to reload the app, so he can enter his correct email to login.

Should we add an option to go back to login screen for registered users on the sign up screen?

Clicking on the link will take user back to login page.

image

Add arcpy.AddError to the sendmsg

hard to trouble shoot errors when the error message is only returned as a parameter
def send_msg(message, messagetype="message",):
""" output messages to stdout as well as arcpy """
if messagetype.lower() == "message":
arcpy.AddMessage(message)
if messagetype.lower() == "warning":
arcpy.AddWarning(message)
if messagetype.lower() == "error":
# set the result_output parameter in case of failures
out_message = {"status":"Failed", "description":message}
arcpy.AddError(message)
arcpy.SetParameterAsText(28, out_message)
if messagetype.lower() == "success":
# set the result_output parameter in case of success
out_message = {"status":"Success", "description":message}
arcpy.SetParameterAsText(28, out_message)
print message

Disable selection of asset while signup gp service is executing

If the GP service is slow the respond, the user could click on an asset, this would transition the page from the sign up while the cursor is spinning to the Adopt Page. From here there is no way to go back. I think it would be best to disable the selection of an asset while any call to a GP service is occuring
@ChrisBuscaglia

Sign Up workflow

If the email address is the only required field, after submitting you email on the initial page, the only indication that you need to do something is the button changes from Sign Up/Login to Sign Up. If no additional fields are required, the app should call the Sign Up GP service without additional user interaction.

@ChrisBuscaglia

HTML Text for Signup and Login

Has there been an update to the config.? I've been trying to get my loginHelpText to look the same as I had for the previous sprint.

I also noticed this with the deployed app...the text was all left aligned and the same size.

The attached document shows difference.

Document.zip

ApplyEdits should only update Nickname and Adopta Fields

Currently apply edits is sending back everything, please limit this to only fields the app is setting

[{"geometry":{"x":-10026507.5173,"y":3496871.515199997,"spatialReference":{"wkid":102100,"latestWkid":3857}},"attributes":{"OBJECTID":36967,"TYPE":"CB","SYSTEM":"Eastbank","GIS_ID":"399-468-0670","BLOCKID":"220710059001037","Survey":0,"Surveyed":" ","RimEl_Ft":5.06588064861,"Depth_Ft":0,"Invert_Ft":0,"Northing":528798.254523,"Easting":3681031.68291,"Assetstatus":"Adopted","RelateGUID":"2979266a-d50e-425a-9b01-2ea0b077b096","Adopteddate":1464873381808,"Laststatusupdate":1464873381808,"Lastcleaneddate":null,"Nickname":"wer"}}]

image

Avoid displaying empty rows in list of adopted assets

@ChrisBuscaglia, @MikeMillerGIS

The logic implemented currently in the app is to use nickname, popup-title, displayField in that order to display rows in the list of adopted assets in the widget (when you click email). The same order is also used to display messages in the app when an action is performed, for e.g., Thank you for adopting {assetTitle}

However, we see that in some cases, you still end up with empty text because the concerned fields are empty. This leads to empty rows in the list of My Assets screen in the widget.

To ensure we always have something to display, we are planning to employ a fallback to use "layername: objectid" if nickame, popup-title, displayField are all empty. This will avoid displaying empty rows in My Assets screen as well as messages used in the app.

Please let us know if this is ok.

Update new asset message

5-13-2016 1-38-08 pm

//Catch Basin = "popuptitle"

Would you like to create a new Catch Basin at this location? The new Catch Basin will be adopted.

Duplicate users in the user table

I cannot reproduce how I did this - but there are multiple users with the same email address, some with different teams (or no team) in the user table. When this happens I receive a message that says it cannot send login emails and to try again later. Only deleting the users will allow the app to send emails again.

Have you (CT) had this issue before?
What triggers the login email failure message? Any time the request to the GP service fails?

@CTLocalGovTeam

Creating a new asset - Applyedits called twice

There is something odd when creating a new asset. It appears Add is called, and then Update is called with the same info. Why is this occuring. It should be an Add and only the update after they change someting, like a nickname

image

Change Actions to always have text and use icon for action

Here is a mock up. The feedback was after clicking the action, you lose the context of the icon. Can we do something like this?

image

For the icon, we need to let the user specify it for the action. By clean, I am thinking we just make a broom or dustpan or something like that

Do we need page navigation arrows in the widget?

@ChrisBuscaglia, @MikeMillerGIS

Here is the original UI as discussed.

image

Here is what we are proposing. Clicking on the green bar at the bottom always takes you to list of your adopted assets. Removing the next arrow beside each adopted asset frees up some space to accomodate potentially larger labels.

image

Please let us know if this is ok.

Legacy code making wrong queries

Looks like there is some old code hanging around. When I click on an asset to adopt it, it is trying to query a layer at index 1, but the query is invalid.
image

image

Nickname is a required parameter - app will not function without it

"nickNameField": "Nickname",

Please remove this dependency from the configuration, only email is required.

I'd vote to change this array to be something different than "additionalfields" to something like "additionalloginparameters".

"additionalFields": [
{
"field": "Nickname",
"placeHolderText": "Nickname",
"isRequired": true
}
],

Which version of ArcREST to use for bulkemail?

@MikeMillerGIS @ChrisBuscaglia

I am seeing issues with using the current release of ArcREST v3.5.3 with Python 3.4 in ArcGIS Pro.

Pro Python is complaining about the usage of dict.has_key() in multiple files in this release branch which doesn't work in Python 3.

Should we get from master? The master too has one occurence of 'has_key' when you search the the repo, in deleteUser.py, but that doesn't affect us.

Limit return messaging from GP service

Just a question, is it bad that the GP service is returning all this text? It is all the parameters being sent to gp process.

{"results":[{"paramName":"Result","dataType":"GPString","value":{'status': 'Failed', 'description': 'User does not exist'}}],"messages":[{"type":"esriJobMessageTypeInformative","description":"Executing (AuthGP): AuthGP [email protected] Login http://qadev000237.esri.com:81/ # "Catch Basin" {"actions":{"assign":{"name":"Adopt","assignLabel":"Adopt Me","assignedLabel":"Adopted","urlParameterLabel":"assign","fieldsToUpdate":[{"field":"Assetstatus","action":"SetValue","value":"Adopted"},{"field":"Adopteddate","action":"SetDate"},{"field":"Laststatusupdate","action":"SetDate"}]},"unAssign":{"name":"Abandon","urlParameterLabel":"unassign","displayInMyAssets":false,"fieldsToUpdate":[{"field":"Assetstatus","action":"SetValue","value":"Available"},{"field":"Adopteddate","action":"Clear"},{"field":"Laststatusupdate","action":"SetDate"}]},"additionalActions":[{"name":"Click if clean","urlParameterLabel":"clean","displayInMyAssets":true,"fieldsToUpdate":[{"field":"Lastcleaneddate","action":"SetDate"}]}]},"nickNameField":"Nickname","foreignKeyFieldForUserTable":"RelateGUID"} # # #"},{"type":"esriJobMessageTypeInformative","description":"Start Time: Thu Jun 02 05:47:24 2016"},{"type":"esriJobMessageTypeInformative","description":"Executing (AuthGP): AuthGP [email protected] Login http://qadev000237.esri.com:81/ # "Catch Basin" {"actions":{"assign":{"name":"Adopt","assignLabel":"Adopt Me","assignedLabel":"Adopted","urlParameterLabel":"assign","fieldsToUpdate":[{"field":"Assetstatus","action":"SetValue","value":"Adopted"},{"field":"Adopteddate","action":"SetDate"},{"field":"Laststatusupdate","action":"SetDate"}]},"unAssign":{"name":"Abandon","urlParameterLabel":"unassign","displayInMyAssets":false,"fieldsToUpdate":[{"field":"Assetstatus","action":"SetValue","value":"Available"},{"field":"Adopteddate","action":"Clear"},{"field":"Laststatusupdate","action":"SetDate"}]},"additionalActions":[{"name":"Click if clean","urlParameterLabel":"clean","displayInMyAssets":true,"fieldsToUpdate":[{"field":"Lastcleaneddate","action":"SetDate"}]}]},"nickNameField":"Nickname","foreignKeyFieldForUserTable":"RelateGUID"} # # #"},{"type":"esriJobMessageTypeInformative","description":"Start Time: Thu Jun 02 05:47:24 2016"},{"type":"esriJobMessageTypeInformative","description":"Executing (AuthGPScript): AuthGPScript [email protected] Login http://qadev000237.esri.com:81/ "C:\arcgisserver\directories\arcgissystem\arcgisinput\Adopta\AdoptaGP.GPServer\extracted\v101\Connection to QADev000237_sqlexpress.sde\Adopta.DBO.User_table" email teamname usertoken tokendate 1440 http://services.arcgis.com/b6gLrKHqgkQb393u/arcgis/rest/services/AdoptaCatchBasin_WFL/FeatureServer/0 # # http://www.arcgis.com [email protected] "Welcome to the Adopt a Catch Basin Program!" C:\arcgisserver\directories\arcgissystem\arcgisinput\Adopta\AdoptaGP.GPServer\extracted\v101..\cd\toolbox1\signup_template.html "Welcome back!" C:\arcgisserver\directories\arcgissystem\arcgisinput\Adopta\AdoptaGP.GPServer\extracted\v101..\cd\toolbox1\login_template.html smtp.esri.com:25 # # false # "Catch Basin" {"actions":{"assign":{"name":"Adopt","assignLabel":"Adopt Me","assignedLabel":"Adopted","urlParameterLabel":"assign","fieldsToUpdate":[{"field":"Assetstatus","action":"SetValue","value":"Adopted"},{"field":"Adopteddate","action":"SetDate"},{"field":"Laststatusupdate","action":"SetDate"}]},"unAssign":{"name":"Abandon","urlParameterLabel":"unassign","displayInMyAssets":false,"fieldsToUpdate":[{"field":"Assetstatus","action":"SetValue","value":"Available"},{"field":"Adopteddate","action":"Clear"},{"field":"Laststatusupdate","action":"SetDate"}]},"additionalActions":[{"name":"Click if clean","urlParameterLabel":"clean","displayInMyAssets":true,"fieldsToUpdate":[{"field":"Lastcleaneddate","action":"SetDate"}]}]},"nickNameField":"Nickname","foreignKeyFieldForUserTable":"RelateGUID"} # # #"},{"type":"esriJobMessageTypeInformative","description":"Start Time: Thu Jun 02 05:47:24 2016"},{"type":"esriJobMessageTypeInformative","description":"Running script AuthGPScript..."},{"type":"esriJobMessageTypeInformative","description":"Completed script AuthGPScript..."},{"type":"esriJobMessageTypeInformative","description":"Succeeded at Thu Jun 02 05:47:24 2016 (Elapsed Time: 0.29 seconds)"},{"type":"esriJobMessageTypeInformative","description":"Succeeded at Thu Jun 02 05:47:24 2016 (Elapsed Time: 0.34 seconds)"},{"type":"esriJobMessageTypeInformative","description":"Succeeded at Thu Jun 02 05:47:24 2016 (Elapsed Time: 0.34 seconds)"}]}

@CTLocalGovTeam

New asset does not have the User ID applied on create, applied on Update

Here is the info I see being passed into the Add, I do not see the User ID that associates this asset to the user.
[{"geometry":{"x":-10025740.424416192,"y":3496863.294630979,"spatialReference":{"wkid":102100}},"attributes":{}}]

here is the update

[{"geometry":{"x":-10025884.34100853,"y":3497004.2254019,"spatialReference":{"wkid":102100}},"attributes":{"OBJECTID":45889,"RelateGUID":"2979266a-d50e-425a-9b01-2ea0b077b096","Assetstatus":"Adopted","Adopteddate":1464873995550,"Laststatusupdate":1464873995550}}]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.