The Layout Service can be used to support OVE with more complex layouts, apart from the absolute coordinates system.
This service requires a standard npm build, which can be built with lerna (as per instructions) in the README.md file found in the root of this repository.
Alternatively, it can be built and run with standard npm, using the package.json.
A standard working example is provided in the Working Example document.
Testing this service requires either a working OVE instance or a mocked service. The mocked service is available as part of this project. To run it:
npm run start:mockup
This will spin up a json mockup rest server, exposing the following url: http://localhost:3004/space-info.
Alternatively, you can use docker to build this image:
./build.sh
In order to run the image, you can customize the docker-compose file or run the default configuration:
SERVICE_VERSION="latest" docker-compose up -d
The service runs on port 8180 on localhost.
The layouts and parameters are available in the layouts document.
> npm run test:coverage
[PASS] src/layout/manager.test.js
[PASS] src/layout/grid.test.js
[PASS] src/validator/validator.test.js
[PASS] src/layout/percent.test.js
[PASS] src/util.test.js
[PASS] src/layout/static.test.js
[PASS] src/validator/extensions.test.js
|-----------------|----------|----------|----------|----------|-------------------|
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|-----------------|----------|----------|----------|----------|-------------------|
| All files | 100 | 100 | 100 | 100 | |
| src | 100 | 100 | 100 | 100 | |
| util.js | 100 | 100 | 100 | 100 | |
| src/layout | 100 | 100 | 100 | 100 | |
| grid.js | 100 | 100 | 100 | 100 | |
| layouts.js | 100 | 100 | 100 | 100 | |
| manager.js | 100 | 100 | 100 | 100 | |
| percent.js | 100 | 100 | 100 | 100 | |
| static.js | 100 | 100 | 100 | 100 | |
| src/test | 100 | 100 | 100 | 100 | |
| testUtils.js | 100 | 100 | 100 | 100 | |
| src/validator | 100 | 100 | 100 | 100 | |
| extensions.js | 100 | 100 | 100 | 100 | |
| validator.js | 100 | 100 | 100 | 100 | |
|-----------------|----------|----------|----------|----------|-------------------|
Test Suites: 7 passed, 7 total
Tests: 35 passed, 35 total
Snapshots: 0 total
Time: 1.899s
Ran all test suites.
Note: All the rest endpoints are not covered by the jest tests.