EnCoMPASS is a project of the 21st Century Partnership for STEM Education, Mathematical Thinking, and Drexel University.
Note: these procedures have the general prerequisites for all three apps required to run Encompass, as well as the specific installations to install the mt-sso Single Signon App.
Ember CLI npm install ember-cli # note if -g desired, may need sudo
cd <code directory>
git clone git@github.com:mathematicalthinking/encompass.git
Note: for troubleshooting MongoDB see mt-sso readme.md
mongod --config /opt/homebrew/etc/mongod.conf
mongod --config /usr/local/etc/mongod.conf
npm run start
(in mt-sso directory)npm run dev
(in vmt/server)npm run dev
(in encompass)npm run test
npm run test
npm run selenium --test=[filename]
(if ran without filename, will run e2e test for entire application ~20 min)If you run into the following error while running tests: "WebDriverException: unknown error: cannot find Chrome binary"
/app
EnCOMPASS uses Ember for the client and was recently migrated to Ember Octane from v2.14. Portions are not fully migrated.
Ember is switching to Glimmer for its component engine. Components that have their templates (.hbs files) in app/components
have been migrated. Their classes (.js files) will look like native JS classes. Components with templates in app/templates/components
have not been migrated and still use Classic Ember component classes. I tried to combine similar components when possible.
admin-problem-filter
and admin-workspace-filter
could be cominedproblem-filter
and workspace-filter
could be combinedusage of mixins (found in app/mixins
) are deprecated - they still work for classic components but should be refactored away
const currentUser = this.modelFor('application')
and passing it as an attribute to child componentscurrentUser
found in app/service/currentUser
. called in the app with @service currentUser
, the user is accessed with this.currentUser.user
error_handling_mixin
is now a Glimmer component to be extended by other components (see add-create-student.js
)
some mixins simply are no longer used
Ember has opinionated routing. All routes are found in app/router.js
. Each route found there corresponds to a file in app/routes/
e.g. encompass.mathematicalthinking.org/#/workspaces corresponds to app/routes/workspaces
and encompass.mathematicalthinking.org/#/workspaces/618c38d408dc48628cbd59e7/submissions/61d45c2308dc48628cc0fbed corresponds to app/routes/workspace/submissions/submission.js
(see resetNamespace
in router.js
)
Each route has a corresponding template that gets rendered. It should be in the corresponding place in app/templates
e.g. app/templates/workspaces
. A route might have a controller to handle user interaction at the route level, found in the corresponding location in app/controllers
. These behave slightly differently than components, but can basically be treated like a component.
/vendor
Libraries that are not managed by npm are added in the /vendor
directory and configured into the bundle in /ember-cli-build.js
including:
app/components/selectize-input.js
)app/components/twitter-typeahead.js
)vendor/image-tagging.js
and vendor/selection-highlighting.js
) that are used in app/components/workspace-submission.js
/helpers
Ember's template library only allows simple logical checks. For more complex logic, you can use helper functions found in app/helpers
and appear in templates as {{<helper-name> arg1 arg2 arg3 ...}}
ex: {{format-date workspace.createDate 'YYYY-MM-DD'}}
uses format-date.js and returns workspace.createDate in 'YYYY-MM-DD' format.
<host>/api/<route>
/app_server
EnCOMPASS uses an express.js server. The Ember client wouldn't allow a directory called /server
, so /app_server
is the solution
/app_server/datasource/api
/app_server/datasource/api/index.js
and exported as a single module of GET, POST, PUT, and DELETE methods/app_server/server.js
npm run lint:hbs
npm run lint:js
npm run lint:js -- --fix
See private docs.