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

Deploy history report #28133

Closed
wants to merge 438 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
438 commits
Select commit Hold shift + click to select a range
e8e3d5b
Merge branch 'master' into ctsims/call_center_widgets
ctsims Jul 7, 2020
4136709
update package and yarn.lock
biyeun Jul 7, 2020
bf9828e
change path to biginteger
biyeun Jul 7, 2020
b9f9ece
Merge remote-tracking branch 'origin/master' into ap/disable-data-edi…
AmitPhulera Jul 8, 2020
c7ddb5a
fix: broken imports
AmitPhulera Jul 8, 2020
ad4c919
replace raw json filters with ORM like filters
sravfeyn Jul 8, 2020
4a76ece
remove ESView get/post/base_query, replace pact use with ORM queries
sravfeyn Jul 8, 2020
7a587ef
update just in ES
sravfeyn Jul 8, 2020
33e82fd
release notes feature
saiprakash-v Jul 8, 2020
96a8e9e
lint errors
saiprakash-v Jul 8, 2020
0e4f7aa
fix: breaking tests
AmitPhulera Jul 8, 2020
794284c
fix: last breaking test (I guess :grin: )
AmitPhulera Jul 9, 2020
2cac683
minor code improvements
saiprakash-v Jul 9, 2020
86c3675
fix braces
sravfeyn Jul 9, 2020
8da0c62
Change the way custom filter is consumed
sravfeyn Jul 9, 2020
e7cebed
lint
sravfeyn Jul 9, 2020
9222c8b
lint
sravfeyn Jul 9, 2020
4a42ad7
fields is not necessary since it's using source now
sravfeyn Jul 9, 2020
bf8333b
convert another pact query to orm
sravfeyn Jul 9, 2020
8147f2a
orm
sravfeyn Jul 9, 2020
526018c
constraint_checks_deferred() for PostgreSQL
kaapstorm Jul 9, 2020
2277588
Simplify load_data_for_db() a little
kaapstorm Jul 9, 2020
de0b04e
Nit: Simplify worker
kaapstorm Jul 9, 2020
0e74dd6
Better error handling
kaapstorm Jul 9, 2020
5c52459
Merge branch 'master' into nh/tdh/concurrent_import
kaapstorm Jul 9, 2020
2de844a
Be smart about whether to use threads or processes
kaapstorm Jul 9, 2020
c9f0c7b
Call SET CONSTRAINTS inside transaction
kaapstorm Jul 9, 2020
3ed85b2
Fix tests
kaapstorm Jul 9, 2020
fc596f7
lint and PR feedback
sravfeyn Jul 10, 2020
8a55777
convert crs-reports ES query to ORM
sravfeyn Jul 10, 2020
8518edd
create record before launching task
calellowitz Jul 10, 2020
d0dfcea
End-to-end functional
ctsims Jul 11, 2020
846f57a
cleanup/linting
ctsims Jul 11, 2020
44fd6f6
linting
ctsims Jul 11, 2020
7715ebb
generify boilerplate
ctsims Jul 11, 2020
b0a92f5
Replace logo with custom HQ domain logo
ctsims Jul 11, 2020
ad478ee
generification
ctsims Jul 11, 2020
3b39fb5
linting
ctsims Jul 11, 2020
45d4ab6
Require toggle for dialer
ctsims Jul 11, 2020
0e893cb
linting
ctsims Jul 11, 2020
ab059ce
remove redundant utils
ctsims Jul 11, 2020
7b5d0e9
Fix removed formplayer header
ctsims Jul 11, 2020
e186f62
combining file download and file date api
saiprakash-v Jul 13, 2020
b9bdf81
lint errors
saiprakash-v Jul 13, 2020
ca19ec5
Merge branch 'master' into ctsims/call_center_widgets
ctsims Jul 13, 2020
d182633
Merge branch 'master' into ctsims/call_center_widgets
ctsims Jul 13, 2020
85d79f5
refactor custom app routing
snopoke Jul 13, 2020
ca6b3ac
explicit filetype indicator for static ref
ctsims Jul 13, 2020
66d2aa1
Include shared tags module
ctsims Jul 13, 2020
d9fcb71
Test deploy
ctsims Jul 13, 2020
d2f50c7
add back css compress
ctsims Jul 13, 2020
08fd22a
never create invoices for deleted domains
biyeun Jul 13, 2020
cd1b941
never raise DomainUserHistory.DoesNotExist errors for deleted domains…
biyeun Jul 13, 2020
7a919dc
removing compress due to deploy issues
ctsims Jul 13, 2020
7250f25
fix varname
sravfeyn Jul 14, 2020
e6b2d12
Fixed spacing on download message
orangejenny Jul 10, 2020
d5861df
Update JS dependency pattern to require.js
ctsims Jul 14, 2020
f1787af
remove unused databinds
ctsims Jul 14, 2020
a3f6785
Update domain reference pattern
ctsims Jul 14, 2020
da38c56
remove redundant custom logo context fetch
ctsims Jul 14, 2020
cced921
remove unused templating
ctsims Jul 14, 2020
ba2c63b
linter
ctsims Jul 14, 2020
4b4b34e
Linting and mild refactoring
ctsims Jul 14, 2020
c13ed16
linting
ctsims Jul 14, 2020
e2d8036
linting
ctsims Jul 14, 2020
a5ce42b
linting
ctsims Jul 14, 2020
b1775fc
Added new page for the deploy history report based on the existing us…
AliRizvi1 Jul 14, 2020
584d870
Removed data_field_class param from get_validator
orangejenny Jul 8, 2020
6683c90
Moved validation methods from definition to field
orangejenny Jul 8, 2020
f1b71a8
Explicit global
ctsims Jul 14, 2020
834c960
Don't lint boilerplant / library files
ctsims Jul 14, 2020
d2f76ff
Updated error message text to use labels user sees
orangejenny Jul 14, 2020
3640aa0
Added tests
orangejenny Jul 14, 2020
a47d74e
Added tests/__init__.py
orangejenny Jul 14, 2020
df3fd20
Repackage under the integrations app
ctsims Jul 14, 2020
1ad9973
repackange under the integrations app
ctsims Jul 14, 2020
21218ed
linting
ctsims Jul 14, 2020
b55b577
JS Strictness
ctsims Jul 14, 2020
7a17e28
fetch upload record by pk
calellowitz Jul 15, 2020
19c12c3
patch upload record in tests
calellowitz Jul 15, 2020
fb7713d
Updated get_validator call to remove param
orangejenny Jul 15, 2020
2640b58
Formatted datetime object
AliRizvi1 Jul 15, 2020
1dcba8d
Removed simpleSearch functionality
AliRizvi1 Jul 15, 2020
1af366f
Refactor: simplify decorator
millerdev Jul 2, 2020
d5e3eb2
Fix ValueError: seek of closed file
millerdev Jul 2, 2020
eb13dca
Improve diff output in travis
millerdev Jul 3, 2020
1ca38f9
remove ga for hipaa domains
calellowitz Jul 15, 2020
6f277df
Handle django-two-factor-auth urlpatterns tuples
millerdev Jul 13, 2020
3bafb65
Fix XFormManagementView.get_xform_ids
millerdev Jul 14, 2020
894d09e
management command to search kafka change feed
snopoke Jul 15, 2020
6d9eab5
Work around Django 2.1 db router changes
millerdev Jul 2, 2020
05b379d
Fix db router
millerdev Jul 13, 2020
f6b4508
Patch TestCase.databases to allow access
millerdev Jun 24, 2020
e084d33
Work around buggy databases = '__all__'
millerdev Jun 25, 2020
40ef5da
Do not transact shard dbs in tests
millerdev Jul 2, 2020
92c90e2
Fix partitioned TransactionTestCase
millerdev Jul 2, 2020
1964f4f
Detect proxy dbs from new-style proxy config
millerdev Jul 8, 2020
cf68674
Fix test transaction management for icds_reports
millerdev Jul 15, 2020
80b2bc1
Another attempt at test case databases
millerdev Jul 15, 2020
c08a801
Dynamic transaction_exempt_databases
millerdev Jul 14, 2020
af29b73
Dynamic TestCase.databases
millerdev Jul 14, 2020
177cea1
removed total_records
AliRizvi1 Jul 15, 2020
ad49968
Added hyperlink to diff url
AliRizvi1 Jul 15, 2020
3066476
Refactor: simplify get attribute
millerdev Jul 8, 2020
d663fa1
Merge branch 'master' of github.com:dimagi/commcare-hq into bmb/SAAS-…
biyeun Jul 15, 2020
c4d028e
Added relative time date
AliRizvi1 Jul 15, 2020
59fe461
dont break if no ga key
calellowitz Jul 15, 2020
f1afbe4
Consolidated lines
AliRizvi1 Jul 15, 2020
1086ab4
use domain_exists and deleted_domain_exists checks
biyeun Jul 15, 2020
17c71ac
fix tests where a domain obj is passed in
biyeun Jul 15, 2020
dbbc702
add test for deleted domain issue in customer invoices
biyeun Jul 15, 2020
35189d5
Added pagination
AliRizvi1 Jul 15, 2020
a2165a4
Merge pull request #28126 from dimagi/dm/dj2-dj1-compat2
millerdev Jul 15, 2020
08e89fc
Fixed js-guide links for real this time [ci skip]
orangejenny Jul 15, 2020
966b62c
Merge pull request #28130 from dimagi/dm/dj2-dj1-compat3
millerdev Jul 15, 2020
c678651
Updated last_deploy script to handle icds-staging [ci skip]
orangejenny Jul 15, 2020
3cd98ca
patch record in other class
calellowitz Jul 15, 2020
e2fa28f
update staging.yaml
biyeun Jul 15, 2020
2d8dcae
Added more docs for linked domains [ci skip]
orangejenny Jul 15, 2020
a3850d8
Merge pull request #28131 from dimagi/dm/dj2-dj1-compat4
millerdev Jul 15, 2020
7026d2a
fix test cases
Rohit25negi Jul 15, 2020
d01c0e3
Merge pull request #28134 from dimagi/jls/fix-js-docs-links-for-real
orangejenny Jul 16, 2020
e67b201
Merge pull request #28139 from dimagi/dm/dj2-fix-icds-decimals
dannyroberts Jul 16, 2020
f4bf674
Upgrade django to 2.2 (run make requirements)
millerdev Jun 23, 2020
24d9416
Update django-two-factor-auth and django-otp
millerdev Jul 10, 2020
7bcb751
update staging.yaml
dannyroberts Jul 16, 2020
58cbdde
Merge pull request #27955 from dimagi/ap/fix-progress-bar-for-messagi…
AmitPhulera Jul 16, 2020
f120954
Merge pull request #28128 from dimagi/sk/search-kafka
snopoke Jul 16, 2020
2c6baa5
Merge pull request #28135 from dimagi/jls/last-deploy-icds-staging
orangejenny Jul 16, 2020
5012130
allow searching PillowErrors by doc_id
snopoke Jul 16, 2020
91a5adc
Merge pull request #28109 from dimagi/jls/fix-message-spacing
orangejenny Jul 16, 2020
44fbec8
Update staging.yml
Jul 16, 2020
d4d2993
Don't be smart. Just use processes.
kaapstorm Jul 16, 2020
dfda753
Merge pull request #28100 from dimagi/bmb/SAAS-11017
biyeun Jul 16, 2020
6d9d2cf
Merge pull request #28127 from dimagi/ce/ga-hipaa
calellowitz Jul 16, 2020
7b6d83b
Added a district
Rohit25negi Jul 16, 2020
ee15b3a
Merge branch 'master' into nh/tdh/concurrent_import
kaapstorm Jul 16, 2020
303336a
update icds-staging.yaml
Rohit25negi Jul 16, 2020
683fb78
Marked ADD_USERS_FROM_LOCATION deprecated
orangejenny Jul 16, 2020
5361160
update icds-staging.yaml
Rohit25negi Jul 16, 2020
2713751
update readme
biyeun Jul 16, 2020
67f44f4
upgrade grunt-mocha
biyeun Jul 16, 2020
bfff9a3
Merge pull request #28144 from dimagi/rn_fix_telangana_state_level_to…
Rohit25negi Jul 16, 2020
1995c30
This fixes the map size issue
Rohit25negi Jul 16, 2020
a86c079
update icds-staging.yaml
Rohit25negi Jul 16, 2020
a65972c
Merge pull request #28145 from dimagi/orangejenny-patch-4
orangejenny Jul 16, 2020
9284ee5
Updated based on feedback [ci skip]
orangejenny Jul 16, 2020
51a2240
rebuild yarn.lock
biyeun Jul 16, 2020
6ac1a58
Merge pull request #28136 from dimagi/jls/more-linked-domain-docs
orangejenny Jul 16, 2020
90ea8d5
Merge pull request #28012 from dimagi/bmb/bower-to-yarn
biyeun Jul 16, 2020
60c3af6
vellum:e70bf37445865b527604bb32d1740058d7f8579e
biyeun Jul 16, 2020
e8715a1
remove name from case details title
calellowitz Jul 16, 2020
41dd5a1
update staging.yaml
biyeun Jul 16, 2020
0c02662
Merge pull request #28113 from dimagi/jls/custom-fields-tests
orangejenny Jul 16, 2020
627febb
update staging.yaml
millerdev Jul 17, 2020
770aff5
update staging.yaml
millerdev Jul 17, 2020
ca06b88
Removed dead code
orangejenny Jul 17, 2020
cc19acb
Merge pull request #28146 from dimagi/rn_correct_positioning_of_states
Rohit25negi Jul 17, 2020
85df8d4
add new users
mkangia Jul 17, 2020
7057b06
add branch for icds staging
mkangia Jul 17, 2020
f6e0644
Merge pull request #27862 from dimagi/nh/tdh/concurrent_import
kaapstorm Jul 17, 2020
14e968d
update icds-staging.yaml
sravfeyn Jul 17, 2020
2076593
track de-re-activate
mkangia Jul 17, 2020
479e729
Step 1: Increase timeout
kaapstorm Jul 17, 2020
ed10ed4
Silence meaningless "Script error." jserror
dannyroberts Jul 17, 2020
7a1f873
Merge pull request #28148 from dimagi/jls/kill-update_user_data
orangejenny Jul 17, 2020
a954c2e
Merge pull request #28102 from dimagi/sr/proj-health
dannyroberts Jul 17, 2020
532bbd5
Merge pull request #28153 from dimagi/dmr/silence-meaningless-script-…
dannyroberts Jul 17, 2020
95e02d1
It's a BytesWarning in Py3
kaapstorm Jul 17, 2020
ada06c0
Removed top_five_projects_by_country
orangejenny Jul 17, 2020
1ff9472
Merge pull request #28151 from dimagi/nh/repeat_records
kaapstorm Jul 17, 2020
2340344
Merge pull request #28003 from dimagi/ce/user-upload-record
calellowitz Jul 17, 2020
404fb33
Decode content to avoid BytesWarning
millerdev Jul 17, 2020
0065fd9
Use {...!r} (repr) to avoid BytesWarning
millerdev Jul 17, 2020
863a981
Fix AttributeError in celery_push_metrics signal
millerdev Jul 17, 2020
fdf05d7
Decode or repr bytes to void BytesWarning
millerdev Jul 17, 2020
fb1097c
Safely convert error to str
millerdev Jul 17, 2020
b013491
Do not encode cookie values
millerdev Jul 17, 2020
9e63381
Merge pull request #28147 from dimagi/ce/title-data
calellowitz Jul 17, 2020
ff851b2
Fix tests
millerdev Jul 18, 2020
591d860
Merge remote-tracking branch 'origin/master' into ap/disable-data-edi…
AmitPhulera Jul 20, 2020
a167c2a
refactor: use is_icds_cas_project instead of IS_ICDS_ENVIORNMENT
AmitPhulera Jul 20, 2020
54e1b6d
Merge pull request #27740 from saiprakash-v/pse-hiding-old-photos
ShubhamBansal1997 Jul 20, 2020
f59f972
Merge pull request #28068 from saiprakash-v/release-notes-update
ShubhamBansal1997 Jul 20, 2020
da6ba9d
Merge pull request #28149 from dimagi/mk/aks-audit/update-users-for-r…
mkangia Jul 20, 2020
12d2e41
remove merged branch
mkangia Jul 20, 2020
2e16e80
We don't get bytes in JSON forms
kaapstorm Jul 20, 2020
7833db3
Merge pull request #28157 from dimagi/dm/dj2-avoid-byteswarning
millerdev Jul 20, 2020
abc2a77
update icds-staging.yaml
snopoke Jul 20, 2020
8239050
update icds-staging.yaml
snopoke Jul 20, 2020
36c7415
Merge pull request #28155 from dimagi/nh/warning
kaapstorm Jul 20, 2020
05c4eb5
Merge pull request #28015 from dimagi/ap/disable-data-edit-fields
AmitPhulera Jul 20, 2020
3764fb4
update icds-staging.yaml
snopoke Jul 20, 2020
2e0efa3
update staging.yaml
millerdev Jul 20, 2020
b456b76
Add bulk app translations to waf allow list
dannyroberts Jul 20, 2020
da25218
Fix project health report locally and in Django 2.2
dannyroberts Jul 20, 2020
fd1cd13
Fixed link in docs [ci skip]
orangejenny Jul 20, 2020
a2672af
Merge pull request #28164 from dimagi/orangejenny-patch-4
orangejenny Jul 20, 2020
53a7bb2
pass message as string
mkangia Jul 20, 2020
1bb5cc1
use more human friendly message
mkangia Jul 20, 2020
7a11454
Merge pull request #28165 from dimagi/dmr/fix-project-health-report-d…
millerdev Jul 20, 2020
f80903b
Fix JsonResponse lists.
esoergel Jul 20, 2020
4f9296d
Merge branch 'master' into ctsims/call_center_widgets
ctsims Jul 20, 2020
346671c
Merge pull request #28156 from dimagi/jls/kill-top_five_projects_by_c…
orangejenny Jul 20, 2020
dbd8921
Move DetectRTC dependency to yarn management
ctsims Jul 20, 2020
b501117
add --frozen-lockfile tag
biyeun Jul 20, 2020
687d9c3
re-generate yarn.lock from scratch again so that current tests pass
biyeun Jul 20, 2020
d2de881
Basic translation support
ctsims Jul 20, 2020
5d6aea5
Merge pull request #28150 from dimagi/mk/icds-user-permissions/track-…
mkangia Jul 20, 2020
d42bc0e
Merge pull request #28166 from dimagi/es/system-json
esoergel Jul 20, 2020
efc8af7
Merge pull request #28163 from dimagi/dmr/waf-allow-bulk-app-translat…
dannyroberts Jul 20, 2020
0c2eb46
fix to specific versions of packages. no use of '^'
biyeun Jul 20, 2020
85a4e4b
regenerate yarn.lock
biyeun Jul 20, 2020
1bfecf1
Merge pull request #28137 from dimagi/dm/django2-upgrade
millerdev Jul 20, 2020
5c33fdf
two_factor:twilio_call_app -> two_factor_twilio:call_app
millerdev Jul 20, 2020
b08793b
lint
millerdev Jul 20, 2020
e8db609
Merge pull request #28170 from dimagi/dm/twilio-url
dannyroberts Jul 20, 2020
0f1f0f9
Merge pull request #28142 from dimagi/sk/search-errors
snopoke Jul 21, 2020
4f270ba
use count instead
mkangia Jul 21, 2020
d52db22
Merge pull request #28032 from dimagi/sr-es-api-q
sravfeyn Jul 21, 2020
fb3280e
Merge pull request #28099 from dimagi/sk/custom-app-routing
snopoke Jul 21, 2020
c8e19f8
Merge pull request #28168 from dimagi/bmb/frozen-lock
biyeun Jul 21, 2020
51d6701
Merge pull request #28172 from dimagi/mk/fetch-count
mkangia Jul 21, 2020
bfa6708
Fix str(report_content_bytes)
millerdev Jul 21, 2020
fb8b446
Un-confuse return values
millerdev Jul 21, 2020
5de0262
Merge pull request #28174 from dimagi/dm/binary-scheduled-reports
millerdev Jul 21, 2020
4835cd4
use npm version of ui-select
biyeun Jul 21, 2020
48ec97e
Merge branch 'master' into ctsims/call_center_widgets
ctsims Jul 21, 2020
794af25
hard ignore any yarn.lock changes in the diff when testing make requi…
biyeun Jul 21, 2020
925b3e8
Merge pull request #28175 from dimagi/bmb/ui-select-npm
biyeun Jul 21, 2020
00a06f5
Merge branch 'master' into ctsims/call_center_widgets
ctsims Jul 21, 2020
c3ebebf
go back to including yarn.lock in the diff check
biyeun Jul 21, 2020
dcc2aab
Merge pull request #28089 from dimagi/ctsims/call_center_widgets
ctsims Jul 21, 2020
bf1c31a
don't auto remove lock files in tests
biyeun Jul 21, 2020
bff94f2
Merge pull request #28177 from dimagi/bmb/yarn-test
millerdev Jul 21, 2020
50f650f
update staging.yaml
calellowitz Jul 22, 2020
3b92d05
merge master
sravfeyn Jul 22, 2020
4f3be1a
Update es.py
sravfeyn Jul 22, 2020
87be4b1
Merge pull request #26733 from dimagi/sr-es-alias
sravfeyn Jul 22, 2020
b053865
update icds-staging.yaml
ShubhamBansal1997 Jul 22, 2020
f9ba283
Added new page for the deploy history report based on the existing us…
AliRizvi1 Jul 14, 2020
2885e1f
Formatted datetime object
AliRizvi1 Jul 15, 2020
c83df97
Removed simpleSearch functionality
AliRizvi1 Jul 15, 2020
f26a70d
removed total_records
AliRizvi1 Jul 15, 2020
3d0d9de
Added hyperlink to diff url
AliRizvi1 Jul 15, 2020
0e3ab2e
Added relative time date
AliRizvi1 Jul 15, 2020
ffcc6a3
Consolidated lines
AliRizvi1 Jul 15, 2020
54c369e
Added pagination
AliRizvi1 Jul 15, 2020
48c3d59
Address PR comments - change to naturaltime, remove unnecessary funct…
AliRizvi1 Jul 23, 2020
6e4ec7c
Fix merging issues
AliRizvi1 Jul 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ xforms/
submissions/
/formplayer_build
/export/
/bower_components
bad/
*.log*
/CommCare.ja*
Expand Down Expand Up @@ -66,4 +65,5 @@ node_modules/
/sharedfiles/
docker/data
*.lock
!yarn.lock
fab/config.py
53 changes: 22 additions & 31 deletions DEV_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,41 +232,33 @@ names to the aliases.

$ ./manage.py ptop_es_manage --flip_all_aliases

### Installing Bower
### Installing Yarn

We use Bower to manage our JavaScript dependencies. In order to download the required JavaScript packages,
you'll need to install `bower` and run `bower install`. Follow these steps to install:
We use Yarn to manage our JavaScript dependencies. It is able to install older `bower` dependencies/repositories that we still need
and `npm` repositories. Eventually we will move fully to `npm`, but for now you will need `yarn` to manage `js` repositories.

1. If you do not already have npm:
In order to download the required JavaScript packages, you'll need to install `yarn` and run `yarn install`. Follow these steps to install:

For Ubuntu: In Ubuntu this is now bundled with NodeJS. An up-to-date version is available on the NodeSource
repository. Run the following commands:
1. Follow [these steps](https://classic.yarnpkg.com/en/docs/install#mac-stable) to install Yarn.

$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
2. Install dependencies with:

For macOS: Install with Homebrew:

$ brew install node

For others: install [npm](https://www.npmjs.com/)

2. Install Bower:

$ sudo npm -g install bower

3. Run Bower with:
```
yarn install --frozen-lockfile
```

$ bower install
NOTE: if you are making changes to `package.json`, please run `yarn install` without the `--frozen-lockfile` flag so that `yarn.lock` will get updated.


### Install JS-XPATH
#### Troubleshooting Javascript dependency installation

This is required for the server side xpath validation. See [package.json](package.json) for exact version.
Depending on your operating system, and what version of `nodejs` and `npm` you have locally,
you might run into issues. Here are minimum version requirements for these packages.

```
npm install dimagi/js-xpath#v0.0.2-rc1
```
$ npm --version
$ 6.14.4
$ node --version
$ v12.18.1

### Using LESS: 2 Options

Expand Down Expand Up @@ -457,14 +449,13 @@ See https://github.com/nose-devs/nose/blob/master/nose/plugins/testid.py

### Setup

In order to run the JavaScript tests you'll need to install the required npm packages:

$ npm install
Make sure javascript packages are installed with the following. Please see the section on
installing `yarn` above for more details.

It's recommended to install grunt globally in order to use grunt from the command line:
It's recommended to install grunt globally (with `yarn`) in order to use grunt from the command line:

$ npm install -g grunt
$ npm install -g grunt-cli
$ yarn install global grunt
$ yarn install global grunt-cli

In order for the tests to run the __development server needs to be running on port 8000__.

Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ RUN npm -g install \
bower \
grunt-cli \
uglify-js \
&& npm -g install \
puppeteer \
mocha-headless-chrome \
&& echo '{ "allow_root": true }' > /root/.bowerrc \
&& cd /vendor \
&& npm shrinkwrap \
&& yarn global add phantomjs-prebuilt \
Expand Down
99 changes: 0 additions & 99 deletions bower.json

This file was deleted.

10 changes: 9 additions & 1 deletion corehq/apps/accounting/invoicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
log_accounting_info,
months_from_date,
)
from corehq.apps.domain.dbaccessors import domain_exists, deleted_domain_exists
from corehq.apps.smsbillables.models import SmsBillable
from corehq.util.dates import (
get_first_last_days,
Expand Down Expand Up @@ -427,6 +428,9 @@ def _email_invoice(self):


def should_create_invoice(subscription, domain, invoice_start, invoice_end):
if not domain_exists(domain) and deleted_domain_exists(domain):
# domain has been deleted, ignore
return False
if subscription.is_trial:
log_accounting_info("Skipping invoicing for Subscription %s because it's a trial." % subscription.pk)
return False
Expand Down Expand Up @@ -718,7 +722,11 @@ def quantity(self):
history = DomainUserHistory.objects.get(domain=domain, record_date=date)
total_users += history.num_users
except DomainUserHistory.DoesNotExist:
raise
if not deleted_domain_exists(domain):
# this checks to see if the domain still exists
# before raising an error. If it was deleted the
# loop will continue
raise
excess_users += max(total_users - self.rate.monthly_limit, 0)
return excess_users

Expand Down
24 changes: 23 additions & 1 deletion corehq/apps/accounting/tests/test_customer_invoicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class TestCustomerInvoice(BaseCustomerInvoiceCase):

def test_multiple_subscription_invoice(self):
invoice_date = utils.months_from_date(self.subscription.date_start,
random.randint(2, self.subscription_length))
random.randint(3, self.subscription_length))
calculate_users_in_all_domains(invoice_date)
tasks.generate_invoices(invoice_date)

Expand Down Expand Up @@ -185,6 +185,28 @@ def test_no_invoice_after_end(self):
tasks.generate_invoices(invoice_date)
self.assertEqual(CustomerInvoice.objects.count(), 0)

def test_deleted_domain_in_multiple_subscription_invoice(self):
invoice_date = utils.months_from_date(self.subscription.date_start, 2)

domain_to_be_deleted = generator.arbitrary_domain()
generator.generate_domain_subscription(
self.account,
domain_to_be_deleted,
date_start=self.sub2.date_start,
date_end=self.sub2.date_end,
plan_version=self.advanced_plan
)
domain_to_be_deleted.delete(leave_tombstone=True)

calculate_users_in_all_domains(invoice_date)
tasks.generate_invoices(invoice_date)

self.assertEqual(CustomerInvoice.objects.count(), 1)
invoice = CustomerInvoice.objects.first()

num_product_line_items = invoice.lineitem_set.get_products().count()
self.assertEqual(num_product_line_items, 2)


class TestProductLineItem(BaseCustomerInvoiceCase):
"""
Expand Down
2 changes: 1 addition & 1 deletion corehq/apps/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This varies depending on the service; see details on individual services below.

### Client Side

For passing data from the server to the client, which is mostly API keys, analytics uses a variation on [initial_page_data](https://github.com/dimagi/commcare-hq/blob/master/docs/js-guide/blob/master/integration-patterns.md): same general idea, but with better namespacing and accessed via [initial.js](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/analytics/static/analytix/js/initial.js). Most of the analytics templates just contain this initial data, while a few contain the actual third-party scripts (for the services that don't interact with any other HQ JavaScript).
For passing data from the server to the client, which is mostly API keys, analytics uses a variation on [initial_page_data](https://github.com/dimagi/commcare-hq/blob/master/docs/js-guide/integration-patterns.md): same general idea, but with better namespacing and accessed via [initial.js](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/analytics/static/analytix/js/initial.js). Most of the analytics templates just contain this initial data, while a few contain the actual third-party scripts (for the services that don't interact with any other HQ JavaScript).

Analytics has its own logging infrastructure, is set up in [logging.js](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/analytics/static/analytix/js/logging.js) and prints to the browser console. The logging level can be controlled via `settings.ANALYTICS_CONFIG['LOG_LEVEL']` (see "Debugging" below).

Expand Down
Loading