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

feat(app): Add attached pipette info to intercom support #2140

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

Kadee80
Copy link
Contributor

@Kadee80 Kadee80 commented Aug 27, 2018

overview

This PR closes #2019 by adding attached pipettes info to intercom data when a the api returns 'api:PIPETTES_SUCCESS'

changelog

  • feat(app): Add attached pipette info to intercom support

review requests

Unfortunately, the imported intercom handler always returned as a noop for Intercom('update') calls. So we had to do it the old fashioned way with window.Intercom(...)

Intercom does not accept arrays or objects for values in custom data fields. So rather than just have a single data attribute Pipettes: {...} with all of the apps info about the pipettes, it needed to be split up into Left Pipette: model string etc.

TODO: (in the future)
Add pipette serial numbers to intercom once they are exposed by the api

We have a test intercom app for these PRs so we can avoid confusing support with our nonsense messages. I will ping you with the intercom ID you need to set in app, and a link to the dashboard to view the user data

Open app (with the intercom ID set that I share via slack)

make -C app dev OT_APP_INTERCOM_ID=xyz123

Also go to your Intercom user in the intercom webapp. Look for the "Details" section on the left of the page. To see our custom properties, you will have to click "Show __ Hidden" link.

screen shot 2018-09-04 at 3 26 18 pm

  1. Connect to a robot
  2. View attached pipettes
    • "Robot Name" in Intercom user properties matches connected robot
    • "Pipette Model Left" and "Pipette Model Right" in user match connected pipettes
  3. View attached pipettes of robot that you're not connected to
    • "Pipette Model Left" and "Pipette Model Right" remain unchanged
  4. Connect to a robot with different (or empty) pipettes
    • "Pipette Model Left" and "Pipette Model Right" update or clear accordingly

@Kadee80 Kadee80 added feature Ticket is a feature request / PR introduces a feature app Affects the `app` project WIP labels Aug 27, 2018
@codecov
Copy link

codecov bot commented Aug 27, 2018

Codecov Report

Merging #2140 into edge will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2140      +/-   ##
==========================================
- Coverage   31.18%   31.15%   -0.03%     
==========================================
  Files         467      467              
  Lines        7689     7696       +7     
==========================================
  Hits         2398     2398              
- Misses       5291     5298       +7
Impacted Files Coverage Δ
...pp/src/components/RobotSettings/ResetRobotModal.js 0% <ø> (ø) ⬆️
app/src/support.js 0% <0%> (ø) ⬆️

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 af09a4b...1a8078b. Read the comment docs.

@Kadee80 Kadee80 force-pushed the app_add-pipettes-intercom branch from f9a7942 to cde177f Compare August 28, 2018 18:25
@Kadee80 Kadee80 removed the WIP label Aug 28, 2018
@Kadee80 Kadee80 requested review from b-cooper and IanLondon August 28, 2018 20:12
Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

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

Maybe we should avoid intercom = noop altogether and always do window.Intercom && window.Intercom(args)? It's more verbose but IMO much easier to understand. This slippery bug came from mutating intercom in a weird way. With this change, if somehow the intercom script doesn't inject Intercom into window scope, then Run App will crash, which I think is what Mike was trying to avoid?

Or instead of window.Intercom && window.Intercom(stuff) each time, we could do

function callIntercom (...args) {
 if (window && window.Intercom) {
    window.Intercom(...args)
  } else {
    log.warn('window.Intercom is not available')
  }
}

then call that fn instead of intercom / window.Intercom

@Kadee80 Kadee80 added DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available and removed ready for review labels Aug 30, 2018
@mcous
Copy link
Contributor

mcous commented Sep 4, 2018

Will rebase this PR once #2179 is merged

@mcous mcous added blocked Ticket or PR is blocked by other work and removed blocked Ticket or PR is blocked by other work labels Sep 4, 2018
@mcous mcous force-pushed the app_add-pipettes-intercom branch from cde177f to 1a8078b Compare September 4, 2018 19:08
@mcous mcous added ready for review and removed DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available labels Sep 4, 2018
@mcous
Copy link
Contributor

mcous commented Sep 5, 2018

Testing with @umbhau

  1. Connect to a robot
  2. View attached pipettes
    • "Robot Name" in Intercom user properties matches connected robot
    • "Pipette Model Left" and "Pipette Model Right" in user match connected pipettes
  3. View attached pipettes of robot that you're not connected to
    • "Pipette Model Left" and "Pipette Model Right" remain unchanged
  4. Connect to a robot with different (or empty) pipettes
    • "Pipette Model Left" and "Pipette Model Right" update or clear accordingly

Copy link

@umbhau umbhau left a comment

Choose a reason for hiding this comment

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

🌭

@mcous mcous dismissed IanLondon’s stale review September 5, 2018 14:58

Requested changes implemented in #2179

@Laura-Danielle
Copy link
Contributor

Laura-Danielle commented Sep 5, 2018

From Windows Computer:

Connect to a robot
View attached pipettes

  • "Robot Name" in Intercom user properties matches connected robot
  • "Pipette Model Left" and "Pipette Model Right" in user match connected pipettes
    View attached pipettes of robot that you're not connected to
  • "Pipette Model Left" and "Pipette Model Right" remain unchanged
    Connect to a robot with different (or empty) pipettes
  • "Pipette Model Left" and "Pipette Model Right" update or clear accordingly

Works, just have to refresh intercom a few times to get the fields to update. Doubt we can do anything to fix this.

@Laura-Danielle Laura-Danielle self-requested a review September 5, 2018 15:24
Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

💃

@mcous mcous merged commit b06e845 into edge Sep 5, 2018
@mcous mcous deleted the app_add-pipettes-intercom branch September 5, 2018 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project feature Ticket is a feature request / PR introduces a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support: Add Run App and Robot Data to Intercom
5 participants