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

136998 - Adjust method signatures to accept ids instead of models #286

Conversation

rweber-esri
Copy link
Contributor

A follow-up PR to my original PR for hoisting survey sharing logic.

  1. Addresses some cleanup in the surveys package, e.g. moving get-* methods out of sharing dir and into a new items dir
  2. Changes some of the get-* method signatures to accept an ID string vs IModel.
  3. Changes getStakeholderModel to use the Survey2Data relationship and accept the Form ID instead of a Fieldworker ID
  4. Improved getSurveyModels performance by make the getInputFeatureServiceModel and getStakeholderModel calls concurrent (point of More initiatives #3 above).

@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@3317a15). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             master      #286   +/-   ##
==========================================
  Coverage          ?   100.00%           
==========================================
  Files             ?       321           
  Lines             ?      3761           
  Branches          ?       491           
==========================================
  Hits              ?      3761           
  Misses            ?         0           
  Partials          ?         0           
Impacted Files Coverage Δ
...rveys/src/items/get-input-feature-service-model.ts 100.00% <ø> (ø)
...t-source-feature-service-model-from-fieldworker.ts 100.00% <ø> (ø)
packages/surveys/src/sharing/index.ts 100.00% <ø> (ø)
packages/surveys/src/index.ts 100.00% <100.00%> (ø)
...ackages/surveys/src/items/get-stakeholder-model.ts 100.00% <100.00%> (ø)
packages/surveys/src/items/get-survey-models.ts 100.00% <100.00%> (ø)
packages/surveys/src/items/index.ts 100.00% <100.00%> (ø)
...s/surveys/src/sharing/get-group-sharing-details.ts 100.00% <100.00%> (ø)
packages/surveys/src/sharing/set-access.ts 100.00% <100.00%> (ø)
packages/surveys/src/sharing/share-with-group.ts 100.00% <100.00%> (ø)
... and 322 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3317a15...ee06d1c. Read the comment docs.

Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

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

Nice. Usually we have used getModelFromOptions to allow the client to use either an ID or a model in functions that require an item model, but it looks like it might not make sense in your case(?) @rweber-esri

@rweber-esri
Copy link
Contributor Author

Nice. Usually we have used getModelFromOptions to allow the client to use either an ID or a model in functions that require an item model, but it looks like it might not make sense in your case(?) @rweber-esri

Good observation @drewctate. Admittedly, this is something I went back and forth on. Ultimately, these methods don't benefit from accepting a full model object (we don't need groups, data, etc) and the existing shareItemToGroups and unshareItemFromGroups methods from the hub-common package use a simplified interface that accepts id strings, so went this direction to be consistent on the sharing front.

@rweber-esri rweber-esri merged commit 22577cb into master Jul 2, 2020
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.

2 participants