Compare commits
874 Commits
feature/th
...
plotly-tes
Author | SHA1 | Date | |
---|---|---|---|
352fe8ea7c | |||
29650f54de | |||
02d00aeb07 | |||
fd21594e4a | |||
5d0beb4351 | |||
f88d3bcaf3 | |||
22ca339fb9 | |||
c1102ed4b1 | |||
fcd8a9a9c9 | |||
7f8764560b | |||
4411bb0a2d | |||
5f729640b2 | |||
4ecd264d93 | |||
5fc12c771a | |||
7931177497 | |||
195aa0a95b | |||
c252d435bf | |||
87aa5a4342 | |||
bd98b81339 | |||
16677c99c9 | |||
6ab468086a | |||
56794b0ed5 | |||
0398679abc | |||
9d2991ee10 | |||
6dd8d448df | |||
1bc60f8108 | |||
ef2db1edaf | |||
3748927e87 | |||
122f3efa1f | |||
7e4aac028b | |||
32791b442d | |||
8e54b8a819 | |||
9e5eddec9b | |||
7aaccdb286 | |||
c46e4c5dad | |||
f0dc928230 | |||
6f674930d9 | |||
8675fc3fa6 | |||
25434342f3 | |||
8044dfe726 | |||
cd6c7fdc5e | |||
7ff85dc396 | |||
fb4877924a | |||
4b13cbdb33 | |||
51c9328dfd | |||
31ac67b393 | |||
f49556adad | |||
0399766ccd | |||
18ab034147 | |||
f726bfa31a | |||
8a4bc2a463 | |||
e9c6c5760e | |||
07c3dd6cfa | |||
771fb9c044 | |||
651a369391 | |||
ae67a2f438 | |||
055cf2b118 | |||
e9cf337aac | |||
04a18248c7 | |||
d462db60de | |||
67ebcf4749 | |||
38dbf2ccab | |||
e9968e3649 | |||
d9fafd2956 | |||
1acda469a9 | |||
d5b0ef735c | |||
a6cac13dfc | |||
3d058151f2 | |||
76817193eb | |||
35ef4407be | |||
f3526f9185 | |||
b5aba7ce8f | |||
0db5648e10 | |||
83325da738 | |||
4d1b2f3456 | |||
6137700c82 | |||
91a1b3f31d | |||
70649b0657 | |||
357b25a76b | |||
3b89bf0b8c | |||
a314aa3c95 | |||
dc5723c227 | |||
61fd7d4e4e | |||
bab53ad9bd | |||
d0d4579f13 | |||
32fc871e67 | |||
6b74a133d8 | |||
ceaf4c2ef0 | |||
982b69e7e1 | |||
8e5182732d | |||
2d0b92cc38 | |||
75e846ea3f | |||
1b5dee981d | |||
4fee7f73e7 | |||
4308a4c9cf | |||
abbffcfbf1 | |||
01710876fb | |||
9e3d97c85d | |||
519075001e | |||
96a48dd9ee | |||
550daae76f | |||
b8fcb8ff14 | |||
373ddd0bf5 | |||
d62cc6b3ee | |||
5116d38437 | |||
29771f2722 | |||
7bfe4bb25c | |||
510c637081 | |||
02b537580c | |||
d7c65fec4c | |||
7073b0717f | |||
d6bb1b2a12 | |||
626e2d8e80 | |||
1fe673c1f5 | |||
d9b00574e7 | |||
7c48b3ba9a | |||
c256696790 | |||
b6e589eed4 | |||
d5480e7524 | |||
ab463e93fe | |||
fb1813c14b | |||
cce834f873 | |||
ca60d02614 | |||
9520c09b49 | |||
0d70717b35 | |||
f18da542d6 | |||
8962b0c88b | |||
e7c38d473b | |||
2f8db31a33 | |||
1c58d8c85f | |||
baf426055c | |||
aa3af520ea | |||
4a43893ccc | |||
77f50a41c9 | |||
e4cd5f441f | |||
a9cfb002fb | |||
b603a5b722 | |||
be165761c7 | |||
da88cf58cc | |||
bc2bd53f9b | |||
6b7fd5f22a | |||
4ee214a142 | |||
4af24db38a | |||
8db27809ef | |||
3116b1addd | |||
5f67c45b50 | |||
8158afc29a | |||
13b3acb7e0 | |||
8363c65312 | |||
04598b6cf1 | |||
3876151a4b | |||
43628ad9d6 | |||
67bea86bc8 | |||
4eb4cbfffc | |||
eda01abcbc | |||
2fa29124bf | |||
694b8f4666 | |||
33faeafa98 | |||
a40ff07353 | |||
41dc9c794d | |||
f1faf3965d | |||
da2ecbbcad | |||
32c892fe98 | |||
bbb271a678 | |||
fec1438806 | |||
28f19ec310 | |||
f934454c25 | |||
eb49ffae02 | |||
5751012872 | |||
aa041e04cf | |||
24e7ea143a | |||
79d5d9c4d0 | |||
b5bfdc4418 | |||
59730c60ec | |||
4a87a5d847 | |||
421c09ec2c | |||
0679b246b8 | |||
83f9c6c528 | |||
a5f3ba6259 | |||
a70facf0c8 | |||
447fe94325 | |||
8e2b666766 | |||
dcbfbdbb89 | |||
4c76bf34ab | |||
81b7a9d3e0 | |||
dc573c479c | |||
23303c910e | |||
3282934cf6 | |||
c157fab081 | |||
7c07b66cc9 | |||
7a906ccf5c | |||
ff7debfb81 | |||
92ba103f45 | |||
2c2d8d6b56 | |||
cfadb9f4fd | |||
396817b2d1 | |||
96eb6d6b74 | |||
cb5d47f66f | |||
ea90d02d66 | |||
95f73d8eb8 | |||
a37c686993 | |||
f12166097c | |||
d103a22fa0 | |||
04a60cfcbb | |||
8d723960f4 | |||
6d3cd2c699 | |||
87bf94fe0a | |||
af93823b6f | |||
4a39ddf425 | |||
83c273b976 | |||
7dd81beb03 | |||
1842d3923c | |||
26838635b6 | |||
11f2c35bb2 | |||
766f48c1ba | |||
da7b93f9b3 | |||
99c095a69f | |||
f885e83505 | |||
928bc4c68a | |||
d5539c7ae4 | |||
c86a104fb6 | |||
46fedc1a30 | |||
3b6ef9b44b | |||
c68edd9b7d | |||
11574b7c40 | |||
abc2cd2413 | |||
5d74882646 | |||
9fe7f230e6 | |||
de4c5b3729 | |||
2a7901914a | |||
73b0fc6f79 | |||
ddef16795c | |||
d188b9a056 | |||
f510f3edd0 | |||
e05b0bb562 | |||
713c5e9fb7 | |||
17bca04560 | |||
61bdadc33c | |||
e0c5bca47d | |||
cdc7c1af64 | |||
3158baa998 | |||
698508fde4 | |||
68a96989e1 | |||
46a6a43234 | |||
d41fc27b55 | |||
24bb96cc90 | |||
483ee173d6 | |||
469e93d916 | |||
f96dfcc942 | |||
063a6c0e51 | |||
7c289d76b6 | |||
c617a440eb | |||
8f81a45b9b | |||
666459be87 | |||
53df89aa5d | |||
8f553f6327 | |||
f91a64483b | |||
de8d63c09d | |||
58b4a6ebf5 | |||
9d45080526 | |||
d3fe2a6811 | |||
97b37edce4 | |||
d3443518d6 | |||
c33314a4bf | |||
59eb034ab4 | |||
67d53fb62b | |||
0fd637c0e9 | |||
169cc6617a | |||
a946325e95 | |||
1beba78111 | |||
2edfeaa606 | |||
2a1f9fd063 | |||
63fe92f8ea | |||
35f303ffa4 | |||
dd70bb470f | |||
250fee125a | |||
956029c786 | |||
b9ab599c35 | |||
5a690932e9 | |||
b00757150e | |||
8515a411bd | |||
3034ec016a | |||
a81af1ce34 | |||
64c5725687 | |||
72a3248123 | |||
ee4a81bdfd | |||
b90eb80584 | |||
ebaf702c59 | |||
3956cd1c06 | |||
064cf6747e | |||
8512b634c7 | |||
4220a8a68a | |||
e7e5116773 | |||
079201273e | |||
e4c9f156a7 | |||
42eeeea374 | |||
7b060509f5 | |||
3ca9e9ae56 | |||
984bede43b | |||
87d838c690 | |||
072bf361de | |||
4e39d9fb84 | |||
14eaf4e899 | |||
a31d10e708 | |||
f9e88321a3 | |||
9e12203b86 | |||
a5326a7b95 | |||
84874f22e6 | |||
d00e8b68a5 | |||
2907d6d79c | |||
a5a4bb87c5 | |||
389589d7f7 | |||
c02cbd1ba7 | |||
90b475e17b | |||
89a298f5b3 | |||
f990a14a3c | |||
6b00af6ece | |||
5ec8ac95c1 | |||
5f061001d6 | |||
ef3c4ccf47 | |||
1a86204637 | |||
0a1959df38 | |||
03a690a158 | |||
459a055455 | |||
502d29dd25 | |||
bf947a8835 | |||
f0fd0a9cc7 | |||
7282792da1 | |||
ec0291c54d | |||
4413c29abb | |||
91e1a144ed | |||
53440c31d5 | |||
5128af2531 | |||
eedc0f13bc | |||
4172fdf1d5 | |||
7c200df4c4 | |||
d1b28e079a | |||
23ec838643 | |||
271c619c63 | |||
0552769670 | |||
99a9f5b3ba | |||
4b535ade31 | |||
de8f8088e2 | |||
32c16416d3 | |||
0cf27c349b | |||
015aa8c637 | |||
4a07ddbefc | |||
a81009541c | |||
1b680cfaca | |||
311ff003c0 | |||
0cae61444d | |||
28a603def8 | |||
d2b7407674 | |||
fff89a6384 | |||
953b95f79c | |||
6ff5ce78e1 | |||
0857fd95a7 | |||
a1f2608e7c | |||
b7cea7b955 | |||
32da19a486 | |||
39d7dc8372 | |||
f76f537be7 | |||
a681d67e05 | |||
0a634eb490 | |||
fcca8fa8d9 | |||
829eecf1ae | |||
dc7f83754a | |||
51498c0e75 | |||
6dbdebbe05 | |||
c994227d5d | |||
761ca7ad56 | |||
7f49a7bc99 | |||
ca022b8a28 | |||
6f500d0d0b | |||
07d101ac1c | |||
cdf0dd0c10 | |||
c27c347d29 | |||
dc54eef2c9 | |||
57a68a24de | |||
2c1b4b4cfc | |||
437e8a0263 | |||
0a2e912091 | |||
87513a14b7 | |||
168c040f3c | |||
78487a48f6 | |||
a5a197680d | |||
d42bd44485 | |||
77b705ecc8 | |||
48af39a584 | |||
ec978f3a35 | |||
f13714e0c4 | |||
42ac3ef9af | |||
26ffe8efde | |||
87b4000b12 | |||
f790c9bd39 | |||
096c9688d5 | |||
1f19f480ce | |||
44f48a3e2a | |||
60fce4a003 | |||
f04b5b689e | |||
05d981768e | |||
e4a6c21101 | |||
d51dd8b7d0 | |||
aed5377ad2 | |||
459b2060a5 | |||
cbeb25c583 | |||
b38a9ad4ce | |||
ecf3e19f16 | |||
3b82fd5d8b | |||
e08b4ff0ab | |||
1f3ec77bf1 | |||
3f61db2067 | |||
ce1fdbddda | |||
5332d136b7 | |||
983ed7f0e7 | |||
11978cd869 | |||
00d1b5e69f | |||
6731283cf8 | |||
6b4cd25417 | |||
0cd2799d00 | |||
243b9cac24 | |||
316e0f24cf | |||
05f94edb49 | |||
e22458f09e | |||
cc2df8401b | |||
43a82ec05f | |||
fe2e29d69b | |||
60aecfe27e | |||
5d21a8b6fe | |||
500ab52476 | |||
b0bb723357 | |||
b7fffeab1c | |||
e339d743ed | |||
84f0d49d6f | |||
090e89d524 | |||
90dd53e954 | |||
6ab60ab52e | |||
8975bc8c55 | |||
55e5c49f6e | |||
f090f7ffe7 | |||
94b5617e63 | |||
41c79c6032 | |||
83c648cc26 | |||
76e7fec1a0 | |||
09bfd80f69 | |||
15a7d03e74 | |||
1dc9743484 | |||
8f05c57d1a | |||
81caa27cba | |||
74a7ef2565 | |||
649575fd2d | |||
b75b7a958a | |||
625b39d722 | |||
65f80f4c45 | |||
02cd3048c8 | |||
63feaef988 | |||
6095872682 | |||
dba55867f4 | |||
0da80c2a67 | |||
084df5329a | |||
49ff0c79db | |||
7a4b967a01 | |||
ddfa611c44 | |||
efca7c8e58 | |||
8900072239 | |||
a7e57c62f4 | |||
24bade2284 | |||
5fcc4eebe1 | |||
27a09239e3 | |||
8d86c914a1 | |||
fab04519c6 | |||
4a5e106709 | |||
4675fc8ae6 | |||
cf9336dae9 | |||
7f32d196e4 | |||
897d05276a | |||
3e6509ce6f | |||
576b843bd5 | |||
9b8b63a0d8 | |||
a1b1fa464e | |||
95f855f905 | |||
5b00246cc0 | |||
47c388450f | |||
34a149661c | |||
4c4b587d9c | |||
b8b838f490 | |||
8cb29ba4a9 | |||
ece6223b23 | |||
ecabd00b0c | |||
768df84f10 | |||
f8b3899bb9 | |||
3b046db4f8 | |||
97f829da9f | |||
fb1eed1982 | |||
dd9b567025 | |||
fa83b4867c | |||
47d4fc9103 | |||
dabd0bff29 | |||
51c70d02d7 | |||
b74733bf3f | |||
84ae65536b | |||
71424dcf8d | |||
2c40396139 | |||
16a0bf9d6c | |||
5498ba8e1e | |||
0f9d7d2832 | |||
9bd1c51a6e | |||
fd74fb0ec4 | |||
3626ff9947 | |||
fd568409d3 | |||
14e3500a88 | |||
83d08ae369 | |||
39bf601ee1 | |||
cfafecdd64 | |||
629ca089cf | |||
89ae6ef8c7 | |||
300acd6ec8 | |||
ba780981a5 | |||
62774678a7 | |||
ac13bc5850 | |||
e526626e09 | |||
564be6f8ba | |||
371a7d3a3e | |||
8539d60562 | |||
d333fd5822 | |||
364191eddc | |||
583f4dac85 | |||
28255dce01 | |||
c9419d3e2d | |||
b386275330 | |||
d2a45e46f1 | |||
35d1727dbf | |||
8125a4f321 | |||
1a409afb03 | |||
e57c18fd69 | |||
3aec9ec6ff | |||
0e9bf74332 | |||
2609a41ee8 | |||
b8dc5acf00 | |||
fbbdf8cff7 | |||
b0edb19239 | |||
85902b878e | |||
9d5c7a4015 | |||
fc53e855c4 | |||
467c57b7c6 | |||
a51c0d5139 | |||
d46310ca7d | |||
8f87cc78e8 | |||
ee6e0f310e | |||
f328a1078e | |||
b4cf81a0ef | |||
1b9b7e2345 | |||
4456633010 | |||
cda97d142a | |||
858199e396 | |||
f504a335af | |||
463ec47af6 | |||
ec4d121a98 | |||
fea6d2df96 | |||
598d2b31e9 | |||
25e28ab97c | |||
43056c4068 | |||
614206b10c | |||
30a493d038 | |||
96e433beaa | |||
0915aaea3b | |||
80656c1be0 | |||
acd75f86f4 | |||
486dae54bd | |||
92ecf3af1d | |||
fd0c19026d | |||
3109c8d825 | |||
78cf75323f | |||
b744467f21 | |||
a0b7999ea2 | |||
2bb2bb6a1b | |||
11ed7027e7 | |||
36bcfd5a41 | |||
70b5c627ca | |||
f4f1d0387b | |||
a1bf4a92e5 | |||
7d2256d70f | |||
5814d2a35e | |||
6ab84c0bc3 | |||
a7fc9b3caa | |||
67f493f012 | |||
0686e6d38f | |||
7fc825949c | |||
2a9ccdcffd | |||
6db78af69f | |||
038489256c | |||
53b785269b | |||
007b14b5c9 | |||
50b331c451 | |||
44fc62e0ba | |||
2635f085f0 | |||
22161fce7f | |||
386fc75047 | |||
fa6dd84945 | |||
d425bd564c | |||
93e3065b3e | |||
0ad2d59924 | |||
f4468a8233 | |||
dc08877bbb | |||
f08caa6135 | |||
ad7d029ce8 | |||
387912b4d3 | |||
53e0ed4d4a | |||
11c205b5c4 | |||
4ede6351ec | |||
24bbcb466f | |||
682601477c | |||
b6b5cfe403 | |||
b6ce9c6ed7 | |||
6e5e8f0ce8 | |||
2415d785cc | |||
2b5d6beb84 | |||
86316d8940 | |||
1f2b5ec5c8 | |||
0a9d23d86f | |||
379e37c881 | |||
37ef269dce | |||
8db6f8f633 | |||
79557165a3 | |||
ec1d4abde9 | |||
07c5e2800a | |||
79811d6662 | |||
67919ece16 | |||
7029dcf09e | |||
38deef6e72 | |||
b6220288ac | |||
fc03b3a79d | |||
096d6371f1 | |||
e580734c95 | |||
2690156a9d | |||
7ac7a40b1b | |||
dc9e572052 | |||
b15ebfd492 | |||
8baee7a0c9 | |||
dc85063467 | |||
be428b326e | |||
dd0e360709 | |||
04da88e3b4 | |||
9bcab02e35 | |||
1ff4d41b7c | |||
04a5c8f69f | |||
8886a94a01 | |||
f25eebdf3f | |||
f9ba46fe85 | |||
6f6fb859d6 | |||
1e3389b427 | |||
c977c64139 | |||
e419149378 | |||
a5a3e41d21 | |||
ecef8eaf86 | |||
de03cfbe64 | |||
03a6de55d6 | |||
3c5047df5e | |||
3cc630d4c2 | |||
b3488c54cd | |||
01b1d66bea | |||
2e82edb306 | |||
8f0e773ac1 | |||
223a0feada | |||
bc9cadaa77 | |||
0fd0da8331 | |||
f42ec7e2c5 | |||
d6a422fbdb | |||
d98b54bea7 | |||
0beda1d053 | |||
e912ab8f4e | |||
5055a18ca1 | |||
fa21911287 | |||
96746f4042 | |||
b22ad3ded9 | |||
7e0f475c63 | |||
efb3c2b71e | |||
862ea6986f | |||
cfa5dcb02e | |||
23aaada79d | |||
9e4458db10 | |||
a8da06033c | |||
0bf3597147 | |||
cfd9730055 | |||
e88ead30dc | |||
67b24ce846 | |||
709c3fff65 | |||
ab6e87ae6b | |||
cdb7066bed | |||
73d0507f1f | |||
4d263bcf32 | |||
2d8f61172d | |||
621c1dc11e | |||
dd136a5ff4 | |||
8fc785bbd6 | |||
82be503f4f | |||
7feb933519 | |||
e806e5a293 | |||
770951c6da | |||
7b7c7b528a | |||
a554aa20f8 | |||
ff1ef1f184 | |||
bf1efaf912 | |||
ff2bc41317 | |||
bdaf8aff15 | |||
1dc4f9f6bb | |||
d6320f5da1 | |||
276be5e857 | |||
3101e77ecc | |||
ab6dae16f1 | |||
36222d79c6 | |||
08656a6674 | |||
8034317796 | |||
a59f3a550e | |||
415b967c0b | |||
642499d519 | |||
fa0a54eee7 | |||
82f175f6c7 | |||
8df549e8d9 | |||
9fd720777b | |||
4c68c725b1 | |||
06a5207c6d | |||
78b885c508 | |||
a18a3b6099 | |||
68949e070c | |||
654333dabe | |||
81b8a76f1b | |||
31736fa194 | |||
33632ef1dc | |||
94305ed82c | |||
c8abc45e25 | |||
cd25459ac9 | |||
aaf1eb8059 | |||
1589e4236a | |||
8ca202d0a9 | |||
d2f7904118 | |||
2d059fb856 | |||
8bbd7898bb | |||
ea6f8c9a50 | |||
d152440436 | |||
1ffe76a525 | |||
a6825f530c | |||
7cf6dc386f | |||
5d8252bb07 | |||
e1e1e0fb2f | |||
4f7345563f | |||
68a2b9f3a8 | |||
d79402c568 | |||
d0e8f650be | |||
d819c6efe2 | |||
91c877f234 | |||
55a674ba7b | |||
36055b7c04 | |||
7db4ac8ff6 | |||
fe3cc661d3 | |||
eb7efae1cc | |||
63f8fb54d4 | |||
097fa2e655 | |||
3d0b4d51c2 | |||
37650487f7 | |||
6ccc0b4fbf | |||
79fe95372d | |||
6adb190d0e | |||
c094e6c6f4 | |||
8c796b4e57 | |||
c08e9a89ff | |||
03829af2ad | |||
cc8ba18ccc | |||
57c671a42e | |||
1ee6ecf3ae | |||
5f80b3773b | |||
8452455050 | |||
e5d8f60cdb | |||
de466000a0 | |||
49664c011c | |||
cf34d6b127 | |||
e52f6ce099 | |||
1ecdc4c487 | |||
d38e2c49cb | |||
f8464fa76f | |||
308ae2cb2e | |||
88219659fb | |||
c34c2df061 | |||
99c7bd4c10 | |||
322cd94be7 | |||
f93d5a6fbf | |||
cd116667be | |||
2f2de3952d | |||
45e56798c5 | |||
0664d480e6 | |||
5d31806fb7 | |||
283599ddf5 | |||
09e3ceefa0 | |||
87f76ebfe4 | |||
384f0efcb3 | |||
55a195b841 | |||
c7946fd7b3 | |||
5d3ba3199c | |||
f0d10306fc | |||
161943b5b8 | |||
e545043a26 | |||
40fb58b5b7 | |||
1f9d4708b3 | |||
162809e081 | |||
482c871ac2 | |||
f0b3311630 | |||
656d6d6c3f | |||
ea45f0f4aa | |||
6a25cb0a58 | |||
4a1901420d | |||
ad64f00608 | |||
65aea29cb9 | |||
7981424e9a | |||
10c4340475 | |||
0a95db1a51 | |||
ace77dce65 | |||
c1d58bb25f | |||
fbcafe0f62 | |||
9a9d9222a9 | |||
221e5b4f6c | |||
5df74aee68 | |||
3b195e9c7d | |||
17838d8040 | |||
2248c2da08 | |||
532c0e98db | |||
ef3bae1312 | |||
37a8cf071c | |||
98c9cc92b8 | |||
490cb2225d | |||
ecd8372efa | |||
50173a4413 | |||
76fc0b01fa | |||
23781fa686 | |||
8ec1b9965a | |||
a16a44208a | |||
f82ca91a61 | |||
f86b8cce16 | |||
b06c234b59 | |||
31a7ebd4f1 | |||
c83e44ff1c | |||
d6faa25888 | |||
55327a0150 | |||
28d2194d51 | |||
b3bc618bb0 | |||
419285c396 | |||
3f6f893e29 | |||
14e8c7a401 | |||
3dee6db5e2 | |||
98c8e19d93 | |||
a8ba3b3fdb | |||
1b31a472a5 | |||
e5fe8fd975 | |||
b36d1ca2bc | |||
e9730ced9e | |||
ff2f79b087 | |||
76e163473a | |||
6fdc24ab21 | |||
cb93124ee1 | |||
4bda4080d2 | |||
e710cafb2c | |||
e9643ad07f | |||
ca16892237 | |||
a2b0d350d8 | |||
534bdbae50 | |||
831873e7de | |||
622d246fdd | |||
4a1ca9f299 | |||
4e1de2678c | |||
33a4792531 | |||
37dd4856a6 | |||
6a9cf3389d | |||
2da2395473 | |||
00ecd27bb3 | |||
0fa4486dcf |
@ -2,7 +2,7 @@ version: 2
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8-browsers
|
- image: circleci/node:13-browsers
|
||||||
environment:
|
environment:
|
||||||
CHROME_BIN: "/usr/bin/google-chrome"
|
CHROME_BIN: "/usr/bin/google-chrome"
|
||||||
steps:
|
steps:
|
||||||
@ -11,17 +11,17 @@ jobs:
|
|||||||
name: Update npm
|
name: Update npm
|
||||||
command: 'sudo npm install -g npm@latest'
|
command: 'sudo npm install -g npm@latest'
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: dependency-cache-{{ checksum "package.json" }}
|
key: dependency-cache-13-{{ checksum "package.json" }}
|
||||||
- run:
|
- run:
|
||||||
name: Installing dependencies (npm install)
|
name: Installing dependencies (npm install)
|
||||||
command: npm install
|
command: npm install
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: dependency-cache-{{ checksum "package.json" }}
|
key: dependency-cache-13-{{ checksum "package.json" }}
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- node_modules
|
||||||
- run:
|
- run:
|
||||||
name: npm run test
|
name: npm run test:coverage
|
||||||
command: npm run test
|
command: npm run test:coverage
|
||||||
- run:
|
- run:
|
||||||
name: npm run lint
|
name: npm run lint
|
||||||
command: npm run lint
|
command: npm run lint
|
||||||
|
64
.eslintrc.js
@ -1,3 +1,4 @@
|
|||||||
|
const LEGACY_FILES = ["platform/**", "example/**"];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
@ -10,7 +11,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:vue/recommended"
|
"plugin:vue/recommended",
|
||||||
|
"plugin:you-dont-need-lodash-underscore/compatible"
|
||||||
],
|
],
|
||||||
"parser": "vue-eslint-parser",
|
"parser": "vue-eslint-parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
@ -22,6 +24,9 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"you-dont-need-lodash-underscore/omit": "off",
|
||||||
|
"you-dont-need-lodash-underscore/throttle": "off",
|
||||||
|
"you-dont-need-lodash-underscore/flatten": "off",
|
||||||
"no-bitwise": "error",
|
"no-bitwise": "error",
|
||||||
"curly": "error",
|
"curly": "error",
|
||||||
"eqeqeq": "error",
|
"eqeqeq": "error",
|
||||||
@ -66,6 +71,56 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
"dot-notation": "error",
|
"dot-notation": "error",
|
||||||
"indent": ["error", 4],
|
"indent": ["error", 4],
|
||||||
|
|
||||||
|
// https://eslint.org/docs/rules/no-case-declarations
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
// https://eslint.org/docs/rules/max-classes-per-file
|
||||||
|
"max-classes-per-file": ["error", 1],
|
||||||
|
// https://eslint.org/docs/rules/no-eq-null
|
||||||
|
"no-eq-null": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-eval
|
||||||
|
"no-eval": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-floating-decimal
|
||||||
|
"no-floating-decimal": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-implicit-globals
|
||||||
|
"no-implicit-globals": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-implied-eval
|
||||||
|
"no-implied-eval": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-lone-blocks
|
||||||
|
"no-lone-blocks": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-loop-func
|
||||||
|
"no-loop-func": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-new-func
|
||||||
|
"no-new-func": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-new-wrappers
|
||||||
|
"no-new-wrappers": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-octal-escape
|
||||||
|
"no-octal-escape": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-proto
|
||||||
|
"no-proto": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-return-await
|
||||||
|
"no-return-await": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-script-url
|
||||||
|
"no-script-url": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-self-compare
|
||||||
|
"no-self-compare": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-sequences
|
||||||
|
"no-sequences": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-unmodified-loop-condition
|
||||||
|
"no-unmodified-loop-condition": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-useless-call
|
||||||
|
"no-useless-call": "error",
|
||||||
|
// https://eslint.org/docs/rules/wrap-iife
|
||||||
|
"wrap-iife": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-nested-ternary
|
||||||
|
"no-nested-ternary": "error",
|
||||||
|
// https://eslint.org/docs/rules/switch-colon-spacing
|
||||||
|
"switch-colon-spacing": "error",
|
||||||
|
// https://eslint.org/docs/rules/no-useless-computed-key
|
||||||
|
"no-useless-computed-key": "error",
|
||||||
|
// https://eslint.org/docs/rules/rest-spread-spacing
|
||||||
|
"rest-spread-spacing": ["error"],
|
||||||
|
|
||||||
"vue/html-indent": [
|
"vue/html-indent": [
|
||||||
"error",
|
"error",
|
||||||
4,
|
4,
|
||||||
@ -112,6 +167,13 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"files": LEGACY_FILES,
|
||||||
|
"rules": {
|
||||||
|
// https://eslint.org/docs/rules/no-nested-ternary
|
||||||
|
"no-nested-ternary": "off",
|
||||||
|
"no-var": "off"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
1
.gitignore
vendored
@ -38,3 +38,4 @@ protractor/logs
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
report.*.json
|
||||||
|
80
API.md
@ -52,7 +52,6 @@
|
|||||||
- [The URL Status Indicator](#the-url-status-indicator)
|
- [The URL Status Indicator](#the-url-status-indicator)
|
||||||
- [Creating a Simple Indicator](#creating-a-simple-indicator)
|
- [Creating a Simple Indicator](#creating-a-simple-indicator)
|
||||||
- [Custom Indicators](#custom-indicators)
|
- [Custom Indicators](#custom-indicators)
|
||||||
- [Included Plugins](#included-plugins)
|
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
@ -109,15 +108,13 @@ script loaders are also supported.
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Open MCT</title>
|
<title>Open MCT</title>
|
||||||
<script src="openmct.js"></script>
|
<script src="dist/openmct.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
openmct.setAssetPath('openmct/dist');
|
|
||||||
openmct.install(openmct.plugins.LocalStorage());
|
openmct.install(openmct.plugins.LocalStorage());
|
||||||
openmct.install(openmct.plugins.MyItems());
|
openmct.install(openmct.plugins.MyItems());
|
||||||
openmct.install(openmct.plugins.UTCTimeSystem());
|
openmct.install(openmct.plugins.UTCTimeSystem());
|
||||||
openmct.install(openmct.plugins.Espresso());
|
|
||||||
openmct.start();
|
openmct.start();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
@ -128,9 +125,6 @@ The Open MCT library included above requires certain assets such as html
|
|||||||
templates, images, and css. If you installed Open MCT from GitHub as described
|
templates, images, and css. If you installed Open MCT from GitHub as described
|
||||||
in the section on [Building from Source](#building-from-source) then these
|
in the section on [Building from Source](#building-from-source) then these
|
||||||
assets will have been downloaded along with the Open MCT javascript library.
|
assets will have been downloaded along with the Open MCT javascript library.
|
||||||
You can specify the location of these assets by calling `openmct.setAssetPath()`.
|
|
||||||
Typically this will be the same location as the `openmct.js` library is
|
|
||||||
included from.
|
|
||||||
|
|
||||||
There are some plugins bundled with the application that provide UI,
|
There are some plugins bundled with the application that provide UI,
|
||||||
persistence, and other default configuration which are necessary to be able to
|
persistence, and other default configuration which are necessary to be able to
|
||||||
@ -237,7 +231,7 @@ attributes
|
|||||||
of this object. This is used for specifying an icon to appear next to each
|
of this object. This is used for specifying an icon to appear next to each
|
||||||
object of this type.
|
object of this type.
|
||||||
|
|
||||||
The [Open MCT Tutorials](https://github.com/openmct/openmct-tutorial) provide a
|
The [Open MCT Tutorials](https://github.com/nasa/openmct-tutorial) provide a
|
||||||
step-by-step examples of writing code for Open MCT that includes a [section on
|
step-by-step examples of writing code for Open MCT that includes a [section on
|
||||||
defining a new object type](https://github.com/nasa/openmct-tutorial#step-3---providing-objects).
|
defining a new object type](https://github.com/nasa/openmct-tutorial#step-3---providing-objects).
|
||||||
|
|
||||||
@ -429,12 +423,12 @@ attribute | type | flags | notes
|
|||||||
|
|
||||||
###### Value Hints
|
###### Value Hints
|
||||||
|
|
||||||
Each telemetry value description has an object defining hints. Keys in this this object represent the hint itself, and the value represents the weight of that hint. A lower weight means the hint has a higher priority. For example, multiple values could be hinted for use as the y axis of a plot (raw, engineering), but the highest priority would be the default choice. Likewise, a table will use hints to determine the default order of columns.
|
Each telemetry value description has an object defining hints. Keys in this this object represent the hint itself, and the value represents the weight of that hint. A lower weight means the hint has a higher priority. For example, multiple values could be hinted for use as the y-axis of a plot (raw, engineering), but the highest priority would be the default choice. Likewise, a table will use hints to determine the default order of columns.
|
||||||
|
|
||||||
Known hints:
|
Known hints:
|
||||||
|
|
||||||
* `domain`: Indicates that the value represents the "input" of a datum. Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first.
|
* `domain`: Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first.
|
||||||
* `range`: Indicates that the value is the "output" of a datum. Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values.
|
* `range`: Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values.
|
||||||
* `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available.
|
* `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available.
|
||||||
|
|
||||||
##### The Time Conductor and Telemetry
|
##### The Time Conductor and Telemetry
|
||||||
@ -511,7 +505,7 @@ example:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This strategy says "I want the lastest data point in this time range". A provider which recognizes this request should return only one value-- the latest-- in the requested time range. Depending on your back-end implementation, performing these queries in bulk can be a large performance increase. These are generally issued by views that are only capable of displaying a single value and only need to show the latest value.
|
This strategy says "I want the latest data point in this time range". A provider which recognizes this request should return only one value-- the latest-- in the requested time range. Depending on your back-end implementation, performing these queries in bulk can be a large performance increase. These are generally issued by views that are only capable of displaying a single value and only need to show the latest value.
|
||||||
|
|
||||||
##### `minmax` request strategy
|
##### `minmax` request strategy
|
||||||
|
|
||||||
@ -606,7 +600,7 @@ evaluator, take a look at `examples/generator/SinewaveLimitProvider.js`.
|
|||||||
|
|
||||||
### Telemetry Consumer APIs **draft**
|
### Telemetry Consumer APIs **draft**
|
||||||
|
|
||||||
The APIs for requesting telemetry from Open MCT -- e.g. for use in custom views -- are currently in draft state and are being revised. If you'd like to experiement with them before they are finalized, please contact the team via the contact-us link on our website.
|
The APIs for requesting telemetry from Open MCT -- e.g. for use in custom views -- are currently in draft state and are being revised. If you'd like to experiment with them before they are finalized, please contact the team via the contact-us link on our website.
|
||||||
|
|
||||||
|
|
||||||
## Time API
|
## Time API
|
||||||
@ -994,7 +988,7 @@ A common use case for indicators is to convey the state of some external system
|
|||||||
persistence backend or HTTP server. So long as this system is accessible via HTTP request,
|
persistence backend or HTTP server. So long as this system is accessible via HTTP request,
|
||||||
Open MCT provides a general purpose indicator to show whether the server is available and
|
Open MCT provides a general purpose indicator to show whether the server is available and
|
||||||
returing a 2xx status code. The URL Status Indicator is made available as a default plugin. See
|
returing a 2xx status code. The URL Status Indicator is made available as a default plugin. See
|
||||||
[Included Plugins](#included-plugins) below for details on how to install and configure the
|
the [documentation](./src/plugins/URLIndicatorPlugin) for details on how to install and configure the
|
||||||
URL Status Indicator.
|
URL Status Indicator.
|
||||||
|
|
||||||
### Creating a Simple Indicator
|
### Creating a Simple Indicator
|
||||||
@ -1033,7 +1027,7 @@ different colors to indicate status.
|
|||||||
|
|
||||||
### Custom Indicators
|
### Custom Indicators
|
||||||
|
|
||||||
A completely custom indicator can be added by simple providing a DOM element to place alongside other indicators.
|
A completely custom indicator can be added by simply providing a DOM element to place alongside other indicators.
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
var domNode = document.createElement('div');
|
var domNode = document.createElement('div');
|
||||||
@ -1046,59 +1040,3 @@ A completely custom indicator can be added by simple providing a DOM element to
|
|||||||
element: domNode
|
element: domNode
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Included Plugins
|
|
||||||
|
|
||||||
Open MCT is packaged along with a few general-purpose plugins:
|
|
||||||
|
|
||||||
* `openmct.plugins.Conductor` provides a user interface for working with time
|
|
||||||
within the application. If activated, configuration must be provided. This is
|
|
||||||
detailed in the section on [Time Conductor Configuration](#time-conductor-configuration).
|
|
||||||
* `openmct.plugins.CouchDB` is an adapter for using CouchDB for persistence
|
|
||||||
of user-created objects. This is a constructor that takes the URL for the
|
|
||||||
CouchDB database as a parameter, e.g.
|
|
||||||
```javascript
|
|
||||||
openmct.install(openmct.plugins.CouchDB('http://localhost:5984/openmct'))
|
|
||||||
```
|
|
||||||
* `openmct.plugins.Elasticsearch` is an adapter for using Elasticsearch for
|
|
||||||
persistence of user-created objects. This is a
|
|
||||||
constructor that takes the URL for the Elasticsearch instance as a
|
|
||||||
parameter. eg.
|
|
||||||
```javascript
|
|
||||||
openmct.install(openmct.plugins.CouchDB('http://localhost:9200'))
|
|
||||||
```
|
|
||||||
* `openmct.plugins.Espresso` and `openmct.plugins.Snow` are two different
|
|
||||||
themes (dark and light) available for Open MCT. Note that at least one
|
|
||||||
of these themes must be installed for Open MCT to appear correctly.
|
|
||||||
* `openmct.plugins.URLIndicator` adds an indicator which shows the
|
|
||||||
availability of a URL with the following options:
|
|
||||||
- `url` : URL to indicate the status of
|
|
||||||
- `iconClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items)
|
|
||||||
- `interval`: Interval between checking the connection, defaults to `10000`
|
|
||||||
- `label` Name showing up as text in the status bar, defaults to url
|
|
||||||
```javascript
|
|
||||||
openmct.install(openmct.plugins.URLIndicator({
|
|
||||||
url: 'http://localhost:8080',
|
|
||||||
iconClass: 'check',
|
|
||||||
interval: 10000,
|
|
||||||
label: 'Localhost'
|
|
||||||
})
|
|
||||||
);
|
|
||||||
```
|
|
||||||
* `openmct.plugins.LocalStorage` provides persistence of user-created
|
|
||||||
objects in browser-local storage. This is particularly useful in
|
|
||||||
development environments.
|
|
||||||
* `openmct.plugins.MyItems` adds a top-level folder named "My Items"
|
|
||||||
when the application is first started, providing a place for a
|
|
||||||
user to store created items.
|
|
||||||
* `openmct.plugins.UTCTimeSystem` provides a default time system for Open MCT.
|
|
||||||
|
|
||||||
Generally, you will want to either install these plugins, or install
|
|
||||||
different plugins that provide persistence and an initial folder
|
|
||||||
hierarchy.
|
|
||||||
|
|
||||||
eg.
|
|
||||||
```javascript
|
|
||||||
openmct.install(openmct.plugins.LocalStorage());
|
|
||||||
openmct.install(openmct.plugins.MyItems());
|
|
||||||
```
|
|
||||||
|
200
CONTRIBUTING.md
@ -103,7 +103,7 @@ the name chosen could not be mistaken for a topic or master branch.
|
|||||||
### Merging
|
### Merging
|
||||||
|
|
||||||
When development is complete on an issue, the first step toward merging it
|
When development is complete on an issue, the first step toward merging it
|
||||||
back into the master branch is to file a Pull Request. The contributions
|
back into the master branch is to file a Pull Request (PR). The contributions
|
||||||
should meet code, test, and commit message standards as described below,
|
should meet code, test, and commit message standards as described below,
|
||||||
and the pull request should include a completed author checklist, also
|
and the pull request should include a completed author checklist, also
|
||||||
as described below. Pull requests may be assigned to specific team
|
as described below. Pull requests may be assigned to specific team
|
||||||
@ -114,6 +114,15 @@ request. When the reviewer is satisfied, they should add a comment to
|
|||||||
the pull request containing the reviewer checklist (from below) and complete
|
the pull request containing the reviewer checklist (from below) and complete
|
||||||
the merge back to the master branch.
|
the merge back to the master branch.
|
||||||
|
|
||||||
|
Additionally:
|
||||||
|
* Every pull request must link to the issue that it addresses. Eg. “Addresses #1234” or “Closes #1234”. This is the responsibility of the pull request’s __author__. If no issue exists, create one.
|
||||||
|
* Every __author__ must include testing instructions. These instructions should identify the areas of code affected, and some minimal test steps. If addressing a bug, reproduction steps should be included, if they were not included in the original issue. If reproduction steps were included on the original issue, and are sufficient, refer to them.
|
||||||
|
* A pull request that closes an issue should say so in the description. Including the text “Closes #1234” will cause the linked issue to be automatically closed when the pull request is merged. This is the responsibility of the pull request’s __author__.
|
||||||
|
* When a pull request is merged, and the corresponding issue closed, the __reviewer__ must add the tag “unverified” to the original issue. This will indicate that although the issue is closed, it has not been tested yet.
|
||||||
|
* Every PR must have two reviewers assigned, though only one approval is necessary for merge.
|
||||||
|
* Changes to API require approval by a senior developer.
|
||||||
|
* When creating a PR, it is the author's responsibility to apply any priority label from the issue to the PR as well. This helps with prioritization.
|
||||||
|
|
||||||
## Standards
|
## Standards
|
||||||
|
|
||||||
Contributions to Open MCT are expected to meet the following standards.
|
Contributions to Open MCT are expected to meet the following standards.
|
||||||
@ -122,97 +131,104 @@ changes.
|
|||||||
|
|
||||||
### Code Standards
|
### Code Standards
|
||||||
|
|
||||||
JavaScript sources in Open MCT must satisfy JSLint under its default
|
JavaScript sources in Open MCT must satisfy the ESLint rules defined in
|
||||||
settings. This is verified by the command line build.
|
this repository. This is verified by the command line build.
|
||||||
|
|
||||||
#### Code Guidelines
|
#### Code Guidelines
|
||||||
|
|
||||||
JavaScript sources in Open MCT should:
|
The following guidelines are provided for anyone contributing source code to the Open MCT project:
|
||||||
|
|
||||||
* Use four spaces for indentation. Tabs should not be used.
|
|
||||||
* Include JSDoc for any exposed API (e.g. public methods, constructors).
|
|
||||||
* Include non-JSDoc comments as-needed for explaining private variables,
|
|
||||||
methods, or algorithms when they are non-obvious.
|
|
||||||
* Define one public class per script, expressed as a constructor function
|
|
||||||
returned from an AMD-style module.
|
|
||||||
* Follow “Java-like” naming conventions. These includes:
|
|
||||||
* Classes should use camel case, first letter capitalized
|
|
||||||
(e.g. SomeClassName).
|
|
||||||
* Methods, variables, fields, and function names should use camel case,
|
|
||||||
first letter lower-case (e.g. someVariableName).
|
|
||||||
* Constants (variables or fields which are meant to be declared and
|
|
||||||
initialized statically, and never changed) should use only capital
|
|
||||||
letters, with underscores between words (e.g. SOME_CONSTANT).
|
|
||||||
* File names should be the name of the exported class, plus a .js extension
|
|
||||||
(e.g. SomeClassName.js).
|
|
||||||
* Avoid anonymous functions, except when functions are short (a few lines)
|
|
||||||
and/or their inclusion makes sense within the flow of the code
|
|
||||||
(e.g. as arguments to a forEach call).
|
|
||||||
* Avoid deep nesting (especially of functions), except where necessary
|
|
||||||
(e.g. due to closure scope).
|
|
||||||
* End with a single new-line character.
|
|
||||||
* Expose public methods by declaring them on the class's prototype.
|
|
||||||
* Within a given function's scope, do not mix declarations and imperative
|
|
||||||
code, and present these in the following order:
|
|
||||||
* First, variable declarations and initialization.
|
|
||||||
* Second, function declarations.
|
|
||||||
* Third, imperative statements.
|
|
||||||
* Finally, the returned value.
|
|
||||||
|
|
||||||
|
1. Write clean code. Here’s a good summary - https://github.com/ryanmcdermott/clean-code-javascript.
|
||||||
|
1. Include JSDoc for any exposed API (e.g. public methods, classes).
|
||||||
|
1. Include non-JSDoc comments as-needed for explaining private variables,
|
||||||
|
methods, or algorithms when they are non-obvious. Otherwise code
|
||||||
|
should be self-documenting.
|
||||||
|
1. Classes and Vue components should use camel case, first letter capitalized
|
||||||
|
(e.g. SomeClassName).
|
||||||
|
1. Methods, variables, fields, events, and function names should use camelCase,
|
||||||
|
first letter lower-case (e.g. someVariableName).
|
||||||
|
1. Source files that export functions should use camelCase, first letter lower-case (eg. testTools.js)
|
||||||
|
1. Constants (variables or fields which are meant to be declared and
|
||||||
|
initialized statically, and never changed) should use only capital
|
||||||
|
letters, with underscores between words (e.g. SOME_CONSTANT). They should always be declared as `const`s
|
||||||
|
1. File names should be the name of the exported class, plus a .js extension
|
||||||
|
(e.g. SomeClassName.js).
|
||||||
|
1. Avoid anonymous functions, except when functions are short (one or two lines)
|
||||||
|
and their inclusion makes sense within the flow of the code
|
||||||
|
(e.g. as arguments to a forEach call). Anonymous functions should always be arrow functions.
|
||||||
|
1. Named functions are preferred over functions assigned to variables.
|
||||||
|
eg.
|
||||||
|
```JavaScript
|
||||||
|
function renameObject(object, newName) {
|
||||||
|
Object.name = newName;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
is preferable to
|
||||||
|
```JavaScript
|
||||||
|
const rename = (object, newName) => {
|
||||||
|
Object.name = newName;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
1. Avoid deep nesting (especially of functions), except where necessary
|
||||||
|
(e.g. due to closure scope).
|
||||||
|
1. End with a single new-line character.
|
||||||
|
1. Always use ES6 `Class`es and inheritence rather than the pre-ES6 prototypal
|
||||||
|
pattern.
|
||||||
|
1. Within a given function's scope, do not mix declarations and imperative
|
||||||
|
code, and present these in the following order:
|
||||||
|
* First, variable declarations and initialization.
|
||||||
|
* Secondly, imperative statements.
|
||||||
|
* Finally, the returned value. A single return statement at the end of the function should be used, except where an early return would improve code clarity.
|
||||||
|
1. Avoid the use of "magic" values.
|
||||||
|
eg.
|
||||||
|
```JavaScript
|
||||||
|
Const UNAUTHORIZED = 401
|
||||||
|
if (responseCode === UNAUTHORIZED)
|
||||||
|
```
|
||||||
|
is preferable to
|
||||||
|
```JavaScript
|
||||||
|
if (responseCode === 401)
|
||||||
|
```
|
||||||
|
1. Use the ternary operator only for simple cases such as variable assignment. Nested ternaries should be avoided in all cases.
|
||||||
|
1. Test specs should reside alongside the source code they test, not in a separate directory.
|
||||||
|
1. Organize code by feature, not by type.
|
||||||
|
eg.
|
||||||
|
```
|
||||||
|
- telemetryTable
|
||||||
|
- row
|
||||||
|
TableRow.js
|
||||||
|
TableRowCollection.js
|
||||||
|
TableRow.vue
|
||||||
|
- column
|
||||||
|
TableColumn.js
|
||||||
|
TableColumn.vue
|
||||||
|
plugin.js
|
||||||
|
pluginSpec.js
|
||||||
|
```
|
||||||
|
is preferable to
|
||||||
|
```
|
||||||
|
- telemetryTable
|
||||||
|
- components
|
||||||
|
TableRow.vue
|
||||||
|
TableColumn.vue
|
||||||
|
- collections
|
||||||
|
TableRowCollection.js
|
||||||
|
TableColumn.js
|
||||||
|
TableRow.js
|
||||||
|
plugin.js
|
||||||
|
pluginSpec.js
|
||||||
|
```
|
||||||
Deviations from Open MCT code style guidelines require two-party agreement,
|
Deviations from Open MCT code style guidelines require two-party agreement,
|
||||||
typically from the author of the change and its reviewer.
|
typically from the author of the change and its reviewer.
|
||||||
|
|
||||||
#### Code Example
|
|
||||||
|
|
||||||
```js
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bundles should declare themselves as namespaces in whichever source
|
|
||||||
* file is most like the "main point of entry" to the bundle.
|
|
||||||
* @namespace some/bundle
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
['./OtherClass'],
|
|
||||||
function (OtherClass) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A summary of how to use this class goes here.
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @memberof some/bundle
|
|
||||||
*/
|
|
||||||
function ExampleClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods which are not intended for external use should
|
|
||||||
// not have JSDoc (or should be marked @private)
|
|
||||||
ExampleClass.prototype.privateMethod = function () {
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A summary of this method goes here.
|
|
||||||
* @param {number} n a parameter
|
|
||||||
* @returns {number} a return value
|
|
||||||
*/
|
|
||||||
ExampleClass.prototype.publicMethod = function (n) {
|
|
||||||
return n * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ExampleClass;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Test Standards
|
### Test Standards
|
||||||
|
|
||||||
Automated testing shall occur whenever changes are merged into the main
|
Automated testing shall occur whenever changes are merged into the main
|
||||||
development branch and must be confirmed alongside any pull request.
|
development branch and must be confirmed alongside any pull request.
|
||||||
|
|
||||||
Automated tests are typically unit tests which exercise individual software
|
Automated tests are tests which exercise plugins, API, and utility classes.
|
||||||
components. Tests are subject to code review along with the actual
|
Tests are subject to code review along with the actual implementation, to
|
||||||
implementation, to ensure that tests are applicable and useful.
|
ensure that tests are applicable and useful.
|
||||||
|
|
||||||
Examples of useful tests:
|
Examples of useful tests:
|
||||||
* Tests which replicate bugs (or their root causes) to verify their
|
* Tests which replicate bugs (or their root causes) to verify their
|
||||||
@ -222,8 +238,26 @@ Examples of useful tests:
|
|||||||
* Tests which verify expected interactions with other components in the
|
* Tests which verify expected interactions with other components in the
|
||||||
system.
|
system.
|
||||||
|
|
||||||
During automated testing, code coverage metrics will be reported. Line
|
#### Guidelines
|
||||||
coverage must remain at or above 80%.
|
* 100% statement coverage is achievable and desirable.
|
||||||
|
* Do blackbox testing. Test external behaviors, not internal details. Write tests that describe what your plugin is supposed to do. How it does this doesn't matter, so don't test it.
|
||||||
|
* Unit test specs for plugins should be defined at the plugin level. Start with one test spec per plugin named pluginSpec.js, and as this test spec grows too big, break it up into multiple test specs that logically group related tests.
|
||||||
|
* Unit tests for API or for utility functions and classes may be defined at a per-source file level.
|
||||||
|
* Wherever possible only use and mock public API, builtin functions, and UI in your test specs. Do not directly invoke any private functions. ie. only call or mock functions and objects exposed by openmct.* (eg. openmct.telemetry, openmct.objectView, etc.), and builtin browser functions (fetch, requestAnimationFrame, setTimeout, etc.).
|
||||||
|
* Where builtin functions have been mocked, be sure to clear them between tests.
|
||||||
|
* Test at an appropriate level of isolation. Eg.
|
||||||
|
* If you’re testing a view, you do not need to test the whole application UI, you can just fetch the view provider using the public API and render the view into an element that you have created.
|
||||||
|
* You do not need to test that the view switcher works, there should be separate tests for that.
|
||||||
|
* You do not need to test that telemetry providers work, you can mock openmct.telemetry.request() to feed test data to the view.
|
||||||
|
* Use your best judgement when deciding on appropriate scope.
|
||||||
|
* Automated tests for plugins should start by actually installing the plugin being tested, and then test that installing the plugin adds the desired features and behavior to Open MCT, observing the above rules.
|
||||||
|
* All variables used in a test spec, including any instances of the Open MCT API should be declared inside of an appropriate block scope (not at the root level of the source file), and should be initialized in the relevant beforeEach block. `beforeEach` is preferable to `beforeAll` to avoid leaking of state between tests.
|
||||||
|
* A `afterEach` or `afterAll` should be used to do any clean up necessary to prevent leakage of state between test specs. This can happen when functions on `window` are wrapped, or when the URL is changed. [A convenience function](https://github.com/nasa/openmct/blob/master/src/utils/testing.js#L59) is provided for resetting the URL and clearing builtin spies between tests.
|
||||||
|
* If writing unit tests for legacy Angular code be sure to follow [best practices in order to avoid memory leaks](https://www.thecodecampus.de/blog/avoid-memory-leaks-angularjs-unit-tests/).
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
* [Example of an automated test spec for an object view plugin](https://github.com/nasa/openmct/blob/master/src/plugins/telemetryTable/pluginSpec.js)
|
||||||
|
* [Example of an automated test spec for API](https://github.com/nasa/openmct/blob/master/src/api/time/TimeAPISpec.js)
|
||||||
|
|
||||||
### Commit Message Standards
|
### Commit Message Standards
|
||||||
|
|
||||||
@ -292,6 +326,7 @@ checklist).
|
|||||||
2. Unit tests included and/or updated with changes?
|
2. Unit tests included and/or updated with changes?
|
||||||
3. Command line build passes?
|
3. Command line build passes?
|
||||||
4. Changes have been smoke-tested?
|
4. Changes have been smoke-tested?
|
||||||
|
5. Testing instructions included?
|
||||||
|
|
||||||
### Reviewer Checklist
|
### Reviewer Checklist
|
||||||
|
|
||||||
@ -299,3 +334,4 @@ checklist).
|
|||||||
2. Appropriate unit tests included?
|
2. Appropriate unit tests included?
|
||||||
3. Code style and in-line documentation are appropriate?
|
3. Code style and in-line documentation are appropriate?
|
||||||
4. Commit messages meet standards?
|
4. Commit messages meet standards?
|
||||||
|
5. Has associated issue been labelled `unverified`? (only applicable if this PR closes the issue)
|
||||||
|
7
LICENSE.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Open MCT License
|
||||||
|
|
||||||
|
Open MCT, Copyright (c) 2014-2020, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.
|
||||||
|
|
||||||
|
Open MCT is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
691
LICENSES.md
@ -1,691 +0,0 @@
|
|||||||
# Open MCT Licenses
|
|
||||||
|
|
||||||
Open MCT, Copyright (c) 2014-2017, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.
|
|
||||||
|
|
||||||
Open MCT is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
|
|
||||||
Open MCT includes source code licensed under additional open source licenses as follows.
|
|
||||||
|
|
||||||
## Software Components Licenses
|
|
||||||
|
|
||||||
This software includes components released under the following licenses:
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### SuperSocket
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://supersocket.codeplex.com/
|
|
||||||
|
|
||||||
* Version: 0.9.0.2
|
|
||||||
|
|
||||||
* Author: Kerry Jiang
|
|
||||||
|
|
||||||
* Description: Supports SuperWebSocket
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright 2012 Kerry Jiang (kerry-jiang@hotmail.com)
|
|
||||||
|
|
||||||
SuperSocket is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### SuperWebSocket
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://superswebocket.codeplex.com/
|
|
||||||
|
|
||||||
* Version: 0.9.0.2
|
|
||||||
|
|
||||||
* Author: Kerry Jiang
|
|
||||||
|
|
||||||
* Description: WebSocket implementation for client-server communication
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright 2010-2013 Kerry Jiang (kerry-jiang@hotmail.com)
|
|
||||||
|
|
||||||
SuperWebSocket is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### log4net
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://logging.apache.org/log4net/
|
|
||||||
|
|
||||||
* Version: 1.2.13
|
|
||||||
|
|
||||||
* Author: Apache Software Foundation
|
|
||||||
|
|
||||||
* Description: Logging.
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright © 2004-2015 Apache Software Foundation.
|
|
||||||
|
|
||||||
log4net is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Blanket.js
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://blanketjs.org/
|
|
||||||
|
|
||||||
* Version: 1.1.5
|
|
||||||
|
|
||||||
* Author: Alex Seville
|
|
||||||
|
|
||||||
* Description: Code coverage measurement and reporting
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2013 Alex Seville
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Jasmine
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://jasmine.github.io/
|
|
||||||
|
|
||||||
* Version: 1.3.1
|
|
||||||
|
|
||||||
* Author: Pivotal Labs
|
|
||||||
|
|
||||||
* Description: Unit testing
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2008-2011 Pivotal Labs
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### RequireJS
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://requirejs.org/
|
|
||||||
|
|
||||||
* Version: 2.1.22
|
|
||||||
|
|
||||||
* Author: The Dojo Foundation
|
|
||||||
|
|
||||||
* Description: Script loader
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2015, The Dojo Foundation
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### requirejs-text
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/requirejs/text
|
|
||||||
|
|
||||||
* Version: 2.0.14
|
|
||||||
|
|
||||||
* Author: The Dojo Foundation
|
|
||||||
|
|
||||||
* Description: Text loading plugin for RequireJS
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2014, The Dojo Foundation
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### AngularJS
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://angularjs.org/
|
|
||||||
|
|
||||||
* Version: 1.4.4
|
|
||||||
|
|
||||||
* Author: Google
|
|
||||||
|
|
||||||
* Description: Client-side web application framework
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Angular-Route
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://angularjs.org/
|
|
||||||
|
|
||||||
* Version: 1.4.4
|
|
||||||
|
|
||||||
* Author: Google
|
|
||||||
|
|
||||||
* Description: Client-side view routing
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### ES6-Promise
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/jakearchibald/es6-promise
|
|
||||||
|
|
||||||
* Version: 3.0.2
|
|
||||||
|
|
||||||
* Authors: Yehuda Katz, Tom Dale, Stefan Penner and contributors
|
|
||||||
|
|
||||||
* Description: Promise polyfill for pre-ECMAScript 6 browsers
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### screenfull.js
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/sindresorhus/screenfull.js/
|
|
||||||
|
|
||||||
* Version: 3.0.0
|
|
||||||
|
|
||||||
* Author: Sindre Sorhus
|
|
||||||
|
|
||||||
* Description: Wrapper for cross-browser usage of fullscreen API
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Math.uuid.js
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/broofa/node-uuid
|
|
||||||
|
|
||||||
* Version: 1.4.7
|
|
||||||
|
|
||||||
* Author: Robert Kieffer
|
|
||||||
|
|
||||||
* Description: Unique identifer generation.
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Robert Kieffer
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Normalize.css
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/necolas/normalize.css
|
|
||||||
|
|
||||||
* Version: 1.1.2
|
|
||||||
|
|
||||||
* Authors: Nicolas Gallagher, Jonathan Neal
|
|
||||||
|
|
||||||
* Description: Browser style normalization
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) Nicolas Gallagher and Jonathan Neal
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Moment.js
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://momentjs.com
|
|
||||||
|
|
||||||
* Version: 2.11.1
|
|
||||||
|
|
||||||
* Authors: Tim Wood, Iskren Chernev, Moment.js contributors
|
|
||||||
|
|
||||||
* Description: Time/date parsing/formatting
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### moment-duration-format
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/jsmreese/moment-duration-format
|
|
||||||
|
|
||||||
* Version: 1.3.0
|
|
||||||
|
|
||||||
* Authors: John Madhavan-Reese
|
|
||||||
|
|
||||||
* Description: Duration parsing/formatting
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright 2014 John Madhavan-Reese
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### CSV.js
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/knrz/CSV.js
|
|
||||||
|
|
||||||
* Version: 3.6.4
|
|
||||||
|
|
||||||
* Authors: Kash Nouroozi
|
|
||||||
|
|
||||||
* Description: Encoder for CSV (comma separated values) export
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2014 Kash Nouroozi
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### FileSaver.js
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: https://github.com/eligrey/FileSaver.js/
|
|
||||||
|
|
||||||
* Version: 0.0.2
|
|
||||||
|
|
||||||
* Authors: Eli Grey
|
|
||||||
|
|
||||||
* Description: File download initiator (for file exports)
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright © 2015 Eli Grey.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Zepto
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://zeptojs.com/
|
|
||||||
|
|
||||||
* Version: 1.1.6
|
|
||||||
|
|
||||||
* Authors: Thomas Fuchs
|
|
||||||
|
|
||||||
* Description: DOM manipulation
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2016 Thomas Fuchs
|
|
||||||
http://zeptojs.com/
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Json.NET
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://www.newtonsoft.com/json
|
|
||||||
|
|
||||||
* Version: 6.0.8
|
|
||||||
|
|
||||||
* Author: Newtonsoft
|
|
||||||
|
|
||||||
* Description: JSON serialization/deserialization
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright (c) 2007 James Newton-King
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Nancy
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://nancyfx.org
|
|
||||||
|
|
||||||
* Version: 0.23.2
|
|
||||||
|
|
||||||
* Author: Andreas Håkansson, Steven Robbins and contributors
|
|
||||||
|
|
||||||
* Description: Embedded web server
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Nancy.Hosting.Self
|
|
||||||
|
|
||||||
#### Info
|
|
||||||
|
|
||||||
* Link: http://nancyfx.org
|
|
||||||
|
|
||||||
* Version: 0.23.2
|
|
||||||
|
|
||||||
* Author: Andreas Håkansson, Steven Robbins and contributors
|
|
||||||
|
|
||||||
* Description: Embedded web server
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Almond
|
|
||||||
|
|
||||||
* Link: https://github.com/requirejs/almond
|
|
||||||
|
|
||||||
* Version: 0.3.3
|
|
||||||
|
|
||||||
* Author: jQuery Foundation
|
|
||||||
|
|
||||||
* Description: Lightweight RequireJS replacement for builds
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright jQuery Foundation and other contributors, https://jquery.org/
|
|
||||||
|
|
||||||
This software consists of voluntary contributions made by many
|
|
||||||
individuals. For exact contribution history, see the revision history
|
|
||||||
available at https://github.com/requirejs/almond
|
|
||||||
|
|
||||||
The following license applies to all parts of this software except as
|
|
||||||
documented below:
|
|
||||||
|
|
||||||
====
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
====
|
|
||||||
|
|
||||||
Copyright and related rights for sample code are waived via CC0. Sample
|
|
||||||
code is defined as all source code displayed within the prose of the
|
|
||||||
documentation.
|
|
||||||
|
|
||||||
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
|
||||||
|
|
||||||
====
|
|
||||||
|
|
||||||
Files located in the node_modules directory, and certain utilities used
|
|
||||||
to build or test the software in the test and dist directories, are
|
|
||||||
externally maintained libraries used by this software which have their own
|
|
||||||
licenses; we recommend you read them, as their terms may differ from the
|
|
||||||
terms above.
|
|
||||||
|
|
||||||
|
|
||||||
### Lodash
|
|
||||||
|
|
||||||
* Link: https://lodash.com
|
|
||||||
|
|
||||||
* Version: 3.10.1
|
|
||||||
|
|
||||||
* Author: Dojo Foundation
|
|
||||||
|
|
||||||
* Description: Utility functions
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
|
||||||
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
|
|
||||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
### EventEmitter3
|
|
||||||
|
|
||||||
* Link: https://github.com/primus/eventemitter3
|
|
||||||
|
|
||||||
* Version: 1.2.0
|
|
||||||
|
|
||||||
* Author: Arnout Kazemier
|
|
||||||
|
|
||||||
* Description: Event-driven programming support
|
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014 Arnout Kazemier
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
96
README.md
@ -9,26 +9,6 @@ Please visit our [Official Site](https://nasa.github.io/openmct/) and [Getting S
|
|||||||
Try Open MCT now with our [live demo](https://openmct-demo.herokuapp.com/).
|
Try Open MCT now with our [live demo](https://openmct-demo.herokuapp.com/).
|
||||||

|

|
||||||
|
|
||||||
## New API
|
|
||||||
|
|
||||||
A simpler, [easier-to-use API](https://nasa.github.io/openmct/docs/api/)
|
|
||||||
has been added to Open MCT. Changes in this
|
|
||||||
API include a move away from a declarative system of JSON configuration files
|
|
||||||
towards an imperative system based on function calls. Developers will be able
|
|
||||||
to extend and build on Open MCT by making direct function calls to a public
|
|
||||||
API. Open MCT is also being refactored to minimize the dependencies that using
|
|
||||||
Open MCT imposes on developers, such as the current requirement to use
|
|
||||||
AngularJS.
|
|
||||||
|
|
||||||
This new API has not yet been heavily used and is likely to contain defects.
|
|
||||||
You can help by trying it out, and reporting any issues you encounter
|
|
||||||
using our GitHub issue tracker. Such issues may include bugs, suggestions,
|
|
||||||
missing documentation, or even just requests for help if you're having
|
|
||||||
trouble.
|
|
||||||
|
|
||||||
We want Open MCT to be as easy to use, install, run, and develop for as
|
|
||||||
possible, and your feedback will help us get there!
|
|
||||||
|
|
||||||
## Building and Running Open MCT Locally
|
## Building and Running Open MCT Locally
|
||||||
|
|
||||||
Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website.
|
Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website.
|
||||||
@ -48,9 +28,14 @@ Building and running Open MCT in your local dev environment is very easy. Be sur
|
|||||||
|
|
||||||
Open MCT is now running, and can be accessed by pointing a web browser at [http://localhost:8080/](http://localhost:8080/)
|
Open MCT is now running, and can be accessed by pointing a web browser at [http://localhost:8080/](http://localhost:8080/)
|
||||||
|
|
||||||
|
## Open MCT v1.0.0
|
||||||
|
This represents a major overhaul of Open MCT with significant changes under the hood. We aim to maintain backward compatibility but if you do find compatibility issues, please let us know by filing an issue in this repository. If you are having major issues with v1.0.0 please check-out the v0.14.0 tag until we can resolve them for you.
|
||||||
|
|
||||||
|
If you are migrating an application built with Open MCT as a dependency to v1.0.0 from an earlier version, please refer to [our migration guide](https://nasa.github.io/openmct/documentation/migration-guide).
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Documentation is available on the [Open MCT website](https://nasa.github.io/openmct/documentation/). The documentation can also be built locally.
|
Documentation is available on the [Open MCT website](https://nasa.github.io/openmct/documentation/).
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
@ -58,48 +43,29 @@ The clearest examples for developing Open MCT plugins are in the
|
|||||||
[tutorials](https://github.com/nasa/openmct-tutorial) provided in
|
[tutorials](https://github.com/nasa/openmct-tutorial) provided in
|
||||||
our documentation.
|
our documentation.
|
||||||
|
|
||||||
For a practical example of a telemetry adapter, see David Hudson's
|
We want Open MCT to be as easy to use, install, run, and develop for as
|
||||||
[Kerbal Space Program plugin](https://github.com/hudsonfoo/kerbal-openmct),
|
possible, and your feedback will help us get there! Feedback can be provided via [GitHub issues](https://github.com/nasa/openmct/issues), or by emailing us at [arc-dl-openmct@mail.nasa.gov](mailto:arc-dl-openmct@mail.nasa.gov).
|
||||||
which allows [Kerbal Space Program](https://kerbalspaceprogram.com) players
|
|
||||||
to build and use displays for their own missions in Open MCT.
|
|
||||||
|
|
||||||
Additional examples are available in the `examples` hierarchy of this
|
## Building Applications With Open MCT
|
||||||
repository; however, be aware that these examples are
|
|
||||||
[not fully-documented](https://github.com/nasa/openmct/issues/846), so
|
|
||||||
the tutorials will likely serve as a better starting point.
|
|
||||||
|
|
||||||
### Building the Open MCT Documentation Locally
|
Open MCT is built using [`npm`](http://npmjs.com/) and [`webpack`](https://webpack.js.org/).
|
||||||
Open MCT's documentation is generated by an
|
|
||||||
[npm](https://www.npmjs.com/)-based build. It has additional dependencies that
|
|
||||||
may not be available on every platform and thus is not covered in the standard
|
|
||||||
npm install. Ensure your system has [libcairo](http://cairographics.org/)
|
|
||||||
installed and then run the following commands:
|
|
||||||
|
|
||||||
* `npm install`
|
See our documentation for a guide on [building Applications with Open MCT](https://github.com/nasa/openmct/blob/master/API.md#starting-an-open-mct-application).
|
||||||
* `npm install canvas nomnoml`
|
|
||||||
* `npm run docs`
|
|
||||||
|
|
||||||
Documentation will be generated in `target/docs`.
|
## Plugins
|
||||||
|
|
||||||
## Deploying Open MCT
|
Open MCT can be extended via plugins that make calls to the Open MCT API. A plugin is a group
|
||||||
|
of software components (including source code and resources such as images and HTML templates)
|
||||||
|
that is intended to be added or removed as a single unit.
|
||||||
|
|
||||||
Open MCT is built using [`npm`](http://npmjs.com/)
|
As well as providing an extension mechanism, most of the core Open MCT codebase is also
|
||||||
|
written as plugins.
|
||||||
|
|
||||||
To build Open MCT for deployment:
|
For information on writing plugins, please see [our API documentation](https://github.com/nasa/openmct/blob/master/API.md#plugins).
|
||||||
|
|
||||||
`npm run prepare`
|
|
||||||
|
|
||||||
This will compile and minify JavaScript sources, as well as copy over assets.
|
|
||||||
The contents of the `dist` folder will contain a runnable Open MCT
|
|
||||||
instance (e.g. by starting an HTTP server in that directory), including:
|
|
||||||
|
|
||||||
* `openmct.js` - Open MCT source code.
|
|
||||||
* `openmct.css` - Basic styles to load to prevent a FOUC.
|
|
||||||
* `index.html`, an example to run Open MCT in the basic configuration.
|
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Tests are written for [Jasmine 3](http://jasmine.github.io/)
|
Tests are written for [Jasmine 3](https://jasmine.github.io/api/3.1/global)
|
||||||
and run by [Karma](http://karma-runner.github.io). To run:
|
and run by [Karma](http://karma-runner.github.io). To run:
|
||||||
|
|
||||||
`npm test`
|
`npm test`
|
||||||
@ -115,7 +81,7 @@ naming convention is otherwise the same.)
|
|||||||
### Test Reporting
|
### Test Reporting
|
||||||
|
|
||||||
When `npm test` is run, test results will be written as HTML to
|
When `npm test` is run, test results will be written as HTML to
|
||||||
`target/tests`. Code coverage information is written to `target/coverage`.
|
`dist/reports/tests/`. Code coverage information is written to `dist/reports/coverage`.
|
||||||
|
|
||||||
# Glossary
|
# Glossary
|
||||||
|
|
||||||
@ -125,11 +91,8 @@ addressed (either by updating this glossary or changing code to reflect
|
|||||||
correct usage.) Other developer documentation, particularly in-line
|
correct usage.) Other developer documentation, particularly in-line
|
||||||
documentation, may presume an understanding of these terms.
|
documentation, may presume an understanding of these terms.
|
||||||
|
|
||||||
* _bundle_: A bundle is a removable, reusable grouping of software elements.
|
* _plugin_: A plugin is a removable, reusable grouping of software elements.
|
||||||
The application is composed of bundles. Plug-ins are bundles. For more
|
The application is composed of plugins.
|
||||||
information, refer to framework documentation (under `platform/framework`.)
|
|
||||||
* _capability_: An object which exposes dynamic behavior or non-persistent
|
|
||||||
state associated with a domain object.
|
|
||||||
* _composition_: In the context of a domain object, this refers to the set of
|
* _composition_: In the context of a domain object, this refers to the set of
|
||||||
other domain objects that compose or are contained by that object. A domain
|
other domain objects that compose or are contained by that object. A domain
|
||||||
object's composition is the set of domain objects that should appear
|
object's composition is the set of domain objects that should appear
|
||||||
@ -144,13 +107,8 @@ documentation, may presume an understanding of these terms.
|
|||||||
* _domain object_: A meaningful object to the user; a distinct thing in
|
* _domain object_: A meaningful object to the user; a distinct thing in
|
||||||
the work support by Open MCT. Anything that appears in the left-hand
|
the work support by Open MCT. Anything that appears in the left-hand
|
||||||
tree is a domain object.
|
tree is a domain object.
|
||||||
* _extension_: An extension is a unit of functionality exposed to the
|
* _identifier_: A tuple consisting of a namespace and a key, which together uniquely
|
||||||
platform in a declarative fashion by a bundle. For more
|
identifies a domain object.
|
||||||
information, refer to framework documentation (under `platform/framework`.)
|
|
||||||
* _id_: A string which uniquely identifies a domain object.
|
|
||||||
* _key_: When used as an object property, this refers to the machine-readable
|
|
||||||
identifier for a specific thing in a set of things. (Most often used in the
|
|
||||||
context of extensions or other similar application-specific object sets.)
|
|
||||||
* _model_: The persistent state associated with a domain object. A domain
|
* _model_: The persistent state associated with a domain object. A domain
|
||||||
object's model is a JavaScript object which can be converted to JSON
|
object's model is a JavaScript object which can be converted to JSON
|
||||||
without losing information (that is, it contains no methods.)
|
without losing information (that is, it contains no methods.)
|
||||||
@ -162,7 +120,5 @@ documentation, may presume an understanding of these terms.
|
|||||||
a user clicks on a domain object in the tree, they are _navigating_ to
|
a user clicks on a domain object in the tree, they are _navigating_ to
|
||||||
it, and it is thereafter considered the _navigated_ object (until the
|
it, and it is thereafter considered the _navigated_ object (until the
|
||||||
user makes another such choice.)
|
user makes another such choice.)
|
||||||
* _space_: A name used to identify a persistence store. Interactions with
|
* _namespace_: A name used to identify a persistence store. A running open MCT
|
||||||
persistence will generally involve a `space` parameter in some form, to
|
application could potentially use multiple persistence stores, with the
|
||||||
distinguish multiple persistence stores from one another (for cases
|
|
||||||
where there are multiple valid persistence locations available.)
|
|
||||||
|
2
app.js
@ -16,7 +16,7 @@ const request = require('request');
|
|||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
options.port = options.port || options.p || 8080;
|
options.port = options.port || options.p || 8080;
|
||||||
options.host = options.host || options.h || 'localhost';
|
options.host = options.host || 'localhost';
|
||||||
options.directory = options.directory || options.D || '.';
|
options.directory = options.directory || options.D || '.';
|
||||||
|
|
||||||
// Show command line options
|
// Show command line options
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2018, United States Government
|
Open MCT, Copyright (c) 2014-2020, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
@ -18,4 +18,4 @@
|
|||||||
licenses. See the Open Source Licenses file (LICENSES.md) included with
|
licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
this source code distribution or the Licensing information page available
|
this source code distribution or the Licensing information page available
|
||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
* Open MCT, Copyright (c) 2014-2020, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -18,4 +18,4 @@
|
|||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@ -33,5 +33,5 @@ As we transition to a new API, the following documentation for the old API
|
|||||||
* The [Developer's Guide](guide/) goes into more detail about how to use the
|
* The [Developer's Guide](guide/) goes into more detail about how to use the
|
||||||
platform and the functionality that it provides.
|
platform and the functionality that it provides.
|
||||||
|
|
||||||
* The [Tutorials](tutorials/) give examples of extending the platform to add
|
* The [Tutorials](https://github.com/nasa/openmct-tutorial) give examples of extending the platform to add
|
||||||
functionality, and integrate with data sources.
|
functionality, and integrate with data sources.
|
||||||
|
@ -125,3 +125,22 @@ A release is not closed until both categories have been performed on
|
|||||||
the latest snapshot of the software, _and_ no issues labelled as
|
the latest snapshot of the software, _and_ no issues labelled as
|
||||||
["blocker" or "critical"](https://github.com/nasa/openmctweb/blob/master/CONTRIBUTING.md#issue-reporting)
|
["blocker" or "critical"](https://github.com/nasa/openmctweb/blob/master/CONTRIBUTING.md#issue-reporting)
|
||||||
remain open.
|
remain open.
|
||||||
|
|
||||||
|
### Testathons
|
||||||
|
Testathons can be used as a means of performing per-sprint and per-release testing.
|
||||||
|
|
||||||
|
#### Timing
|
||||||
|
For per-sprint testing, a testathon is typically performed at the beginning of the third week of a sprint, and again later that week to verify any fixes. For per-release testing, a testathon is typically performed prior to any formal testing processes that are applicable to that release.
|
||||||
|
|
||||||
|
#### Process
|
||||||
|
|
||||||
|
1. Prior to the scheduled testathon, a list will be compiled of all issues that are closed and unverified.
|
||||||
|
2. For each issue, testers should review the associated PR for testing instructions. See the contributing guide for instructions on [pull requests](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md#merging).
|
||||||
|
3. As each issue is verified via testing, any team members testing it should leave a comment on that issue indicating that it has been verified fixed.
|
||||||
|
4. If a bug is found that relates to an issue being tested, notes should be included on the associated issue, and the issue should be reopened. Bug notes should include reproduction steps.
|
||||||
|
5. For any bugs that are not obviously related to any of the issues under test, a new issue should be created with details about the bug, including reproduction steps. If unsure about whether a bug relates to an issue being tested, just create a new issue.
|
||||||
|
6. At the end of the testathon, triage will take place, where all tested issues will be reviewed.
|
||||||
|
7. If verified fixed, an issue will remain closed, and will have the “unverified” label removed.
|
||||||
|
8. For any bugs found, a severity will be assigned.
|
||||||
|
9. A second testathon will be scheduled for later in the week that will aim to address all issues identified as blockers, as well as any other issues scoped by the team during triage.
|
||||||
|
10. Any issues that were not tested will remain "unverified" and will be picked up in the next testathon.
|
||||||
|
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 43 KiB |
@ -9,7 +9,8 @@ define([
|
|||||||
values: [
|
values: [
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
name: "Name"
|
name: "Name",
|
||||||
|
format: "string"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "utc",
|
key: "utc",
|
||||||
@ -27,6 +28,16 @@ define([
|
|||||||
domain: 2
|
domain: 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Need to enable "LocalTimeSystem" plugin to make use of this
|
||||||
|
// {
|
||||||
|
// key: "local",
|
||||||
|
// name: "Time",
|
||||||
|
// format: "local-format",
|
||||||
|
// source: "utc",
|
||||||
|
// hints: {
|
||||||
|
// domain: 3
|
||||||
|
// }
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
key: "sin",
|
key: "sin",
|
||||||
name: "Sine",
|
name: "Sine",
|
||||||
@ -49,7 +60,8 @@ define([
|
|||||||
values: [
|
values: [
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
name: "Name"
|
name: "Name",
|
||||||
|
format: "string"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "utc",
|
key: "utc",
|
||||||
@ -59,6 +71,15 @@ define([
|
|||||||
domain: 1
|
domain: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "local",
|
||||||
|
name: "Time",
|
||||||
|
format: "utc",
|
||||||
|
source: "utc",
|
||||||
|
hints: {
|
||||||
|
domain: 2
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "state",
|
key: "state",
|
||||||
source: "value",
|
source: "value",
|
||||||
@ -98,7 +119,7 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) {
|
GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) {
|
||||||
return _.extend(
|
return Object.assign(
|
||||||
{},
|
{},
|
||||||
domainObject.telemetry,
|
domainObject.telemetry,
|
||||||
METADATA_BY_TYPE[domainObject.type]
|
METADATA_BY_TYPE[domainObject.type]
|
||||||
|
@ -31,6 +31,7 @@ define([
|
|||||||
period: 10,
|
period: 10,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
dataRateInHz: 1,
|
dataRateInHz: 1,
|
||||||
|
randomness: 0,
|
||||||
phase: 0
|
phase: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,7 +53,8 @@ define([
|
|||||||
'period',
|
'period',
|
||||||
'offset',
|
'offset',
|
||||||
'dataRateInHz',
|
'dataRateInHz',
|
||||||
'phase'
|
'phase',
|
||||||
|
'randomness'
|
||||||
];
|
];
|
||||||
|
|
||||||
request = request || {};
|
request = request || {};
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
name: data.name,
|
name: data.name,
|
||||||
utc: nextStep,
|
utc: nextStep,
|
||||||
yesterday: nextStep - 60*60*24*1000,
|
yesterday: nextStep - 60*60*24*1000,
|
||||||
sin: sin(nextStep, data.period, data.amplitude, data.offset, data.phase),
|
sin: sin(nextStep, data.period, data.amplitude, data.offset, data.phase, data.randomness),
|
||||||
cos: cos(nextStep, data.period, data.amplitude, data.offset, data.phase)
|
cos: cos(nextStep, data.period, data.amplitude, data.offset, data.phase, data.randomness)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
nextStep += step;
|
nextStep += step;
|
||||||
@ -99,6 +99,7 @@
|
|||||||
var offset = request.offset;
|
var offset = request.offset;
|
||||||
var dataRateInHz = request.dataRateInHz;
|
var dataRateInHz = request.dataRateInHz;
|
||||||
var phase = request.phase;
|
var phase = request.phase;
|
||||||
|
var randomness = request.randomness;
|
||||||
|
|
||||||
var step = 1000 / dataRateInHz;
|
var step = 1000 / dataRateInHz;
|
||||||
var nextStep = start - (start % step) + step;
|
var nextStep = start - (start % step) + step;
|
||||||
@ -110,8 +111,8 @@
|
|||||||
name: request.name,
|
name: request.name,
|
||||||
utc: nextStep,
|
utc: nextStep,
|
||||||
yesterday: nextStep - 60*60*24*1000,
|
yesterday: nextStep - 60*60*24*1000,
|
||||||
sin: sin(nextStep, period, amplitude, offset, phase),
|
sin: sin(nextStep, period, amplitude, offset, phase, randomness),
|
||||||
cos: cos(nextStep, period, amplitude, offset, phase)
|
cos: cos(nextStep, period, amplitude, offset, phase, randomness)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
self.postMessage({
|
self.postMessage({
|
||||||
@ -120,14 +121,14 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function cos(timestamp, period, amplitude, offset, phase) {
|
function cos(timestamp, period, amplitude, offset, phase, randomness) {
|
||||||
return amplitude *
|
return amplitude *
|
||||||
Math.cos(phase + (timestamp / period / 1000 * Math.PI * 2)) + offset;
|
Math.cos(phase + (timestamp / period / 1000 * Math.PI * 2)) + (amplitude * Math.random() * randomness) + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sin(timestamp, period, amplitude, offset, phase) {
|
function sin(timestamp, period, amplitude, offset, phase, randomness) {
|
||||||
return amplitude *
|
return amplitude *
|
||||||
Math.sin(phase + (timestamp / period / 1000 * Math.PI * 2)) + offset;
|
Math.sin(phase + (timestamp / period / 1000 * Math.PI * 2)) + (amplitude * Math.random() * randomness) + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendError(error, message) {
|
function sendError(error, message) {
|
||||||
|
@ -122,6 +122,17 @@ define([
|
|||||||
"telemetry",
|
"telemetry",
|
||||||
"phase"
|
"phase"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Randomness",
|
||||||
|
control: "numberfield",
|
||||||
|
cssClass: "l-input-sm l-numeric",
|
||||||
|
key: "randomness",
|
||||||
|
required: true,
|
||||||
|
property: [
|
||||||
|
"telemetry",
|
||||||
|
"randomness"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
initialize: function (object) {
|
initialize: function (object) {
|
||||||
@ -130,7 +141,8 @@ define([
|
|||||||
amplitude: 1,
|
amplitude: 1,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
dataRateInHz: 1,
|
dataRateInHz: 1,
|
||||||
phase: 0
|
phase: 0,
|
||||||
|
randomness: 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -52,6 +52,7 @@ define([
|
|||||||
return {
|
return {
|
||||||
name: name,
|
name: name,
|
||||||
utc: Math.floor(timestamp / 5000) * 5000,
|
utc: Math.floor(timestamp / 5000) * 5000,
|
||||||
|
local: Math.floor(timestamp / 5000) * 5000,
|
||||||
url: IMAGE_SAMPLES[Math.floor(timestamp / 5000) % IMAGE_SAMPLES.length]
|
url: IMAGE_SAMPLES[Math.floor(timestamp / 5000) % IMAGE_SAMPLES.length]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -78,7 +79,7 @@ define([
|
|||||||
},
|
},
|
||||||
request: function (domainObject, options) {
|
request: function (domainObject, options) {
|
||||||
var start = options.start;
|
var start = options.start;
|
||||||
var end = options.end;
|
var end = Math.min(options.end, Date.now());
|
||||||
var data = [];
|
var data = [];
|
||||||
while (start <= end && data.length < 5000) {
|
while (start <= end && data.length < 5000) {
|
||||||
data.push(pointForTimestamp(start, domainObject.name));
|
data.push(pointForTimestamp(start, domainObject.name));
|
||||||
@ -118,6 +119,14 @@ define([
|
|||||||
name: 'Time',
|
name: 'Time',
|
||||||
key: 'utc',
|
key: 'utc',
|
||||||
format: 'utc',
|
format: 'utc',
|
||||||
|
hints: {
|
||||||
|
domain: 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Local Time',
|
||||||
|
key: 'local',
|
||||||
|
format: 'local-format',
|
||||||
hints: {
|
hints: {
|
||||||
domain: 1
|
domain: 1
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="example">{{ msg }}</div>
|
<div class="example">{{ msg }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Hello world!'
|
msg: 'Hello world!'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
49
index.html
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2017, United States Government
|
Open MCT, Copyright (c) 2014-2020, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
@ -34,17 +34,18 @@
|
|||||||
<body>
|
<body>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
const FIVE_MINUTES = 5 * 60 * 1000;
|
const THIRTY_SECONDS = 30 * 1000;
|
||||||
const THIRTY_MINUTES = 30 * 60 * 1000;
|
const THIRTY_MINUTES = THIRTY_SECONDS * 60;
|
||||||
|
|
||||||
[
|
[
|
||||||
'example/eventGenerator',
|
'example/eventGenerator'
|
||||||
'example/styleguide'
|
|
||||||
].forEach(
|
].forEach(
|
||||||
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
|
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
|
||||||
);
|
);
|
||||||
openmct.install(openmct.plugins.MyItems());
|
|
||||||
openmct.install(openmct.plugins.LocalStorage());
|
openmct.install(openmct.plugins.LocalStorage());
|
||||||
|
openmct.install(openmct.plugins.Espresso());
|
||||||
|
openmct.install(openmct.plugins.MyItems());
|
||||||
openmct.install(openmct.plugins.Generator());
|
openmct.install(openmct.plugins.Generator());
|
||||||
openmct.install(openmct.plugins.ExampleImagery());
|
openmct.install(openmct.plugins.ExampleImagery());
|
||||||
openmct.install(openmct.plugins.UTCTimeSystem());
|
openmct.install(openmct.plugins.UTCTimeSystem());
|
||||||
@ -62,7 +63,39 @@
|
|||||||
bounds: {
|
bounds: {
|
||||||
start: Date.now() - THIRTY_MINUTES,
|
start: Date.now() - THIRTY_MINUTES,
|
||||||
end: Date.now()
|
end: Date.now()
|
||||||
}
|
},
|
||||||
|
// commonly used bounds can be stored in history
|
||||||
|
// bounds (start and end) can accept either a milliseconds number
|
||||||
|
// or a callback function returning a milliseconds number
|
||||||
|
// a function is useful for invoking Date.now() at exact moment of preset selection
|
||||||
|
presets: [
|
||||||
|
{
|
||||||
|
label: 'Last Day',
|
||||||
|
bounds: {
|
||||||
|
start: () => Date.now() - 1000 * 60 * 60 * 24,
|
||||||
|
end: () => Date.now()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Last 2 hours',
|
||||||
|
bounds: {
|
||||||
|
start: () => Date.now() - 1000 * 60 * 60 * 2,
|
||||||
|
end: () => Date.now()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Last hour',
|
||||||
|
bounds: {
|
||||||
|
start: () => Date.now() - 1000 * 60 * 60,
|
||||||
|
end: () => Date.now()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// maximum recent bounds to retain in conductor history
|
||||||
|
records: 10,
|
||||||
|
// maximum duration between start and end bounds
|
||||||
|
// for utc-based time systems this is in milliseconds
|
||||||
|
limit: 1000 * 60 * 60 * 24
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Realtime",
|
name: "Realtime",
|
||||||
@ -70,7 +103,7 @@
|
|||||||
clock: 'local',
|
clock: 'local',
|
||||||
clockOffsets: {
|
clockOffsets: {
|
||||||
start: - THIRTY_MINUTES,
|
start: - THIRTY_MINUTES,
|
||||||
end: FIVE_MINUTES
|
end: THIRTY_SECONDS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -24,16 +24,27 @@
|
|||||||
|
|
||||||
const devMode = process.env.NODE_ENV !== 'production';
|
const devMode = process.env.NODE_ENV !== 'production';
|
||||||
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'];
|
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'];
|
||||||
|
const coverageEnabled = process.env.COVERAGE === 'true';
|
||||||
|
const reporters = ['progress', 'html'];
|
||||||
|
|
||||||
|
if (coverageEnabled) {
|
||||||
|
reporters.push('coverage-istanbul');
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = (config) => {
|
module.exports = (config) => {
|
||||||
const webpackConfig = require('./webpack.config.js');
|
const webpackConfig = require('./webpack.config.js');
|
||||||
delete webpackConfig.output;
|
delete webpackConfig.output;
|
||||||
|
|
||||||
if (!devMode) {
|
if (!devMode || coverageEnabled) {
|
||||||
webpackConfig.module.rules.push({
|
webpackConfig.module.rules.push({
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: /node_modules|example/,
|
exclude: /node_modules|example|lib|dist/,
|
||||||
use: 'istanbul-instrumenter-loader'
|
use: {
|
||||||
|
loader: 'istanbul-instrumenter-loader',
|
||||||
|
options: {
|
||||||
|
esModules: true
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,11 +56,7 @@ module.exports = (config) => {
|
|||||||
'src/**/*Spec.js'
|
'src/**/*Spec.js'
|
||||||
],
|
],
|
||||||
port: 9876,
|
port: 9876,
|
||||||
reporters: [
|
reporters: reporters,
|
||||||
'progress',
|
|
||||||
'coverage',
|
|
||||||
'html'
|
|
||||||
],
|
|
||||||
browsers: browsers,
|
browsers: browsers,
|
||||||
customLaunchers: {
|
customLaunchers: {
|
||||||
ChromeDebugging: {
|
ChromeDebugging: {
|
||||||
@ -61,27 +68,27 @@ module.exports = (config) => {
|
|||||||
colors: true,
|
colors: true,
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
coverageReporter: {
|
|
||||||
dir: process.env.CIRCLE_ARTIFACTS ?
|
|
||||||
process.env.CIRCLE_ARTIFACTS + '/coverage' :
|
|
||||||
"dist/reports/coverage",
|
|
||||||
check: {
|
|
||||||
global: {
|
|
||||||
lines: 80,
|
|
||||||
excludes: ['src/plugins/plot/**/*.js']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// HTML test reporting.
|
// HTML test reporting.
|
||||||
htmlReporter: {
|
htmlReporter: {
|
||||||
outputDir: "dist/reports/tests",
|
outputDir: "dist/reports/tests",
|
||||||
preserveDescribeNesting: true,
|
preserveDescribeNesting: true,
|
||||||
foldAll: false
|
foldAll: false
|
||||||
},
|
},
|
||||||
|
coverageIstanbulReporter: {
|
||||||
|
fixWebpackSourcePaths: true,
|
||||||
|
dir: process.env.CIRCLE_ARTIFACTS ?
|
||||||
|
process.env.CIRCLE_ARTIFACTS + '/coverage' :
|
||||||
|
"dist/reports/coverage",
|
||||||
|
reports: ['html', 'lcovonly', 'text-summary'],
|
||||||
|
thresholds: {
|
||||||
|
global: {
|
||||||
|
lines: 62
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
// add webpack as preprocessor
|
'platform/**/*Spec.js': ['webpack', 'sourcemap'],
|
||||||
'platform/**/*Spec.js': [ 'webpack', 'sourcemap' ],
|
'src/**/*Spec.js': ['webpack', 'sourcemap']
|
||||||
'src/**/*Spec.js': [ 'webpack', 'sourcemap' ]
|
|
||||||
},
|
},
|
||||||
webpack: webpackConfig,
|
webpack: webpackConfig,
|
||||||
webpackMiddleware: {
|
webpackMiddleware: {
|
||||||
|
40
package.json
@ -1,16 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "openmct",
|
"name": "openmct",
|
||||||
"version": "1.0.0-beta",
|
"version": "1.0.0-snapshot",
|
||||||
"description": "The Open MCT core platform",
|
"description": "The Open MCT core platform",
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"acorn": "6.2.0",
|
"angular": ">=1.8.0",
|
||||||
"angular": "1.4.14",
|
|
||||||
"angular-route": "1.4.14",
|
"angular-route": "1.4.14",
|
||||||
"babel-eslint": "8.2.6",
|
"babel-eslint": "8.2.6",
|
||||||
"comma-separated-values": "^3.6.4",
|
"comma-separated-values": "^3.6.4",
|
||||||
"concurrently": "^3.6.1",
|
"concurrently": "^3.6.1",
|
||||||
"copy-webpack-plugin": "^4.5.2",
|
"copy-webpack-plugin": "^4.5.2",
|
||||||
|
"cross-env": "^6.0.3",
|
||||||
"css-loader": "^1.0.0",
|
"css-loader": "^1.0.0",
|
||||||
"d3-array": "1.2.x",
|
"d3-array": "1.2.x",
|
||||||
"d3-axis": "1.0.x",
|
"d3-axis": "1.0.x",
|
||||||
@ -24,6 +23,7 @@
|
|||||||
"d3-time-format": "2.1.x",
|
"d3-time-format": "2.1.x",
|
||||||
"eslint": "5.2.0",
|
"eslint": "5.2.0",
|
||||||
"eslint-plugin-vue": "^6.0.0",
|
"eslint-plugin-vue": "^6.0.0",
|
||||||
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
|
||||||
"eventemitter3": "^1.2.0",
|
"eventemitter3": "^1.2.0",
|
||||||
"exports-loader": "^0.7.0",
|
"exports-loader": "^0.7.0",
|
||||||
"express": "^4.13.1",
|
"express": "^4.13.1",
|
||||||
@ -38,31 +38,35 @@
|
|||||||
"istanbul-instrumenter-loader": "^3.0.1",
|
"istanbul-instrumenter-loader": "^3.0.1",
|
||||||
"jasmine-core": "^3.1.0",
|
"jasmine-core": "^3.1.0",
|
||||||
"jsdoc": "^3.3.2",
|
"jsdoc": "^3.3.2",
|
||||||
"karma": "^2.0.3",
|
"karma": "5.0.9",
|
||||||
"karma-chrome-launcher": "^2.2.0",
|
"karma-chrome-launcher": "3.1.0",
|
||||||
"karma-cli": "^1.0.1",
|
"karma-cli": "^1.0.1",
|
||||||
"karma-coverage": "^1.1.2",
|
"karma-coverage": "^1.1.2",
|
||||||
|
"karma-coverage-istanbul-reporter": "^2.1.1",
|
||||||
"karma-html-reporter": "^0.2.7",
|
"karma-html-reporter": "^0.2.7",
|
||||||
"karma-jasmine": "^1.1.2",
|
"karma-jasmine": "^2.0.0",
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-webpack": "^3.0.0",
|
"karma-webpack": "^3.0.0",
|
||||||
"location-bar": "^3.0.1",
|
"location-bar": "^3.0.1",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^4.17.12",
|
||||||
"markdown-toc": "^0.11.7",
|
"markdown-toc": "^0.11.7",
|
||||||
"marked": "^0.3.5",
|
"marked": "^0.3.5",
|
||||||
"mini-css-extract-plugin": "^0.4.1",
|
"mini-css-extract-plugin": "^0.4.1",
|
||||||
"minimist": "^1.1.1",
|
"minimist": "^1.1.1",
|
||||||
"moment": "^2.11.1",
|
"moment": "2.25.3",
|
||||||
"moment-duration-format": "^2.2.2",
|
"moment-duration-format": "^2.2.2",
|
||||||
"moment-timezone": "^0.5.21",
|
"moment-timezone": "0.5.28",
|
||||||
"node-bourbon": "^4.2.3",
|
"node-bourbon": "^4.2.3",
|
||||||
"node-sass": "^4.9.2",
|
"node-sass": "^4.9.2",
|
||||||
"painterro": "^0.2.65",
|
"painterro": "^0.2.65",
|
||||||
|
"plotly.js-basic-dist-min": "^1.54.6",
|
||||||
|
"plotly.js-gl2d-dist-min": "^1.54.5",
|
||||||
"printj": "^1.2.1",
|
"printj": "^1.2.1",
|
||||||
"raw-loader": "^0.5.1",
|
"raw-loader": "^0.5.1",
|
||||||
"request": "^2.69.0",
|
"request": "^2.69.0",
|
||||||
"split": "^1.0.0",
|
"split": "^1.0.0",
|
||||||
"style-loader": "^0.21.0",
|
"style-loader": "^1.0.1",
|
||||||
|
"uuid": "^3.3.3",
|
||||||
"v8-compile-cache": "^1.1.0",
|
"v8-compile-cache": "^1.1.0",
|
||||||
"vue": "2.5.6",
|
"vue": "2.5.6",
|
||||||
"vue-loader": "^15.2.6",
|
"vue-loader": "^15.2.6",
|
||||||
@ -74,15 +78,17 @@
|
|||||||
"zepto": "^1.2.0"
|
"zepto": "^1.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"clean": "rm -rf ./dist",
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
"lint": "eslint platform example src/**/*.{js,vue} openmct.js",
|
"lint": "eslint platform example src --ext .js,.vue openmct.js",
|
||||||
"lint:fix": "eslint platform example src/**/*.{js,vue} openmct.js --fix",
|
"lint:fix": "eslint platform example src --ext .js,.vue openmct.js --fix",
|
||||||
"build:prod": "NODE_ENV=production webpack",
|
"build:prod": "cross-env NODE_ENV=production webpack",
|
||||||
"build:dev": "webpack",
|
"build:dev": "webpack",
|
||||||
"build:watch": "webpack --watch",
|
"build:watch": "webpack --watch",
|
||||||
"test": "karma start --single-run",
|
"test": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run",
|
||||||
"test-debug": "NODE_ENV=debug karma start --no-single-run",
|
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
|
||||||
"test:watch": "karma start --no-single-run",
|
"test:coverage": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" COVERAGE=true karma start --single-run",
|
||||||
|
"test:watch": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --no-single-run",
|
||||||
"verify": "concurrently 'npm:test' 'npm:lint'",
|
"verify": "concurrently 'npm:test' 'npm:lint'",
|
||||||
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
||||||
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
||||||
|
@ -6,6 +6,12 @@
|
|||||||
ng-show="ngModel.dialog.messages.length > 1 ||
|
ng-show="ngModel.dialog.messages.length > 1 ||
|
||||||
ngModel.dialog.messages.length == 0">s</span>
|
ngModel.dialog.messages.length == 0">s</span>
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
ng-if="ngModel.dialog.topBarButton"
|
||||||
|
class="c-button c-button--major"
|
||||||
|
ng-click="ngModel.topBarButton.onClick">
|
||||||
|
{{ ngModel.topBarButton.label }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-messages c-overlay__messages">
|
<div class="w-messages c-overlay__messages">
|
||||||
<mct-include
|
<mct-include
|
||||||
@ -16,7 +22,7 @@
|
|||||||
<button ng-repeat="dialogAction in ngModel.dialog.actions"
|
<button ng-repeat="dialogAction in ngModel.dialog.actions"
|
||||||
class="c-button c-button--major"
|
class="c-button c-button--major"
|
||||||
ng-click="dialogAction.action()">
|
ng-click="dialogAction.action()">
|
||||||
{{dialogAction.label}}
|
{{ dialogAction.label }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,10 +81,15 @@ define(
|
|||||||
* context.
|
* context.
|
||||||
*/
|
*/
|
||||||
PropertiesAction.appliesTo = function (context) {
|
PropertiesAction.appliesTo = function (context) {
|
||||||
|
|
||||||
var domainObject = (context || {}).domainObject,
|
var domainObject = (context || {}).domainObject,
|
||||||
type = domainObject && domainObject.getCapability('type'),
|
type = domainObject && domainObject.getCapability('type'),
|
||||||
creatable = type && type.hasFeature('creation');
|
creatable = type && type.hasFeature('creation');
|
||||||
|
|
||||||
|
if (domainObject && domainObject.model && domainObject.model.locked) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Only allow creatable types to be edited
|
// Only allow creatable types to be edited
|
||||||
return domainObject && creatable;
|
return domainObject && creatable;
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
['../../../../../src/api/objects/object-utils'],
|
['objectUtils'],
|
||||||
function (objectUtils) {
|
function (objectUtils) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,44 +21,15 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
"./src/NotificationIndicatorController",
|
"./src/NotificationService"
|
||||||
"./src/NotificationIndicator",
|
|
||||||
"./src/NotificationService",
|
|
||||||
"./res/notification-indicator.html"
|
|
||||||
], function (
|
], function (
|
||||||
NotificationIndicatorController,
|
NotificationService
|
||||||
NotificationIndicator,
|
|
||||||
NotificationService,
|
|
||||||
notificationIndicatorTemplate
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name:"platform/commonUI/notification",
|
name:"platform/commonUI/notification",
|
||||||
definition: {
|
definition: {
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"templates": [
|
|
||||||
{
|
|
||||||
"key": "notificationIndicatorTemplate",
|
|
||||||
"template": notificationIndicatorTemplate
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"controllers": [
|
|
||||||
{
|
|
||||||
"key": "NotificationIndicatorController",
|
|
||||||
"implementation": NotificationIndicatorController,
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"openmct",
|
|
||||||
"dialogService"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"indicators": [
|
|
||||||
{
|
|
||||||
"implementation": NotificationIndicator,
|
|
||||||
"priority": "fallback"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": [
|
"services": [
|
||||||
{
|
{
|
||||||
"key": "notificationService",
|
"key": "notificationService",
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
|
||||||
<div ng-show="notifications.length > 0" class="c-indicator c-indicator--clickable s-status-{{highest.severity}} icon-bell"
|
|
||||||
ng-controller="NotificationIndicatorController">
|
|
||||||
<span class="label c-indicator__label">
|
|
||||||
<button ng-click="showNotificationsList()">
|
|
||||||
{{notifications.length}} Notification<span ng-show="notifications.length > 1">s</span></button>
|
|
||||||
</span><span class="c-indicator__count">{{notifications.length}}</span>
|
|
||||||
</div>
|
|
@ -1,73 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides an indicator that is visible when there are
|
|
||||||
* banner notifications that have been minimized. Will also indicate
|
|
||||||
* the number of notifications. Notifications can be viewed by
|
|
||||||
* clicking on the indicator to launch a dialog showing a list of
|
|
||||||
* notifications.
|
|
||||||
* @param $scope
|
|
||||||
* @param notificationService
|
|
||||||
* @param dialogService
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function NotificationIndicatorController($scope, openmct, dialogService) {
|
|
||||||
$scope.notifications = openmct.notifications.notifications;
|
|
||||||
$scope.highest = openmct.notifications.highest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Launch a dialog showing a list of current notifications.
|
|
||||||
*/
|
|
||||||
$scope.showNotificationsList = function () {
|
|
||||||
let notificationsList = openmct.notifications.notifications.map(notification => {
|
|
||||||
if (notification.model.severity === 'alert' || notification.model.severity === 'info') {
|
|
||||||
notification.model.primaryOption = {
|
|
||||||
label: 'Dismiss',
|
|
||||||
callback: () => {
|
|
||||||
let currentIndex = notificationsList.indexOf(notification);
|
|
||||||
notification.dismiss();
|
|
||||||
notificationsList.splice(currentIndex, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return notification;
|
|
||||||
})
|
|
||||||
dialogService.getDialogResponse('overlay-message-list', {
|
|
||||||
dialog: {
|
|
||||||
title: "Messages",
|
|
||||||
//Launch the message list dialog with the models
|
|
||||||
// from the notifications
|
|
||||||
messages: notificationsList
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return NotificationIndicatorController;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
['../src/NotificationIndicatorController'],
|
|
||||||
function (NotificationIndicatorController) {
|
|
||||||
|
|
||||||
xdescribe("The notification indicator controller ", function () {
|
|
||||||
var mockNotificationService,
|
|
||||||
mockScope,
|
|
||||||
mockDialogService,
|
|
||||||
controller;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockNotificationService = jasmine.createSpy("notificationService");
|
|
||||||
mockScope = jasmine.createSpy("$scope");
|
|
||||||
mockDialogService = jasmine.createSpyObj(
|
|
||||||
"dialogService",
|
|
||||||
["getDialogResponse","dismiss"]
|
|
||||||
);
|
|
||||||
mockNotificationService.highest = {
|
|
||||||
severity: "error"
|
|
||||||
};
|
|
||||||
controller = new NotificationIndicatorController(mockScope, mockNotificationService, mockDialogService);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("exposes the highest notification severity to the template", function () {
|
|
||||||
expect(mockScope.highest).toBeTruthy();
|
|
||||||
expect(mockScope.highest.severity).toBe("error");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("invokes the dialog service to show list of messages", function () {
|
|
||||||
expect(mockScope.showNotificationsList).toBeDefined();
|
|
||||||
mockScope.showNotificationsList();
|
|
||||||
expect(mockDialogService.getDialogResponse).toHaveBeenCalled();
|
|
||||||
expect(mockDialogService.getDialogResponse.calls.mostRecent().args[0]).toBe('overlay-message-list');
|
|
||||||
expect(mockDialogService.getDialogResponse.calls.mostRecent().args[1].dialog).toBeDefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -26,7 +26,7 @@
|
|||||||
* @namespace platform/containment
|
* @namespace platform/containment
|
||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
['../../../src/api/objects/object-utils'],
|
['objectUtils'],
|
||||||
function (objectUtils) {
|
function (objectUtils) {
|
||||||
|
|
||||||
function PersistableCompositionPolicy(openmct) {
|
function PersistableCompositionPolicy(openmct) {
|
||||||
|
@ -81,7 +81,7 @@ define(
|
|||||||
baseContext = context || {};
|
baseContext = context || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
var actionContext = _.extend({}, baseContext);
|
var actionContext = Object.assign({}, baseContext);
|
||||||
actionContext.domainObject = this.domainObject;
|
actionContext.domainObject = this.domainObject;
|
||||||
|
|
||||||
return this.actionService.getActions(actionContext);
|
return this.actionService.getActions(actionContext);
|
||||||
@ -102,14 +102,14 @@ define(
|
|||||||
* @returns {Action[]} an array of matching actions
|
* @returns {Action[]} an array of matching actions
|
||||||
* @memberof platform/core.ActionCapability#
|
* @memberof platform/core.ActionCapability#
|
||||||
*/
|
*/
|
||||||
ActionCapability.prototype.perform = function (context) {
|
ActionCapability.prototype.perform = function (context, flag) {
|
||||||
// Alias to getActions(context)[0].perform, with a
|
// Alias to getActions(context)[0].perform, with a
|
||||||
// check for empty arrays.
|
// check for empty arrays.
|
||||||
var actions = this.getActions(context);
|
var actions = this.getActions(context);
|
||||||
|
|
||||||
return this.$q.when(
|
return this.$q.when(
|
||||||
(actions && actions.length > 0) ?
|
(actions && actions.length > 0) ?
|
||||||
actions[0].perform() :
|
actions[0].perform(flag) :
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,18 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
MoveAction.prototype = Object.create(AbstractComposeAction.prototype);
|
MoveAction.prototype = Object.create(AbstractComposeAction.prototype);
|
||||||
MoveAction.appliesTo = AbstractComposeAction.appliesTo;
|
|
||||||
|
MoveAction.appliesTo = function (context) {
|
||||||
|
var applicableObject =
|
||||||
|
context.selectedObject || context.domainObject;
|
||||||
|
|
||||||
|
if (applicableObject && applicableObject.model.locked) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Boolean(applicableObject &&
|
||||||
|
applicableObject.hasCapability('context'));
|
||||||
|
};
|
||||||
|
|
||||||
return MoveAction;
|
return MoveAction;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ define(
|
|||||||
.then(function () {
|
.then(function () {
|
||||||
return object
|
return object
|
||||||
.getCapability('action')
|
.getCapability('action')
|
||||||
.perform('remove');
|
.perform('remove', true);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -227,10 +227,11 @@ define(
|
|||||||
locationPromise.resolve();
|
locationPromise.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("removes object from parent", function () {
|
it("removes object from parent without user warning dialog", function () {
|
||||||
expect(actionCapability.perform)
|
expect(actionCapability.perform)
|
||||||
.toHaveBeenCalledWith('remove');
|
.toHaveBeenCalledWith('remove', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -247,9 +248,9 @@ define(
|
|||||||
.toHaveBeenCalled();
|
.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("removes object from parent", function () {
|
it("removes object from parent without user warning dialog", function () {
|
||||||
expect(actionCapability.perform)
|
expect(actionCapability.perform)
|
||||||
.toHaveBeenCalledWith('remove');
|
.toHaveBeenCalledWith('remove', true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define([
|
|
||||||
"./src/policies/ImageryViewPolicy",
|
|
||||||
"./src/controllers/ImageryController",
|
|
||||||
"./src/directives/MCTBackgroundImage",
|
|
||||||
"./res/templates/imagery.html"
|
|
||||||
], function (
|
|
||||||
ImageryViewPolicy,
|
|
||||||
ImageryController,
|
|
||||||
MCTBackgroundImage,
|
|
||||||
imageryTemplate
|
|
||||||
) {
|
|
||||||
|
|
||||||
return {
|
|
||||||
name:"platform/features/imagery",
|
|
||||||
definition: {
|
|
||||||
"name": "Plot view for telemetry",
|
|
||||||
"extensions": {
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"name": "Imagery",
|
|
||||||
"key": "imagery",
|
|
||||||
"cssClass": "icon-image",
|
|
||||||
"template": imageryTemplate,
|
|
||||||
"priority": "preferred",
|
|
||||||
"needs": [
|
|
||||||
"telemetry"
|
|
||||||
],
|
|
||||||
"editable": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"policies": [
|
|
||||||
{
|
|
||||||
"category": "view",
|
|
||||||
"implementation": ImageryViewPolicy,
|
|
||||||
"depends": [
|
|
||||||
"openmct"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"controllers": [
|
|
||||||
{
|
|
||||||
"key": "ImageryController",
|
|
||||||
"implementation": ImageryController,
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"$window",
|
|
||||||
"$element",
|
|
||||||
"openmct"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"directives": [
|
|
||||||
{
|
|
||||||
"key": "mctBackgroundImage",
|
|
||||||
"implementation": MCTBackgroundImage,
|
|
||||||
"depends": [
|
|
||||||
"$document"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
@ -1,58 +0,0 @@
|
|||||||
<div class="t-imagery c-imagery" ng-controller="ImageryController as imagery">
|
|
||||||
<mct-split-pane class='abs' anchor="bottom" alias="imagery">
|
|
||||||
<div class="split-pane-component has-local-controls l-image-main-wrapper l-flex-col">
|
|
||||||
<div class="h-local-controls h-local-controls--overlay-content c-local-controls--show-on-hover l-flex-row c-imagery__lc">
|
|
||||||
<span class="holder flex-elem grows c-imagery__lc__sliders">
|
|
||||||
<input class="icon-brightness" type="range"
|
|
||||||
min="0"
|
|
||||||
max="500"
|
|
||||||
ng-model="filters.brightness" />
|
|
||||||
<input class="icon-contrast" type="range"
|
|
||||||
min="0"
|
|
||||||
max="500"
|
|
||||||
ng-model="filters.contrast" />
|
|
||||||
</span>
|
|
||||||
<span class="holder flex-elem t-reset-btn-holder c-imagery__lc__reset-btn">
|
|
||||||
<a class="s-icon-button icon-reset t-btn-reset"
|
|
||||||
ng-click="filters = { brightness: 100, contrast: 100 }"></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="l-image-main s-image-main flex-elem grows"
|
|
||||||
ng-class="{ paused: imagery.paused(), stale:false }">
|
|
||||||
<div class="image-main"
|
|
||||||
|
|
||||||
mct-background-image="imagery.getImageUrl()"
|
|
||||||
filters="filters">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="l-image-main-controlbar flex-elem l-flex-row">
|
|
||||||
<div class="l-datetime-w flex-elem grows">
|
|
||||||
<a class="c-button show-thumbs sm hidden icon-thumbs-strip"
|
|
||||||
ng-click="showThumbsBubble = (showThumbsBubble) ? false:true"></a>
|
|
||||||
<span class="l-time">{{imagery.getTime()}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="h-local-controls flex-elem">
|
|
||||||
<a class="c-button icon-pause pause-play"
|
|
||||||
ng-click="imagery.paused(!imagery.paused())"
|
|
||||||
ng-class="{ 'is-paused': imagery.paused() }"></a>
|
|
||||||
<a href=""
|
|
||||||
class="s-button l-mag s-mag vsm icon-reset"
|
|
||||||
ng-click="clipped = false"
|
|
||||||
ng-show="clipped === true"
|
|
||||||
title="Not all of image is visible; click to reset."></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<mct-splitter></mct-splitter>
|
|
||||||
<div class="split-pane-component l-image-thumbs-wrapper">
|
|
||||||
<div class="l-image-thumb-item" ng-class="{selected: image.selected}" ng-repeat="image in imageHistory track by $index"
|
|
||||||
ng-click="imagery.setSelectedImage(image)" ng-init="imagery.scrollToBottom()">
|
|
||||||
<img class="l-thumb"
|
|
||||||
ng-src={{imagery.getImageUrl(image)}}>
|
|
||||||
<div class="l-time">{{imagery.getTime(image)}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</mct-split-pane>
|
|
||||||
</div>
|
|
@ -1,284 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This bundle implements views of image telemetry.
|
|
||||||
* @namespace platform/features/imagery
|
|
||||||
*/
|
|
||||||
|
|
||||||
define(
|
|
||||||
[
|
|
||||||
'zepto',
|
|
||||||
'lodash'
|
|
||||||
],
|
|
||||||
function ($, _) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controller for the "Imagery" view of a domain object which
|
|
||||||
* provides image telemetry.
|
|
||||||
* @constructor
|
|
||||||
* @memberof platform/features/imagery
|
|
||||||
*/
|
|
||||||
|
|
||||||
function ImageryController($scope, $window, element, openmct) {
|
|
||||||
this.$scope = $scope;
|
|
||||||
this.$window = $window;
|
|
||||||
this.openmct = openmct;
|
|
||||||
this.date = "";
|
|
||||||
this.time = "";
|
|
||||||
this.zone = "";
|
|
||||||
this.imageUrl = "";
|
|
||||||
this.requestCount = 0;
|
|
||||||
this.scrollable = $(".l-image-thumbs-wrapper");
|
|
||||||
this.autoScroll = openmct.time.clock() ? true : false;
|
|
||||||
this.$scope.imageHistory = [];
|
|
||||||
this.$scope.filters = {
|
|
||||||
brightness: 100,
|
|
||||||
contrast: 100
|
|
||||||
};
|
|
||||||
|
|
||||||
this.subscribe = this.subscribe.bind(this);
|
|
||||||
this.stopListening = this.stopListening.bind(this);
|
|
||||||
this.updateValues = this.updateValues.bind(this);
|
|
||||||
this.updateHistory = this.updateHistory.bind(this);
|
|
||||||
this.onBoundsChange = this.onBoundsChange.bind(this);
|
|
||||||
this.onScroll = this.onScroll.bind(this);
|
|
||||||
this.setSelectedImage = this.setSelectedImage.bind(this);
|
|
||||||
|
|
||||||
this.subscribe(this.$scope.domainObject);
|
|
||||||
|
|
||||||
this.$scope.$on('$destroy', this.stopListening);
|
|
||||||
this.openmct.time.on('bounds', this.onBoundsChange);
|
|
||||||
this.scrollable.on('scroll', this.onScroll);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageryController.prototype.subscribe = function (domainObject) {
|
|
||||||
this.date = "";
|
|
||||||
this.imageUrl = "";
|
|
||||||
this.openmct.objects.get(domainObject.getId())
|
|
||||||
.then(function (object) {
|
|
||||||
this.domainObject = object;
|
|
||||||
var metadata = this.openmct
|
|
||||||
.telemetry
|
|
||||||
.getMetadata(this.domainObject);
|
|
||||||
this.timeKey = this.openmct.time.timeSystem().key;
|
|
||||||
this.timeFormat = this.openmct
|
|
||||||
.telemetry
|
|
||||||
.getValueFormatter(metadata.value(this.timeKey));
|
|
||||||
this.imageFormat = this.openmct
|
|
||||||
.telemetry
|
|
||||||
.getValueFormatter(metadata.valuesForHints(['image'])[0]);
|
|
||||||
this.unsubscribe = this.openmct.telemetry
|
|
||||||
.subscribe(this.domainObject, function (datum) {
|
|
||||||
this.updateHistory(datum);
|
|
||||||
this.updateValues(datum);
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
this.requestHistory(this.openmct.time.bounds());
|
|
||||||
}.bind(this));
|
|
||||||
};
|
|
||||||
|
|
||||||
ImageryController.prototype.requestHistory = function (bounds) {
|
|
||||||
this.requestCount++;
|
|
||||||
this.$scope.imageHistory = [];
|
|
||||||
var requestId = this.requestCount;
|
|
||||||
this.openmct.telemetry
|
|
||||||
.request(this.domainObject, bounds)
|
|
||||||
.then(function (values) {
|
|
||||||
if (this.requestCount > requestId) {
|
|
||||||
return Promise.resolve('Stale request');
|
|
||||||
}
|
|
||||||
|
|
||||||
values.forEach(function (datum) {
|
|
||||||
this.updateHistory(datum);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this.updateValues(values[values.length - 1]);
|
|
||||||
}.bind(this));
|
|
||||||
};
|
|
||||||
|
|
||||||
ImageryController.prototype.stopListening = function () {
|
|
||||||
this.openmct.time.off('bounds', this.onBoundsChange);
|
|
||||||
this.scrollable.off('scroll', this.onScroll);
|
|
||||||
if (this.unsubscribe) {
|
|
||||||
this.unsubscribe();
|
|
||||||
delete this.unsubscribe;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Responds to bound change event be requesting new
|
|
||||||
* historical data if the bound change was manual.
|
|
||||||
* @private
|
|
||||||
* @param {object} [newBounds] new bounds object
|
|
||||||
* @param {boolean} [tick] true when change is automatic
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.onBoundsChange = function (newBounds, tick) {
|
|
||||||
if (this.domainObject && !tick) {
|
|
||||||
this.requestHistory(newBounds);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates displayable values to match those of the most
|
|
||||||
* recently received datum.
|
|
||||||
* @param {object} [datum] the datum
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.updateValues = function (datum) {
|
|
||||||
if (this.isPaused) {
|
|
||||||
this.nextDatum = datum;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.time = this.timeFormat.format(datum);
|
|
||||||
this.imageUrl = this.imageFormat.format(datum);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Appends given imagery datum to running history.
|
|
||||||
* @private
|
|
||||||
* @param {object} [datum] target telemetry datum
|
|
||||||
* @returns {boolean} falsy when a duplicate datum is given
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.updateHistory = function (datum) {
|
|
||||||
if (!this.datumMatchesMostRecent(datum)) {
|
|
||||||
var index = _.sortedIndex(this.$scope.imageHistory, datum, this.timeFormat.format.bind(this.timeFormat));
|
|
||||||
this.$scope.imageHistory.splice(index, 0, datum);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks to see if the given datum is the same as the most recent in history.
|
|
||||||
* @private
|
|
||||||
* @param {object} [datum] target telemetry datum
|
|
||||||
* @returns {boolean} true if datum is most recent in history, false otherwise
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.datumMatchesMostRecent = function (datum) {
|
|
||||||
if (this.$scope.imageHistory.length !== 0) {
|
|
||||||
var datumTime = this.timeFormat.format(datum);
|
|
||||||
var datumURL = this.imageFormat.format(datum);
|
|
||||||
var lastHistoryTime = this.timeFormat.format(this.$scope.imageHistory.slice(-1)[0]);
|
|
||||||
var lastHistoryURL = this.imageFormat.format(this.$scope.imageHistory.slice(-1)[0]);
|
|
||||||
|
|
||||||
return datumTime === lastHistoryTime && datumURL === lastHistoryURL;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
ImageryController.prototype.onScroll = function (event) {
|
|
||||||
this.$window.requestAnimationFrame(function () {
|
|
||||||
var thumbnailWrapperHeight = this.scrollable[0].offsetHeight;
|
|
||||||
var thumbnailWrapperWidth = this.scrollable[0].offsetWidth;
|
|
||||||
if (this.scrollable[0].scrollLeft <
|
|
||||||
(this.scrollable[0].scrollWidth - this.scrollable[0].clientWidth) - (thumbnailWrapperWidth) ||
|
|
||||||
this.scrollable[0].scrollTop <
|
|
||||||
(this.scrollable[0].scrollHeight - this.scrollable[0].clientHeight) - (thumbnailWrapperHeight)) {
|
|
||||||
this.autoScroll = false;
|
|
||||||
} else {
|
|
||||||
this.autoScroll = true;
|
|
||||||
}
|
|
||||||
}.bind(this));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Force history imagery div to scroll to bottom.
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.scrollToBottom = function () {
|
|
||||||
if (this.autoScroll) {
|
|
||||||
this.scrollable[0].scrollTop = this.scrollable[0].scrollHeight;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the time portion (hours, minutes, seconds) of the
|
|
||||||
* timestamp associated with the incoming image telemetry
|
|
||||||
* if no parameter is given, or of a provided datum.
|
|
||||||
* @param {object} [datum] target telemetry datum
|
|
||||||
* @returns {string} the time
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.getTime = function (datum) {
|
|
||||||
return datum ?
|
|
||||||
this.timeFormat.format(datum) :
|
|
||||||
this.time;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the URL of the most recent image telemetry if no
|
|
||||||
* parameter is given, or of a provided datum.
|
|
||||||
* @param {object} [datum] target telemetry datum
|
|
||||||
* @returns {string} URL for telemetry image
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.getImageUrl = function (datum) {
|
|
||||||
return datum ?
|
|
||||||
this.imageFormat.format(datum) :
|
|
||||||
this.imageUrl;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Getter-setter for paused state of the view (true means
|
|
||||||
* paused, false means not.)
|
|
||||||
* @param {boolean} [state] the state to set
|
|
||||||
* @returns {boolean} the current state
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.paused = function (state) {
|
|
||||||
if (arguments.length > 0 && state !== this.isPaused) {
|
|
||||||
this.unselectAllImages();
|
|
||||||
this.isPaused = state;
|
|
||||||
if (this.nextDatum) {
|
|
||||||
this.updateValues(this.nextDatum);
|
|
||||||
delete this.nextDatum;
|
|
||||||
} else {
|
|
||||||
this.updateValues(this.$scope.imageHistory[this.$scope.imageHistory.length - 1]);
|
|
||||||
}
|
|
||||||
this.autoScroll = true;
|
|
||||||
}
|
|
||||||
return this.isPaused;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the selected image on the state for the large imagery div to use.
|
|
||||||
* @param {object} [image] the image object to get url from.
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.setSelectedImage = function (image) {
|
|
||||||
this.imageUrl = this.getImageUrl(image);
|
|
||||||
this.time = this.getTime(image);
|
|
||||||
this.paused(true);
|
|
||||||
this.unselectAllImages();
|
|
||||||
image.selected = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loop through the history imagery data to set all images to unselected.
|
|
||||||
*/
|
|
||||||
ImageryController.prototype.unselectAllImages = function () {
|
|
||||||
for (var i = 0; i < this.$scope.imageHistory.length; i++) {
|
|
||||||
this.$scope.imageHistory[i].selected = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return ImageryController;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,110 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
function () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the `mct-background-image` directive.
|
|
||||||
*
|
|
||||||
* Used as an attribute, this will set the `background-image`
|
|
||||||
* property to the URL given in its value, but only after that
|
|
||||||
* image has loaded; this avoids "flashing" as images change.
|
|
||||||
*
|
|
||||||
* If the value of `mct-background-image`is falsy, no image
|
|
||||||
* will be displayed (immediately.)
|
|
||||||
*
|
|
||||||
* Optionally, a `filters` attribute may be specified as an
|
|
||||||
* object with `brightness` and/or `contrast` properties,
|
|
||||||
* whose values are percentages. A value of 100 will make
|
|
||||||
* no changes to the image's brightness or contrast.
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @memberof platform/features/imagery
|
|
||||||
*/
|
|
||||||
function MCTBackgroundImage($document) {
|
|
||||||
function link(scope, element) {
|
|
||||||
// General strategy here:
|
|
||||||
// - Keep count of how many images have been requested; this
|
|
||||||
// counter will be used as an internal identifier or sorts
|
|
||||||
// for each image that loads.
|
|
||||||
// - As the src attribute changes, begin loading those images.
|
|
||||||
// - When images do load, update the background-image property
|
|
||||||
// of the element, but only if a more recently
|
|
||||||
// requested image has not already been loaded.
|
|
||||||
// The order in which URLs are passed in and the order
|
|
||||||
// in which images are actually loaded may be different, so
|
|
||||||
// some strategy like this is necessary to ensure that images
|
|
||||||
// do not display out-of-order.
|
|
||||||
var requested = 0, loaded = 0;
|
|
||||||
|
|
||||||
function updateFilters(filters) {
|
|
||||||
var styleValue = filters ?
|
|
||||||
Object.keys(filters).map(function (k) {
|
|
||||||
return k + "(" + filters[k] + "%)";
|
|
||||||
}).join(' ') :
|
|
||||||
"";
|
|
||||||
element.css('filter', styleValue);
|
|
||||||
element.css('webkitFilter', styleValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
function nextImage(url) {
|
|
||||||
var myCounter = requested,
|
|
||||||
image;
|
|
||||||
|
|
||||||
function useImage() {
|
|
||||||
if (loaded <= myCounter) {
|
|
||||||
loaded = myCounter;
|
|
||||||
element.css('background-image', "url('" + url + "')");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!url) {
|
|
||||||
loaded = myCounter;
|
|
||||||
element.css('background-image', 'none');
|
|
||||||
} else {
|
|
||||||
image = $document[0].createElement('img');
|
|
||||||
image.src = url;
|
|
||||||
image.onload = useImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
requested += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
scope.$watch('mctBackgroundImage', nextImage);
|
|
||||||
scope.$watchCollection('filters', updateFilters);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: "A",
|
|
||||||
scope: {
|
|
||||||
mctBackgroundImage: "=",
|
|
||||||
filters: "="
|
|
||||||
},
|
|
||||||
link: link
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return MCTBackgroundImage;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define([
|
|
||||||
'../../../../../src/api/objects/object-utils'
|
|
||||||
], function (
|
|
||||||
objectUtils
|
|
||||||
) {
|
|
||||||
/**
|
|
||||||
* Policy preventing the Imagery view from being made available for
|
|
||||||
* domain objects which do not have associated image telemetry.
|
|
||||||
* @implements {Policy.<View, DomainObject>}
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function ImageryViewPolicy(openmct) {
|
|
||||||
this.openmct = openmct;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageryViewPolicy.prototype.hasImageTelemetry = function (domainObject) {
|
|
||||||
var newDO = objectUtils.toNewFormat(
|
|
||||||
domainObject.getModel(),
|
|
||||||
domainObject.getId()
|
|
||||||
);
|
|
||||||
|
|
||||||
var metadata = this.openmct.telemetry.getMetadata(newDO);
|
|
||||||
var values = metadata.valuesForHints(['image']);
|
|
||||||
return values.length >= 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
ImageryViewPolicy.prototype.allow = function (view, domainObject) {
|
|
||||||
if (view.key === 'imagery' || view.key === 'historical-imagery') {
|
|
||||||
return this.hasImageTelemetry(domainObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
return ImageryViewPolicy;
|
|
||||||
});
|
|
||||||
|
|
@ -1,271 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
[
|
|
||||||
"zepto",
|
|
||||||
"../../src/controllers/ImageryController"
|
|
||||||
],
|
|
||||||
function ($, ImageryController) {
|
|
||||||
|
|
||||||
var MOCK_ELEMENT_TEMPLATE =
|
|
||||||
'<div class="l-image-thumbs-wrapper"></div>';
|
|
||||||
|
|
||||||
xdescribe("The Imagery controller", function () {
|
|
||||||
var $scope,
|
|
||||||
openmct,
|
|
||||||
oldDomainObject,
|
|
||||||
newDomainObject,
|
|
||||||
unsubscribe,
|
|
||||||
metadata,
|
|
||||||
prefix,
|
|
||||||
controller,
|
|
||||||
requestPromise,
|
|
||||||
mockWindow,
|
|
||||||
mockElement;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
$scope = jasmine.createSpyObj('$scope', ['$on', '$watch']);
|
|
||||||
oldDomainObject = jasmine.createSpyObj(
|
|
||||||
'domainObject',
|
|
||||||
['getId']
|
|
||||||
);
|
|
||||||
newDomainObject = { name: 'foo' };
|
|
||||||
oldDomainObject.getId.and.returnValue('testID');
|
|
||||||
openmct = {
|
|
||||||
objects: jasmine.createSpyObj('objectAPI', [
|
|
||||||
'get'
|
|
||||||
]),
|
|
||||||
time: jasmine.createSpyObj('timeAPI', [
|
|
||||||
'timeSystem',
|
|
||||||
'clock',
|
|
||||||
'on',
|
|
||||||
'off',
|
|
||||||
'bounds'
|
|
||||||
]),
|
|
||||||
telemetry: jasmine.createSpyObj('telemetryAPI', [
|
|
||||||
'subscribe',
|
|
||||||
'request',
|
|
||||||
'getValueFormatter',
|
|
||||||
'getMetadata'
|
|
||||||
])
|
|
||||||
};
|
|
||||||
metadata = jasmine.createSpyObj('metadata', [
|
|
||||||
'value',
|
|
||||||
'valuesForHints'
|
|
||||||
]);
|
|
||||||
metadata.value.and.returnValue("timestamp");
|
|
||||||
metadata.valuesForHints.and.returnValue(["value"]);
|
|
||||||
|
|
||||||
prefix = "formatted ";
|
|
||||||
unsubscribe = jasmine.createSpy('unsubscribe');
|
|
||||||
openmct.telemetry.subscribe.and.returnValue(unsubscribe);
|
|
||||||
openmct.time.timeSystem.and.returnValue({
|
|
||||||
key: 'testKey'
|
|
||||||
});
|
|
||||||
$scope.domainObject = oldDomainObject;
|
|
||||||
openmct.objects.get.and.returnValue(Promise.resolve(newDomainObject));
|
|
||||||
openmct.telemetry.getMetadata.and.returnValue(metadata);
|
|
||||||
openmct.telemetry.getValueFormatter.and.callFake(function (property) {
|
|
||||||
var formatter =
|
|
||||||
jasmine.createSpyObj("formatter-" + property, ['format']);
|
|
||||||
var isTime = (property === "timestamp");
|
|
||||||
formatter.format.and.callFake(function (datum) {
|
|
||||||
return (isTime ? prefix : "") + datum[property];
|
|
||||||
});
|
|
||||||
return formatter;
|
|
||||||
});
|
|
||||||
|
|
||||||
requestPromise = new Promise(function (resolve) {
|
|
||||||
setTimeout(function () {
|
|
||||||
resolve([{
|
|
||||||
timestamp: 1434600258123,
|
|
||||||
value: 'some/url'
|
|
||||||
}]);
|
|
||||||
}, 10);
|
|
||||||
});
|
|
||||||
|
|
||||||
openmct.telemetry.request.and.returnValue(requestPromise);
|
|
||||||
mockElement = $(MOCK_ELEMENT_TEMPLATE);
|
|
||||||
mockWindow = jasmine.createSpyObj('$window', ['requestAnimationFrame']);
|
|
||||||
mockWindow.requestAnimationFrame.and.callFake(function (f) {
|
|
||||||
return f();
|
|
||||||
});
|
|
||||||
|
|
||||||
controller = new ImageryController(
|
|
||||||
$scope,
|
|
||||||
mockWindow,
|
|
||||||
mockElement,
|
|
||||||
openmct
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when loaded", function () {
|
|
||||||
var callback,
|
|
||||||
boundsListener,
|
|
||||||
bounds;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
return requestPromise.then(function () {
|
|
||||||
openmct.time.on.calls.all().forEach(function (call) {
|
|
||||||
if (call.args[0] === "bounds") {
|
|
||||||
boundsListener = call.args[1];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
callback =
|
|
||||||
openmct.telemetry.subscribe.calls.mostRecent().args[1];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("requests history", function () {
|
|
||||||
expect(openmct.telemetry.request).toHaveBeenCalledWith(
|
|
||||||
newDomainObject, bounds
|
|
||||||
);
|
|
||||||
expect(controller.getTime()).toEqual(prefix + 1434600258123);
|
|
||||||
expect(controller.getImageUrl()).toEqual('some/url');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
it("exposes the latest telemetry values", function () {
|
|
||||||
callback({
|
|
||||||
timestamp: 1434600259456,
|
|
||||||
value: "some/other/url"
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(controller.getTime()).toEqual(prefix + 1434600259456);
|
|
||||||
expect(controller.getImageUrl()).toEqual("some/other/url");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("allows updates to be paused and unpaused", function () {
|
|
||||||
var newTimestamp = 1434600259456,
|
|
||||||
newUrl = "some/other/url",
|
|
||||||
initialTimestamp = controller.getTime(),
|
|
||||||
initialUrl = controller.getImageUrl();
|
|
||||||
|
|
||||||
expect(initialTimestamp).not.toBe(prefix + newTimestamp);
|
|
||||||
expect(initialUrl).not.toBe(newUrl);
|
|
||||||
expect(controller.paused()).toBeFalsy();
|
|
||||||
|
|
||||||
controller.paused(true);
|
|
||||||
expect(controller.paused()).toBeTruthy();
|
|
||||||
callback({ timestamp: newTimestamp, value: newUrl });
|
|
||||||
|
|
||||||
expect(controller.getTime()).toEqual(initialTimestamp);
|
|
||||||
expect(controller.getImageUrl()).toEqual(initialUrl);
|
|
||||||
|
|
||||||
controller.paused(false);
|
|
||||||
expect(controller.paused()).toBeFalsy();
|
|
||||||
expect(controller.getTime()).toEqual(prefix + newTimestamp);
|
|
||||||
expect(controller.getImageUrl()).toEqual(newUrl);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("forwards large image view to latest image in history on un-pause", function () {
|
|
||||||
$scope.imageHistory = [
|
|
||||||
{ utc: 1434600258122, url: 'some/url1', selected: false},
|
|
||||||
{ utc: 1434600258123, url: 'some/url2', selected: false}
|
|
||||||
];
|
|
||||||
controller.paused(true);
|
|
||||||
controller.paused(false);
|
|
||||||
|
|
||||||
expect(controller.getImageUrl()).toEqual(controller.getImageUrl($scope.imageHistory[1]));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("subscribes to telemetry", function () {
|
|
||||||
expect(openmct.telemetry.subscribe).toHaveBeenCalledWith(
|
|
||||||
newDomainObject,
|
|
||||||
jasmine.any(Function)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("requests telemetry", function () {
|
|
||||||
expect(openmct.telemetry.request).toHaveBeenCalledWith(
|
|
||||||
newDomainObject,
|
|
||||||
bounds
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("unsubscribes and unlistens when scope is destroyed", function () {
|
|
||||||
expect(unsubscribe).not.toHaveBeenCalled();
|
|
||||||
|
|
||||||
$scope.$on.calls.all().forEach(function (call) {
|
|
||||||
if (call.args[0] === '$destroy') {
|
|
||||||
call.args[1]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
expect(unsubscribe).toHaveBeenCalled();
|
|
||||||
expect(openmct.time.off)
|
|
||||||
.toHaveBeenCalledWith('bounds', jasmine.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("listens for bounds event and responds to tick and manual change", function () {
|
|
||||||
var mockBounds = {start: 1434600000000, end: 1434600500000};
|
|
||||||
expect(openmct.time.on).toHaveBeenCalled();
|
|
||||||
openmct.telemetry.request.calls.reset();
|
|
||||||
boundsListener(mockBounds, true);
|
|
||||||
expect(openmct.telemetry.request).not.toHaveBeenCalled();
|
|
||||||
boundsListener(mockBounds, false);
|
|
||||||
expect(openmct.telemetry.request).toHaveBeenCalledWith(newDomainObject, mockBounds);
|
|
||||||
});
|
|
||||||
|
|
||||||
it ("doesnt append duplicate datum", function () {
|
|
||||||
var mockDatum = {value: 'image/url', timestamp: 1434700000000};
|
|
||||||
var mockDatum2 = {value: 'image/url', timestamp: 1434700000000};
|
|
||||||
var mockDatum3 = {value: 'image/url', url: 'someval', timestamp: 1434700000000};
|
|
||||||
expect(controller.updateHistory(mockDatum)).toBe(true);
|
|
||||||
expect(controller.updateHistory(mockDatum)).toBe(false);
|
|
||||||
expect(controller.updateHistory(mockDatum)).toBe(false);
|
|
||||||
expect(controller.updateHistory(mockDatum2)).toBe(false);
|
|
||||||
expect(controller.updateHistory(mockDatum3)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when user clicks on imagery thumbnail", function () {
|
|
||||||
var mockDatum = { utc: 1434600258123, url: 'some/url', selected: false};
|
|
||||||
|
|
||||||
it("pauses and adds selected class to imagery thumbnail", function () {
|
|
||||||
controller.setSelectedImage(mockDatum);
|
|
||||||
expect(controller.paused()).toBeTruthy();
|
|
||||||
expect(mockDatum.selected).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("unselects previously selected image", function () {
|
|
||||||
$scope.imageHistory = [{ utc: 1434600258123, url: 'some/url', selected: true}];
|
|
||||||
controller.unselectAllImages();
|
|
||||||
expect($scope.imageHistory[0].selected).toBeFalsy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates larger image url and time", function () {
|
|
||||||
controller.setSelectedImage(mockDatum);
|
|
||||||
expect(controller.getImageUrl()).toEqual(controller.getImageUrl(mockDatum));
|
|
||||||
expect(controller.getTime()).toEqual(controller.timeFormat.format(mockDatum.utc));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
it("initially shows an empty string for date/time", function () {
|
|
||||||
expect(controller.getTime()).toEqual("");
|
|
||||||
expect(controller.getImageUrl()).toEqual("");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
["../../src/directives/MCTBackgroundImage"],
|
|
||||||
function (MCTBackgroundImage) {
|
|
||||||
|
|
||||||
describe("The mct-background-image directive", function () {
|
|
||||||
var mockDocument,
|
|
||||||
mockScope,
|
|
||||||
mockElement,
|
|
||||||
testImage,
|
|
||||||
directive;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockDocument = [
|
|
||||||
jasmine.createSpyObj('document', ['createElement'])
|
|
||||||
];
|
|
||||||
mockScope = jasmine.createSpyObj('scope', [
|
|
||||||
'$watch',
|
|
||||||
'$watchCollection'
|
|
||||||
]);
|
|
||||||
mockElement = jasmine.createSpyObj('element', ['css']);
|
|
||||||
testImage = {};
|
|
||||||
|
|
||||||
mockDocument[0].createElement.and.returnValue(testImage);
|
|
||||||
|
|
||||||
directive = new MCTBackgroundImage(mockDocument);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("is applicable as an attribute", function () {
|
|
||||||
expect(directive.restrict).toEqual("A");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("two-way-binds its own value", function () {
|
|
||||||
expect(directive.scope.mctBackgroundImage).toEqual("=");
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("once linked", function () {
|
|
||||||
beforeEach(function () {
|
|
||||||
directive.link(mockScope, mockElement, {});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("watches for changes to the URL", function () {
|
|
||||||
expect(mockScope.$watch).toHaveBeenCalledWith(
|
|
||||||
'mctBackgroundImage',
|
|
||||||
jasmine.any(Function)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates images in-order, even when they load out-of-order", function () {
|
|
||||||
var firstOnload;
|
|
||||||
|
|
||||||
mockScope.$watch.calls.mostRecent().args[1]("some/url/0");
|
|
||||||
firstOnload = testImage.onload;
|
|
||||||
|
|
||||||
mockScope.$watch.calls.mostRecent().args[1]("some/url/1");
|
|
||||||
|
|
||||||
// Resolve in a different order
|
|
||||||
testImage.onload();
|
|
||||||
firstOnload();
|
|
||||||
|
|
||||||
// Should still have taken the more recent value
|
|
||||||
expect(mockElement.css.calls.mostRecent().args).toEqual([
|
|
||||||
"background-image",
|
|
||||||
"url('some/url/1')"
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("clears the background image when undefined is passed in", function () {
|
|
||||||
mockScope.$watch.calls.mostRecent().args[1]("some/url/0");
|
|
||||||
testImage.onload();
|
|
||||||
mockScope.$watch.calls.mostRecent().args[1](undefined);
|
|
||||||
|
|
||||||
expect(mockElement.css.calls.mostRecent().args).toEqual([
|
|
||||||
"background-image",
|
|
||||||
"none"
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates filters on change", function () {
|
|
||||||
var filters = { brightness: 123, contrast: 21 };
|
|
||||||
mockScope.$watchCollection.calls.all().forEach(function (call) {
|
|
||||||
if (call.args[0] === 'filters') {
|
|
||||||
call.args[1](filters);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
expect(mockElement.css).toHaveBeenCalledWith(
|
|
||||||
'filter',
|
|
||||||
'brightness(123%) contrast(21%)'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("clears filters when none are present", function () {
|
|
||||||
mockScope.$watchCollection.calls.all().forEach(function (call) {
|
|
||||||
if (call.args[0] === 'filters') {
|
|
||||||
call.args[1](undefined);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
expect(mockElement.css)
|
|
||||||
.toHaveBeenCalledWith('filter', '');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
["../../src/policies/ImageryViewPolicy"],
|
|
||||||
function (ImageryViewPolicy) {
|
|
||||||
|
|
||||||
describe("Imagery view policy", function () {
|
|
||||||
var testView,
|
|
||||||
openmct,
|
|
||||||
mockDomainObject,
|
|
||||||
mockTelemetry,
|
|
||||||
mockMetadata,
|
|
||||||
policy;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
testView = { key: "imagery" };
|
|
||||||
mockMetadata = jasmine.createSpyObj('metadata', [
|
|
||||||
"valuesForHints"
|
|
||||||
]);
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
|
||||||
'domainObject',
|
|
||||||
['getId', 'getModel', 'getCapability']
|
|
||||||
);
|
|
||||||
mockTelemetry = jasmine.createSpyObj(
|
|
||||||
'telemetry',
|
|
||||||
['getMetadata']
|
|
||||||
);
|
|
||||||
mockDomainObject.getCapability.and.callFake(function (c) {
|
|
||||||
return c === 'telemetry' ? mockTelemetry : undefined;
|
|
||||||
});
|
|
||||||
mockDomainObject.getId.and.returnValue("some-id");
|
|
||||||
mockDomainObject.getModel.and.returnValue({ name: "foo" });
|
|
||||||
mockTelemetry.getMetadata.and.returnValue(mockMetadata);
|
|
||||||
mockMetadata.valuesForHints.and.returnValue(["bar"]);
|
|
||||||
|
|
||||||
openmct = { telemetry: mockTelemetry };
|
|
||||||
|
|
||||||
policy = new ImageryViewPolicy(openmct);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("checks for hints indicating image telemetry", function () {
|
|
||||||
policy.allow(testView, mockDomainObject);
|
|
||||||
expect(mockMetadata.valuesForHints)
|
|
||||||
.toHaveBeenCalledWith(["image"]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("allows the imagery view for domain objects with image telemetry", function () {
|
|
||||||
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("disallows the imagery view for domain objects without image telemetry", function () {
|
|
||||||
mockMetadata.valuesForHints.and.returnValue([]);
|
|
||||||
expect(policy.allow(testView, mockDomainObject)).toBeFalsy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("allows other views", function () {
|
|
||||||
testView.key = "somethingElse";
|
|
||||||
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
8
platform/features/my-items/README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# My Items plugin
|
||||||
|
Defines top-level folder named "My Items" to store user-created items. Enabled by default, this can be disabled in a
|
||||||
|
read-only deployment with no user-editable objects.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```js
|
||||||
|
openmct.install(openmct.plugins.MyItems());
|
||||||
|
```
|
@ -87,6 +87,11 @@ define([
|
|||||||
bootstrapper
|
bootstrapper
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Override of angular1.6 ! hashPrefix
|
||||||
|
app.config(['$locationProvider', function ($locationProvider) {
|
||||||
|
$locationProvider.hashPrefix('');
|
||||||
|
}]);
|
||||||
|
|
||||||
// Apply logging levels; this must be done now, before the
|
// Apply logging levels; this must be done now, before the
|
||||||
// first log statement.
|
// first log statement.
|
||||||
new LogLevel(logLevel).configure(app, $log);
|
new LogLevel(logLevel).configure(app, $log);
|
||||||
|
14
platform/import-export/README.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Import / Export Plugin
|
||||||
|
The Import/Export plugin allows objects to be exported as JSON files. This allows for sharing of objects between users
|
||||||
|
who are not using a shared persistence store. It also allows object trees to be backed up. Additionally, object trees
|
||||||
|
exported using this tool can then be exposed as read-only static root trees using the
|
||||||
|
[Static Root Plugin](../../src/plugins/staticRootPlugin/README.md).
|
||||||
|
|
||||||
|
Upon installation it will add two new context menu actions to allow import and export of objects. Initiating the Export
|
||||||
|
action on an object will produce a JSON file that includes the object and all of its composed children. Selecting Import
|
||||||
|
on an object will allow the user to import a previously exported object tree as a child of the selected object.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```js
|
||||||
|
openmct.install(openmct.plugins.ImportExport())
|
||||||
|
```
|
@ -121,7 +121,7 @@ define(['lodash'], function (_) {
|
|||||||
*/
|
*/
|
||||||
ExportAsJSONAction.prototype.rewriteLink = function (child, parent) {
|
ExportAsJSONAction.prototype.rewriteLink = function (child, parent) {
|
||||||
this.externalIdentifiers.push(this.getId(child));
|
this.externalIdentifiers.push(this.getId(child));
|
||||||
var index = _.findIndex(parent.composition, function (id) {
|
var index = parent.composition.findIndex(id => {
|
||||||
return _.isEqual(child.identifier, id);
|
return _.isEqual(child.identifier, id);
|
||||||
});
|
});
|
||||||
var copyOfChild = this.copyObject(child);
|
var copyOfChild = this.copyObject(child);
|
||||||
@ -133,7 +133,7 @@ define(['lodash'], function (_) {
|
|||||||
copyOfChild.location = parentId;
|
copyOfChild.location = parentId;
|
||||||
parent.composition[index] = copyOfChild.identifier;
|
parent.composition[index] = copyOfChild.identifier;
|
||||||
this.tree[newIdString] = copyOfChild;
|
this.tree[newIdString] = copyOfChild;
|
||||||
this.tree[parentId].composition[index] = newIdString;
|
this.tree[parentId].composition[index] = copyOfChild.identifier;
|
||||||
|
|
||||||
return copyOfChild;
|
return copyOfChild;
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, objectUtils) {
|
define(['zepto', 'objectUtils'], function ($, objectUtils) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ImportAsJSONAction is available from context menus and allows a user
|
* The ImportAsJSONAction is available from context menus and allows a user
|
||||||
@ -136,6 +136,10 @@ define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, ob
|
|||||||
return tree;
|
return tree;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ImportAsJSONAction.prototype.getKeyString = function (identifier) {
|
||||||
|
return this.openmct.objects.makeKeyString(identifier);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rewrites all instances of a given id in the tree with a newly generated
|
* Rewrites all instances of a given id in the tree with a newly generated
|
||||||
* replacement to prevent collision.
|
* replacement to prevent collision.
|
||||||
@ -212,8 +216,14 @@ define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, ob
|
|||||||
};
|
};
|
||||||
|
|
||||||
ImportAsJSONAction.appliesTo = function (context) {
|
ImportAsJSONAction.appliesTo = function (context) {
|
||||||
return context.domainObject !== undefined &&
|
let domainObject = context.domainObject;
|
||||||
context.domainObject.hasCapability("composition");
|
|
||||||
|
if (domainObject && domainObject.model.locked) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return domainObject !== undefined &&
|
||||||
|
domainObject.hasCapability("composition");
|
||||||
};
|
};
|
||||||
|
|
||||||
return ImportAsJSONAction;
|
return ImportAsJSONAction;
|
||||||
|
@ -47,7 +47,12 @@ define(
|
|||||||
uniqueId = 0;
|
uniqueId = 0;
|
||||||
newObjects = [];
|
newObjects = [];
|
||||||
openmct = {
|
openmct = {
|
||||||
$injector: jasmine.createSpyObj('$injector', ['get'])
|
$injector: jasmine.createSpyObj('$injector', ['get']),
|
||||||
|
objects: {
|
||||||
|
makeKeyString: function (identifier) {
|
||||||
|
return identifier.key;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
mockInstantiate = jasmine.createSpy('instantiate').and.callFake(
|
mockInstantiate = jasmine.createSpy('instantiate').and.callFake(
|
||||||
function (model, id) {
|
function (model, id) {
|
||||||
@ -153,7 +158,7 @@ define(
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
"openmct": {
|
"openmct": {
|
||||||
"infiniteParent": {
|
"infiniteParent": {
|
||||||
"composition": ["infinteChild"],
|
"composition": [{key: "infinteChild", namespace: ""}],
|
||||||
"name": "1",
|
"name": "1",
|
||||||
"type": "folder",
|
"type": "folder",
|
||||||
"modified": 1503598129176,
|
"modified": 1503598129176,
|
||||||
@ -161,7 +166,7 @@ define(
|
|||||||
"persisted": 1503598129176
|
"persisted": 1503598129176
|
||||||
},
|
},
|
||||||
"infinteChild": {
|
"infinteChild": {
|
||||||
"composition": ["infiniteParent"],
|
"composition": [{key: "infinteParent", namespace: ""}],
|
||||||
"name": "2",
|
"name": "2",
|
||||||
"type": "folder",
|
"type": "folder",
|
||||||
"modified": 1503598132428,
|
"modified": 1503598132428,
|
||||||
|
@ -1,2 +1,8 @@
|
|||||||
This bundle implements a connection to an external CouchDB persistence
|
# Couch DB Persistence Plugin
|
||||||
store in Open MCT.
|
An adapter for using CouchDB for persistence of user-created objects. The plugin installation function takes the URL
|
||||||
|
for the CouchDB database as a parameter.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```js
|
||||||
|
openmct.install(openmct.plugins.CouchDB('http://localhost:5984/openmct'))
|
||||||
|
```
|
@ -33,7 +33,7 @@ define(
|
|||||||
var CONNECTED = {
|
var CONNECTED = {
|
||||||
text: "Connected",
|
text: "Connected",
|
||||||
glyphClass: "ok",
|
glyphClass: "ok",
|
||||||
statusClass: "s-status-ok",
|
statusClass: "s-status-on",
|
||||||
description: "Connected to the domain object database."
|
description: "Connected to the domain object database."
|
||||||
},
|
},
|
||||||
DISCONNECTED = {
|
DISCONNECTED = {
|
||||||
|
@ -1,2 +1,8 @@
|
|||||||
This bundle implements a connection to an external ElasticSearch persistence
|
# Elasticsearch Persistence Provider
|
||||||
store in Open MCT.
|
An adapter for using Elastic for persistence of user-created objects. The installation function takes the URL for an
|
||||||
|
Elasticsearch server as a parameter.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```js
|
||||||
|
openmct.install(openmct.plugins.Elasticsearch('http://localhost:9200'))
|
||||||
|
```
|
@ -71,7 +71,7 @@ define([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "ELASTIC_PATH",
|
"key": "ELASTIC_PATH",
|
||||||
"value": "mct/domain_object",
|
"value": "mct/_doc",
|
||||||
"priority": "fallback"
|
"priority": "fallback"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ define(
|
|||||||
var CONNECTED = {
|
var CONNECTED = {
|
||||||
text: "Connected",
|
text: "Connected",
|
||||||
glyphClass: "ok",
|
glyphClass: "ok",
|
||||||
statusClass: "s-status-ok",
|
statusClass: "s-status-on",
|
||||||
description: "Connected to the domain object database."
|
description: "Connected to the domain object database."
|
||||||
},
|
},
|
||||||
DISCONNECTED = {
|
DISCONNECTED = {
|
||||||
|
@ -32,9 +32,9 @@ define(
|
|||||||
// JSLint doesn't like underscore-prefixed properties,
|
// JSLint doesn't like underscore-prefixed properties,
|
||||||
// so hide them here.
|
// so hide them here.
|
||||||
var SRC = "_source",
|
var SRC = "_source",
|
||||||
REV = "_version",
|
CONFLICT = 409,
|
||||||
ID = "_id",
|
SEQ_NO = "_seq_no",
|
||||||
CONFLICT = 409;
|
PRIMARY_TERM = "_primary_term";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ElasticPersistenceProvider reads and writes JSON documents
|
* The ElasticPersistenceProvider reads and writes JSON documents
|
||||||
@ -104,7 +104,8 @@ define(
|
|||||||
// Get a domain object model out of ElasticSearch's response
|
// Get a domain object model out of ElasticSearch's response
|
||||||
ElasticPersistenceProvider.prototype.getModel = function (response) {
|
ElasticPersistenceProvider.prototype.getModel = function (response) {
|
||||||
if (response && response[SRC]) {
|
if (response && response[SRC]) {
|
||||||
this.revs[response[ID]] = response[REV];
|
this.revs[response[SEQ_NO]] = response[SEQ_NO];
|
||||||
|
this.revs[response[PRIMARY_TERM]] = response[PRIMARY_TERM];
|
||||||
return response[SRC];
|
return response[SRC];
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -116,7 +117,8 @@ define(
|
|||||||
// indicate that the request failed.
|
// indicate that the request failed.
|
||||||
ElasticPersistenceProvider.prototype.checkResponse = function (response, key) {
|
ElasticPersistenceProvider.prototype.checkResponse = function (response, key) {
|
||||||
if (response && !response.error) {
|
if (response && !response.error) {
|
||||||
this.revs[key] = response[REV];
|
this.revs[SEQ_NO] = response[SEQ_NO];
|
||||||
|
this.revs[PRIMARY_TERM] = response[PRIMARY_TERM];
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
return this.handleError(response, key);
|
return this.handleError(response, key);
|
||||||
@ -147,7 +149,7 @@ define(
|
|||||||
function checkUpdate(response) {
|
function checkUpdate(response) {
|
||||||
return self.checkResponse(response, key);
|
return self.checkResponse(response, key);
|
||||||
}
|
}
|
||||||
return this.put(key, value, { version: this.revs[key] })
|
return this.put(key, value)
|
||||||
.then(checkUpdate);
|
.then(checkUpdate);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ define(
|
|||||||
it("allows object creation", function () {
|
it("allows object creation", function () {
|
||||||
var model = { someKey: "some value" };
|
var model = { someKey: "some value" };
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 1 }
|
data: { "_id": "abc", "_seq_no": 1, "_primary_term": 1 }
|
||||||
}));
|
}));
|
||||||
provider.createObject("testSpace", "abc", model).then(capture);
|
provider.createObject("testSpace", "abc", model).then(capture);
|
||||||
expect(mockHttp).toHaveBeenCalledWith({
|
expect(mockHttp).toHaveBeenCalledWith({
|
||||||
@ -100,7 +100,7 @@ define(
|
|||||||
it("allows object models to be read back", function () {
|
it("allows object models to be read back", function () {
|
||||||
var model = { someKey: "some value" };
|
var model = { someKey: "some value" };
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 1, "_source": model }
|
data: { "_id": "abc", "_seq_no": 1, "_primary_term": 1, "_source": model }
|
||||||
}));
|
}));
|
||||||
provider.readObject("testSpace", "abc").then(capture);
|
provider.readObject("testSpace", "abc").then(capture);
|
||||||
expect(mockHttp).toHaveBeenCalledWith({
|
expect(mockHttp).toHaveBeenCalledWith({
|
||||||
@ -117,19 +117,19 @@ define(
|
|||||||
|
|
||||||
// First do a read to populate rev tags...
|
// First do a read to populate rev tags...
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 42, "_source": {} }
|
data: { "_id": "abc", "_source": {} }
|
||||||
}));
|
}));
|
||||||
provider.readObject("testSpace", "abc");
|
provider.readObject("testSpace", "abc");
|
||||||
|
|
||||||
// Now perform an update
|
// Now perform an update
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 43, "_source": {} }
|
data: { "_id": "abc", "_seq_no": 1, "_source": {} }
|
||||||
}));
|
}));
|
||||||
provider.updateObject("testSpace", "abc", model).then(capture);
|
provider.updateObject("testSpace", "abc", model).then(capture);
|
||||||
expect(mockHttp).toHaveBeenCalledWith({
|
expect(mockHttp).toHaveBeenCalledWith({
|
||||||
url: "/test/db/abc",
|
url: "/test/db/abc",
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
params: { version: 42 },
|
params: undefined,
|
||||||
data: model
|
data: model
|
||||||
});
|
});
|
||||||
expect(capture.calls.mostRecent().args[0]).toBeTruthy();
|
expect(capture.calls.mostRecent().args[0]).toBeTruthy();
|
||||||
@ -138,13 +138,13 @@ define(
|
|||||||
it("allows object deletion", function () {
|
it("allows object deletion", function () {
|
||||||
// First do a read to populate rev tags...
|
// First do a read to populate rev tags...
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 42, "_source": {} }
|
data: { "_id": "abc", "_source": {} }
|
||||||
}));
|
}));
|
||||||
provider.readObject("testSpace", "abc");
|
provider.readObject("testSpace", "abc");
|
||||||
|
|
||||||
// Now perform an update
|
// Now perform an update
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 42, "_source": {} }
|
data: { "_id": "abc", "_source": {} }
|
||||||
}));
|
}));
|
||||||
provider.deleteObject("testSpace", "abc", {}).then(capture);
|
provider.deleteObject("testSpace", "abc", {}).then(capture);
|
||||||
expect(mockHttp).toHaveBeenCalledWith({
|
expect(mockHttp).toHaveBeenCalledWith({
|
||||||
@ -167,13 +167,13 @@ define(
|
|||||||
expect(capture).toHaveBeenCalledWith(undefined);
|
expect(capture).toHaveBeenCalledWith(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("handles rejection due to version", function () {
|
it("handles rejection due to _seq_no", function () {
|
||||||
var model = { someKey: "some value" },
|
var model = { someKey: "some value" },
|
||||||
mockErrorCallback = jasmine.createSpy('error');
|
mockErrorCallback = jasmine.createSpy('error');
|
||||||
|
|
||||||
// First do a read to populate rev tags...
|
// First do a read to populate rev tags...
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 42, "_source": {} }
|
data: { "_id": "abc", "_seq_no": 1, "_source": {} }
|
||||||
}));
|
}));
|
||||||
provider.readObject("testSpace", "abc");
|
provider.readObject("testSpace", "abc");
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ define(
|
|||||||
|
|
||||||
// First do a read to populate rev tags...
|
// First do a read to populate rev tags...
|
||||||
mockHttp.and.returnValue(mockPromise({
|
mockHttp.and.returnValue(mockPromise({
|
||||||
data: { "_id": "abc", "_version": 42, "_source": {} }
|
data: { "_id": "abc", "_seq_no": 1, "_source": {} }
|
||||||
}));
|
}));
|
||||||
provider.readObject("testSpace", "abc");
|
provider.readObject("testSpace", "abc");
|
||||||
|
|
||||||
|
9
platform/persistence/local/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Local Storage Plugin
|
||||||
|
Provides persistence of user-created objects in browser Local Storage. Objects persisted in this way will only be
|
||||||
|
available from the browser and machine on which they were persisted. For shared persistence, consider the
|
||||||
|
[Elasticsearch](../elastic/) and [CouchDB](../couch/) persistence plugins.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```js
|
||||||
|
openmct.install(openmct.plugins.LocalStorage());
|
||||||
|
```
|
@ -25,7 +25,7 @@
|
|||||||
* Module defining GenericSearchProvider. Created by shale on 07/16/2015.
|
* Module defining GenericSearchProvider. Created by shale on 07/16/2015.
|
||||||
*/
|
*/
|
||||||
define([
|
define([
|
||||||
'../../../../src/api/objects/object-utils',
|
'objectUtils',
|
||||||
'lodash'
|
'lodash'
|
||||||
], function (
|
], function (
|
||||||
objectUtils,
|
objectUtils,
|
||||||
@ -191,7 +191,7 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
var domainObject = objectUtils.toNewFormat(model, id);
|
var domainObject = objectUtils.toNewFormat(model, id);
|
||||||
var composition = _.find(this.openmct.composition.registry, function (p) {
|
var composition = this.openmct.composition.registry.find(p => {
|
||||||
return p.appliesTo(domainObject);
|
return p.appliesTo(domainObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
[
|
[
|
||||||
'../../../src/api/objects/object-utils',
|
'objectUtils',
|
||||||
'lodash'
|
'lodash'
|
||||||
],
|
],
|
||||||
function (
|
function (
|
||||||
@ -235,7 +235,7 @@ define(
|
|||||||
var defaultRange = metadata.valuesForHints(['range'])[0];
|
var defaultRange = metadata.valuesForHints(['range'])[0];
|
||||||
defaultRange = defaultRange ? defaultRange.key : undefined;
|
defaultRange = defaultRange ? defaultRange.key : undefined;
|
||||||
|
|
||||||
var sourceMap = _.indexBy(metadata.values(), 'key');
|
var sourceMap = _.keyBy(metadata.values(), 'key');
|
||||||
|
|
||||||
var isLegacyProvider = telemetryAPI.findRequestProvider(domainObject) ===
|
var isLegacyProvider = telemetryAPI.findRequestProvider(domainObject) ===
|
||||||
telemetryAPI.legacyProvider;
|
telemetryAPI.legacyProvider;
|
||||||
@ -300,7 +300,7 @@ define(
|
|||||||
var defaultRange = metadata.valuesForHints(['range'])[0];
|
var defaultRange = metadata.valuesForHints(['range'])[0];
|
||||||
defaultRange = defaultRange ? defaultRange.key : undefined;
|
defaultRange = defaultRange ? defaultRange.key : undefined;
|
||||||
|
|
||||||
var sourceMap = _.indexBy(metadata.values(), 'key');
|
var sourceMap = _.keyBy(metadata.values(), 'key');
|
||||||
|
|
||||||
var isLegacyProvider = telemetryAPI.findSubscriptionProvider(domainObject) ===
|
var isLegacyProvider = telemetryAPI.findSubscriptionProvider(domainObject) ===
|
||||||
telemetryAPI.legacyProvider;
|
telemetryAPI.legacyProvider;
|
||||||
|
@ -1,106 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// Converts all templateUrl references in bundle.js files to
|
|
||||||
// plain template references, loading said templates with the
|
|
||||||
// RequireJS text plugin.
|
|
||||||
|
|
||||||
var glob = require('glob'),
|
|
||||||
fs = require('fs'),
|
|
||||||
path = require('path'),
|
|
||||||
_ = require('lodash');
|
|
||||||
|
|
||||||
function toTemplateName(templateUrl) {
|
|
||||||
var parts = templateUrl.split('/');
|
|
||||||
return _.camelCase(parts[parts.length - 1].replace(".html", "")) +
|
|
||||||
"Template";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTemplateUrl(sourceLine) {
|
|
||||||
return _.trim(sourceLine.split(":")[1], "\", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
function hasTemplateUrl(sourceLine) {
|
|
||||||
return sourceLine.indexOf("templateUrl") !== -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function findTemplateURLs(sourceCode) {
|
|
||||||
return sourceCode.split('\n')
|
|
||||||
.map(_.trim)
|
|
||||||
.filter(hasTemplateUrl)
|
|
||||||
.map(getTemplateUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
function injectRequireArgument(sourceCode, templateUrls) {
|
|
||||||
var lines = sourceCode.split('\n'),
|
|
||||||
index;
|
|
||||||
|
|
||||||
templateUrls = _.uniq(templateUrls);
|
|
||||||
|
|
||||||
// Add arguments for source paths...
|
|
||||||
index = lines.map(_.trim).indexOf("'legacyRegistry'");
|
|
||||||
lines = lines.slice(0, index).concat(templateUrls.map(function (url) {
|
|
||||||
return " \"text!./res/" + url + "\",";
|
|
||||||
}).concat(lines.slice(index)));
|
|
||||||
|
|
||||||
/// ...and for arguments
|
|
||||||
index = lines.map(_.trim).indexOf("legacyRegistry");
|
|
||||||
lines = lines.slice(0, index).concat(templateUrls.map(function (url) {
|
|
||||||
return " " + toTemplateName(url) + ",";
|
|
||||||
}).concat(lines.slice(index)));
|
|
||||||
|
|
||||||
return lines.join('\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
function rewriteUrl(sourceLine) {
|
|
||||||
return [
|
|
||||||
sourceLine.substring(0, sourceLine.indexOf(sourceLine.trim())),
|
|
||||||
"\"template\": " + toTemplateName(getTemplateUrl(sourceLine)),
|
|
||||||
_.endsWith(sourceLine, ",") ? "," : ""
|
|
||||||
].join('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function rewriteLine(sourceLine) {
|
|
||||||
return hasTemplateUrl(sourceLine) ?
|
|
||||||
rewriteUrl(sourceLine.replace("templateUrl", "template")) :
|
|
||||||
sourceLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
function rewriteTemplateUrls(sourceCode) {
|
|
||||||
return sourceCode.split('\n').map(rewriteLine).join('\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
function migrate(file) {
|
|
||||||
var sourceCode = fs.readFileSync(file, 'utf8');
|
|
||||||
fs.writeFileSync(file, rewriteTemplateUrls(
|
|
||||||
injectRequireArgument(sourceCode, findTemplateURLs(sourceCode))
|
|
||||||
), 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
glob('platform/**/bundle.js', {}, function (err, files) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
files.forEach(migrate);
|
|
||||||
});
|
|
@ -1,72 +0,0 @@
|
|||||||
// Temporary utility script to rewrite bundle.json
|
|
||||||
// files as bundle.js files.
|
|
||||||
|
|
||||||
var glob = require('glob'),
|
|
||||||
fs = require('fs'),
|
|
||||||
path = require('path'),
|
|
||||||
_ = require('lodash'),
|
|
||||||
template = _.template(
|
|
||||||
fs.readFileSync(path.resolve(__dirname, 'rebundle-template.txt'), 'utf8')
|
|
||||||
);
|
|
||||||
|
|
||||||
function indent(str, depth) {
|
|
||||||
return _.trimLeft(str.split('\n').map(function (line) {
|
|
||||||
return _.repeat(' ', depth || 1) + line;
|
|
||||||
}).filter(function (line) {
|
|
||||||
return line.trim().length > 0;
|
|
||||||
}).join('\n'));
|
|
||||||
}
|
|
||||||
|
|
||||||
function findImpls(bundleContents) {
|
|
||||||
return _(bundleContents.extensions || {})
|
|
||||||
.map()
|
|
||||||
.flatten()
|
|
||||||
.pluck('implementation')
|
|
||||||
.filter()
|
|
||||||
.uniq()
|
|
||||||
.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
function toIdentifier(impl) {
|
|
||||||
var parts = impl.replace(".js", "").split('/');
|
|
||||||
return parts[parts.length - 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
function toPath(impl) {
|
|
||||||
return "\"./src/" + impl.replace(".js", "") + "\"";
|
|
||||||
}
|
|
||||||
|
|
||||||
function replaceImpls(bundleText) {
|
|
||||||
var rx = /"implementation": "([^"]*)"/;
|
|
||||||
return bundleText.split('\n').map(function (line) {
|
|
||||||
var m = line.match(rx);
|
|
||||||
return m !== null ?
|
|
||||||
line.replace(rx, '"implementation": ' + toIdentifier(m[1])) :
|
|
||||||
line;
|
|
||||||
}).join('\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
function rebundle(file) {
|
|
||||||
var plainJson = fs.readFileSync(file, 'utf8'),
|
|
||||||
bundleContents = JSON.parse(plainJson),
|
|
||||||
impls = findImpls(bundleContents),
|
|
||||||
bundleName = file.replace("/bundle.json", ""),
|
|
||||||
outputFile = file.replace(".json", ".js"),
|
|
||||||
contents = template({
|
|
||||||
bundleName: bundleName,
|
|
||||||
implPaths: indent(impls.map(toPath).concat([""]).join(",\n")),
|
|
||||||
implNames: indent(impls.map(toIdentifier).concat([""]).join(",\n")),
|
|
||||||
bundleContents: indent(replaceImpls(JSON.stringify(bundleContents, null, 4)))
|
|
||||||
});
|
|
||||||
fs.writeFileSync(outputFile, contents, 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
glob('**/bundle.json', {}, function (err, files) {
|
|
||||||
if (err) {
|
|
||||||
console.log(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
files.forEach(rebundle);
|
|
||||||
});
|
|
||||||
|
|
85
src/MCT.js
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
* Open MCT, Copyright (c) 2014-2020, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -28,18 +28,17 @@ define([
|
|||||||
'./api/api',
|
'./api/api',
|
||||||
'./api/overlays/OverlayAPI',
|
'./api/overlays/OverlayAPI',
|
||||||
'./selection/Selection',
|
'./selection/Selection',
|
||||||
'./api/objects/object-utils',
|
'objectUtils',
|
||||||
'./plugins/plugins',
|
'./plugins/plugins',
|
||||||
'./adapter/indicators/legacy-indicators-plugin',
|
'./adapter/indicators/legacy-indicators-plugin',
|
||||||
'./plugins/buildInfo/plugin',
|
'./plugins/buildInfo/plugin',
|
||||||
'./ui/registries/ViewRegistry',
|
'./ui/registries/ViewRegistry',
|
||||||
|
'./plugins/imagery/plugin',
|
||||||
'./ui/registries/InspectorViewRegistry',
|
'./ui/registries/InspectorViewRegistry',
|
||||||
'./ui/registries/ToolbarRegistry',
|
'./ui/registries/ToolbarRegistry',
|
||||||
'./ui/router/ApplicationRouter',
|
'./ui/router/ApplicationRouter',
|
||||||
'./ui/router/Browse',
|
'./ui/router/Browse',
|
||||||
'../platform/framework/src/Main',
|
'../platform/framework/src/Main',
|
||||||
'./styles/core.scss',
|
|
||||||
'./styles/notebook.scss',
|
|
||||||
'./ui/layout/Layout.vue',
|
'./ui/layout/Layout.vue',
|
||||||
'../platform/core/src/objects/DomainObjectImpl',
|
'../platform/core/src/objects/DomainObjectImpl',
|
||||||
'../platform/core/src/capabilities/ContextualDomainObject',
|
'../platform/core/src/capabilities/ContextualDomainObject',
|
||||||
@ -61,13 +60,12 @@ define([
|
|||||||
LegacyIndicatorsPlugin,
|
LegacyIndicatorsPlugin,
|
||||||
buildInfoPlugin,
|
buildInfoPlugin,
|
||||||
ViewRegistry,
|
ViewRegistry,
|
||||||
|
ImageryPlugin,
|
||||||
InspectorViewRegistry,
|
InspectorViewRegistry,
|
||||||
ToolbarRegistry,
|
ToolbarRegistry,
|
||||||
ApplicationRouter,
|
ApplicationRouter,
|
||||||
Browse,
|
Browse,
|
||||||
Main,
|
Main,
|
||||||
coreStyles,
|
|
||||||
NotebookStyles,
|
|
||||||
Layout,
|
Layout,
|
||||||
DomainObjectImpl,
|
DomainObjectImpl,
|
||||||
ContextualDomainObject,
|
ContextualDomainObject,
|
||||||
@ -251,9 +249,10 @@ define([
|
|||||||
this.legacyRegistry = new BundleRegistry();
|
this.legacyRegistry = new BundleRegistry();
|
||||||
installDefaultBundles(this.legacyRegistry);
|
installDefaultBundles(this.legacyRegistry);
|
||||||
|
|
||||||
// Plugin's that are installed by default
|
// Plugins that are installed by default
|
||||||
|
|
||||||
this.install(this.plugins.Plot());
|
this.install(this.plugins.Plot());
|
||||||
|
this.install(this.plugins.PlotlyPlot());
|
||||||
this.install(this.plugins.TelemetryTable());
|
this.install(this.plugins.TelemetryTable());
|
||||||
this.install(PreviewPlugin.default());
|
this.install(PreviewPlugin.default());
|
||||||
this.install(LegacyIndicatorsPlugin());
|
this.install(LegacyIndicatorsPlugin());
|
||||||
@ -261,10 +260,16 @@ define([
|
|||||||
this.install(RemoveActionPlugin.default());
|
this.install(RemoveActionPlugin.default());
|
||||||
this.install(this.plugins.FolderView());
|
this.install(this.plugins.FolderView());
|
||||||
this.install(this.plugins.Tabs());
|
this.install(this.plugins.Tabs());
|
||||||
|
this.install(ImageryPlugin.default());
|
||||||
this.install(this.plugins.FlexibleLayout());
|
this.install(this.plugins.FlexibleLayout());
|
||||||
this.install(this.plugins.GoToOriginalAction());
|
this.install(this.plugins.GoToOriginalAction());
|
||||||
this.install(this.plugins.ImportExport());
|
this.install(this.plugins.ImportExport());
|
||||||
this.install(this.plugins.WebPage());
|
this.install(this.plugins.WebPage());
|
||||||
|
this.install(this.plugins.Condition());
|
||||||
|
this.install(this.plugins.ConditionWidget());
|
||||||
|
this.install(this.plugins.URLTimeSettingsSynchronizer());
|
||||||
|
this.install(this.plugins.NotificationIndicator());
|
||||||
|
this.install(this.plugins.NewFolderAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
MCT.prototype = Object.create(EventEmitter.prototype);
|
MCT.prototype = Object.create(EventEmitter.prototype);
|
||||||
@ -318,11 +323,26 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @method setAssetPath
|
* @method setAssetPath
|
||||||
*/
|
*/
|
||||||
MCT.prototype.setAssetPath = function (path) {
|
MCT.prototype.setAssetPath = function (assetPath) {
|
||||||
this.legacyExtension('constants', {
|
this._assetPath = assetPath;
|
||||||
key: "ASSETS_PATH",
|
};
|
||||||
value: path
|
|
||||||
});
|
/**
|
||||||
|
* Get path to where assets are hosted.
|
||||||
|
* @memberof module:openmct.MCT#
|
||||||
|
* @method getAssetPath
|
||||||
|
*/
|
||||||
|
MCT.prototype.getAssetPath = function () {
|
||||||
|
const assetPathLength = this._assetPath && this._assetPath.length;
|
||||||
|
if (!assetPathLength) {
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._assetPath[assetPathLength - 1] !== '/') {
|
||||||
|
return this._assetPath + '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._assetPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -334,17 +354,13 @@ define([
|
|||||||
* @param {HTMLElement} [domElement] the DOM element in which to run
|
* @param {HTMLElement} [domElement] the DOM element in which to run
|
||||||
* MCT; if undefined, MCT will be run in the body of the document
|
* MCT; if undefined, MCT will be run in the body of the document
|
||||||
*/
|
*/
|
||||||
MCT.prototype.start = function (domElement) {
|
MCT.prototype.start = function (domElement = document.body, isHeadlessMode = false) {
|
||||||
if (!this.plugins.DisplayLayout._installed) {
|
if (!this.plugins.DisplayLayout._installed) {
|
||||||
this.install(this.plugins.DisplayLayout({
|
this.install(this.plugins.DisplayLayout({
|
||||||
showAsView: ['summary-widget']
|
showAsView: ['summary-widget']
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!domElement) {
|
|
||||||
domElement = document.body;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.element = domElement;
|
this.element = domElement;
|
||||||
|
|
||||||
this.legacyExtension('runs', {
|
this.legacyExtension('runs', {
|
||||||
@ -384,24 +400,31 @@ define([
|
|||||||
// something has depended upon objectService. Cool, right?
|
// something has depended upon objectService. Cool, right?
|
||||||
this.$injector.get('objectService');
|
this.$injector.get('objectService');
|
||||||
|
|
||||||
var appLayout = new Vue({
|
if (!isHeadlessMode) {
|
||||||
components: {
|
var appLayout = new Vue({
|
||||||
'Layout': Layout.default
|
components: {
|
||||||
},
|
'Layout': Layout.default
|
||||||
provide: {
|
},
|
||||||
openmct: this
|
provide: {
|
||||||
},
|
openmct: this
|
||||||
template: '<Layout ref="layout"></Layout>'
|
},
|
||||||
});
|
template: '<Layout ref="layout"></Layout>'
|
||||||
domElement.appendChild(appLayout.$mount().$el);
|
});
|
||||||
|
domElement.appendChild(appLayout.$mount().$el);
|
||||||
|
|
||||||
this.layout = appLayout.$refs.layout;
|
this.layout = appLayout.$refs.layout;
|
||||||
Browse(this);
|
Browse(this);
|
||||||
|
}
|
||||||
this.router.start();
|
this.router.start();
|
||||||
this.emit('start');
|
this.emit('start');
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MCT.prototype.startHeadless = function () {
|
||||||
|
let unreachableNode = document.createElement('div');
|
||||||
|
return this.start(unreachableNode, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install a plugin in MCT.
|
* Install a plugin in MCT.
|
||||||
*
|
*
|
||||||
@ -413,6 +436,10 @@ define([
|
|||||||
plugin(this);
|
plugin(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MCT.prototype.destroy = function () {
|
||||||
|
this.emit('destroy');
|
||||||
|
};
|
||||||
|
|
||||||
MCT.prototype.plugins = plugins;
|
MCT.prototype.plugins = plugins;
|
||||||
|
|
||||||
return MCT;
|
return MCT;
|
||||||
|
@ -21,24 +21,28 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'./MCT',
|
|
||||||
'./plugins/plugins',
|
'./plugins/plugins',
|
||||||
'legacyRegistry'
|
'legacyRegistry',
|
||||||
], function (MCT, plugins, legacyRegistry) {
|
'utils/testing'
|
||||||
xdescribe("MCT", function () {
|
], function (plugins, legacyRegistry, testUtils) {
|
||||||
|
describe("MCT", function () {
|
||||||
var openmct;
|
var openmct;
|
||||||
var mockPlugin;
|
var mockPlugin;
|
||||||
var mockPlugin2;
|
var mockPlugin2;
|
||||||
var mockListener;
|
var mockListener;
|
||||||
var oldBundles;
|
var oldBundles;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
testUtils.resetApplicationState();
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockPlugin = jasmine.createSpy('plugin');
|
mockPlugin = jasmine.createSpy('plugin');
|
||||||
mockPlugin2 = jasmine.createSpy('plugin2');
|
mockPlugin2 = jasmine.createSpy('plugin2');
|
||||||
mockListener = jasmine.createSpy('listener');
|
mockListener = jasmine.createSpy('listener');
|
||||||
oldBundles = legacyRegistry.list();
|
oldBundles = legacyRegistry.list();
|
||||||
|
|
||||||
openmct = new MCT();
|
openmct = testUtils.createOpenMct();
|
||||||
|
|
||||||
openmct.install(mockPlugin);
|
openmct.install(mockPlugin);
|
||||||
openmct.install(mockPlugin2);
|
openmct.install(mockPlugin2);
|
||||||
@ -52,6 +56,7 @@ define([
|
|||||||
legacyRegistry.delete(bundle);
|
legacyRegistry.delete(bundle);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
testUtils.resetApplicationState(openmct);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("exposes plugins", function () {
|
it("exposes plugins", function () {
|
||||||
@ -63,8 +68,11 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("start", function () {
|
describe("start", function () {
|
||||||
beforeEach(function () {
|
let appHolder;
|
||||||
openmct.start();
|
beforeEach(function (done) {
|
||||||
|
appHolder = document.createElement("div");
|
||||||
|
openmct.on('start', done);
|
||||||
|
openmct.start(appHolder);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("calls plugins for configuration", function () {
|
it("calls plugins for configuration", function () {
|
||||||
@ -75,25 +83,51 @@ define([
|
|||||||
it("emits a start event", function () {
|
it("emits a start event", function () {
|
||||||
expect(mockListener).toHaveBeenCalled();
|
expect(mockListener).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("Renders the application into the provided container element", function () {
|
||||||
|
let openMctShellElements = appHolder.querySelectorAll('div.l-shell');
|
||||||
|
expect(openMctShellElements.length).toBe(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("startHeadless", function () {
|
||||||
|
beforeEach(function (done) {
|
||||||
|
openmct.on('start', done);
|
||||||
|
openmct.startHeadless();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("calls plugins for configuration", function () {
|
||||||
|
expect(mockPlugin).toHaveBeenCalledWith(openmct);
|
||||||
|
expect(mockPlugin2).toHaveBeenCalledWith(openmct);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("emits a start event", function () {
|
||||||
|
expect(mockListener).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Does not render Open MCT", function () {
|
||||||
|
let openMctShellElements = document.body.querySelectorAll('div.l-shell');
|
||||||
|
expect(openMctShellElements.length).toBe(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("setAssetPath", function () {
|
describe("setAssetPath", function () {
|
||||||
var testAssetPath;
|
var testAssetPath;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
testAssetPath = "some/path";
|
|
||||||
openmct.legacyExtension = jasmine.createSpy('legacyExtension');
|
openmct.legacyExtension = jasmine.createSpy('legacyExtension');
|
||||||
openmct.setAssetPath(testAssetPath);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("internally configures the path for assets", function () {
|
it("configures the path for assets", function () {
|
||||||
expect(openmct.legacyExtension).toHaveBeenCalledWith(
|
testAssetPath = "some/path/";
|
||||||
'constants',
|
openmct.setAssetPath(testAssetPath);
|
||||||
{
|
expect(openmct.getAssetPath()).toBe(testAssetPath);
|
||||||
key: "ASSETS_PATH",
|
});
|
||||||
value: testAssetPath
|
|
||||||
}
|
it("adds a trailing /", function () {
|
||||||
);
|
testAssetPath = "some/path";
|
||||||
|
openmct.setAssetPath(testAssetPath);
|
||||||
|
expect(openmct.getAssetPath()).toBe(testAssetPath + "/");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'../../api/objects/object-utils'
|
'objectUtils'
|
||||||
], function (objectUtils) {
|
], function (objectUtils) {
|
||||||
function ActionDialogDecorator(mct, actionService) {
|
function ActionDialogDecorator(mct, actionService) {
|
||||||
this.mct = mct;
|
this.mct = mct;
|
||||||
|
@ -29,7 +29,6 @@ define([
|
|||||||
'./capabilities/APICapabilityDecorator',
|
'./capabilities/APICapabilityDecorator',
|
||||||
'./policies/AdaptedViewPolicy',
|
'./policies/AdaptedViewPolicy',
|
||||||
'./runs/AlternateCompositionInitializer',
|
'./runs/AlternateCompositionInitializer',
|
||||||
'./runs/TimeSettingsURLHandler',
|
|
||||||
'./runs/TypeDeprecationChecker',
|
'./runs/TypeDeprecationChecker',
|
||||||
'./runs/LegacyTelemetryProvider',
|
'./runs/LegacyTelemetryProvider',
|
||||||
'./runs/RegisterLegacyTypes',
|
'./runs/RegisterLegacyTypes',
|
||||||
@ -46,7 +45,6 @@ define([
|
|||||||
APICapabilityDecorator,
|
APICapabilityDecorator,
|
||||||
AdaptedViewPolicy,
|
AdaptedViewPolicy,
|
||||||
AlternateCompositionInitializer,
|
AlternateCompositionInitializer,
|
||||||
TimeSettingsURLHandler,
|
|
||||||
TypeDeprecationChecker,
|
TypeDeprecationChecker,
|
||||||
LegacyTelemetryProvider,
|
LegacyTelemetryProvider,
|
||||||
RegisterLegacyTypes,
|
RegisterLegacyTypes,
|
||||||
@ -134,16 +132,6 @@ define([
|
|||||||
implementation: AlternateCompositionInitializer,
|
implementation: AlternateCompositionInitializer,
|
||||||
depends: ["openmct"]
|
depends: ["openmct"]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
implementation: function (openmct, $location, $rootScope) {
|
|
||||||
return new TimeSettingsURLHandler(
|
|
||||||
openmct.time,
|
|
||||||
$location,
|
|
||||||
$rootScope
|
|
||||||
);
|
|
||||||
},
|
|
||||||
depends: ["openmct", "$location", "$rootScope"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
implementation: LegacyTelemetryProvider,
|
implementation: LegacyTelemetryProvider,
|
||||||
depends: [
|
depends: [
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(['../../api/objects/object-utils'], function (objectUtils) {
|
define(['objectUtils'], function (objectUtils) {
|
||||||
function AdapterCapability(domainObject) {
|
function AdapterCapability(domainObject) {
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* Module defining AlternateCompositionCapability. Created by vwoeltje on 11/7/14.
|
* Module defining AlternateCompositionCapability. Created by vwoeltje on 11/7/14.
|
||||||
*/
|
*/
|
||||||
define([
|
define([
|
||||||
'../../api/objects/object-utils',
|
'objectUtils',
|
||||||
'../../../platform/core/src/capabilities/ContextualDomainObject'
|
'../../../platform/core/src/capabilities/ContextualDomainObject'
|
||||||
], function (objectUtils, ContextualDomainObject) {
|
], function (objectUtils, ContextualDomainObject) {
|
||||||
function AlternateCompositionCapability($injector, domainObject) {
|
function AlternateCompositionCapability($injector, domainObject) {
|
||||||
|
@ -31,6 +31,7 @@ define([
|
|||||||
var capability = viewConstructor(domainObject);
|
var capability = viewConstructor(domainObject);
|
||||||
var oldInvoke = capability.invoke.bind(capability);
|
var oldInvoke = capability.invoke.bind(capability);
|
||||||
|
|
||||||
|
/* eslint-disable you-dont-need-lodash-underscore/map */
|
||||||
capability.invoke = function () {
|
capability.invoke = function () {
|
||||||
var availableViews = oldInvoke();
|
var availableViews = oldInvoke();
|
||||||
var newDomainObject = capability
|
var newDomainObject = capability
|
||||||
@ -52,6 +53,8 @@ define([
|
|||||||
.map('view')
|
.map('view')
|
||||||
.value();
|
.value();
|
||||||
};
|
};
|
||||||
|
/* eslint-enable you-dont-need-lodash-underscore/map */
|
||||||
|
|
||||||
return capability;
|
return capability;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
7
src/adapter/policies/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Espresso Theme
|
||||||
|
Dark theme for the Open MCT user interface.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```js
|
||||||
|
openmct.install(openmct.plugins.Espresso());
|
||||||
|
```
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
define([
|
define([
|
||||||
'../capabilities/AlternateCompositionCapability',
|
'../capabilities/AlternateCompositionCapability',
|
||||||
'../../api/objects/object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
AlternateCompositionCapability,
|
AlternateCompositionCapability,
|
||||||
objectUtils
|
objectUtils
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'../../api/objects/object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
utils
|
utils
|
||||||
) {
|
) {
|
||||||
|
@ -1,150 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define([
|
|
||||||
'lodash'
|
|
||||||
], function (
|
|
||||||
_
|
|
||||||
) {
|
|
||||||
// Parameter names in query string
|
|
||||||
var SEARCH = {
|
|
||||||
MODE: 'tc.mode',
|
|
||||||
TIME_SYSTEM: 'tc.timeSystem',
|
|
||||||
START_BOUND: 'tc.startBound',
|
|
||||||
END_BOUND: 'tc.endBound',
|
|
||||||
START_DELTA: 'tc.startDelta',
|
|
||||||
END_DELTA: 'tc.endDelta'
|
|
||||||
};
|
|
||||||
var TIME_EVENTS = ['bounds', 'timeSystem', 'clock', 'clockOffsets'];
|
|
||||||
// Used to shorthand calls to $location, which clears null parameters
|
|
||||||
var NULL_PARAMETERS = { key: null, start: null, end: null };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Communicates settings from the URL to the time API,
|
|
||||||
* and vice versa.
|
|
||||||
*/
|
|
||||||
function TimeSettingsURLHandler(time, $location, $rootScope) {
|
|
||||||
this.time = time;
|
|
||||||
this.$location = $location;
|
|
||||||
|
|
||||||
$rootScope.$on('$locationChangeSuccess', this.updateTime.bind(this));
|
|
||||||
|
|
||||||
TIME_EVENTS.forEach(function (event) {
|
|
||||||
this.time.on(event, this.updateQueryParams.bind(this));
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
this.updateTime(); // Initialize
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeSettingsURLHandler.prototype.updateQueryParams = function () {
|
|
||||||
var clock = this.time.clock();
|
|
||||||
var fixed = !clock;
|
|
||||||
var mode = fixed ? 'fixed' : clock.key;
|
|
||||||
var timeSystem = this.time.timeSystem() || NULL_PARAMETERS;
|
|
||||||
var bounds = fixed ? this.time.bounds() : NULL_PARAMETERS;
|
|
||||||
var deltas = fixed ? NULL_PARAMETERS : this.time.clockOffsets();
|
|
||||||
|
|
||||||
bounds = bounds || NULL_PARAMETERS;
|
|
||||||
deltas = deltas || NULL_PARAMETERS;
|
|
||||||
if (deltas.start) {
|
|
||||||
deltas = { start: -deltas.start, end: deltas.end };
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$location.search(SEARCH.MODE, mode);
|
|
||||||
this.$location.search(SEARCH.TIME_SYSTEM, timeSystem.key);
|
|
||||||
this.$location.search(SEARCH.START_BOUND, bounds.start);
|
|
||||||
this.$location.search(SEARCH.END_BOUND, bounds.end);
|
|
||||||
this.$location.search(SEARCH.START_DELTA, deltas.start);
|
|
||||||
this.$location.search(SEARCH.END_DELTA, deltas.end);
|
|
||||||
};
|
|
||||||
|
|
||||||
TimeSettingsURLHandler.prototype.parseQueryParams = function () {
|
|
||||||
var searchParams = _.pick(this.$location.search(), _.values(SEARCH));
|
|
||||||
var parsedParams = {
|
|
||||||
clock: searchParams[SEARCH.MODE],
|
|
||||||
timeSystem: searchParams[SEARCH.TIME_SYSTEM]
|
|
||||||
};
|
|
||||||
if (!isNaN(parseInt(searchParams[SEARCH.START_DELTA], 0xA)) &&
|
|
||||||
!isNaN(parseInt(searchParams[SEARCH.END_DELTA], 0xA))) {
|
|
||||||
parsedParams.clockOffsets = {
|
|
||||||
start: -searchParams[SEARCH.START_DELTA],
|
|
||||||
end: +searchParams[SEARCH.END_DELTA]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (!isNaN(parseInt(searchParams[SEARCH.START_BOUND], 0xA)) &&
|
|
||||||
!isNaN(parseInt(searchParams[SEARCH.END_BOUND], 0xA))) {
|
|
||||||
parsedParams.bounds = {
|
|
||||||
start: +searchParams[SEARCH.START_BOUND],
|
|
||||||
end: +searchParams[SEARCH.END_BOUND]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return parsedParams;
|
|
||||||
};
|
|
||||||
|
|
||||||
TimeSettingsURLHandler.prototype.updateTime = function () {
|
|
||||||
var params = this.parseQueryParams();
|
|
||||||
if (_.isEqual(params, this.last)) {
|
|
||||||
return; // Do nothing;
|
|
||||||
}
|
|
||||||
this.last = params;
|
|
||||||
|
|
||||||
if (!params.timeSystem) {
|
|
||||||
this.updateQueryParams();
|
|
||||||
} else if (params.clock === 'fixed' && params.bounds) {
|
|
||||||
if (!this.time.timeSystem() ||
|
|
||||||
this.time.timeSystem().key !== params.timeSystem) {
|
|
||||||
|
|
||||||
this.time.timeSystem(
|
|
||||||
params.timeSystem,
|
|
||||||
params.bounds
|
|
||||||
);
|
|
||||||
} else if (!_.isEqual(this.time.bounds(), params.bounds)) {
|
|
||||||
this.time.bounds(params.bounds);
|
|
||||||
}
|
|
||||||
if (this.time.clock()) {
|
|
||||||
this.time.stopClock();
|
|
||||||
}
|
|
||||||
} else if (params.clockOffsets) {
|
|
||||||
if (params.clock === 'fixed') {
|
|
||||||
this.time.stopClock();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.time.clock() ||
|
|
||||||
this.time.clock().key !== params.clock) {
|
|
||||||
|
|
||||||
this.time.clock(params.clock, params.clockOffsets);
|
|
||||||
} else if (!_.isEqual(this.time.clockOffsets(), params.clockOffsets)) {
|
|
||||||
this.time.clockOffsets(params.clockOffsets);
|
|
||||||
}
|
|
||||||
if (!this.time.timeSystem() ||
|
|
||||||
this.time.timeSystem().key !== params.timeSystem) {
|
|
||||||
|
|
||||||
this.time.timeSystem(params.timeSystem);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Neither found, update from timeSystem.
|
|
||||||
this.updateQueryParams();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return TimeSettingsURLHandler;
|
|
||||||
});
|
|
@ -1,576 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define([
|
|
||||||
'./TimeSettingsURLHandler',
|
|
||||||
'../../api/time/TimeAPI'
|
|
||||||
], function (
|
|
||||||
TimeSettingsURLHandler,
|
|
||||||
TimeAPI
|
|
||||||
) {
|
|
||||||
describe("TimeSettingsURLHandler", function () {
|
|
||||||
var time;
|
|
||||||
var $location;
|
|
||||||
var $rootScope;
|
|
||||||
var search;
|
|
||||||
var handler; // eslint-disable-line
|
|
||||||
var clockA;
|
|
||||||
var clockB;
|
|
||||||
var timeSystemA;
|
|
||||||
var timeSystemB;
|
|
||||||
var boundsA;
|
|
||||||
var boundsB;
|
|
||||||
var offsetsA;
|
|
||||||
var offsetsB;
|
|
||||||
var initialize;
|
|
||||||
var triggerLocationChange;
|
|
||||||
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
clockA = jasmine.createSpyObj('clockA', ['on', 'off']);
|
|
||||||
clockA.key = 'clockA';
|
|
||||||
clockA.currentValue = function () {
|
|
||||||
return 1000;
|
|
||||||
};
|
|
||||||
clockB = jasmine.createSpyObj('clockB', ['on', 'off']);
|
|
||||||
clockB.key = 'clockB';
|
|
||||||
clockB.currentValue = function () {
|
|
||||||
return 2000;
|
|
||||||
};
|
|
||||||
timeSystemA = {key: 'timeSystemA'};
|
|
||||||
timeSystemB = {key: 'timeSystemB'};
|
|
||||||
boundsA = {
|
|
||||||
start: 10,
|
|
||||||
end: 20
|
|
||||||
};
|
|
||||||
boundsB = {
|
|
||||||
start: 120,
|
|
||||||
end: 360
|
|
||||||
};
|
|
||||||
offsetsA = {
|
|
||||||
start: -100,
|
|
||||||
end: 0
|
|
||||||
};
|
|
||||||
offsetsB = {
|
|
||||||
start: -50,
|
|
||||||
end: 50
|
|
||||||
};
|
|
||||||
|
|
||||||
time = new TimeAPI();
|
|
||||||
|
|
||||||
[
|
|
||||||
'on',
|
|
||||||
'bounds',
|
|
||||||
'clockOffsets',
|
|
||||||
'timeSystem',
|
|
||||||
'clock',
|
|
||||||
'stopClock'
|
|
||||||
].forEach(function (method) {
|
|
||||||
spyOn(time, method).and.callThrough();
|
|
||||||
});
|
|
||||||
time.addTimeSystem(timeSystemA);
|
|
||||||
time.addTimeSystem(timeSystemB);
|
|
||||||
time.addClock(clockA);
|
|
||||||
time.addClock(clockB);
|
|
||||||
|
|
||||||
$location = jasmine.createSpyObj('$location', [
|
|
||||||
'search'
|
|
||||||
]);
|
|
||||||
$rootScope = jasmine.createSpyObj('$rootScope', [
|
|
||||||
'$on'
|
|
||||||
]);
|
|
||||||
|
|
||||||
search = {};
|
|
||||||
$location.search.and.callFake(function (key, value) {
|
|
||||||
if (arguments.length === 0) {
|
|
||||||
return search;
|
|
||||||
}
|
|
||||||
if (value === null) {
|
|
||||||
delete search[key];
|
|
||||||
} else {
|
|
||||||
search[key] = String(value);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(time.timeSystem()).toBeUndefined();
|
|
||||||
expect(time.bounds()).toEqual({});
|
|
||||||
expect(time.clockOffsets()).toBeUndefined();
|
|
||||||
expect(time.clock()).toBeUndefined();
|
|
||||||
|
|
||||||
initialize = function () {
|
|
||||||
handler = new TimeSettingsURLHandler(
|
|
||||||
time,
|
|
||||||
$location,
|
|
||||||
$rootScope
|
|
||||||
);
|
|
||||||
expect($rootScope.$on).toHaveBeenCalledWith(
|
|
||||||
'$locationChangeSuccess',
|
|
||||||
jasmine.any(Function)
|
|
||||||
);
|
|
||||||
triggerLocationChange = $rootScope.$on.calls.mostRecent().args[1];
|
|
||||||
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it("initializes with missing time system", function () {
|
|
||||||
// This handles an odd transitory case where a url does not include
|
|
||||||
// a timeSystem. It's generally only experienced by those who
|
|
||||||
// based their code on the tutorial before it specified a time
|
|
||||||
// system.
|
|
||||||
search['tc.mode'] = 'clockA';
|
|
||||||
search['tc.timeSystem'] = undefined;
|
|
||||||
search['tc.startDelta'] = '123';
|
|
||||||
search['tc.endDelta'] = '456';
|
|
||||||
|
|
||||||
// We don't specify behavior right now other than "don't break."
|
|
||||||
expect(initialize).not.toThrow();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("can initalize fixed mode from location", function () {
|
|
||||||
search['tc.mode'] = 'fixed';
|
|
||||||
search['tc.timeSystem'] = 'timeSystemA';
|
|
||||||
search['tc.startBound'] = '123';
|
|
||||||
search['tc.endBound'] = '456';
|
|
||||||
|
|
||||||
initialize();
|
|
||||||
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemA',
|
|
||||||
{
|
|
||||||
start: 123,
|
|
||||||
end: 456
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("can initialize clock mode from location", function () {
|
|
||||||
search['tc.mode'] = 'clockA';
|
|
||||||
search['tc.timeSystem'] = 'timeSystemA';
|
|
||||||
search['tc.startDelta'] = '123';
|
|
||||||
search['tc.endDelta'] = '456';
|
|
||||||
|
|
||||||
initialize();
|
|
||||||
|
|
||||||
expect(time.clock).toHaveBeenCalledWith(
|
|
||||||
'clockA',
|
|
||||||
{
|
|
||||||
start: -123,
|
|
||||||
end: 456
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemA'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("can initialize fixed mode from time API", function () {
|
|
||||||
time.timeSystem(timeSystemA.key, boundsA);
|
|
||||||
initialize();
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.mode', 'fixed');
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.timeSystem', 'timeSystemA');
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.startBound', 10);
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.endBound', 20);
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.startDelta', null);
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.endDelta', null);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("can initialize clock mode from time API", function () {
|
|
||||||
time.clock(clockA.key, offsetsA);
|
|
||||||
time.timeSystem(timeSystemA.key);
|
|
||||||
initialize();
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.mode', 'clockA');
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.timeSystem', 'timeSystemA');
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.startBound', null);
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.endBound', null);
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.startDelta', 100);
|
|
||||||
expect($location.search)
|
|
||||||
.toHaveBeenCalledWith('tc.endDelta', 0);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('location changes in fixed mode', function () {
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
time.timeSystem(timeSystemA.key, boundsA);
|
|
||||||
initialize();
|
|
||||||
time.timeSystem.calls.reset();
|
|
||||||
time.bounds.calls.reset();
|
|
||||||
time.clock.calls.reset();
|
|
||||||
time.stopClock.calls.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("does not change on spurious location change", function () {
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
'timeSystemA',
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.bounds).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.stopClock).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates timeSystem changes", function () {
|
|
||||||
search['tc.timeSystem'] = 'timeSystemB';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemB',
|
|
||||||
{
|
|
||||||
start: 10,
|
|
||||||
end: 20
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates bounds changes", function () {
|
|
||||||
search['tc.startBound'] = '100';
|
|
||||||
search['tc.endBound'] = '200';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.anything(), jasmine.anything()
|
|
||||||
);
|
|
||||||
expect(time.bounds).toHaveBeenCalledWith({
|
|
||||||
start: 100,
|
|
||||||
end: 200
|
|
||||||
});
|
|
||||||
search['tc.endBound'] = '300';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.anything(), jasmine.anything()
|
|
||||||
);
|
|
||||||
expect(time.bounds).toHaveBeenCalledWith({
|
|
||||||
start: 100,
|
|
||||||
end: 300
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates clock mode w/o timeSystem change", function () {
|
|
||||||
search['tc.mode'] = 'clockA';
|
|
||||||
search['tc.startDelta'] = '50';
|
|
||||||
search['tc.endDelta'] = '50';
|
|
||||||
delete search['tc.endBound'];
|
|
||||||
delete search['tc.startBound'];
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.clock).toHaveBeenCalledWith(
|
|
||||||
'clockA',
|
|
||||||
{
|
|
||||||
start: -50,
|
|
||||||
end: 50
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.anything(), jasmine.anything()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates clock mode and timeSystem", function () {
|
|
||||||
search['tc.mode'] = 'clockA';
|
|
||||||
search['tc.startDelta'] = '50';
|
|
||||||
search['tc.endDelta'] = '50';
|
|
||||||
search['tc.timeSystem'] = 'timeSystemB';
|
|
||||||
delete search['tc.endBound'];
|
|
||||||
delete search['tc.startBound'];
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.clock).toHaveBeenCalledWith(
|
|
||||||
'clockA',
|
|
||||||
{
|
|
||||||
start: -50,
|
|
||||||
end: 50
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith('timeSystemB');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('location changes in clock mode', function () {
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
time.clock(clockA.key, offsetsA);
|
|
||||||
time.timeSystem(timeSystemA.key);
|
|
||||||
initialize();
|
|
||||||
time.timeSystem.calls.reset();
|
|
||||||
time.bounds.calls.reset();
|
|
||||||
time.clock.calls.reset();
|
|
||||||
time.clockOffsets.calls.reset();
|
|
||||||
time.stopClock.calls.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("does not change on spurious location change", function () {
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
'timeSystemA',
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.clockOffsets).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.clock).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.bounds).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("changes time system", function () {
|
|
||||||
search['tc.timeSystem'] = 'timeSystemB';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemB'
|
|
||||||
);
|
|
||||||
expect(time.clockOffsets).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.clock).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.stopClock).not.toHaveBeenCalled();
|
|
||||||
expect(time.bounds).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("changes offsets", function () {
|
|
||||||
search['tc.startDelta'] = '50';
|
|
||||||
search['tc.endDelta'] = '50';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
'timeSystemA',
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
expect(time.clockOffsets).toHaveBeenCalledWith(
|
|
||||||
{
|
|
||||||
start: -50,
|
|
||||||
end: 50
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.clock).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.any(Object)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates to fixed w/o timeSystem change", function () {
|
|
||||||
search['tc.mode'] = 'fixed';
|
|
||||||
search['tc.startBound'] = '234';
|
|
||||||
search['tc.endBound'] = '567';
|
|
||||||
delete search['tc.endDelta'];
|
|
||||||
delete search['tc.startDelta'];
|
|
||||||
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.stopClock).toHaveBeenCalled();
|
|
||||||
expect(time.bounds).toHaveBeenCalledWith({
|
|
||||||
start: 234,
|
|
||||||
end: 567
|
|
||||||
});
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(
|
|
||||||
jasmine.anything(), jasmine.anything()
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates fixed and timeSystem", function () {
|
|
||||||
search['tc.mode'] = 'fixed';
|
|
||||||
search['tc.startBound'] = '234';
|
|
||||||
search['tc.endBound'] = '567';
|
|
||||||
search['tc.timeSystem'] = 'timeSystemB';
|
|
||||||
delete search['tc.endDelta'];
|
|
||||||
delete search['tc.startDelta'];
|
|
||||||
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.stopClock).toHaveBeenCalled();
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemB',
|
|
||||||
{
|
|
||||||
start: 234,
|
|
||||||
end: 567
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates clock", function () {
|
|
||||||
search['tc.mode'] = 'clockB';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.clock).toHaveBeenCalledWith(
|
|
||||||
'clockB',
|
|
||||||
{
|
|
||||||
start: -100,
|
|
||||||
end: 0
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.timeSystem).not.toHaveBeenCalledWith(jasmine.anything());
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates clock and timeSystem", function () {
|
|
||||||
search['tc.mode'] = 'clockB';
|
|
||||||
search['tc.timeSystem'] = 'timeSystemB';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.clock).toHaveBeenCalledWith(
|
|
||||||
'clockB',
|
|
||||||
{
|
|
||||||
start: -100,
|
|
||||||
end: 0
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemB'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates clock and timeSystem and offsets", function () {
|
|
||||||
search['tc.mode'] = 'clockB';
|
|
||||||
search['tc.timeSystem'] = 'timeSystemB';
|
|
||||||
search['tc.startDelta'] = '50';
|
|
||||||
search['tc.endDelta'] = '50';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.clock).toHaveBeenCalledWith(
|
|
||||||
'clockB',
|
|
||||||
{
|
|
||||||
start: -50,
|
|
||||||
end: 50
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(time.timeSystem).toHaveBeenCalledWith(
|
|
||||||
'timeSystemB'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("stops the clock", function () {
|
|
||||||
// this is a robustness test, unsure if desired, requires
|
|
||||||
// user to be manually editing location strings.
|
|
||||||
search['tc.mode'] = 'fixed';
|
|
||||||
triggerLocationChange();
|
|
||||||
expect(time.stopClock).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
describe("location updates from time API in fixed", function () {
|
|
||||||
beforeEach(function () {
|
|
||||||
time.timeSystem(timeSystemA.key, boundsA);
|
|
||||||
initialize();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates on bounds change", function () {
|
|
||||||
time.bounds(boundsB);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'fixed',
|
|
||||||
'tc.startBound': '120',
|
|
||||||
'tc.endBound': '360',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates on timeSystem change", function () {
|
|
||||||
time.timeSystem(timeSystemB, boundsA);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'fixed',
|
|
||||||
'tc.startBound': '10',
|
|
||||||
'tc.endBound': '20',
|
|
||||||
'tc.timeSystem': 'timeSystemB'
|
|
||||||
});
|
|
||||||
time.timeSystem(timeSystemA, boundsB);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'fixed',
|
|
||||||
'tc.startBound': '120',
|
|
||||||
'tc.endBound': '360',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("Updates to clock", function () {
|
|
||||||
time.clock(clockA, offsetsA);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'clockA',
|
|
||||||
'tc.startDelta': '100',
|
|
||||||
'tc.endDelta': '0',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("location updates from time API in fixed", function () {
|
|
||||||
beforeEach(function () {
|
|
||||||
time.clock(clockA.key, offsetsA);
|
|
||||||
time.timeSystem(timeSystemA.key);
|
|
||||||
initialize();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates offsets", function () {
|
|
||||||
time.clockOffsets(offsetsB);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'clockA',
|
|
||||||
'tc.startDelta': '50',
|
|
||||||
'tc.endDelta': '50',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates clocks", function () {
|
|
||||||
time.clock(clockB, offsetsA);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'clockB',
|
|
||||||
'tc.startDelta': '100',
|
|
||||||
'tc.endDelta': '0',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
time.clock(clockA, offsetsB);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'clockA',
|
|
||||||
'tc.startDelta': '50',
|
|
||||||
'tc.endDelta': '50',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates timesystems", function () {
|
|
||||||
time.timeSystem(timeSystemB);
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'clockA',
|
|
||||||
'tc.startDelta': '100',
|
|
||||||
'tc.endDelta': '0',
|
|
||||||
'tc.timeSystem': 'timeSystemB'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("stops the clock", function () {
|
|
||||||
time.stopClock();
|
|
||||||
expect(search).toEqual({
|
|
||||||
'tc.mode': 'fixed',
|
|
||||||
'tc.startBound': '900',
|
|
||||||
'tc.endBound': '1000',
|
|
||||||
'tc.timeSystem': 'timeSystemA'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'../../api/objects/object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
utils
|
utils
|
||||||
) {
|
) {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'../../api/objects/object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
objectUtils
|
objectUtils
|
||||||
) {
|
) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
define([
|
define([
|
||||||
'./LegacyViewProvider',
|
'./LegacyViewProvider',
|
||||||
'./TypeInspectorViewProvider',
|
'./TypeInspectorViewProvider',
|
||||||
'../../api/objects/object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
LegacyViewProvider,
|
LegacyViewProvider,
|
||||||
TypeInspectorViewProvider,
|
TypeInspectorViewProvider,
|
||||||
|
@ -70,7 +70,7 @@ define([
|
|||||||
* @memberof module:openmct.CompositionAPI#
|
* @memberof module:openmct.CompositionAPI#
|
||||||
*/
|
*/
|
||||||
CompositionAPI.prototype.get = function (domainObject) {
|
CompositionAPI.prototype.get = function (domainObject) {
|
||||||
var provider = _.find(this.registry, function (p) {
|
var provider = this.registry.find(p => {
|
||||||
return p.appliesTo(domainObject);
|
return p.appliesTo(domainObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ define([
|
|||||||
throw new Error('Event not supported by composition: ' + event);
|
throw new Error('Event not supported by composition: ' + event);
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = _.findIndex(this.listeners[event], function (l) {
|
var index = this.listeners[event].findIndex(l => {
|
||||||
return l.callback === callback && l.context === context;
|
return l.callback === callback && l.context === context;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
define([
|
define([
|
||||||
'lodash',
|
'lodash',
|
||||||
'../objects/object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
_,
|
_,
|
||||||
objectUtils
|
objectUtils
|
||||||
@ -143,7 +143,7 @@ define([
|
|||||||
var keyString = objectUtils.makeKeyString(domainObject.identifier);
|
var keyString = objectUtils.makeKeyString(domainObject.identifier);
|
||||||
var objectListeners = this.listeningTo[keyString];
|
var objectListeners = this.listeningTo[keyString];
|
||||||
|
|
||||||
var index = _.findIndex(objectListeners[event], function (l) {
|
var index = objectListeners[event].findIndex(l => {
|
||||||
return l.callback === callback && l.context === context;
|
return l.callback === callback && l.context === context;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -196,8 +196,8 @@ define([
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
DefaultCompositionProvider.prototype.includes = function (parent, childId) {
|
DefaultCompositionProvider.prototype.includes = function (parent, childId) {
|
||||||
return parent.composition.findIndex(composee =>
|
return parent.composition.some(composee =>
|
||||||
this.publicAPI.objects.areIdsEqual(composee, childId)) !== -1;
|
this.publicAPI.objects.areIdsEqual(composee, childId));
|
||||||
};
|
};
|
||||||
|
|
||||||
DefaultCompositionProvider.prototype.reorder = function (domainObject, oldIndex, newIndex) {
|
DefaultCompositionProvider.prototype.reorder = function (domainObject, oldIndex, newIndex) {
|
||||||
|
@ -128,6 +128,11 @@ export default class NotificationAPI extends EventEmitter {
|
|||||||
return this._notify(notificationModel);
|
return this._notify(notificationModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dismissAllNotifications() {
|
||||||
|
this.notifications = [];
|
||||||
|
this.emit('dismiss-all');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimize a notification. The notification will still be available
|
* Minimize a notification. The notification will still be available
|
||||||
* from the notification list. Typically notifications with a
|
* from the notification list. Typically notifications with a
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'./object-utils.js',
|
'objectUtils',
|
||||||
'lodash'
|
'lodash'
|
||||||
], function (
|
], function (
|
||||||
utils,
|
utils,
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
define([
|
define([
|
||||||
'lodash',
|
'lodash',
|
||||||
'./object-utils',
|
'objectUtils',
|
||||||
'./MutableObject',
|
'./MutableObject',
|
||||||
'./RootRegistry',
|
'./RootRegistry',
|
||||||
'./RootObjectProvider',
|
'./RootObjectProvider',
|
||||||
|
@ -43,7 +43,7 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
RootRegistry.prototype.addRoot = function (key) {
|
RootRegistry.prototype.addRoot = function (key) {
|
||||||
if (isKey(key) || (_.isArray(key) && _.every(key, isKey))) {
|
if (isKey(key) || (Array.isArray(key) && key.every(isKey))) {
|
||||||
this.providers.push(function () {
|
this.providers.push(function () {
|
||||||
return key;
|
return key;
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
define([
|
define([
|
||||||
'../object-utils'
|
'objectUtils'
|
||||||
], function (
|
], function (
|
||||||
objectUtils
|
objectUtils
|
||||||
) {
|
) {
|
||||||
|
@ -33,92 +33,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@import "~styles/sass-base";
|
|
||||||
|
|
||||||
@mixin legacyMessage() {
|
|
||||||
flex: 0 1 auto;
|
|
||||||
font-family: symbolsfont;
|
|
||||||
font-size: $messageIconD; // Singleton message in a dialog
|
|
||||||
margin-right: $interiorMarginLg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.c-message {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
> * + * {
|
|
||||||
margin-left: $interiorMarginLg;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__icon {
|
|
||||||
// Holds a background SVG graphic
|
|
||||||
$s: 80px;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
min-width: $s;
|
|
||||||
min-height: $s;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__text {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1 1 auto;
|
|
||||||
|
|
||||||
> * + * {
|
|
||||||
margin-top: $interiorMargin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// __text elements
|
|
||||||
&__action-text {
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__title {
|
|
||||||
font-size: 1.5em;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--simple {
|
|
||||||
// Icon and text elements only
|
|
||||||
&:before {
|
|
||||||
font-size: 30px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*='__text'] {
|
|
||||||
font-size: 1.25em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************** LEGACY */
|
|
||||||
&.message-severity-info:before {
|
|
||||||
@include legacyMessage();
|
|
||||||
content: $glyph-icon-info;
|
|
||||||
color: $colorInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.message-severity-alert:before {
|
|
||||||
@include legacyMessage();
|
|
||||||
content: $glyph-icon-alert-rect;
|
|
||||||
color: $colorWarningLo;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.message-severity-error:before {
|
|
||||||
@include legacyMessage();
|
|
||||||
content: $glyph-icon-alert-triangle;
|
|
||||||
color: $colorWarningHi;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Messages in a list
|
|
||||||
.c-overlay__messages & {
|
|
||||||
padding: $interiorMarginLg;
|
|
||||||
&:before {
|
|
||||||
font-size: $messageListIconD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
inject:['iconClass', 'title', 'hint', 'timestamp', 'message']
|
inject:['iconClass', 'title', 'hint', 'timestamp', 'message']
|
||||||
|