Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update feature service to add layer(s) &| table(s) #317

Merged
merged 10 commits into from
Sep 14, 2018

Conversation

MikeTschudi
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b9034b4 on mkt-updateFeatureService into a339fea on master.

@Esri Esri deleted a comment from coveralls Sep 11, 2018
@Esri Esri deleted a comment from coveralls Sep 11, 2018
import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
import { ILayer, ITable } from "@esri/arcgis-rest-common-types";

export interface IAddToFeatureServiceRequestOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to call the method updateFeatureService(), i'd recommend using IUpdateFeatureService... as interface names too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; how about we rename the function to addToFeatureService?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noahmulfinger drafted some function names i quite liked back in October 2017 based on his team's work in https://developers.arcgis.com/.

#46 (comment)

do you have any misgivings about the way he laid things out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good resource--thanks!

},
response => {
// We're not interested in the full ArcGISRequestError response, nor having an exception thrown
resolve(response.response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't quite grok your code comment. what is it exactly that you're going for here? specifically why you don't want devs to catch() errors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgravois, the underlying REST call sends an HTTP 200 for success or failure, but the request call converts the failure into an exception. Purpose of this section is to 1) align with style of REST call and 2) reduce the wordy content returned by failed request call; much of that content simply echoes what the app sent. Not needed by app, and more to define in error response type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the request call converts the failure into an exception.

Thats actually an intentional design choice in this API. We think developers will consider it more intuitive to trust that everything went according to plan if a promise resolves and catch() errors from our REST API (even if they were sent with a 200 status code).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK; easy enough to change

@MikeTschudi
Copy link
Member Author

@jgravois, I think that I addressed your review comments.
Thanks for them.

@jgravois
Copy link
Contributor

i pushed up another tweak that further simplifies how errors are handled.

please take a look at 31e56db and let me know what you think.

@MikeTschudi
Copy link
Member Author

Sounds good, @jgravois; thanks

Copy link
Member

@tomwayson tomwayson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work fellas

@jgravois jgravois merged commit d3f2553 into master Sep 14, 2018
@jgravois
Copy link
Contributor

@MikeTschudi if it'd be helpful to you for us to publish this to npm, just say the word.

@jgravois jgravois deleted the mkt-updateFeatureService branch September 14, 2018 23:02
@MikeTschudi
Copy link
Member Author

@jgravois, what does publishing to npm do, please?

@jgravois
Copy link
Contributor

npm is a package manager for sharing JS code that gets more popular by the day. it includes a cli that allows folks to pull down any bundle they're interested in.

npm install @esri/arcgis-rest-feature-service-admin

https://www.npmjs.com/package/@esri/arcgis-rest-feature-service-admin

usually when folks use npm, they organize the dependencies for their project in a package.json file. you can find some straightforward examples of this in our /demos/ directory.

"dependencies": {
"@esri/arcgis-rest-feature-service": "^1.9.0",
"@esri/arcgis-rest-request": "^1.9.0"
},

i offered to publish a release to npm because the version thats up there right now has the method you contributed to create feature services, but it doesn't yet include the method you added for modifying them.

@tomwayson
Copy link
Member

we gotta get me back on the release wagon. I'm gunshy after the releases I made didn't bump all the packages. Maybe @jgravois can hold my hand on Mon while I run the scripts?

@MikeTschudi
Copy link
Member Author

Thanks, @jgravois. I've been using @esri/... without thinking about how we get from the repository to @esri/...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants