https://models-resources.concord.org/vortex/index.html
The data table component currently supports these devices:
- Sensor Tag cc2650 (small "green light" sensor)
- Sensor Tag cc1350 (small "red light" sensor)
- Multi-Sensor (bigger sensor)
When testing in the browser the following url params are available:
?allowReset
- if present in query string the "Reset Local Data" button is shown under the experiment run list. This param doesn't need a value.?mockSensor
- if present in query string the mock sensor is automatically used in the measurement tab. This param doesn't need a value.?showDevicePicker
- if present in query string the device picker is shown for the mock sensor. This param doesn't need a value.?enableSensor
- present in query string the "Show Sensor" button is shown in the LARA app.
If you want to build everything run npm run build
, it will create the files in the dist
folder.
You do not need to build to deploy the code, that is automatic. See more info in the Deployment section below.
If you want to build a local version run npm run build:web
, it will create the files in the dist
folder.
You do not need to build to deploy the code, that is automatic. See more info in the Deployment section below.
Cordova maintains its own package.json
in the cordova-wrapper
folder and Cordova itself is a dev dependency in that folder.
The cordova-wrapper
folder contains all the needed files to wrap the contents of the compiled output the cordova-app
folder.
To build for the various platforms perform the following steps once:
- From the project root run
npm i
to install all the project dependencies - From the project root run
npm run build:cordova-app
to create thedist/cordova-app
folder which is not under source control cd src/cordova-wrapper
npm i
to get the Cordova dependenciesln -s ../../dist/cordova-app/ www
to setup a link to the compiled Javascript app (the next 3 steps will fail if you don't do this)npm run cordova -- prepare browser
to download the browser platformnpm run cordova -- prepare android
to download the Android platformnpm run cordova -- prepare ios
to download the iOS platform- Setup your Android development environment and a default emulator and device as defined here: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#installing-the-requirements
- Setup your iOS development environment as defined here: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/index.html
To test cordova-wrapper
in the browser:
- If needed, run
npm run build:cordova-app
in the project root to create the latest build. You will need to do this whenever you make a change at the app in step 6 copies code when it starts and does not pickup changes to the code. cd src/cordova-wrapper
npm run run:browser
to runcordova run browser
using the cordova dev dependency.
If you make any changes to the cordova-app
code you run npm run build:cordova-app
in the project root
and npm run run:browser
in cordova-wrapper
again in order to see the change.
To test cordova-wrapper
in Android:
- If needed, run
npm run build:cordova-app
in the project root to create the latest build. You will need to do this whenever you make a change at the app in step 6 copies code when it starts and does not pickup changes to the code. cd src/cordova-wrapper
npm run run:android
to runcordova run android
using the cordova dev dependency (runs in emulator)npm run run:android:device
to runcordova run android --device
using the cordova dev dependency (runs on connected device)
If you make any changes to the cordova-app
code you run npm run build:cordova-app
in the project root
and npm run run:android
in cordova-wrapper
again in order to see the change.
To test cordova-wrapper
on iOS:
- If needed, run
npm run build:cordova-app
in the project root to create the latest build. You will need to do this whenever you make a change at the app in step 6 copies code when it starts and does not pickup changes to the code. - Open
src/cordova-wrapper/platforms/ios/Monitor Your World.xcworkspace
from XCode - In Xcode, the left hand side of the page gives you different views on the project. The folder icon gives a tree view. Select the folder icon and select the root Vortex node.
- As long as you are logged in with a developer account that has permissions with the Apple developer account, you can go to
the
Signing & Capabilities
section in the center of the screen (the text link near the top-center). - Check the box to
Automatically Manage Signing
and select theConcord Consortium Inc.
team. You should do this for bothDebug
andRelease
signing modes, then toggle off and on the "Automatically manage signing" to resolve any lingering error messages. - If this is the first time a device has been selected, you should be given the option to add the device to the list of approved devices. We have up to 100 devices - once we run out we need to remove old devices to add new.
- Select your device from the top bar of the window, and you should be able to click the
Play
button to run with the Xcode debugger attached. Errors and exceptions should show up in the bottom panel while running.
If you make any changes to the cordova-app
code you run npm run build:cordova-app
in the project root,
then run npm run cordova -- prepare ios
and run again in Xcode to see the change.
Cordova can be quite sticky with plugins and packages, and updates to which plugins you are using may not show up. To clean up the Cordova installation and start fresh (preserving project configuration settings for XCode etc.) run the following script:
cd src/cordova-wrapper
./clean.sh
This will backup configuration, then remove all the Cordova target platforms, re-prepare each of them, and restore configuration.
After a time, the build process for iOS can break. The /cordova-wrapper/clean.sh
script will clean out old plugins and packages
and do a complete rebuild. If Xcode complains about duplicate declarations for some files, you may need to remove temporary files by deleting the Monitor Your World-###
directory in:
Macintosh HD/Users/[username]/Library/Developer/Xcode/DerivedData
Then repeat the clean build process.
There are additions defined in the config.xml for Cordova that modify the Monitor Your World-Info.plist
file to add required descriptions about how we use Bluetooth and Camera.
If these settings are missing, you can add them manually as follows:
- Edit
ios/Monitor Your World/Monitor Your World-Info.plist
in VSCode (easier than in XCode editor - Add the following to allow access to Bluetooth and Camera (insert both key-string pairs near the end of the file before the closing
</dict></plist>
)
<key>NSBluetoothAlwaysUsageDescription</key>
<string>This application uses bluetooth to find, connect and transfer data from Sensor Tag bluetooth devices</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>This application uses bluetooth to find, connect and transfer data from Sensor Tag bluetooth devices</string>
<key>NSCameraUsageDescription</key>
<string>This application needs camera access to capture photographs and to scan barcodes to upload data</string>
</dict>
</plist>
- Make sure if you are using Visual Studio Code that you use the workspace version of TypeScript.
To ensure that you are open a TypeScript file in VSC and then click on the version number next to
TypeScript React
in the status bar and select 'Use Workspace Version' in the popup menu.
Deployments are based on the contents of the /dist folder and are built automatically by GitHub Actions for each branch and tag pushed to GitHub.
Branches are deployed to https://models-resources.concord.org/vortex/branch/<name>/
.
Tags are deployed to https://models-resources.concord.org/vortex/version/<name>/
You can view the status of all the branch and tag deploys here.
The production release is available at `https://models-resources.concord.org/vortex/.
Production releases are done using a manual GitHub Actions workflow. You specify which tag you want to release to production and the workflow copies that tag's index-top.html
to https://models-resources.concord.org/vortex/index.html
.
See the CLUE docs/deploy.md for more details (it uses the same process).
To deploy a production release:
- Create
release-<version>
branch and commit changes, push to GitHub, create PR and merge - Test the master build at: https://models-resources.concord.org/vortex/index-master.html
- Push a version tag to GitHub and/or use https://github.com/concord-consortium/vortex/releases to create a new GitHub release
- Stage the release by running the Release Staging Workflow and entering the version tag you just pushed.
- Test the staged release at https://models-resources.concord.org/vortex/index-staging.html
- Update production by running the Release Workflow and entering the release version tag.
Each time the mobile app launches it downloads a json file which is an array of experiments and saves them to local storage. If the version number of the experiments json file is greater than the mobile apps known max supported version an upgrade message is shown in the mobile interface.
By default the json is loaded from https://models-resources.concord.org/vortex/data/experiments.json which is the production version of the Vortex app. For local testing you can override this url by setting the updateUrl
localStorage variable. During development you can set this to https://localhost:8080/data/experiments.json to load the current version. However, this is the same version that the app will build with so to test a true update you should update the json file outside the repo and host it there.
Run npm test
to run jest tests. Run npm run test:full
to run jest and Cypress tests.
Inside of your package.json
file:
--browser browser-name
: define browser for running tests--group group-name
: assign a group name for tests running--spec
: define the spec files to run--headed
: show cypress test runner GUI while running test (will exit by default when done)--no-exit
: keep cypress test runner GUI open when done running--record
: decide whether or not tests will have video recordings--key
: specify your secret record key--reporter
: specify a mocha reporter
cypress run --browser chrome
will run cypress in a chrome browsercypress run --headed --no-exit
will open cypress test runner when tests begin to run, and it will remain open when tests are finished running.cypress run --spec 'cypress/integration/examples/smoke-test.js'
will point to a smoke-test file rather than running all of the test files for a project.
Vortex is Copyright 2020 (c) by the Concord Consortium and is distributed under the MIT license.
See license.md for the complete license text.