Commit Graph

402 Commits

Author SHA1 Message Date
Timmy Huang
2b0c4692ba e2e-add-more-logs (#1598) 2020-06-30 21:27:38 -07:00
Bruce Martin
8898a9817c protect against non-integer array indexing (#1595)
* do not assume non-iteger array bracket access will return undefined

* revert to spec
2020-06-29 09:37:59 -07:00
Timmy Huang
b79f09c550 FIX-test-target-closed: remove jestPuppeteer.resetBrowser() (#1592) 2020-06-26 10:02:25 -07:00
Timmy Huang
52a3f8b85a disable-puppeteer-dumpio (#1591) 2020-06-25 19:52:59 -07:00
Timmy Huang
83376627e8 1510-smoke-test (#1548)
* 1510-smoke-test

* config default

* update tests

* update test config

* fix linter errors

* more comments

* address comments

* use npm install in push_tests.yml

* use environment.default.json

* adding docs

* Take care of @mweiden's nits

* Save screenshots in the __tests__/screenshots/ directory

* typo

* docs

* Add chart tests (#1580)

* merge tests

* check if bin creation returned null before rendering charts (#1576)

* check if bin creation returned null before rendering charts

* refactor chart rendering into functions (#1577)

* little fixes from PR

* reintroduce fix to check for null values

* change getAllByClass to return element

* slice instead

* new stackedbar test

* feedback-1573-test (#1579)

* feedback-1573-test

* enable whole test set

* revert tests

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>

* tweak test to actually render chart

* include snapshot

* remove async

* fix getAllHistograms

* properly grab id

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>

Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com>
Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
2020-06-24 11:45:39 -07:00
Severiano Badajoz
9e7ecfa279 check if bin creation returned null before rendering charts (#1576)
* check if bin creation returned null before rendering charts

* refactor chart rendering into functions (#1577)

* little fixes from PR

* reintroduce fix to check for null values

* change getAllByClass to return element

* slice instead

* new stackedbar test

* feedback-1573-test (#1579)

* feedback-1573-test

* enable whole test set

* revert tests

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>
2020-06-23 11:59:39 -07:00
Severiano Badajoz
0e28df0bd6 Fix Truncation styling issues (#1558)
* fix color inheritance

* tweak width constants

* update snapshot

* Trigger workflow
2020-06-16 10:48:28 -07:00
Donald Paul Herman
d6a96e9c29 Improve Lasso 'will close' visual feedback. (#1550)
* Decreased the scope of polygonToPath and distance variables.  Added a
new variable for the lasso path color.  Removed the color setting from
handleDragStart, since this is already set in handleDrag.  Added a
closePathColor "#bb2f00" which is the complementary of lasso path color.
When a lasso can close, the color will change from blue to red.

* Fix some linter issues.

* Fixed some linter issues.

* Fixing some linter issues.

* Changed lasso open and closed to BLUE5 and GREEN5 respectively.
2020-06-16 11:48:29 -04:00
Severiano Badajoz
23619010c3 Componentize bar charts (#1557)
* create miniHistogram Component

* use MiniHistogram

* create MiniStackedBar Component

* Use MiniStackedBar

* update graphs on colorAccessor change

* Move bin creation out of miniHistogram

* rename expressionLabel

* breakout stackedbar bin creation

* Trigger workflow

* move components to individual folders

* rename constant
2020-06-15 11:32:55 -07:00
Colin Megill
77ffa0712e If min / max are the same, hide histo + legend, show value (#1554)
* hide legend, histo single value

* display block

* extra check for domain

* Update client/src/components/continuousLegend/index.js

Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>

* readability on variables, use clipped ranges

Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
2020-06-11 16:27:02 -04:00
Bruce Martin
bc7a712048 refactor categorical controls state (#1549)
* refactor categorical controls state

* lint

* fix race condition in tests

* fix typo

* add missing update on subset

* remove obsolete code

* update jest and puppeteer major version; update all minors

* update when label changes

* remove lint from tests; increase timeouts in e2e tests

* changes in response to PR review

* lint

* more PR comment changes

* more PR comment fixes

* lint

* more PR comment resolutions
2020-06-10 12:56:38 -07:00
Severiano Badajoz
f063708b33 Add linting rules around ESLint directive comments (#1551)
* add eslint-plugin-eslint-comments and require descriptive configuration

https://eslint.org/docs/user-guide/configuring#using-configuration-comments

* update ESLint

* audit ESLint disables

* update ESLint and related dependencies
2020-06-08 17:31:25 -07:00
Severiano Badajoz
4e96847032 Create Truncation Component (#1500)
* remove ESLint rules

operator-linebreak is no different then default
quotes is overwriting prettier config

* add string-pixel-width dep

* don't lint-staged src, only staged

* add widthMap

* create Truncate component

* refactor in truncate component

* add font load checking

* remove font-family styling

* render Truncate's child instead of creating own component to render

* refactor to use Truncate component

* add span back

* support children

* remove maybeTruncateString

* sub in Truncate component

* add bold prop

* accurately compute largest possible string

* remove logs

* tweak truncation method

* memoize comp function

* explain disable

* fix bugs w/ abs/floor

* tweak widths

* tweak widths

* fix font size

* remove border

* move test-id

* attempt css solution

* Revert "attempt css solution"

This reverts commit aac4d8a6f6.

* CSS solution v2

* remove string-pixel-width

* remove widthsMap

* remove dead code

* remove "data-truncated" as it is always true

* tweak label width

* fix e2e tests

* remove testing string

* e2e annotations tweaks

* correct snapshot

* remove resolves

* check for labels

* add test-id

* format fix

* update snapshot

* fix color

* pull constants out where available
2020-06-05 10:14:42 -07:00
Bruce Martin
2ba4944f5c initial bug fixes and test improvements for the matrix refactor (#1503)
* initial bug fixes and test improvements for the matrix refactor

* lint
2020-06-02 09:47:40 -07:00
Severiano Badajoz
271e7a1e76 Fix prettier related ESLint issues (#1493)
* add quotes

* add prettier dev-dep

* run prettier on src

* add eslint-prettier-plugin to install
2020-05-26 09:33:59 -07:00
Severiano Badajoz
889b582538 ESLint tooling and enforcement(#1492)
* add eslint-prettier

* add lint-staged

* ignore .eslintcache

* remove unused import

* attempt test change

* Revert "attempt test change"

This reverts commit 78d0e31d41.

* attempt to add error

* Revert "attempt to add error"

This reverts commit a5885c0942.

* add error

* create config

* add comment

* tweak glob

* Revert "add error"

This reverts commit 3187522396.

* add python error

* Revert "add python error"

This reverts commit d0b116ed15.

* lint on push + PR

* Revert "add comment"

This reverts commit efa4eb6676.

* add prettier rules to ESLint

* remove lint-diff targets
2020-05-21 14:27:49 -07:00
Severiano Badajoz
18da8911a0 Change appearance of centroid labels of unselected values (#1491)
* add opacity change on selection state

* change overlay z-index to capture pointer

* https://www.youtube.com/watch?v=xrg-RgF5F8o

* render null if no coloring by continuous

* run lint on push + pr

* revert commit

wrong branch
2020-05-21 09:22:10 -07:00
Matt Weiden
8d762e59ca Deduplicate merged gene list in subsetAndResetGeneLists (#1490)
Fixes https://github.com/chanzuckerberg/cellxgene/issues/1486
2020-05-20 15:35:27 -07:00
Matt Weiden
efdae22fbe Lengthen e2e test timeout to account for page load (#1488) 2020-05-20 14:55:43 -07:00
Severiano Badajoz
b06b08ce33 Fix centroid label + continuous color-by interactions (#1484)
* add case to removing labels

* add disabled state to centroid button

* fix centroid test button clicking order

* don't accidentally un-toggle first color
2020-05-20 14:02:10 -07:00
Colin Megill
bc5b01da0f Break out anno plus button (#1473)
* break out plus button

* remove menu item

* padding, remove icon

* icon padding
2020-05-20 16:22:29 -04:00
Severiano Badajoz
ce819383af re-enable front-end lint test (#1483)
* change lint to only src

* reenable lint all
2020-05-19 15:46:04 -07:00
Severiano Badajoz
c34a68304e remove all linting errors on client/src (#1463)
* run eslint --fix

* camelcase

* camelCase config part 1

* part 2

* part 3 - removing subscripts

* fix "class-methods-use-this"

* fix "class-methods-use-this"

* fix eslint ignores

* add eslint ignore for set state in update

* reformat comments to appease eslint

* add a11y features

* sort-comp fix

* a11y fix

* add ignore for set state in update

* add a11y htmlFor

* remove unused toast

* remove unnecessary bind

* add ignore for set state in update

* add rel="noopener noreferrer"

Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener

* use arrow function to bind

* remove unused definitions/declarations

* prettier

* remove unused state

* add comments to empty catch blocks remove curly brackets

* escape '

* use eqeqeq

* switch from default export

* remove ignore log

* remove static

* fix import

* revert subscripting config

* clean-up

* remove unnecessary subscript

* fix new errors from master

* change category click handler to a class property

* fix camelcase changes that slipped by

* unused import

* Fix newly introduced ESLint errors from addGenes
2020-05-19 12:38:29 -07:00
Colin Megill
5fc76edf2d Factor adding genes into own component (#1480)
* factor out add genes to own component

* correct import
2020-05-19 11:41:49 -04:00
Matt Weiden
e55595cc55 Fix smoke tests to work with remote deployments of cellxgene (#1469)
* Add test for terms of service

* Add workaround for chromium CSP require-trusted-types-for error
2020-05-12 13:01:57 -07:00
Bruce Martin
c1bf491a96 Hooks for sentry integration (#1460)
* add sentry webpack plugin

* allow override of webpack config

* work around cheerio inability to parse jinga templates

* webpack can not minify jinja templates

* allow script injection to specify other attributes

* allow script injection to specify other attributes

* Adjustments to make plugin systems work

* Add sourcemaps for javascript in prod webpack

* Update .gitignore

* Fix spelling errors

Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com>
2020-05-08 15:59:56 -07:00
Colin Megill
9026e0ce41 Sci notation on continuous legend (#1450)
* sci notation on continuous legend

* significant digits
2020-05-07 12:59:10 -04:00
Colin Megill
7ec9bb92f7 Create new label button overflow (#1459)
* Tighten up copy

* amp;
2020-05-07 12:58:21 -04:00
Matt Weiden
888f730526 Refactor CSS and React logic for layout (#1424)
* Refactor CSS layout and react logic for layout

Fixes https://github.com/chanzuckerberg/cellxgene/issues/1022

* Menubar should wrap inside middle pane instead of overlapping left
  sidebar when window is scrunched
* cellxgene should have a minimum width of 1240px

1. Replace absolute positioning and dimension calculation with css grid
2. Use flexbox for wrapping menubar buttons

* Middle pane (graph) can calculate its own size
* Removing components calculating their size/position relative to
  eachother increases modularity, decreases use of global variables
* Improved some scrollbar behavior
* Removed responsive reducer, propagating window size to components
  triggers unnecessary events and encourages breaking modularity; doing
  this made some components state agnostic

Reference: https://css-tricks.com/snippets/css/complete-guide-grid/

* Reposition the continuous legend

* Small fixes

* Respond to feedback from @colinmegill

* Respond to feedback from @colinmegill

Add more documentation on the renderGraph method.
2020-05-06 13:46:13 -07:00
Matt Weiden
a7d641ea6b Provide ToS button identifiers for smoke test to use (#1462) 2020-05-06 13:45:09 -07:00
Colin Megill
67d7b8160f was 27, 41 was too long, 33 seems ok (#1458) 2020-05-05 15:47:18 -04:00
Colin Megill
630b59d4a7 remove popover (#1456) 2020-05-05 14:34:11 -04:00
Bruce Martin
f42f5151a6 Refactor build and CSP headers for Safari compat (#1442)
* add unsafe-inline directive to style-src

* debugging - turn on csp reporting

* revert reporting only csp

* do not inline JS and CSS in build

* enable HTTPs only when in production mode

* remove debug printf

* fix clean target

* revert force_https removal
2020-05-04 12:47:35 -07:00
Severiano Badajoz
6cccc41c0f run prettier(2.0.5) (#1438) 2020-05-04 10:26:42 -07:00
Matt Weiden
40fbc42b13 Cache crossfilter when embedding type is changed (#1439)
Fixes https://github.com/chanzuckerberg/cellxgene/issues/1433

When selection is deselected the world is reset to the universe the
crossfilter is reset to that in the resetCache, including the embeddings
in the layout_XY dim.  However, the embedding selection stays the same.

If the embedding selected is not the default, the embedding shown to the
user will be different than the embedding layout_XY in the crossfilter,
causing lasso selections to be made against the wrong embedding
coordinates
2020-04-30 13:48:14 -07:00
Bruce Martin
05fcdaf93c Revised terms and privacy consent dialog, analytics hooks (#1426)
* revised terms and privacy consent

* reorg code

* fix conditional

* Overlay reflects un-dissmissable state

* add inline scripts, and consent callback

* add csp_directive config hook

* revert config.yaml

* fix logic error

Co-authored-by: Colin Megill <colinmegill@gmail.com>
2020-04-28 14:21:53 -07:00
Matt Weiden
546e272a60 Add user-defined category-label colors (#1402)
* Add user-defined category-label colors

Fixes https://github.com/chanzuckerberg/cellxgene/issues/1152

As described in https://github.com/chanzuckerberg/cellxgene/issues/1307

* Respond to feedback from @bkmartinjr in nodejs

* Respond to feedback from @bkmartinjr in python

* Add tests to the server module

* Autoformat python, run linter

* Make colors_get error handling specific

* Respond to feedback from @bkmartinjr

* Respond to feedback from @bkmartinjr

* Fix whitespace

* Fix python lint errrors

* Update documentation

* Add --disable-user-colors option to launch and cxgtool.py

* Fix python formatting

* Rename '--disable-user-colors' to '--disable-custom-colors'
2020-04-26 22:52:57 -07:00
Bruce Martin
d31b7dc797 clamp brush selection range to data range (#1423) 2020-04-24 09:24:01 -07:00
Matt Weiden
a2047b90ae Make the URL hit by jest smoke tests configurable (#1420)
* Make the URL hit by jest smoke tests configurable

* Fix typo

* Make names consistent
2020-04-22 15:23:11 -07:00
Bruce Martin
8742f9094e cleanup (#1411) 2020-04-20 09:56:26 -07:00
Severiano Badajoz
8b59755157 increase category label max length (#1394) 2020-04-20 09:48:47 -07:00
Bruce Martin
cbcd3f4f8f ensure crossfilter index dimensions match data (#1409) 2020-04-19 08:44:46 -07:00
Bruce Martin
55ef1448e8 CSP content hashes (#1406)
* remove duplicate content-type header

* plumbing to compute CSP content hashes

* add logging of missing CSP hashes

* convert sub-class init protocol to static

* factor function

* lint
2020-04-17 11:42:09 -07:00
Matt Weiden
95ade476e8 Add end of line marker to lint diff regexp (#1400)
This prevents json files from being linted
2020-04-15 13:46:36 -07:00
Colin Megill
ea434fc46f Handle loading state when rendering categories with one label (#1393)
* refactor & loading state

* truncate

* fix minor PR review issues

* lint

Co-authored-by: bkmartinjr <bruce@chanzuckerberg.com>
2020-04-15 14:38:44 -04:00
Matt Weiden
7d4d360e52 Refactor developer convenience scripts (#1377)
* Cleanup the backend-dev convenience method

* Add the frontend_dev convenience method

frontend_dev is a soup-to-nuts convenience method for setting up the FE
development environment with node running a the client code on port 3000
with the a separate cellxgene package serving the API over port 5005 in
the background.

The script can be run from Finder.

* Update the developer scripts documentation

* Remove the 'test' make target in the client Makefile

Rationale:
* Given how long the smoke tests take to run, it is unlikely that
  developers will want to run all tests together.
* It is unlikely that developers will have set up the backend server
  properly for the tests to pass.
* Available commands should be safe-ish and not lend themselves to
  confusing errors.
* You can still group tests by concatenating them in a make command, as
  in `make unit-test smoke-test`.
* This target isn't used in any of our CI pipelines -- KISS.

* Some version of python3...

* Minor typos in docs

* Respond to feedback from @bkmartinjr

* Make adjustments so that DATASET path is predictable

* Simplify environment defaults a bit
2020-04-15 10:32:19 -07:00
Severiano Badajoz
e5dfd6e8fa Add eslint steps to lint job (#1335)
* add lint-client and lint-diff-client targets

* add lint-diff and lint targets

* prettier

* add lint-diff call to lint task

* temp

* tweak lint-diff

* add lint for PRs and lint for master

* remove temp

* remove incorrect branches syntax, use github_ref

* pull all branches

* format

* proper target and comment

* create separate steps with conditionals

* fix indentation

* refactor lint->lint-server, introduce lint to lint all

* trade diff-index for diff, do check against base instead of master

* remove fetching all branches

* Revert "remove fetching all branches"

This reverts commit 26ce7a0f05.

* tweak comparison

* use local eslint

* add eslint  dep install

* temp

* grab only base

* simplify fetch

* add pull_request type trigger

* specify pushes only to master

* change conditionals to be based on event name

* Revert "temp"

This reverts commit 3d59134cc0.

* "branch" => "branches"

* create separate installation step

* change command based on os
2020-04-15 09:41:45 -07:00
Colin Megill
64bd908c25 Render categories with one label without checkbox (#1375)
* categories with 1 item rendered without checkbox

* break out into helper functions

* prettier
2020-04-13 23:04:23 -04:00
Bruce Martin
a3df1a9f4a performance and correctness fixes to brushable histogram (#1390) 2020-04-13 20:03:46 -07:00
Bruce Martin
136093d583 add GET routes for expression data (#1387)
* add GET routes for expression data

* fix comment typo
2020-04-13 11:28:35 -07:00