Compare commits
607 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1580798479 | ||
|
|
b7b345dacd | ||
|
|
0b22aa55a1 | ||
|
|
3eddea6e88 | ||
|
|
c85e097f8a | ||
|
|
81bc4ef58b | ||
|
|
9fec3ca9ea | ||
|
|
ee29cf9efc | ||
|
|
17aba39636 | ||
|
|
2cd1b07a41 | ||
|
|
72d00314a4 | ||
|
|
5b077ab083 | ||
|
|
da2d6bc3a8 | ||
|
|
33930a5b9c | ||
|
|
fbff4f9219 | ||
|
|
30f725f1e1 | ||
|
|
47cd05b48e | ||
|
|
9a4433bf68 | ||
|
|
d0b2151b4d | ||
|
|
21e22a2d0d | ||
|
|
f3a653c57f | ||
|
|
c9bf412240 | ||
|
|
48955b5fa1 | ||
|
|
24a5748528 | ||
|
|
8758279b14 | ||
|
|
99bb24d899 | ||
|
|
c93a905c1d | ||
|
|
a1e75d2f0b | ||
|
|
fb48bc374a | ||
|
|
10a6ccbbcd | ||
|
|
fea082ec77 | ||
|
|
aa9d2466cd | ||
|
|
97492d7aa0 | ||
|
|
18761cf07b | ||
|
|
9b3dd82ec0 | ||
|
|
e485c964c5 | ||
|
|
5b30d081d7 | ||
|
|
b96094b878 | ||
|
|
1f43537304 | ||
|
|
01e64db0dc | ||
|
|
3ab46bb39a | ||
|
|
af168c69b9 | ||
|
|
63e052c3a3 | ||
|
|
563e34a816 | ||
|
|
1524d06149 | ||
|
|
e9711a0b9c | ||
|
|
9fcf510ffd | ||
|
|
70227f2e43 | ||
|
|
1babd01f38 | ||
|
|
768bfb3525 | ||
|
|
fc5a624efb | ||
|
|
47bf91e150 | ||
|
|
8f4288583e | ||
|
|
595af3bce8 | ||
|
|
dba7efe030 | ||
|
|
1b142b33f1 | ||
|
|
13814c752d | ||
|
|
dd477d49ec | ||
|
|
5decd2624a | ||
|
|
6f9aee42a7 | ||
|
|
1333aae7fb | ||
|
|
33ad89a381 | ||
|
|
02a5852072 | ||
|
|
12782e4daf | ||
|
|
704b78a003 | ||
|
|
ec4f77c8b7 | ||
|
|
1871287a1f | ||
|
|
f9cc230227 | ||
|
|
fe4a7b65e7 | ||
|
|
b3819de878 | ||
|
|
2699d24441 | ||
|
|
1933dee8ca | ||
|
|
375e61f263 | ||
|
|
872d0ca5e6 | ||
|
|
973ad565cd | ||
|
|
7a7fdf9c99 | ||
|
|
49ffaae3ec | ||
|
|
d5494cff08 | ||
|
|
71afc99ec3 | ||
|
|
b5d97e25b7 | ||
|
|
6c26aa7a99 | ||
|
|
712fc63f93 | ||
|
|
77c53130a4 | ||
|
|
73c8e3096d | ||
|
|
8230098f50 | ||
|
|
fd42091f87 | ||
|
|
ec4b36b178 | ||
|
|
0995dfbf43 | ||
|
|
70d4c724c2 | ||
|
|
1d7378f84b | ||
|
|
b4a4ee212e | ||
|
|
25910e7655 | ||
|
|
8e5ba804f6 | ||
|
|
173f9ba7e8 | ||
|
|
e712c19bbe | ||
|
|
aea3c9dbaa | ||
|
|
2f8aade697 | ||
|
|
a7b930a422 | ||
|
|
4e69b73b0f | ||
|
|
c47dd05095 | ||
|
|
15c815fb5e | ||
|
|
9de676acee | ||
|
|
ff0967f0d8 | ||
|
|
e5d082b9b3 | ||
|
|
93aa6b5b80 | ||
|
|
1f74c0bad5 | ||
|
|
a8cb70910e | ||
|
|
852636f07c | ||
|
|
cf5c2c5ba2 | ||
|
|
10f4b99cd3 | ||
|
|
8456bbf762 | ||
|
|
ab39242cc4 | ||
|
|
b799ab6f0b | ||
|
|
cb4d81d6ad | ||
|
|
adf935b1df | ||
|
|
f1cb0101b9 | ||
|
|
4768fd081e | ||
|
|
4a8d9a7fb0 | ||
|
|
ba62b46a45 | ||
|
|
fbf4dae001 | ||
|
|
5943bf04d5 | ||
|
|
93ec19b93f | ||
|
|
63d3f22c93 | ||
|
|
685c7713e4 | ||
|
|
4cfa26a55e | ||
|
|
5dc74e1ef7 | ||
|
|
b703f7a3c4 | ||
|
|
26f0ce0749 | ||
|
|
12d2a04946 | ||
|
|
5501f3e61c | ||
|
|
61f143dfd3 | ||
|
|
8737e8032e | ||
|
|
dfa48caf63 | ||
|
|
e4c933af55 | ||
|
|
be1bd2863f | ||
|
|
507ea61151 | ||
|
|
4f79c86c0e | ||
|
|
160c3c1048 | ||
|
|
8eb751f0c3 | ||
|
|
75bc469708 | ||
|
|
21082fbe0e | ||
|
|
4e7d16b642 | ||
|
|
b68051d3c5 | ||
|
|
bc22797009 | ||
|
|
7a4fe5055d | ||
|
|
6a75ac4a57 | ||
|
|
34da15fd6a | ||
|
|
dd0fab7275 | ||
|
|
ade3cc72a7 | ||
|
|
02e82a7658 | ||
|
|
6e3b9c2977 | ||
|
|
34e03b01bb | ||
|
|
dab35acd2c | ||
|
|
a93741e64b | ||
|
|
549f878c98 | ||
|
|
194f45263b | ||
|
|
83668a6840 | ||
|
|
c9a4f07a7a | ||
|
|
e9c88ea176 | ||
|
|
fbaded4548 | ||
|
|
570e8d9f23 | ||
|
|
0d76c036cb | ||
|
|
138c55cf54 | ||
|
|
60cd8812a9 | ||
|
|
5c5bfbdbbe | ||
|
|
75c34bf18d | ||
|
|
b56cc1cd16 | ||
|
|
1a357df9b3 | ||
|
|
d36e5acaea | ||
|
|
f4f34d02fb | ||
|
|
3fdd3080c1 | ||
|
|
5d525b80b6 | ||
|
|
5e5b0d69d8 | ||
|
|
33b8bd27eb | ||
|
|
8679b8756e | ||
|
|
2a37cb31d9 | ||
|
|
4ad303b358 | ||
|
|
8fe1d33068 | ||
|
|
4999ab5de7 | ||
|
|
8b19f16430 | ||
|
|
a17eb14cdf | ||
|
|
1ad0fa6a9b | ||
|
|
77dcc80522 | ||
|
|
fe10b06928 | ||
|
|
e35f2b8f51 | ||
|
|
0bca2d8920 | ||
|
|
f421119f9d | ||
|
|
ebef0efe06 | ||
|
|
8fc2ecf55c | ||
|
|
3147a0bd98 | ||
|
|
2c705712fc | ||
|
|
d483785098 | ||
|
|
298fe6a779 | ||
|
|
f07e613631 | ||
|
|
60472e2fe0 | ||
|
|
81c950407d | ||
|
|
a34269cc7d | ||
|
|
a8f74a1078 | ||
|
|
58a53e3470 | ||
|
|
fba2a35cef | ||
|
|
b9644b7456 | ||
|
|
afaedb9062 | ||
|
|
f2df7170d2 | ||
|
|
d6827e3601 | ||
|
|
c028e49bfd | ||
|
|
9b1f277530 | ||
|
|
901f28a79f | ||
|
|
3fed697c37 | ||
|
|
d567765a3c | ||
|
|
4dbc17572a | ||
|
|
330c5a85f1 | ||
|
|
2c1400d323 | ||
|
|
cb22764d68 | ||
|
|
eee77a1c9b | ||
|
|
71fb1442f1 | ||
|
|
23908edc28 | ||
|
|
df4ca86d35 | ||
|
|
03f040da0e | ||
|
|
e21bbcc6fe | ||
|
|
23f5dde488 | ||
|
|
29326f3610 | ||
|
|
593ebde211 | ||
|
|
11507c5e5e | ||
|
|
c49dccf254 | ||
|
|
029bee18fb | ||
|
|
ec475e4b7b | ||
|
|
045c171bb4 | ||
|
|
21341132f6 | ||
|
|
ac68fe1a6d | ||
|
|
13855934f9 | ||
|
|
5b62883c1c | ||
|
|
c9681d55bf | ||
|
|
7cfea8a6a0 | ||
|
|
2011864fdb | ||
|
|
8f0cffe424 | ||
|
|
3df372434f | ||
|
|
933dd753a8 | ||
|
|
3992bcda9b | ||
|
|
69e34f048a | ||
|
|
b0a11983fa | ||
|
|
807e6aaaa6 | ||
|
|
324a1f55cc | ||
|
|
abccff03f7 | ||
|
|
aa619c453f | ||
|
|
10b5c03248 | ||
|
|
fde52f5d84 | ||
|
|
78df7e7cc9 | ||
|
|
e314715335 | ||
|
|
a1cf065ec6 | ||
|
|
f9570556c5 | ||
|
|
9859610e80 | ||
|
|
feab2a040b | ||
|
|
35c390a2f9 | ||
|
|
ebb96d7ad7 | ||
|
|
3d58860f6f | ||
|
|
c223566302 | ||
|
|
1439714fa6 | ||
|
|
9c06e9a0bd | ||
|
|
f98cf7812b | ||
|
|
ee0e81e795 | ||
|
|
bd559b6eeb | ||
|
|
c51191aaf0 | ||
|
|
4a2645d4c6 | ||
|
|
3ad1709a0a | ||
|
|
cc135398e2 | ||
|
|
067472643d | ||
|
|
225c98c52a | ||
|
|
00e991ecfc | ||
|
|
a362e97dfe | ||
|
|
1ea532fe26 | ||
|
|
9a1c8290e4 | ||
|
|
0d959116d8 | ||
|
|
0b9f575dab | ||
|
|
13bc910d7c | ||
|
|
9e2f8e2461 | ||
|
|
61e7cdaa81 | ||
|
|
53aecdc607 | ||
|
|
2da511021e | ||
|
|
371b319e92 | ||
|
|
ff42ec2cc6 | ||
|
|
7278d4b1fc | ||
|
|
6930106380 | ||
|
|
c0859642fd | ||
|
|
37821ee008 | ||
|
|
c31cb01065 | ||
|
|
1fa58674f3 | ||
|
|
d204c158a2 | ||
|
|
b0b4d5e26a | ||
|
|
c2c722e12e | ||
|
|
1a61ee3ec0 | ||
|
|
d5afa1815e | ||
|
|
87667676e6 | ||
|
|
bfeb015d71 | ||
|
|
a9c514aaf7 | ||
|
|
7fa6665445 | ||
|
|
ff6b20b69c | ||
|
|
c4bf44677a | ||
|
|
8bdcfb06c5 | ||
|
|
b3643ffbb7 | ||
|
|
b91d4bdcaf | ||
|
|
8bc8e2dadf | ||
|
|
84d5becf2a | ||
|
|
e8120c5f79 | ||
|
|
40c6a2621c | ||
|
|
06887f6ff1 | ||
|
|
7847cf7d63 | ||
|
|
121a44ef15 | ||
|
|
823e4ccdd6 | ||
|
|
0c45d69662 | ||
|
|
df23842c57 | ||
|
|
d68a4dce5f | ||
|
|
db86e394cf | ||
|
|
4c9326a9da | ||
|
|
200fea952a | ||
|
|
90a0a7d39b | ||
|
|
26252be75a | ||
|
|
6c6366e6f0 | ||
|
|
de04a403d7 | ||
|
|
0b6f1fc21b | ||
|
|
445f8e5c36 | ||
|
|
a29136037c | ||
|
|
08953cc919 | ||
|
|
22f835d3cb | ||
|
|
823f172a9f | ||
|
|
44dff83046 | ||
|
|
569430e5cd | ||
|
|
07a1c23df5 | ||
|
|
b97b8477ad | ||
|
|
9b72dfe076 | ||
|
|
3ee83a4c4a | ||
|
|
cdd2259d08 | ||
|
|
fc368ee425 | ||
|
|
7a2e08c3eb | ||
|
|
ba0d069283 | ||
|
|
670d86eb5f | ||
|
|
63f38b7acd | ||
|
|
8b5ffc6f84 | ||
|
|
cce2052e79 | ||
|
|
8ea6283430 | ||
|
|
08b86c1c6d | ||
|
|
0449a3ff31 | ||
|
|
4ea46f197e | ||
|
|
d7edaa3ba2 | ||
|
|
632fc5aace | ||
|
|
b9abb36799 | ||
|
|
d7e7b99a76 | ||
|
|
db87c8740e | ||
|
|
5f2b54a320 | ||
|
|
f62d0e1300 | ||
|
|
9e156c1c30 | ||
|
|
26965b4948 | ||
|
|
7a03928f48 | ||
|
|
8f14efdaff | ||
|
|
03a7e24204 | ||
|
|
2f7cb1bc8a | ||
|
|
64783b7f06 | ||
|
|
8ed872756c | ||
|
|
83ea472d37 | ||
|
|
0505163ff9 | ||
|
|
3d38bb478f | ||
|
|
654e906f6b | ||
|
|
54da6c69ab | ||
|
|
8284e829fb | ||
|
|
bcfff469de | ||
|
|
b5ceb268ef | ||
|
|
8583eaa8ad | ||
|
|
ef66da7d94 | ||
|
|
1b4e0f5de7 | ||
|
|
479247b60c | ||
|
|
57c8fbe14e | ||
|
|
938a20e7c0 | ||
|
|
dc842e9201 | ||
|
|
f5dbdf245a | ||
|
|
35357afb90 | ||
|
|
419877b364 | ||
|
|
143d515bfc | ||
|
|
8481dacff4 | ||
|
|
94905a287a | ||
|
|
34af780264 | ||
|
|
3c8a3caa1d | ||
|
|
9d566ef302 | ||
|
|
e23a07af03 | ||
|
|
2312db46f2 | ||
|
|
52434a837f | ||
|
|
230ad33f02 | ||
|
|
b3495b8c00 | ||
|
|
dec790a9f3 | ||
|
|
cfe12c5a5d | ||
|
|
944bee6101 | ||
|
|
38ed046c9f | ||
|
|
1acf063755 | ||
|
|
c426c826f7 | ||
|
|
4b1275ae56 | ||
|
|
b3c3134a86 | ||
|
|
c311c12bcf | ||
|
|
76321937d7 | ||
|
|
c9ca2b99f6 | ||
|
|
d42f0b2d40 | ||
|
|
e530c23d4c | ||
|
|
0973ee8abb | ||
|
|
3ee7537a6c | ||
|
|
d769afab6f | ||
|
|
cf86509a0b | ||
|
|
54894c3a26 | ||
|
|
9c12b04578 | ||
|
|
1519849219 | ||
|
|
202b93d8be | ||
|
|
0a62bee3a1 | ||
|
|
9579f12a83 | ||
|
|
463d4ce518 | ||
|
|
2e4d196452 | ||
|
|
4078af2996 | ||
|
|
73825ea266 | ||
|
|
b2a0d61844 | ||
|
|
1774edabc0 | ||
|
|
54b8e7c136 | ||
|
|
54f09f73db | ||
|
|
35aca1d4cf | ||
|
|
757333c2d6 | ||
|
|
92728de04c | ||
|
|
407f14ffca | ||
|
|
ecb8a5c244 | ||
|
|
0e8fab4872 | ||
|
|
c15fa0c592 | ||
|
|
09ab00e360 | ||
|
|
1728f924cf | ||
|
|
8dc10fbd9a | ||
|
|
a16170e701 | ||
|
|
07c0bba568 | ||
|
|
d36d18f85b | ||
|
|
bd20ce12ac | ||
|
|
1cdfcfaa3c | ||
|
|
2fdace518a | ||
|
|
3516e4ef45 | ||
|
|
d842968142 | ||
|
|
600741620a | ||
|
|
45f4277eb4 | ||
|
|
bcf3041c91 | ||
|
|
da423340ec | ||
|
|
4003d4f1aa | ||
|
|
a6b782e0ce | ||
|
|
5648de9ba8 | ||
|
|
13eb365f7b | ||
|
|
8257d9d037 | ||
|
|
babbeb79f0 | ||
|
|
8028397f27 | ||
|
|
e05c8e6060 | ||
|
|
ef8839aafa | ||
|
|
14860f6a8b | ||
|
|
a52c783857 | ||
|
|
5e7c785891 | ||
|
|
b242cefaa0 | ||
|
|
fae2b70866 | ||
|
|
1119fce44c | ||
|
|
bfb7edc0eb | ||
|
|
a39a739473 | ||
|
|
c9dfac5b1d | ||
|
|
1b66fff3be | ||
|
|
0fe1b5f9d4 | ||
|
|
143db90a50 | ||
|
|
bac90db3ee | ||
|
|
649d46de89 | ||
|
|
0163e85eda | ||
|
|
f25beb3fb7 | ||
|
|
c66f63d7a5 | ||
|
|
16ae0aa3d8 | ||
|
|
68ada7b590 | ||
|
|
9e745ef648 | ||
|
|
ee0d7f5ec9 | ||
|
|
1b3bbb6c3b | ||
|
|
7bee07c9da | ||
|
|
74ab7a5a42 | ||
|
|
e36853ca84 | ||
|
|
bc65b62776 | ||
|
|
d43b35ba6f | ||
|
|
6e4f0ccee8 | ||
|
|
0ce7772aa3 | ||
|
|
f6ef38479c | ||
|
|
bf85ddaaff | ||
|
|
8bb96c8c91 | ||
|
|
42b05cee00 | ||
|
|
d0fd02123a | ||
|
|
e34203dac3 | ||
|
|
c2bd8518a6 | ||
|
|
46363ccc70 | ||
|
|
5e1512e777 | ||
|
|
188c045fdb | ||
|
|
57d921dc2b | ||
|
|
df0804c8fd | ||
|
|
c289dde806 | ||
|
|
b7cadca3b7 | ||
|
|
43f8200707 | ||
|
|
a1b580bba6 | ||
|
|
19d0313ea2 | ||
|
|
667fe43e23 | ||
|
|
096eba3876 | ||
|
|
99115a12e6 | ||
|
|
7d601cbbc9 | ||
|
|
bf6a09c5aa | ||
|
|
99967e720f | ||
|
|
27f489de20 | ||
|
|
46941d3aa1 | ||
|
|
60c230add7 | ||
|
|
0784a0c6f5 | ||
|
|
9288d89248 | ||
|
|
391fbe130b | ||
|
|
e25c8c4145 | ||
|
|
57353d1b40 | ||
|
|
7f4e08154f | ||
|
|
500c82815b | ||
|
|
4a846f04e9 | ||
|
|
b1e9d87e2a | ||
|
|
ab6ed7da34 | ||
|
|
2e6883c527 | ||
|
|
4c44999b2c | ||
|
|
34c118cf83 | ||
|
|
38a89b9783 | ||
|
|
6e836795b2 | ||
|
|
719fc41dd1 | ||
|
|
467ec201da | ||
|
|
5ab143de41 | ||
|
|
284e497483 | ||
|
|
c5613dddf1 | ||
|
|
34fb3ac79f | ||
|
|
5f58c328f1 | ||
|
|
7d1dbb87db | ||
|
|
45f4d46245 | ||
|
|
44d05c35ac | ||
|
|
edd2cb85f7 | ||
|
|
6c364369bb | ||
|
|
869841b2ac | ||
|
|
c71f722552 | ||
|
|
af3a1e00c6 | ||
|
|
5b2ec81e65 | ||
|
|
0008e5803b | ||
|
|
e1c1f67abb | ||
|
|
30283235a4 | ||
|
|
845e33b396 | ||
|
|
17baa66188 | ||
|
|
5df7bd12c9 | ||
|
|
e14c8b61a0 | ||
|
|
a8a3ec66fd | ||
|
|
a4b9c2da12 | ||
|
|
e6146dae0f | ||
|
|
bd3fe880a4 | ||
|
|
02e919c39b | ||
|
|
99c73aef2d | ||
|
|
be377b5f59 | ||
|
|
6b11ae4312 | ||
|
|
9021977a54 | ||
|
|
9c8d06578a | ||
|
|
114beb2480 | ||
|
|
e97a5cbb29 | ||
|
|
e87efc8bc3 | ||
|
|
be7f601d21 | ||
|
|
9b59d10677 | ||
|
|
a40669e07f | ||
|
|
0bcf5d4be7 | ||
|
|
8bc96764a6 | ||
|
|
6ea03e58b4 | ||
|
|
94801665ab | ||
|
|
aa12151e19 | ||
|
|
c2429e92d2 | ||
|
|
5ffc85c066 | ||
|
|
fad757c878 | ||
|
|
3351a281ee | ||
|
|
1f0053f531 | ||
|
|
935dc38360 | ||
|
|
bfef7fae93 | ||
|
|
da6d456f6f | ||
|
|
c19199c2fb | ||
|
|
1e78861f85 | ||
|
|
10bc5a0bf6 | ||
|
|
313af904df | ||
|
|
8c478087a9 | ||
|
|
ccac41c6d4 | ||
|
|
69635f2c40 | ||
|
|
1867ea50bb | ||
|
|
c64d5ef6c0 | ||
|
|
e3a63899d3 | ||
|
|
4685887fe5 | ||
|
|
f103357e60 | ||
|
|
11738f73ac | ||
|
|
d07c4f969b | ||
|
|
505aafbce3 | ||
|
|
b765693879 | ||
|
|
4620fed0cf | ||
|
|
48ad1d2dce | ||
|
|
f2c323a089 | ||
|
|
ec17cc7eab | ||
|
|
6c7bbe9041 | ||
|
|
551b0222c4 | ||
|
|
2b0e6e9e79 | ||
|
|
4727c19253 | ||
|
|
2ff4d07e83 | ||
|
|
1997f53f40 | ||
|
|
c03b5d51b7 | ||
|
|
197665bb6a | ||
|
|
28fbc2ae62 | ||
|
|
ea1c4ca85c | ||
|
|
588e0cce43 | ||
|
|
8a50351520 | ||
|
|
34e39eda4a | ||
|
|
28a8525ce3 | ||
|
|
5e70f9c04a | ||
|
|
a05b5ba68d | ||
|
|
40ba66c58e |
12
.circleci/Dockerfile.cypress
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM cypress/browsers:chrome67
|
||||||
|
|
||||||
|
ENV APP /usr/src/app
|
||||||
|
WORKDIR $APP
|
||||||
|
|
||||||
|
COPY package.json $APP/package.json
|
||||||
|
RUN npm run cypress:install > /dev/null
|
||||||
|
|
||||||
|
COPY client/cypress $APP/client/cypress
|
||||||
|
COPY cypress.json $APP/cypress.json
|
||||||
|
|
||||||
|
RUN ./node_modules/.bin/cypress verify
|
||||||
@@ -1,6 +1,19 @@
|
|||||||
version: 2.0
|
version: 2.0
|
||||||
|
|
||||||
|
flake8-steps: &steps
|
||||||
|
- checkout
|
||||||
|
- run: sudo pip install flake8
|
||||||
|
- run: ./bin/flake8_tests.sh
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
python-flake8-tests:
|
||||||
|
docker:
|
||||||
|
- image: circleci/python:3.7.0
|
||||||
|
steps: *steps
|
||||||
|
legacy-python-flake8-tests:
|
||||||
|
docker:
|
||||||
|
- image: circleci/python:2.7.15
|
||||||
|
steps: *steps
|
||||||
|
backend-unit-tests:
|
||||||
environment:
|
environment:
|
||||||
COMPOSE_FILE: .circleci/docker-compose.circle.yml
|
COMPOSE_FILE: .circleci/docker-compose.circle.yml
|
||||||
COMPOSE_PROJECT_NAME: redash
|
COMPOSE_PROJECT_NAME: redash
|
||||||
@@ -13,6 +26,7 @@ jobs:
|
|||||||
name: Build Docker Images
|
name: Build Docker Images
|
||||||
command: |
|
command: |
|
||||||
set -x
|
set -x
|
||||||
|
docker-compose build --build-arg skip_ds_deps=true
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
sleep 10
|
sleep 10
|
||||||
- run:
|
- run:
|
||||||
@@ -20,7 +34,7 @@ jobs:
|
|||||||
command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
|
command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
|
||||||
- run:
|
- run:
|
||||||
name: Run Tests
|
name: Run Tests
|
||||||
command: docker-compose run --name tests redash tests --junitxml=junit.xml tests/
|
command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/
|
||||||
- run:
|
- run:
|
||||||
name: Copy Test Results
|
name: Copy Test Results
|
||||||
command: |
|
command: |
|
||||||
@@ -31,14 +45,61 @@ jobs:
|
|||||||
path: /tmp/test-results
|
path: /tmp/test-results
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
|
frontend-lint:
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:8
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: mkdir -p /tmp/test-results/eslint
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run lint:ci
|
||||||
|
- store_test_results:
|
||||||
|
path: /tmp/test-results
|
||||||
|
frontend-unit-tests:
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:8
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: sudo apt install python-pip
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run bundle
|
||||||
|
- run: npm test
|
||||||
|
- run: npm run lint
|
||||||
|
frontend-e2e-tests:
|
||||||
|
environment:
|
||||||
|
COMPOSE_FILE: .circleci/docker-compose.cypress.yml
|
||||||
|
COMPOSE_PROJECT_NAME: cypress
|
||||||
|
PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA==
|
||||||
|
CYPRESS_PROJECT_ID_ENCODED: OTI0Y2th
|
||||||
|
CYPRESS_RECORD_KEY_ENCODED: YzA1OTIxMTUtYTA1Yy00NzQ2LWEyMDMtZmZjMDgwZGI2ODgx
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:8
|
||||||
|
steps:
|
||||||
|
- setup_remote_docker
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Install npm dependencies
|
||||||
|
command: |
|
||||||
|
npm install
|
||||||
|
- run:
|
||||||
|
name: Setup Redash server
|
||||||
|
command: |
|
||||||
|
npm run cypress start
|
||||||
|
docker-compose run cypress npm run cypress db-seed
|
||||||
|
- run:
|
||||||
|
name: Execute Cypress tests
|
||||||
|
command: npm run cypress run-ci
|
||||||
build-tarball:
|
build-tarball:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/node:8
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
- run: sudo apt install python-pip
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run build
|
|
||||||
- run: .circleci/update_version
|
- run: .circleci/update_version
|
||||||
|
- run: npm run bundle
|
||||||
|
- run: npm run build
|
||||||
|
- run: rm -rf ./node_modules/
|
||||||
- run: .circleci/pack
|
- run: .circleci/pack
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: /tmp/artifacts/
|
path: /tmp/artifacts/
|
||||||
@@ -49,77 +110,39 @@ jobs:
|
|||||||
- setup_remote_docker
|
- setup_remote_docker
|
||||||
- checkout
|
- checkout
|
||||||
- run: .circleci/update_version
|
- run: .circleci/update_version
|
||||||
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
- run: .circleci/docker_build
|
||||||
- run: docker build -t redash/redash:$(.circleci/docker_tag) .
|
|
||||||
- run: docker push redash/redash:$(.circleci/docker_tag)
|
|
||||||
integration-tests:
|
|
||||||
working_directory: ~/redash
|
|
||||||
machine: true
|
|
||||||
environment:
|
|
||||||
REDASH_SERVER_URL : "http://127.0.0.1:5000/"
|
|
||||||
DOCKER_IMAGE: mozilla/redash-ui-tests
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Install Docker Compose
|
|
||||||
command: |
|
|
||||||
set -x
|
|
||||||
pip install --upgrade pip
|
|
||||||
pip install docker-compose>=1.18
|
|
||||||
docker-compose --version
|
|
||||||
- run:
|
|
||||||
name: Pull redash images
|
|
||||||
command: |
|
|
||||||
set -x
|
|
||||||
docker-compose -f docker-compose.yml up --no-start
|
|
||||||
sleep 10
|
|
||||||
- run:
|
|
||||||
name: Pull redash-ui-tests
|
|
||||||
command: docker pull "${DOCKER_IMAGE}":latest
|
|
||||||
- run:
|
|
||||||
name: Setup redash instance
|
|
||||||
command: |
|
|
||||||
set -x
|
|
||||||
docker-compose run --rm --user root server create_db
|
|
||||||
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests"
|
|
||||||
docker-compose run --rm --user root server /app/manage.py users create_root root@example.com "rootuser" --password "IAMROOT" --org default
|
|
||||||
docker-compose run --rm --user root server /app/manage.py ds new "ui-tests" --type "url" --options '{"title": "uitests"}'
|
|
||||||
docker-compose run -d -p 5000:5000 --user root server
|
|
||||||
docker-compose start postgres
|
|
||||||
docker-compose run --rm --user root server npm install
|
|
||||||
docker-compose run --rm --user root server npm run build
|
|
||||||
- run:
|
|
||||||
name: Run tests
|
|
||||||
command: |
|
|
||||||
set -x
|
|
||||||
docker run --net="host" --env REDASH_SERVER_URL="${REDASH_SERVER_URL}" "${DOCKER_IMAGE}"
|
|
||||||
- store_artifacts:
|
|
||||||
path: report.html
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
integration_tests:
|
|
||||||
jobs:
|
|
||||||
- integration-tests:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only: master
|
|
||||||
build:
|
build:
|
||||||
jobs:
|
jobs:
|
||||||
- unit-tests
|
- python-flake8-tests
|
||||||
|
- legacy-python-flake8-tests
|
||||||
|
- backend-unit-tests
|
||||||
|
- frontend-lint
|
||||||
|
- frontend-unit-tests:
|
||||||
|
requires:
|
||||||
|
- frontend-lint
|
||||||
|
- frontend-e2e-tests:
|
||||||
|
requires:
|
||||||
|
- frontend-lint
|
||||||
- build-tarball:
|
- build-tarball:
|
||||||
requires:
|
requires:
|
||||||
- unit-tests
|
- backend-unit-tests
|
||||||
|
- frontend-unit-tests
|
||||||
|
- frontend-e2e-tests
|
||||||
filters:
|
filters:
|
||||||
tags:
|
|
||||||
only: /v[0-9]+(\.[0-9\-a-z]+)*/
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- release/.*
|
- /release\/.*/
|
||||||
- build-docker-image:
|
- build-docker-image:
|
||||||
requires:
|
requires:
|
||||||
- unit-tests
|
- backend-unit-tests
|
||||||
|
- frontend-unit-tests
|
||||||
|
- frontend-e2e-tests
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- release/.*
|
- master
|
||||||
|
- preview-image
|
||||||
|
- /release\/.*/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '2'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
redash:
|
redash:
|
||||||
build: ../
|
build: ../
|
||||||
|
|||||||
50
.circleci/docker-compose.cypress.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
build: ../
|
||||||
|
command: dev_server
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
environment:
|
||||||
|
PYTHONUNBUFFERED: 0
|
||||||
|
REDASH_LOG_LEVEL: "INFO"
|
||||||
|
REDASH_REDIS_URL: "redis://redis:6379/0"
|
||||||
|
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||||
|
REDASH_RATELIMIT_ENABLED: "false"
|
||||||
|
worker:
|
||||||
|
build: ../
|
||||||
|
command: scheduler
|
||||||
|
depends_on:
|
||||||
|
- server
|
||||||
|
environment:
|
||||||
|
PYTHONUNBUFFERED: 0
|
||||||
|
REDASH_LOG_LEVEL: "INFO"
|
||||||
|
REDASH_REDIS_URL: "redis://redis:6379/0"
|
||||||
|
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||||
|
QUEUES: "queries,scheduled_queries,celery,schemas"
|
||||||
|
WORKERS_COUNT: 2
|
||||||
|
cypress:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
dockerfile: .circleci/Dockerfile.cypress
|
||||||
|
depends_on:
|
||||||
|
- server
|
||||||
|
- worker
|
||||||
|
environment:
|
||||||
|
CYPRESS_baseUrl: "http://server:5000"
|
||||||
|
PERCY_TOKEN: ${PERCY_TOKEN}
|
||||||
|
PERCY_BRANCH: ${CIRCLE_BRANCH}
|
||||||
|
PERCY_COMMIT: ${CIRCLE_SHA1}
|
||||||
|
PERCY_PULL_REQUEST: ${CIRCLE_PR_NUMBER}
|
||||||
|
CYPRESS_PROJECT_ID: ${CYPRESS_PROJECT_ID}
|
||||||
|
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
|
||||||
|
redis:
|
||||||
|
image: redis:3.0-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
postgres:
|
||||||
|
image: postgres:9.5.6-alpine
|
||||||
|
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
|
||||||
|
restart: unless-stopped
|
||||||
17
.circleci/docker_build
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
VERSION=$(jq -r .version package.json)
|
||||||
|
VERSION_TAG=$VERSION.b$CIRCLE_BUILD_NUM
|
||||||
|
|
||||||
|
docker login -u $DOCKER_USER -p $DOCKER_PASS
|
||||||
|
|
||||||
|
if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-image ]
|
||||||
|
then
|
||||||
|
docker build -t redash/redash:preview -t redash/preview:$VERSION_TAG .
|
||||||
|
docker push redash/redash:preview
|
||||||
|
docker push redash/preview:$VERSION_TAG
|
||||||
|
else
|
||||||
|
docker build -t redash/redash:$VERSION_TAG .
|
||||||
|
docker push redash/redash:$VERSION_TAG
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Built: $VERSION_TAG"
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
VERSION=$(jq -r .version package.json)
|
|
||||||
FULL_VERSION=$VERSION.b$CIRCLE_BUILD_NUM
|
|
||||||
|
|
||||||
echo $FULL_VERSION
|
|
||||||
@@ -6,4 +6,4 @@ FILENAME=$NAME.$FULL_VERSION.tar.gz
|
|||||||
|
|
||||||
mkdir -p /tmp/artifacts/
|
mkdir -p /tmp/artifacts/
|
||||||
|
|
||||||
tar -zcv -f /tmp/artifacts/$FILENAME --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="node_modules" *
|
tar -zcv -f /tmp/artifacts/$FILENAME --exclude=".git" --exclude="optipng*" --exclude="cypress" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" *
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ VERSION=$(jq -r .version package.json)
|
|||||||
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
|
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
|
||||||
|
|
||||||
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
|
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
|
||||||
|
sed -i "s/dev/$CIRCLE_SHA1/" client/app/version.json
|
||||||
|
|||||||
@@ -1,22 +1,32 @@
|
|||||||
engines:
|
version: "2"
|
||||||
|
checks:
|
||||||
|
complex-logic:
|
||||||
|
enabled: false
|
||||||
|
file-lines:
|
||||||
|
enabled: false
|
||||||
|
method-complexity:
|
||||||
|
enabled: false
|
||||||
|
method-count:
|
||||||
|
enabled: false
|
||||||
|
method-lines:
|
||||||
|
config:
|
||||||
|
threshold: 100
|
||||||
|
nested-control-flow:
|
||||||
|
enabled: false
|
||||||
|
identical-code:
|
||||||
|
enabled: false
|
||||||
|
similar-code:
|
||||||
|
enabled: false
|
||||||
|
plugins:
|
||||||
pep8:
|
pep8:
|
||||||
enabled: true
|
enabled: true
|
||||||
eslint:
|
eslint:
|
||||||
enabled: true
|
|
||||||
channel: "eslint-3"
|
|
||||||
config:
|
|
||||||
config: client/.eslintrc.js
|
|
||||||
checks:
|
|
||||||
import/no-unresolved:
|
|
||||||
enabled: false
|
enabled: false
|
||||||
ratings:
|
exclude_patterns:
|
||||||
paths:
|
- "tests/**/*.py"
|
||||||
- "redash/**/*.py"
|
- "migrations/**/*.py"
|
||||||
- "client/**/*.js"
|
- "setup/**/*"
|
||||||
exclude_paths:
|
- "bin/**/*"
|
||||||
- tests/**/*.py
|
- "**/node_modules/"
|
||||||
- migrations/**/*.py
|
- "client/dist/"
|
||||||
- old_migrations/**/*.py
|
- "**/*.pyc"
|
||||||
- setup/**/*
|
|
||||||
- bin/**/*
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
client/.tmp/
|
client/.tmp/
|
||||||
|
client/dist/
|
||||||
node_modules/
|
node_modules/
|
||||||
.tmp/
|
.tmp/
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
.git/
|
.git/
|
||||||
|
/.codeclimate.yml
|
||||||
|
/.coverage
|
||||||
|
/coverage.xml
|
||||||
|
/.circleci/
|
||||||
|
/.github/
|
||||||
|
/netlify.toml
|
||||||
|
/setup/
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ trim_trailing_whitespace = true
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[*.{js,css,html}]
|
[*.{js,jsx,css,less,html}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
34
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,34 +0,0 @@
|
|||||||
<!--
|
|
||||||
#####################################################################
|
|
||||||
#
|
|
||||||
# Need support? USE THE FORUM! https://discuss.redash.io/c/support.
|
|
||||||
#
|
|
||||||
# Don't have steps to reproduce and actually not sure it's a bug?
|
|
||||||
# Use the forum! https://discuss.redash.io/c/support.
|
|
||||||
#
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
**Got an idea for a new feature?** Check if it isn't on the roadmap already: http://bit.ly/redash-roadmap and start a new discussion in the features category: https://discuss.redash.io/c/feature-requests 🌟.
|
|
||||||
|
|
||||||
Found a bug? Please fill out the sections below... thank you 👍
|
|
||||||
|
|
||||||
Found a security vulnerability? Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use this PGP key.
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Issue Summary
|
|
||||||
|
|
||||||
A summary of the issue and the browser/OS environment in which it occurs.
|
|
||||||
|
|
||||||
### Steps to Reproduce
|
|
||||||
|
|
||||||
1. This is the first step
|
|
||||||
2. This is the second step, etc.
|
|
||||||
|
|
||||||
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
|
|
||||||
|
|
||||||
### Technical details:
|
|
||||||
|
|
||||||
* Redash Version:
|
|
||||||
* Browser/OS:
|
|
||||||
* How did you install Redash:
|
|
||||||
34
.github/ISSUE_TEMPLATE/---bug_report.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F41B Bug report"
|
||||||
|
about: Report reproducible software issues so we can improve
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
We use GitHub only for bug reports 🐛
|
||||||
|
|
||||||
|
Anything else should be posted to https://discuss.redash.io 👫
|
||||||
|
|
||||||
|
🚨For support, help & questions use https://discuss.redash.io/c/support
|
||||||
|
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
|
||||||
|
|
||||||
|
**Found a security vulnerability?** Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use this PGP key.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
### Issue Summary
|
||||||
|
|
||||||
|
A summary of the issue and the browser/OS environment in which it occurs.
|
||||||
|
|
||||||
|
### Steps to Reproduce
|
||||||
|
|
||||||
|
1. This is the first step
|
||||||
|
2. This is the second step, etc.
|
||||||
|
|
||||||
|
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
|
||||||
|
|
||||||
|
### Technical details:
|
||||||
|
|
||||||
|
* Redash Version:
|
||||||
|
* Browser/OS:
|
||||||
|
* How did you install Redash:
|
||||||
17
.github/ISSUE_TEMPLATE/--anything_else.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F4A1Anything else"
|
||||||
|
about: "For help, support, features & ideas - please use https://discuss.redash.io \U0001F46B "
|
||||||
|
labels: "Support Question"
|
||||||
|
---
|
||||||
|
|
||||||
|
We use GitHub only for bug reports 🐛
|
||||||
|
|
||||||
|
Anything else should be posted to https://discuss.redash.io 👫
|
||||||
|
|
||||||
|
🚨For support, help & questions use https://discuss.redash.io/c/support
|
||||||
|
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
|
||||||
|
|
||||||
|
Alternatively, check out these resources below. Thanks! 😁.
|
||||||
|
|
||||||
|
- [Forum](https://disucss.redash.io)
|
||||||
|
- [Knowledge Base](https://redash.io/help)
|
||||||
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
## What type of PR is this? (check all applicable)
|
||||||
|
<!-- Please leave only what's applicable -->
|
||||||
|
|
||||||
|
- [ ] Refactor
|
||||||
|
- [ ] Feature
|
||||||
|
- [ ] Bug Fix
|
||||||
|
- [ ] New Query Runner (Data Source)
|
||||||
|
- [ ] New Alert Destination
|
||||||
|
- [ ] Other
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
## Related Tickets & Documents
|
||||||
|
|
||||||
|
## Mobile & Desktop Screenshots/Recordings (if there are UI changes)
|
||||||
23
.github/support.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Configuration for Support Requests - https://github.com/dessant/support-requests
|
||||||
|
|
||||||
|
# Label used to mark issues as support requests
|
||||||
|
supportLabel: Support Question
|
||||||
|
|
||||||
|
# Comment to post on issues marked as support requests, `{issue-author}` is an
|
||||||
|
# optional placeholder. Set to `false` to disable
|
||||||
|
supportComment: >
|
||||||
|
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports
|
||||||
|
and planned work. However, this issue appears to be a support request.
|
||||||
|
Please use [our forum](https://discuss.redash.io) to get help.
|
||||||
|
|
||||||
|
# Close issues marked as support requests
|
||||||
|
close: true
|
||||||
|
|
||||||
|
# Lock issues marked as support requests
|
||||||
|
lock: false
|
||||||
|
|
||||||
|
# Assign `off-topic` as the reason for locking. Set to `false` to disable
|
||||||
|
setLockReason: true
|
||||||
|
|
||||||
|
# Repository to extend settings from
|
||||||
|
# _extends: repo
|
||||||
7
.github/weekly-digest.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
|
||||||
|
publishDay: mon
|
||||||
|
canPublishIssues: true
|
||||||
|
canPublishPullRequests: true
|
||||||
|
canPublishContributors: true
|
||||||
|
canPublishStargazers: true
|
||||||
|
canPublishCommits: true
|
||||||
2
.gitignore
vendored
@@ -24,3 +24,5 @@ node_modules
|
|||||||
.sass-cache
|
.sass-cache
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
|
client/cypress/screenshots
|
||||||
|
client/cypress/videos
|
||||||
|
|||||||
549
CHANGELOG.md
@@ -1,56 +1,353 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## v7.0.0 - 2019-03-17
|
||||||
|
|
||||||
|
We're trying a new format for the CHANGELOG in this release. Focusing on the bigger changes, but for whoever interested, you can see all the changes [here](https://github.com/getredash/redash/compare/v6.0.0...master).
|
||||||
|
|
||||||
|
Besides all the features, bug fixes and improvements listed below we managed to convert a large portion of Redash's frontend code from Angular.js to React. You can see status in [#3071](https://github.com/getredash/redash/issues/3071).
|
||||||
|
|
||||||
|
This release was made possible with the help of 34 contributors. 🙇♂️
|
||||||
|
|
||||||
|
### Data Sources
|
||||||
|
|
||||||
|
- **All data source options are now encrypted in the database.** By default the encryption uses the `REDASH_COOKIE_SECRET` value (`redash.settings.COOKIE_SECRET`), but you can specify a different value by setting the `REDASH_SECRET_KEY` environment variable value. Note that you need to set this _before_ doing the upgrade.
|
||||||
|
- New Data Sources: Uptycs and Apache Drill.
|
||||||
|
- Snowplow: is now enabled by default & supports region setting.
|
||||||
|
- Elasticsearch: add support for Amazon Elasticsearch IAM authentication (with IAM profile or key/secret pair).
|
||||||
|
- PostgreSQL: add support for serializing range values.
|
||||||
|
- Redshift: remove duplicate column information for late-binding views.
|
||||||
|
- Athena: load all databases (using pagination).
|
||||||
|
- BigQuery: correctly handle temp tables with no schema field.
|
||||||
|
- Jira (JQL): support for fetching all records with pagination.
|
||||||
|
- Prometheus: fix schema loading and add support for query range.
|
||||||
|
|
||||||
|
### In-app Help
|
||||||
|
|
||||||
|
You can now open the [Knowledge Base](https://redash.io/help) inside the application. We also added a few "help triggers" in the app, that will open the Knowledge Base in context of what you're currently doing.
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
- **Dashboard Parameters**: We improved the flow of adding queries with parameters to dashboards and now give you full control over how parameters are mapped. You no longer have to make sure all parameters have the same name or use the `Global` checkbox. We also added new options, like keeping the parameter local to the widget or setting a static value. [Read more in our Knowledge Base →](https://redash.io/help/user-guide/querying/query-parameters#Parameter-Mapping-on-Dashboards)
|
||||||
|
- We added server side validation of parameter values for all parameter types, except for parameters of `text` type. All validated parameter types are considered safe. When a query is using safe parameters (or no parameters at all), View Only users can refresh it.
|
||||||
|
- Refreshing safe queries is done using the new results API endpoint, which takes only a query ID (and optionally parameter values) and does not need the query text.
|
||||||
|
|
||||||
|
### Query Editor Improvements
|
||||||
|
|
||||||
|
- Run only the highlighted query text: hit Execute after highlighting a portion of your query and only the selected portion will be sent to the database. This is useful for testing sub-SELECT statements and CTE's.
|
||||||
|
- Improved auto complete: add a dot . after a table name in the query editor and auto complete will only suggest columns on that table.
|
||||||
|
- Autosave parameter configuration changes.
|
||||||
|
- YAML syntax support (for data sources like Yandex Metrica).
|
||||||
|
|
||||||
|
### Improved Query Scheduler
|
||||||
|
|
||||||
|
The Query Scheduler got a face lift and some new options: you can pick a day for a weekly schedule to run on and also set an end date after which the query will no longer execute on schedule.
|
||||||
|
|
||||||
|
### Data Sources
|
||||||
|
|
||||||
|
We added Apache Drill, Uptycs and a new JSON data source. Also fixed a few bugs in Athena's query runner and others.
|
||||||
|
|
||||||
|
### User Management
|
||||||
|
|
||||||
|
The users page got revamped with a new look and feel and few new features:
|
||||||
|
|
||||||
|
- An indication when a user was last active.
|
||||||
|
- Show if an invited user hasn't finished the setup process yet (Pending Invitations section).
|
||||||
|
- You can now generate a new API key for users, if there's a concern it was compromised.
|
||||||
|
|
||||||
|
### Admin
|
||||||
|
|
||||||
|
- New Celery queues status screens, replacing the old Queries Status and better reflecting the status of running queries.
|
||||||
|
- Make the queue name for schema refresh job configurable. The default used to be hard coded `schemas`, which is not available on all setups. Now it's `celery`.
|
||||||
|
- The `gevent` library is installed by default, and you can now setup gunicorn to use `gevent` based workers.
|
||||||
|
- New Docker entrypoint command to do a health check for a worker process.
|
||||||
|
- Flask-Admin is no longer setup or supported.
|
||||||
|
|
||||||
|
### Other Changes
|
||||||
|
|
||||||
|
- New Alert destination: Google Hangouts Chat.
|
||||||
|
- When downloading results from the results API it will set a user friendly filename for the downloaded file.
|
||||||
|
- Archived Queries section added to the queries list.
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Fixed: fork query does not fork tables but instead adds default table.
|
||||||
|
- Fixed: when deleting a visualization, any widget using it was left empty on the dashboard.
|
||||||
|
- Fixed: issues with Query Editor resizing on new versions of Chrome.
|
||||||
|
- Fixed: issues with exporting dictionaries to Excel.
|
||||||
|
- Fixed: Cohort visualization gets stuck when passing string values.
|
||||||
|
- Fixed: use series name for Pie chart label.
|
||||||
|
- Make sure Flask app created in Celery's worker process (could cause some query runners to get stuck while running queries).
|
||||||
|
|
||||||
|
## v6.0.0 - 2018-12-16
|
||||||
|
|
||||||
|
v6.0.0 release version. Mainly includes fixes for regressions from the beta version.
|
||||||
|
|
||||||
|
This release had contributions from 5 people: @rauchy, @denisov-vlad, @arikfr, @ariarijp, and @gabrieldutra. Thank you, everyone 🙏
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- #3183 Make refresh_queries less noisey in logs. @arikfr
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- #3163 Include correct version in production builds. @rauchy
|
||||||
|
- #3161 Clickhouse: fix int() conversion error. @denisov-vlad
|
||||||
|
- #3166 Directly using record_event task requires timestamp. @arikfr
|
||||||
|
- #3167 Alert.evaluate failing when the column is missing. @arikfr
|
||||||
|
- ##3162 Remove API permissions for users who have been disabled. @rauchy
|
||||||
|
- #3171 Reject empty query name. @ariarijp
|
||||||
|
- #3175, #3186 Fix disable error message. @rauchy, @gabrieldutra
|
||||||
|
- #3182 [Redshift] support for schema names with dots. @arikfr
|
||||||
|
- #3187 Safely create_app in Celery code (try to fetch current_app first). @arikfr
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
- #3155 Add DB Seed to Cypress and setup Percy. @gabrieldutra
|
||||||
|
- #3180 Remove coverage from pytest terminal output. @rauchy
|
||||||
|
|
||||||
|
## v6.0.0-beta - 2018-12-03
|
||||||
|
|
||||||
|
This release was 2 months in the making and it is full with good stuff!
|
||||||
|
|
||||||
|
- We have 5 new data sources: Databricks, IBM DB2, Kylin, Druid and Rockset. ⌗
|
||||||
|
- There are fixes and improvements to 11 existing data sources (MySQL, Redshift, Postgres, MongoDB, Google BigQuery, Vertica, TreasureData, Presto, ClickHouse, Google Sheets and Google Analytics).
|
||||||
|
- The Query Results data source can now load cached results, just use the `cached_query_` prefix instead of `query_`.
|
||||||
|
- On the visualizations front we added a Heatmap visualization and did updated the table and counter visualizations.
|
||||||
|
- Alerts got some fixes and a new destination: PagerDuty.
|
||||||
|
- If the live autocomplete in the code editor annoys you, you can disable it now (although we're working to make it better, see #3092).
|
||||||
|
- Fast queries will now load faster. 🏃♂️
|
||||||
|
- We improved the layout of visualizations and content on smaller screen sizes. 📱
|
||||||
|
- For those of you who like sharing, you can now enable the ability to share ownership of queries and dashboards and let others to edit them. Check the Settings page to enable this feature.
|
||||||
|
|
||||||
|
There were also important changes to the code and infrastructure:
|
||||||
|
|
||||||
|
- More components moved to React.
|
||||||
|
- We switched to Webpack 4 with the help of @dmonego.
|
||||||
|
- We upgraded to Celery 4 with the help of @emtwo, @jezdez, @mashrikt and @atharvai.
|
||||||
|
- We started moving towards Python 3 for our backend. The first step was to make sure our code pass basic sanity tests with Flake 8, which was implemented by @cclauss.
|
||||||
|
- We improved our testing on the frontend by adding setup for Jest tests and E2E testing using Cypress (@gabrieldutra).
|
||||||
|
- Each pull request now gets a deploy preview using Netlify to easily test frontend changes.
|
||||||
|
|
||||||
|
This is just a summary, you're welcome to review the full list below. ⬇
|
||||||
|
|
||||||
|
This release had contributions from 38 people: @arikfr, @kravets-levko, @jezdez, @kyoshidajp, @kocsmy, @alison985, @gabrieldutra, @washort, @GitSumito, @emtwo, @rauchy, @alexanderlz, @denisov-vlad, @ariarijp, @yoavbls, @zhujunsan, @sjakthol, @koooge, @SakuradaJun, @dmonego, @Udomomo, @cclauss, @combineads, @zaimy, @Trigl, @ralphilius, @jodevsa, @deecay, @igorcanadi, @pashaxp, @hoangphuoc25, @toph, @burnash, @wankdanker, @Yossi-a, @Rovel, @kadrach, and @nicof38. Thank you, everyone 🙏
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- #2747, #3143 Add a new Databricks query runner. @alison985, @jezdez, @arikfr
|
||||||
|
- #2767 Add ability to add viz to dashboard from query edit page. @alison985, @jezdez
|
||||||
|
- #2780 Add a query autocomplete toggle. @alison985, @jezdez, @arikfr
|
||||||
|
- #2768 Add authentication via JWT providers. @SakuradaJun
|
||||||
|
- #2790 Add the ability to sort favorited queries, paginate the dashboard list and improve UI inconsistencies. @jezdez
|
||||||
|
- #2681 Add ability to search table column names in schema browser. @alison985
|
||||||
|
- #2855 Add option to query cached results. @yoavbls
|
||||||
|
- #2740 Add ability for extensions to add periodic tasks. @emtwo
|
||||||
|
- #2924 Google Spreadsheets: Add support for opening by URL. @alexanderlz
|
||||||
|
- #2903 Add PagerDuty as an Alert Destination. @alexanderlz
|
||||||
|
- #2824 Add support for expanding dashboard visualizations. @sjakthol
|
||||||
|
- #2900 Add ability to specify a counter label. @ralphilius
|
||||||
|
- #2565 Add frontend extension capabilities. @emtwo
|
||||||
|
- #2848 Add IBM Db2 as a data source using the ibm-db Python package. @nicof38
|
||||||
|
- #2959 Add option to auto reload widget data in shared dashboards. @arikfr
|
||||||
|
- #2993 Add page size settings. @kyoshidajp
|
||||||
|
- #2080 New Heatmap chart visualization with Plotly. @deecay
|
||||||
|
- #2991 Show users in CLI group list. @GitSumito
|
||||||
|
- #2342 New SQLPARSE_FORMAT_OPTIONS setting to configure query formatter. @ariarijp
|
||||||
|
- #3031 Add some tests for Query Results. @ariarijp
|
||||||
|
- #2936 Add Kylin data source. @Trigl
|
||||||
|
- #3047 Add Druid data source. @rauchy
|
||||||
|
- #3077 New user interface for the feature flag of the share edit permissions feature. @arikfr
|
||||||
|
- #3007 Add permissions to the result of "manage.py groups list" command. @Udomomo
|
||||||
|
- #3088 Add get_current_user() fuction for the Python query runner. @kyoshidajp
|
||||||
|
- #3114 Add event tracking to autocomplete toggle. @arikfr
|
||||||
|
- #3068 Add Rockset query runner. @igorcanadi, @arikfr
|
||||||
|
- #3105 Display frontend version. @rauchy
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- #2636 Rewrite query editor with React. @washort, @arikfr
|
||||||
|
- #2637 Convert edit-in-place component to React. @washort, @arikfr
|
||||||
|
- #2766 Suitable events are now being recorded server side instead of in the frontend. @alison985, @jezdez
|
||||||
|
- #2796 Change placement (right/bottom) of chart legend depending on chart width. @kravets-levko
|
||||||
|
- #2833 Uses server side sort order for tag list and show count of tagged items. @jezdez
|
||||||
|
- #2318 Support authentication for the URL data source. @jezdez
|
||||||
|
- #2884 Rename Yandex Metrika to Metrica. @jezdez
|
||||||
|
- #2909 MySQL: hide sys tables. @arikfr
|
||||||
|
- #2817 Consistently use simplejson for loading and dumping JSON. @jezdez
|
||||||
|
- #2872 Use Plotly's function to clean y-values (x may be category or date/time). @kravets-levko
|
||||||
|
- #2938 Auto focus tag input. @kyoshidajp
|
||||||
|
- #2927 Design refinements for queries pages. @kocsmy
|
||||||
|
- #2950 Show activity status in CLI user list. @GitSumito
|
||||||
|
- #2968 Presto data source: setting protocol (http/https), safe loading of error messages. @arikfr
|
||||||
|
- #2967 Show groups in CLI user list. @GitSumito
|
||||||
|
- #2603 MongoDB: Update requirements to support srv. @arikfr
|
||||||
|
- #2961 MongoDB: Skip system collections when loading schema. @arikfr
|
||||||
|
- #2960 Add timeout to various HTTP requests. @arikfr
|
||||||
|
- #2983 Databricks: New logo, updated name and enabled by default. @arikfr
|
||||||
|
- #2982 Table visualization: change default size to 25 and add more size options. @arikfr
|
||||||
|
- #2866 Redshift: Hide tables the configured user cannot access. @sjakthol
|
||||||
|
- #3058 Mustache: don't html-escape query parameters values. @kravets-levko
|
||||||
|
- #3079 Always use basic autocomplete, as well as the live autocomplete. @arikfr
|
||||||
|
- #3084 Support tel://, sms://, mailto:// links in query results. @zhujunsan
|
||||||
|
- #3083 Clickhouse: Add WITH TOTALS option support. @denisov-vlad
|
||||||
|
- #3063 Allow setting colors for bubble charts. @toph
|
||||||
|
- #3085 BigQuery: Switch to Standard SQL as the default. @kyoshidajp
|
||||||
|
- #3094 Tags autocomplete: Show note when creating a new label. @kravets-levko
|
||||||
|
- #2984 Autocomplete toggle improvements. @arikfr
|
||||||
|
- #3089 Open new tab when forking a query. @kyoshidajp
|
||||||
|
- #3126 MongoDB: add support for sorting columns. @arikfr
|
||||||
|
- #3128 Improve backoff algorithm of query results polling to speed it up. @arikfr
|
||||||
|
- #3125 Vertica: update driver & add support for connection timeout. @arikfr
|
||||||
|
- #3124 Support unicode in Postgres/Redshift schema. @arikfr
|
||||||
|
- #3138 Migrate all tags components to React. @kravets-levko
|
||||||
|
- #3139 Better manage permissions modal. @kocsmy
|
||||||
|
- #3149 Improve tag link colors and fix group tags on Users page. @kocsmy
|
||||||
|
- #3146 Update, replace and fix new alert destination logos so it fits better. @kocsmy
|
||||||
|
- #3147 Add and improve recent db logos that didn't fit in size properly. @kocsmy
|
||||||
|
- #3148 Fix label positioning on no found screen. @kocsmy
|
||||||
|
- #3156 json_dumps: add support for serializing buffer objects. @arikfr
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- #2849 Fix invalid reference to alert.to_dict() in webhook. @wankdanker
|
||||||
|
- #2840 Improve counter visualization text scaling. @kravets-levko
|
||||||
|
- #2854 Widget titles are no longer rendered wrong on public dashboards. @kravets-levko
|
||||||
|
- #2318 Removed redundant exception handling in data sources since that's handled in the query backend. @jezdez
|
||||||
|
- #2886 Fix Javascript build that broke because registerAll tried to run EditInPlace component. @arikfr
|
||||||
|
- #2911 Don’t show “Add to dashboard” in dropdown to unsaved queries. @jezdez
|
||||||
|
- #2916 Fix export query results output file name. @gabrieldutra
|
||||||
|
- #2917 Fix output file name not changing after rename query. @gabrieldutra
|
||||||
|
- #2868 Address edge case when retrieving Glue schemas for Athena data source. @kadrach
|
||||||
|
- #2929 Fix: date value in a filter is duplicated. @combineads
|
||||||
|
- #2875 Unbreak charts with long legend break in horizontal mode. Update plotly.js. @kravets-levko
|
||||||
|
- #2937 Fix event recording in admin API backend. @kyoshidajp
|
||||||
|
- #2953 Minor fixes for the Clickhouse data source. @denisov-vlad
|
||||||
|
- #2941 Bring back fix to Box plot hover. @arikfr
|
||||||
|
- #2957 Apply missing CSS classes to EditInPlace component. @arikfr
|
||||||
|
- #2897 Show "Add description" only after saving the query. @arikfr
|
||||||
|
- #2922 Query page layout improvements for small screens. @kravets-levko
|
||||||
|
- #2956 Clickhouse: move timeout to params. @denisov-vlad
|
||||||
|
- #2964 Fix no tags shown when having empty set. @gabrieldutra
|
||||||
|
- #2757 Use full text search ranking when searching in list views. @jezdez
|
||||||
|
- #2969 Query Results data source: improved errors, quoted column names. @arikfr
|
||||||
|
- #2906 Preventing open redirection in loging process. @kyoshidajp
|
||||||
|
- #2867 TreasureData: Deduplicate column names. @zaimy
|
||||||
|
- #2994 Fix scheme of various URLs from http to https. @kyoshidajp
|
||||||
|
- #2992 Fix an invalid prop type warning in new version notifier. @kyoshidajp
|
||||||
|
- #3022 Fix Toolbox covering part of a chart. @kravets-levko
|
||||||
|
- #2998 Fix charts losing responsive features after refreshing the dashboard. @kravets-levko
|
||||||
|
- #3034 Postgres: handle NaN/Infinity values. @kravets-levko
|
||||||
|
- #2745 Sort columns with undefined values. @Yossi-a
|
||||||
|
- #3041 Sort CLI output of lists. @GitSumito
|
||||||
|
- #2803, #3006 Address various tag display issues on query list page. @kocsmy, @alison985
|
||||||
|
- #3049 Fix edit-in-place component which ignored isEditable flag and didn't work on Groups page. @kravets-levko
|
||||||
|
- #2965 Google Analytics: Fix crash when no results are returned. @alexanderlz
|
||||||
|
- #3061 Fix table visualization so that the horizontal scrollbar is not be always visible. @kravets-levko
|
||||||
|
- #3076 Add white-space padding to separators in the footer. @burnash
|
||||||
|
- #2919 Fix URL data source to not require a URL. @arikfr
|
||||||
|
- #3098 Force AngularJS to update query editor properly. @washort
|
||||||
|
- #3100 Delete redundant regex segment in query result frontend. @zhujunsan
|
||||||
|
- #2978 Prevent the query update timestamp from changing when it is linked to new query results. @rauchy
|
||||||
|
- #3046 Fix query page header. @kravets-levko
|
||||||
|
- #3097 Mongo: Fix collection fields retreival bug when Views are present. @jodevsa
|
||||||
|
- #3107 Keep query text in local state for now. @washort
|
||||||
|
- #3111 Fix mobile padding issues on Query results. @kocsmy
|
||||||
|
- #3122 Show menu divider only if query is archived. @jezdez
|
||||||
|
- #3120 Fix tag counts for dashboards and queries. @jezdez
|
||||||
|
- #3141 Fix schema refresh to work on MySQL 8. @hoangphuoc25
|
||||||
|
- #3142 Fix: editing dashboard title results in the visualizations being replaced by the loading markers. @kravets-levko
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
- #2850 The setup scripts are now based on Ubuntu 18.04 LTS and Docker. @pashaxp, @arikfr
|
||||||
|
- #2985 Add Jest based tests to our stack. @arikfr
|
||||||
|
- #2999 Add netlify configuration. @arikfr
|
||||||
|
- #3000 Initial Cypress based E2E test infrastructure. @gabrieldutra
|
||||||
|
- #2898 Move Ant styles into a central location. @arikfr
|
||||||
|
- #2910 Fix webpack build error about BigMessage. @jezdez
|
||||||
|
- #2928 Speed up builds by skipping installing requirements_all_ds.txt in CI unit tests. @arikfr
|
||||||
|
- #2963 Fix tarball build failure. @emtwo
|
||||||
|
- #2996 Fix setup.sh failures when run as root. @arikfr
|
||||||
|
- #2989 Rearrange make targets. @koooge
|
||||||
|
- #3036 Update Flask-Admin to 1.5.2. @yoavbls
|
||||||
|
- #2901 Fix documentation links. @kravets-levko
|
||||||
|
- #3073 Remove only Redash containers in clean Make task. @ariarijp
|
||||||
|
- #3048 Remove pytest-watch dependency to workaround an issue with watchdog. @rauchy
|
||||||
|
- #2905 Update development docker-compose.yml file to use latest Redis and Postgres servers and specify working volume explictly. @Rovel
|
||||||
|
- #3032 Makefile: Add make targets for test. @koooge
|
||||||
|
- #2933 Switch to Webpack 4. @dmonego
|
||||||
|
- #2908 Update setup files. @arikfr
|
||||||
|
- #2946 Update snowflake_connector_python version. @arikfr
|
||||||
|
- #2773 Upgrade to Celery 4.2.1. @emtwo, @jezdez
|
||||||
|
- #2881 CircleCI: Make flake8 tests pass on Legacy Python and Python 3. @cclauss
|
||||||
|
- #2907 Remove unused dependencies (honcho, wsgiref). @arikfr
|
||||||
|
- #3039 Build docker image on master branch. @arikfr
|
||||||
|
- #3106 Fix registerAll failures after minification. @arikfr
|
||||||
|
|
||||||
|
## v5.0.2 - 2018-10-18
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Fix: prevent Open Redirect vulnerability.
|
||||||
|
|
||||||
|
## v5.0.1 - 2018-09-27
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added support for JWT authentication (for services like Cloudflare Access or Google IAP).
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Upgraded Celery version to 3.1.26 to make upgrade to Celery 4 easier.
|
||||||
|
|
||||||
## v5.0.0 - 2018-09-21
|
## v5.0.0 - 2018-09-21
|
||||||
|
|
||||||
Final release for V5. Most of the changes were already in the beta release of V5, but this includes several fixes along
|
Final release for V5. Most of the changes were already in the beta release of V5, but this includes several fixes along
|
||||||
with UI improvements.
|
with UI improvements.
|
||||||
|
|
||||||
|
|
||||||
🙏 Thanks to @arikfr, @jezdez, @kravets-levko, @alison985, @kocsmy, @yossi-a, @tdsmith, @nasmithan, @jrbenny35, @sjakthol, @ariarijp and @combineads who contributed to this release.
|
🙏 Thanks to @arikfr, @jezdez, @kravets-levko, @alison985, @kocsmy, @yossi-a, @tdsmith, @nasmithan, @jrbenny35, @sjakthol, @ariarijp and @combineads who contributed to this release.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
* Fix: don't expose Google OAuth client secret. @arikfr
|
- Fix: don't expose Google OAuth client secret. @arikfr
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Improve mobile rendering of dashboards and queries. @kocsmy
|
- Improve mobile rendering of dashboards and queries. @kocsmy
|
||||||
* UI improvements for favorites and empty state. @arikfr
|
- UI improvements for favorites and empty state. @arikfr
|
||||||
* Remove unnecessary X at the end of the query search. @kocsmy
|
- Remove unnecessary X at the end of the query search. @kocsmy
|
||||||
* Add server-side sorting to dashboard list. @jezdez
|
- Add server-side sorting to dashboard list. @jezdez
|
||||||
* Sort queries in descending order. @jezdez
|
- Sort queries in descending order. @jezdez
|
||||||
* Throw error when non-owner tries to add a user to dashboard permissions. @alison985
|
- Throw error when non-owner tries to add a user to dashboard permissions. @alison985
|
||||||
* Propagate query execution errors from Celery tasks properly. @alison985
|
- Propagate query execution errors from Celery tasks properly. @alison985
|
||||||
* Reload the route when using the app header search input. @jezdez
|
- Reload the route when using the app header search input. @jezdez
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* Fix: BigQuery default location is null and not US. @arikfr
|
- Fix: BigQuery default location is null and not US. @arikfr
|
||||||
* Fix: query embeds are broken. @arikfr
|
- Fix: query embeds are broken. @arikfr
|
||||||
* Fix: typo in Celery log foramt. @ariarijp
|
- Fix: typo in Celery log foramt. @ariarijp
|
||||||
* Use QuerySerializer in outdated queries list. @jezdez
|
- Use QuerySerializer in outdated queries list. @jezdez
|
||||||
* Fix: sometimes widgets are getting zero height. @kravets-levko
|
- Fix: sometimes widgets are getting zero height. @kravets-levko
|
||||||
* Athena: Switch to simple_json to serialize NaN/Infinity values as nulls. @kravets-levko, @jezdez
|
- Athena: Switch to simple_json to serialize NaN/Infinity values as nulls. @kravets-levko, @jezdez
|
||||||
* Fix: queries with parameters with no value breaking the scheduler. @arikfr
|
- Fix: queries with parameters with no value breaking the scheduler. @arikfr
|
||||||
* Fix: MongoDB query results parser didn't support unicode keys. @arikfr
|
- Fix: MongoDB query results parser didn't support unicode keys. @arikfr
|
||||||
* Fix: Google Analytics schema wasn't loading in some cases. @arikfr
|
- Fix: Google Analytics schema wasn't loading in some cases. @arikfr
|
||||||
* Fix: date/time parameters not working as global param @kravets-levko.
|
- Fix: date/time parameters not working as global param @kravets-levko.
|
||||||
* Fix: Widgets crumble when trying to move / resize a widget. @kravets-levko
|
- Fix: Widgets crumble when trying to move / resize a widget. @kravets-levko
|
||||||
* Fix: handling rows with "length" field with forOwn method. @yossi-a
|
- Fix: handling rows with "length" field with forOwn method. @yossi-a
|
||||||
* Fix: query selection not working on alert page. @sjakthol
|
- Fix: query selection not working on alert page. @sjakthol
|
||||||
* Fix: query_results for Embedded Parameters (removed deprecated to_dict function). @nasmithan
|
- Fix: query_results for Embedded Parameters (removed deprecated to_dict function). @nasmithan
|
||||||
* Fix: unicode not supported in dashboard search. @combineads
|
- Fix: unicode not supported in dashboard search. @combineads
|
||||||
* Fix: unicode not supported in users search. @arikfr
|
- Fix: unicode not supported in users search. @arikfr
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
|
||||||
* Add test for using saved parameters in scheduled queries. @alison985
|
- Add test for using saved parameters in scheduled queries. @alison985
|
||||||
* Minor code smell cleanup. @jezdez
|
- Minor code smell cleanup. @jezdez
|
||||||
* Update QueryResultListResource docstring. @tdsmith
|
- Update QueryResultListResource docstring. @tdsmith
|
||||||
* Switch to CirlceCI 2.0 @jrbenny35, @arikfr
|
- Switch to CirlceCI 2.0 @jrbenny35, @arikfr
|
||||||
* Remove unnecessary init methods. @jezdez
|
- Remove unnecessary init methods. @jezdez
|
||||||
|
|
||||||
|
|
||||||
## v5.0.0-Beta - 2018-08-06
|
## v5.0.0-Beta - 2018-08-06
|
||||||
|
|
||||||
@@ -58,19 +355,19 @@ This is the first beta of the V5 release (and hopefully the last one). This vers
|
|||||||
|
|
||||||
Some notable changes:
|
Some notable changes:
|
||||||
|
|
||||||
* Extensive work on parameters UI:
|
- Extensive work on parameters UI:
|
||||||
* New Date Range parameter type.
|
- New Date Range parameter type.
|
||||||
* UI for creating new parameters.
|
- UI for creating new parameters.
|
||||||
* Support for Now/Today as default value of date/time parameter.
|
- Support for Now/Today as default value of date/time parameter.
|
||||||
* Tagging and favorites ⭐️ support for queries and dashboards.
|
- Tagging and favorites ⭐️ support for queries and dashboards.
|
||||||
* Users list page was improved (search, additional information) and you can now disable users.
|
- Users list page was improved (search, additional information) and you can now disable users.
|
||||||
* Query editor improvements: additional keyboard shortcuts and support for searching in query text.
|
- Query editor improvements: additional keyboard shortcuts and support for searching in query text.
|
||||||
* Visualizations improvements: option to select colors of pie chart sectors, X Axis type auto detect and option to format values, labels and tooltips.
|
- Visualizations improvements: option to select colors of pie chart sectors, X Axis type auto detect and option to format values, labels and tooltips.
|
||||||
* Data Sources:
|
- Data Sources:
|
||||||
* Support for Yandex Metrika and AppMetrika.
|
- Support for Yandex Metrika and AppMetrika.
|
||||||
* BigQuery: location property support and schema will load all tables now.
|
- BigQuery: location property support and schema will load all tables now.
|
||||||
* Elasticsearch: stop sending source_content_type parameter which wasn't supported in older versions.
|
- Elasticsearch: stop sending source_content_type parameter which wasn't supported in older versions.
|
||||||
* Started migrating the frontend codebase to React.
|
- Started migrating the frontend codebase to React.
|
||||||
|
|
||||||
And much more!
|
And much more!
|
||||||
|
|
||||||
@@ -78,82 +375,82 @@ And much more!
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
* #2712: Date/Time Range parameter type (@kravets-levko)
|
- #2712: Date/Time Range parameter type (@kravets-levko)
|
||||||
* #2482: Add support for ChatWork Alert Destination. (@matsumo)
|
- #2482: Add support for ChatWork Alert Destination. (@matsumo)
|
||||||
* #2678: Explicit "Add Parameter" Button in Query Editor. (@kravets-levko)
|
- #2678: Explicit "Add Parameter" Button in Query Editor. (@kravets-levko)
|
||||||
* #2513: Add location property to BigQuery data source settings. (@kyoshidajp)
|
- #2513: Add location property to BigQuery data source settings. (@kyoshidajp)
|
||||||
* #2616: Pie chart: support setting pie chart sector colors. (@kravets-levko)
|
- #2616: Pie chart: support setting pie chart sector colors. (@kravets-levko)
|
||||||
* #2697: Date/Time parameters: support for "Now" as default value. (@kravets-levko)
|
- #2697: Date/Time parameters: support for "Now" as default value. (@kravets-levko)
|
||||||
* #2693: Enable search function in Query Editor. (@arikfr)
|
- #2693: Enable search function in Query Editor. (@arikfr)
|
||||||
* #2573: Tagging and favorites for Queries and Dashboards (@arikfr)
|
- #2573: Tagging and favorites for Queries and Dashboards (@arikfr)
|
||||||
* #2640: Keyboard shortcut to collapse query editor/schema browser (@kravets-levko)
|
- #2640: Keyboard shortcut to collapse query editor/schema browser (@kravets-levko)
|
||||||
* #2674: Add support for the Chrome Logger extension (@arikfr)
|
- #2674: Add support for the Chrome Logger extension (@arikfr)
|
||||||
* #2653: Add redash db size to status page (@alison985)
|
- #2653: Add redash db size to status page (@alison985)
|
||||||
* #2669: Store Athena query id with result metadata (@tdawber)
|
- #2669: Store Athena query id with result metadata (@tdawber)
|
||||||
* #2546: Configuration for incorporating React components (@washort)
|
- #2546: Configuration for incorporating React components (@washort)
|
||||||
* #2533: New datasource: Yandex Metrika & AppMetrika (@denisov-vlad)
|
- #2533: New datasource: Yandex Metrika & AppMetrika (@denisov-vlad)
|
||||||
* #2536: Chart: formats for values, labels and tooltips (@kravets-levko)
|
- #2536: Chart: formats for values, labels and tooltips (@kravets-levko)
|
||||||
* #2560: Introduce Policy object (@arikfr)
|
- #2560: Introduce Policy object (@arikfr)
|
||||||
* #2380: Admin should be able to disable a user (@kravets-levko)
|
- #2380: Admin should be able to disable a user (@kravets-levko)
|
||||||
* #2509: Show custom date format on settings page (@kyoshidajp)
|
- #2509: Show custom date format on settings page (@kyoshidajp)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* #2715: Improve users list page (@arikfr)
|
- #2715: Improve users list page (@arikfr)
|
||||||
* #2710: Update Ant variables to fit Redash's style (@kocsmy)
|
- #2710: Update Ant variables to fit Redash's style (@kocsmy)
|
||||||
* #2709: Move format button next Add New Param button. (@arikfr)
|
- #2709: Move format button next Add New Param button. (@arikfr)
|
||||||
* #2664: Dashboard shows a spinner when query failed to load (@kravets-levko)
|
- #2664: Dashboard shows a spinner when query failed to load (@kravets-levko)
|
||||||
* #2626: Show real status when loading cached query result (@kravets-levko)
|
- #2626: Show real status when loading cached query result (@kravets-levko)
|
||||||
* #2663: Set column name implicitly when column name is blank (@ariarijp)
|
- #2663: Set column name implicitly when column name is blank (@ariarijp)
|
||||||
* #2695: Improve Date/DateTime type parameters (@kravets-levko)
|
- #2695: Improve Date/DateTime type parameters (@kravets-levko)
|
||||||
* #2694: Block users with disposable email addresses (@arikfr)
|
- #2694: Block users with disposable email addresses (@arikfr)
|
||||||
* #2687: YAML: changed load to safe_load (@denisov-vlad)
|
- #2687: YAML: changed load to safe_load (@denisov-vlad)
|
||||||
* #2514: Update value parsing for google spreadsheets source (@atharvai)
|
- #2514: Update value parsing for google spreadsheets source (@atharvai)
|
||||||
* #2570: fixes query pagination alignment (@alison985)
|
- #2570: fixes query pagination alignment (@alison985)
|
||||||
* #2584: keep query result pagination out of scroll (@alison985)
|
- #2584: keep query result pagination out of scroll (@alison985)
|
||||||
* #2647: Improve Script Query Runner (@ariarijp)
|
- #2647: Improve Script Query Runner (@ariarijp)
|
||||||
* #2583: Query header improvements on widgets (@kocsmy)
|
- #2583: Query header improvements on widgets (@kocsmy)
|
||||||
* #2671: Save some space (@kocsmy)
|
- #2671: Save some space (@kocsmy)
|
||||||
* #2658: delaying schema filtering to improve responsiveness (@alison985)
|
- #2658: delaying schema filtering to improve responsiveness (@alison985)
|
||||||
* #2648: Update datasource documentation links (@Pablohn26)
|
- #2648: Update datasource documentation links (@Pablohn26)
|
||||||
* #2613: Improve Script Query Runner (@ariarijp)
|
- #2613: Improve Script Query Runner (@ariarijp)
|
||||||
* #2619: data source sort case insensitive (@alison985)
|
- #2619: data source sort case insensitive (@alison985)
|
||||||
* #2604: Improve Google Spreadsheets Query Runner (@ariarijp)
|
- #2604: Improve Google Spreadsheets Query Runner (@ariarijp)
|
||||||
* #2542: Closes #2541: x-axis improvements. (@emtwo)
|
- #2542: Closes #2541: x-axis improvements. (@emtwo)
|
||||||
* #2590: Remove redundant variables (@ariarijp)
|
- #2590: Remove redundant variables (@ariarijp)
|
||||||
* #2585: Show data only mode: allow to add and delete visualizations (@kravets-levko)
|
- #2585: Show data only mode: allow to add and delete visualizations (@kravets-levko)
|
||||||
* #2549: Allow get_tables to see views and v10-style partitioned tables (@coreyhuinker)
|
- #2549: Allow get_tables to see views and v10-style partitioned tables (@coreyhuinker)
|
||||||
* #2568: sort datasources alphabetically (@alison985)
|
- #2568: sort datasources alphabetically (@alison985)
|
||||||
* #2444: feat: show error if saml response cannot be parsed (@sjakthol)
|
- #2444: feat: show error if saml response cannot be parsed (@sjakthol)
|
||||||
* #2554: Display name to be delete (@kyoshidajp)
|
- #2554: Display name to be delete (@kyoshidajp)
|
||||||
* #2510: Display confirmation dialog when deleting a item (@kyoshidajp)
|
- #2510: Display confirmation dialog when deleting a item (@kyoshidajp)
|
||||||
* #2518: Design improvements (@kocsmy)
|
- #2518: Design improvements (@kocsmy)
|
||||||
* #2520: Filter data sources in a data source input area (@kyoshidajp)
|
- #2520: Filter data sources in a data source input area (@kyoshidajp)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* #2722: Elasticsearch: Don't send source_content_type parameter. (@arikfr)
|
- #2722: Elasticsearch: Don't send source_content_type parameter. (@arikfr)
|
||||||
* #2719: Remove closing input tags (@maxv)
|
- #2719: Remove closing input tags (@maxv)
|
||||||
* #2458: Get all tables in the BigQuery (@kyoshidajp)
|
- #2458: Get all tables in the BigQuery (@kyoshidajp)
|
||||||
* #2698: Make sure we return distinct data source values (@arikfr)
|
- #2698: Make sure we return distinct data source values (@arikfr)
|
||||||
* #2315: Fix: pyHive type matches (@yuua)
|
- #2315: Fix: pyHive type matches (@yuua)
|
||||||
* #2638: Dashboard stops rendering when adding widget with empty query (@kravets-levko)
|
- #2638: Dashboard stops rendering when adding widget with empty query (@kravets-levko)
|
||||||
* #2610: Fix export query results output file name (@gabrieldutra)
|
- #2610: Fix export query results output file name (@gabrieldutra)
|
||||||
* #2574: commit query result to db before evaluating alerts (@mtrbean)
|
- #2574: commit query result to db before evaluating alerts (@mtrbean)
|
||||||
* #2580: add break-word wrap to add/edit text box on dashboard (@alison985)
|
- #2580: add break-word wrap to add/edit text box on dashboard (@alison985)
|
||||||
* #2578: Fix connection error when you run "create_tables" (@ariarijp)
|
- #2578: Fix connection error when you run "create_tables" (@ariarijp)
|
||||||
* #2572: remove extra menu line if query is archived (@alison985)
|
- #2572: remove extra menu line if query is archived (@alison985)
|
||||||
* #2526: Fix pivot hide control in dashboards (@deecay)
|
- #2526: Fix pivot hide control in dashboards (@deecay)
|
||||||
* #2511: Fixing signed_out.html template (@kocsmy)
|
- #2511: Fixing signed_out.html template (@kocsmy)
|
||||||
* #2523: Frontend: fix boolean field with null value display as null. (@innovia)
|
- #2523: Frontend: fix boolean field with null value display as null. (@innovia)
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
|
||||||
* #2682: Add Zeit's now support to have preview builds for every PR (@arikfr)
|
- #2682: Add Zeit's now support to have preview builds for every PR (@arikfr)
|
||||||
* #2668: Upgrade bootstrap script to Redash 4.0.1 (@ariarijp)
|
- #2668: Upgrade bootstrap script to Redash 4.0.1 (@ariarijp)
|
||||||
* #2639: Add tests for SpreadSheets (@ariarijp)
|
- #2639: Add tests for SpreadSheets (@ariarijp)
|
||||||
* #2635: Add tests for Query Results (@ariarijp)
|
- #2635: Add tests for Query Results (@ariarijp)
|
||||||
* #2537: Remove trailing semicolon (@sieben)
|
- #2537: Remove trailing semicolon (@sieben)
|
||||||
|
|
||||||
## v4.0.1 - 2018-05-02
|
## v4.0.1 - 2018-05-02
|
||||||
|
|
||||||
@@ -345,7 +642,6 @@ And much more!
|
|||||||
- Handling whitespace characters in Query Results data source. @ariarijp
|
- Handling whitespace characters in Query Results data source. @ariarijp
|
||||||
- [MySQL] Close cursor when cancellig the query. @jasonsmithj
|
- [MySQL] Close cursor when cancellig the query. @jasonsmithj
|
||||||
|
|
||||||
|
|
||||||
## v3.0.0 - 2017-11-13
|
## v3.0.0 - 2017-11-13
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -391,7 +687,7 @@ And much more!
|
|||||||
- Salesforce: improve error messages we receive from the API. @akiray03
|
- Salesforce: improve error messages we receive from the API. @akiray03
|
||||||
- Custom JS code visualization improvements. @deecay
|
- Custom JS code visualization improvements. @deecay
|
||||||
- DQL: Update version to 0.5.24. @aterreno
|
- DQL: Update version to 0.5.24. @aterreno
|
||||||
- Cassandra: get_schema support for both C* 2.x and 3.x, support for SortedSet type serialization. (@mfouilleul))
|
- Cassandra: get_schema support for both C\* 2.x and 3.x, support for SortedSet type serialization. (@mfouilleul))
|
||||||
- Replace deprecated ng-annotate with babel plugin. @44px
|
- Replace deprecated ng-annotate with babel plugin. @44px
|
||||||
- Update Python dependencies to recent versions. @alison985
|
- Update Python dependencies to recent versions. @alison985
|
||||||
- Bootstrap script: create /opt/redash directory only if it doesn't exist. @isomura
|
- Bootstrap script: create /opt/redash directory only if it doesn't exist. @isomura
|
||||||
@@ -427,7 +723,6 @@ And much more!
|
|||||||
|
|
||||||
This is a patch release, that adds support for Redshift ACM certificates (see #2044 for details).
|
This is a patch release, that adds support for Redshift ACM certificates (see #2044 for details).
|
||||||
|
|
||||||
|
|
||||||
## v2.0.0 - 2017-08-08
|
## v2.0.0 - 2017-08-08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -437,7 +732,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
- Add the propertyOrder field to specify order of data source settings. @rmakulov
|
- Add the propertyOrder field to specify order of data source settings. @rmakulov
|
||||||
- Add Plotly based Boxplot visualization. @deecay
|
- Add Plotly based Boxplot visualization. @deecay
|
||||||
- [Presto] Add: query cancellation support. @fbertsch
|
- [Presto] Add: query cancellation support. @fbertsch
|
||||||
- [MongoDB] add $oids JSON extension.
|
- [MongoDB] add \$oids JSON extension.
|
||||||
- [PostgreSQL] support for loading materialized views in schema.
|
- [PostgreSQL] support for loading materialized views in schema.
|
||||||
- [MySQL] Add option to hide SSL settings.
|
- [MySQL] Add option to hide SSL settings.
|
||||||
- [MySQL] support for RDS MySQL and SSL.
|
- [MySQL] support for RDS MySQL and SSL.
|
||||||
@@ -507,7 +802,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
- [Google Spreadsheets] handle distant future dates.
|
- [Google Spreadsheets] handle distant future dates.
|
||||||
- [SQLite] better handle utf-8 error messages.
|
- [SQLite] better handle utf-8 error messages.
|
||||||
- Fix: don't remove locks for queries with task status of PENDING.
|
- Fix: don't remove locks for queries with task status of PENDING.
|
||||||
- Only split columns with __/:: that end with filter/MultiFilter.
|
- Only split columns with \_\_/:: that end with filter/MultiFilter.
|
||||||
- Alert notifications fail (sometime) with a SQLAlchemy error.
|
- Alert notifications fail (sometime) with a SQLAlchemy error.
|
||||||
- Safeguard against empty query results when checking alert status. @danielerapati
|
- Safeguard against empty query results when checking alert status. @danielerapati
|
||||||
- Delete data source doesn't work when query results referenced by queries.
|
- Delete data source doesn't work when query results referenced by queries.
|
||||||
@@ -526,7 +821,6 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
- PostgreSQL passwords with spaces were not supported. (#1056)
|
- PostgreSQL passwords with spaces were not supported. (#1056)
|
||||||
- PivotTable wasn't updating after first save.
|
- PivotTable wasn't updating after first save.
|
||||||
|
|
||||||
|
|
||||||
## v1.0.3 - 2017-04-18
|
## v1.0.3 - 2017-04-18
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
@@ -573,7 +867,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
- Fix: query embed dialog close button wasn't working @r0fls
|
- Fix: query embed dialog close button wasn't working @r0fls
|
||||||
- Fix: make errors from Presto runner JSON-serializable @washort
|
- Fix: make errors from Presto runner JSON-serializable @washort
|
||||||
- Fix: race condition in query task status reporting @washort
|
- Fix: race condition in query task status reporting @washort
|
||||||
- Fix: remove $$hashKey from Pivot table
|
- Fix: remove \$\$hashKey from Pivot table
|
||||||
- Fix: map visualization had severe performance issue.
|
- Fix: map visualization had severe performance issue.
|
||||||
- Fix: pemrission dialog wasn't rendering.
|
- Fix: pemrission dialog wasn't rendering.
|
||||||
- Fix: word cloud visualization didn't show column names.
|
- Fix: word cloud visualization didn't show column names.
|
||||||
@@ -590,7 +884,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- [#1563](https://github.com/getredash/redash/pull/1563) Send events to webhook as JSON with a schema.
|
- [#1563](https://github.com/getredash/redash/pull/1563) Send events to webhook as JSON with a schema.
|
||||||
- [#1601] [Presto] friendlier error messages. (@aslotnick)
|
- [#1601][presto] friendlier error messages. (@aslotnick)
|
||||||
- Move the query runner unavailable log message to be DEBUG level instead of WARNING, as it was mainly confusing people.
|
- Move the query runner unavailable log message to be DEBUG level instead of WARNING, as it was mainly confusing people.
|
||||||
- Remove "Send to Cloud" button from Plotly based visualizations.
|
- Remove "Send to Cloud" button from Plotly based visualizations.
|
||||||
- Change Plotly's default hover mode to "Compare".
|
- Change Plotly's default hover mode to "Compare".
|
||||||
@@ -599,7 +893,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- [#1564] Fix: map visualization column picker wasn't populated. (@janusd)
|
- [#1564] Fix: map visualization column picker wasn't populated. (@janusd)
|
||||||
- [#1597] [SQL Server] Fix: schema wasn't loading on case sensitive servers. (@deecay)
|
- [#1597][sql server] Fix: schema wasn't loading on case sensitive servers. (@deecay)
|
||||||
- Fix: dashbonard owner couldn't edit his dashboard.
|
- Fix: dashbonard owner couldn't edit his dashboard.
|
||||||
- Fix: toggle_publish event wasn't logged properly.
|
- Fix: toggle_publish event wasn't logged properly.
|
||||||
- Fix: events with API keys were not logged.
|
- Fix: events with API keys were not logged.
|
||||||
@@ -614,7 +908,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
- Fix: extra whitespace created by the filters component.
|
- Fix: extra whitespace created by the filters component.
|
||||||
- Fix: query results cleanup task was trying to delete query objects.
|
- Fix: query results cleanup task was trying to delete query objects.
|
||||||
- Fix: alert subscriptions were not triggered.
|
- Fix: alert subscriptions were not triggered.
|
||||||
- [DynamoDB] Fix: count(*) queries were broken. (@kopanitsa))
|
- [DynamoDB] Fix: count(\*) queries were broken. (@kopanitsa))
|
||||||
- Fix: Redash is using too many database connections.
|
- Fix: Redash is using too many database connections.
|
||||||
- Fix: download links were not working in dashboards.
|
- Fix: download links were not working in dashboards.
|
||||||
- Fix: the first selection in multi filters was broken in dashboards.
|
- Fix: the first selection in multi filters was broken in dashboards.
|
||||||
@@ -631,9 +925,9 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
|
|||||||
|
|
||||||
This version has two big changes behind the scenes:
|
This version has two big changes behind the scenes:
|
||||||
|
|
||||||
* Refactor the frontend to use latest (at the time) Angular version (1.5) along with better frontend pipeline based on)
|
- Refactor the frontend to use latest (at the time) Angular version (1.5) along with better frontend pipeline based on)
|
||||||
WebPack.
|
WebPack.
|
||||||
* Refactor the backend code to use SQLAlchemy and Alembic, for easier migrations/upgrades.)
|
- Refactor the backend code to use SQLAlchemy and Alembic, for easier migrations/upgrades.)
|
||||||
|
|
||||||
Along with that we have many fixes, additions, new data sources (Google Analytics, ClickHouse, Amazon Athena, Snowflake)
|
Along with that we have many fixes, additions, new data sources (Google Analytics, ClickHouse, Amazon Athena, Snowflake)
|
||||||
and fixes to the existing ones (mainly ElasticSearch and Cassandra).
|
and fixes to the existing ones (mainly ElasticSearch and Cassandra).
|
||||||
@@ -716,7 +1010,7 @@ We're releasing a new upgrade script -- see [here](https://redash.io/help-onprem
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- 61fe16e #1374: Add: allow '*' in REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN (Allen Short)
|
- 61fe16e #1374: Add: allow '\*' in REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN (Allen Short)
|
||||||
- 2f09043 #1113: Add: share modify/access permissions for queries and dashboard (whummer)
|
- 2f09043 #1113: Add: share modify/access permissions for queries and dashboard (whummer)
|
||||||
- 3db0eea #1341: Add: support for specifying SAML nameid-format (zoetrope)
|
- 3db0eea #1341: Add: support for specifying SAML nameid-format (zoetrope)
|
||||||
- b0ecd0e #1343: Add: support for local SAML metadata file (zoetrope)
|
- b0ecd0e #1343: Add: support for local SAML metadata file (zoetrope)
|
||||||
@@ -780,7 +1074,6 @@ We're releasing a new upgrade script -- see [here](https://redash.io/help-onprem
|
|||||||
- 5d43cbe #1198: Change: add support for Standard SQL in BigQuery query runner (mystelynx)
|
- 5d43cbe #1198: Change: add support for Standard SQL in BigQuery query runner (mystelynx)
|
||||||
- 84d0c22 #1193: Change: modify the argument order of moment.add function call (Kenya Yamaguchi)
|
- 84d0c22 #1193: Change: modify the argument order of moment.add function call (Kenya Yamaguchi)
|
||||||
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- d6febb0 #1375: Fix: Download Dataset does not work when not logged in (Joshua Dechant)
|
- d6febb0 #1375: Fix: Download Dataset does not work when not logged in (Joshua Dechant)
|
||||||
@@ -895,7 +1188,7 @@ A big thank you goes to all who contributed code and documentation in this relea
|
|||||||
- e10ecd2 #1058: Bring back filters if dashboard filters are enabled (@AntoineAugusti)
|
- e10ecd2 #1058: Bring back filters if dashboard filters are enabled (@AntoineAugusti)
|
||||||
- 701035f #1059: Fix: DynamoDB having issues when setting host (@arikfr)
|
- 701035f #1059: Fix: DynamoDB having issues when setting host (@arikfr)
|
||||||
- 2924d4f #1040: Small fixes to visualizations view (@arikfr)
|
- 2924d4f #1040: Small fixes to visualizations view (@arikfr)
|
||||||
- fec0d5f #1037: Fix: multi filter wasn't working with __ syntax (@dheerajrav)
|
- fec0d5f #1037: Fix: multi filter wasn't working with \_\_ syntax (@dheerajrav)
|
||||||
- b066ce4 #1033: Fix: only ask for notification permissions if wasn't denied (@arikfr)
|
- b066ce4 #1033: Fix: only ask for notification permissions if wasn't denied (@arikfr)
|
||||||
- 960c416 #1032: Fix: make sure we return dashboards only for current org only (@arikfr)
|
- 960c416 #1032: Fix: make sure we return dashboards only for current org only (@arikfr)
|
||||||
- b3844d3 #1029: Hive: close connection only if it exists (@arikfr)
|
- b3844d3 #1029: Hive: close connection only if it exists (@arikfr)
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ The following is a set of guidelines for contributing to Redash. These are guide
|
|||||||
|
|
||||||
## Quick Links:
|
## Quick Links:
|
||||||
|
|
||||||
- [Feature Roadmap](https://trello.com/b/b2LUHU7A/redash-roadmap)
|
|
||||||
- [Feature Requests](https://discuss.redash.io/c/feature-requests)
|
- [Feature Requests](https://discuss.redash.io/c/feature-requests)
|
||||||
- [Documentation](https://redash.io/help/)
|
- [Documentation](https://redash.io/help/)
|
||||||
- [Blog](http://blog.redash.io/)
|
- [Blog](https://blog.redash.io/)
|
||||||
- [Twitter](https://twitter.com/getredash)
|
- [Twitter](https://twitter.com/getredash)
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -61,13 +60,13 @@ If you would like to suggest an enhancement or ask for a new feature:
|
|||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
The project's documentation can be found at [https://redash.io/help/](https://redash.io/help/). The [documentation sources](https://github.com/getredash/website/tree/master/website/_kb) are hosted on GitHub. To contribute edits / new pages, you can use GitHub's interface. Click the "Edit on GitHub" link on the documentation page to quickly open the edit interface.
|
The project's documentation can be found at [https://redash.io/help/](https://redash.io/help/). The [documentation sources](https://github.com/getredash/website/tree/master/src/pages/kb) are hosted on GitHub. To contribute edits / new pages, you can use GitHub's interface. Click the "Edit on GitHub" link on the documentation page to quickly open the edit interface.
|
||||||
|
|
||||||
## Additional Notes
|
## Additional Notes
|
||||||
|
|
||||||
### Release Method
|
### Release Method
|
||||||
|
|
||||||
We publish a stable release every ~2 months, although the goal is to get to a stable release every month. You can see the change log on [GitHub releases page](http://github.com/getredash/redash/releases).
|
We publish a stable release every ~2 months, although the goal is to get to a stable release every month. You can see the change log on [GitHub releases page](https://github.com/getredash/redash/releases).
|
||||||
|
|
||||||
Every build of the master branch updates the latest *RC release*. These releases are usually stable, but might contain regressions and therefore recommended for "advanced users" only.
|
Every build of the master branch updates the latest *RC release*. These releases are usually stable, but might contain regressions and therefore recommended for "advanced users" only.
|
||||||
|
|
||||||
@@ -75,4 +74,4 @@ When we release a new stable release, we also update the *latest* Docker image t
|
|||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
This project adheres to the Contributor Covenant [code of conduct](http://redash.io/community/code_of_conduct). By participating, you are expected to uphold this code. Please report unacceptable behavior to team@redash.io.
|
This project adheres to the Contributor Covenant [code of conduct](https://redash.io/community/code_of_conduct). By participating, you are expected to uphold this code. Please report unacceptable behavior to team@redash.io.
|
||||||
|
|||||||
19
Dockerfile
@@ -1,12 +1,25 @@
|
|||||||
|
FROM node:10 as frontend-builder
|
||||||
|
|
||||||
|
WORKDIR /frontend
|
||||||
|
COPY package.json package-lock.json /frontend/
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . /frontend
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
FROM redash/base:latest
|
FROM redash/base:latest
|
||||||
|
|
||||||
|
# Controls whether to install extra dependencies needed for all data sources.
|
||||||
|
ARG skip_ds_deps
|
||||||
|
|
||||||
# We first copy only the requirements file, to avoid rebuilding on every file
|
# We first copy only the requirements file, to avoid rebuilding on every file
|
||||||
# change.
|
# change.
|
||||||
COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./
|
COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./
|
||||||
RUN pip install -r requirements.txt -r requirements_dev.txt -r requirements_all_ds.txt
|
RUN pip install -r requirements.txt -r requirements_dev.txt
|
||||||
|
RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi
|
||||||
|
|
||||||
COPY . ./
|
COPY . /app
|
||||||
RUN npm install && npm run build && rm -rf node_modules
|
COPY --from=frontend-builder /frontend/client/dist /app/client/dist
|
||||||
RUN chown -R redash /app
|
RUN chown -R redash /app
|
||||||
USER redash
|
USER redash
|
||||||
|
|
||||||
|
|||||||
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2013-2018, Arik Fraimovich.
|
Copyright (c) 2013-2019, Arik Fraimovich.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
57
Makefile
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
.PHONY: compose_build up test_db create_database clean down bundle tests lint backend-unit-tests frontend-unit-tests test build watch start redis-cli bash
|
||||||
|
|
||||||
|
compose_build:
|
||||||
|
docker-compose build
|
||||||
|
|
||||||
|
up:
|
||||||
|
docker-compose up -d --build
|
||||||
|
|
||||||
|
test_db:
|
||||||
|
@for i in `seq 1 5`; do \
|
||||||
|
if (docker-compose exec postgres sh -c 'psql -U postgres -c "select 1;"' 2>&1 > /dev/null) then break; \
|
||||||
|
else echo "postgres initializing..."; sleep 5; fi \
|
||||||
|
done
|
||||||
|
docker-compose exec postgres sh -c 'psql -U postgres -c "drop database if exists tests;" && psql -U postgres -c "create database tests;"'
|
||||||
|
|
||||||
|
create_database:
|
||||||
|
docker-compose run server create_db
|
||||||
|
|
||||||
|
clean:
|
||||||
|
docker-compose down && docker-compose rm
|
||||||
|
|
||||||
|
down:
|
||||||
|
docker-compose down
|
||||||
|
|
||||||
|
bundle:
|
||||||
|
docker-compose run server bin/bundle-extensions
|
||||||
|
|
||||||
|
tests:
|
||||||
|
docker-compose run server tests
|
||||||
|
|
||||||
|
lint:
|
||||||
|
./bin/flake8_tests.sh
|
||||||
|
|
||||||
|
backend-unit-tests: up test_db
|
||||||
|
docker-compose run --rm --name tests server tests
|
||||||
|
|
||||||
|
frontend-unit-tests: bundle
|
||||||
|
npm install
|
||||||
|
npm run bundle
|
||||||
|
npm test
|
||||||
|
|
||||||
|
test: lint backend-unit-tests frontend-unit-tests
|
||||||
|
|
||||||
|
build: bundle
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
watch: bundle
|
||||||
|
npm run watch
|
||||||
|
|
||||||
|
start: bundle
|
||||||
|
npm run start
|
||||||
|
|
||||||
|
redis-cli:
|
||||||
|
docker-compose run --rm redis redis-cli -h redis
|
||||||
|
|
||||||
|
bash:
|
||||||
|
docker-compose run --rm server bash
|
||||||
@@ -16,7 +16,7 @@ Today **_Redash_** has support for querying multiple databases, including: Redsh
|
|||||||
|
|
||||||
**_Redash_** consists of two parts:
|
**_Redash_** consists of two parts:
|
||||||
|
|
||||||
1. **Query Editor**: think of [JS Fiddle](http://jsfiddle.net) for SQL queries. It's your way to share data in the organization in an open way, by sharing both the dataset and the query that generated it. This way everyone can peer review not only the resulting dataset but also the process that generated it. Also it's possible to fork it and generate new datasets and reach new insights.
|
1. **Query Editor**: think of [JS Fiddle](https://jsfiddle.net) for SQL queries. It's your way to share data in the organization in an open way, by sharing both the dataset and the query that generated it. This way everyone can peer review not only the resulting dataset but also the process that generated it. Also it's possible to fork it and generate new datasets and reach new insights.
|
||||||
2. **Visualizations and Dashboards**: once you have a dataset, you can create different visualizations out of it, and then combine several visualizations into a single dashboard. Currently Redash supports charts, pivot table, cohorts and [more](https://redash.io/help/user-guide/visualizations/visualization-types).
|
2. **Visualizations and Dashboards**: once you have a dataset, you can create different visualizations out of it, and then combine several visualizations into a single dashboard. Currently Redash supports charts, pivot table, cohorts and [more](https://redash.io/help/user-guide/visualizations/visualization-types).
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/getredash/website/8e820cd02c73a8ddf4f946a9d293c54fd3fb08b9/website/_assets/images/redash-anim.gif" width="80%"/>
|
<img src="https://raw.githubusercontent.com/getredash/website/8e820cd02c73a8ddf4f946a9d293c54fd3fb08b9/website/_assets/images/redash-anim.gif" width="80%"/>
|
||||||
@@ -28,13 +28,12 @@ Today **_Redash_** has support for querying multiple databases, including: Redsh
|
|||||||
|
|
||||||
## Supported Data Sources
|
## Supported Data Sources
|
||||||
|
|
||||||
Redash supports more than 25 [data sources](https://redash.io/help/data-sources/supported-data-sources).
|
Redash supports more than 35 [data sources](https://redash.io/help/data-sources/supported-data-sources).
|
||||||
|
|
||||||
## Getting Help
|
## Getting Help
|
||||||
|
|
||||||
* Issues: https://github.com/getredash/redash/issues
|
* Issues: https://github.com/getredash/redash/issues
|
||||||
* Discussion Forum: https://discuss.redash.io/
|
* Discussion Forum: https://discuss.redash.io/
|
||||||
* Slack: http://slack.redash.io/
|
|
||||||
|
|
||||||
## Reporting Bugs and Contributing Code
|
## Reporting Bugs and Contributing Code
|
||||||
|
|
||||||
|
|||||||
39
bin/bundle-extensions
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
from subprocess import call
|
||||||
|
from distutils.dir_util import copy_tree
|
||||||
|
|
||||||
|
from pkg_resources import iter_entry_points, resource_filename, resource_isdir
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Make a directory for extensions and set it as an environment variable
|
||||||
|
# to be picked up by webpack.
|
||||||
|
EXTENSIONS_RELATIVE_PATH = os.path.join('client', 'app', 'extensions')
|
||||||
|
EXTENSIONS_DIRECTORY = os.path.join(
|
||||||
|
os.path.dirname(os.path.dirname(__file__)),
|
||||||
|
EXTENSIONS_RELATIVE_PATH)
|
||||||
|
|
||||||
|
if not os.path.exists(EXTENSIONS_DIRECTORY):
|
||||||
|
os.makedirs(EXTENSIONS_DIRECTORY)
|
||||||
|
os.environ["EXTENSIONS_DIRECTORY"] = EXTENSIONS_RELATIVE_PATH
|
||||||
|
|
||||||
|
for entry_point in iter_entry_points('redash.extensions'):
|
||||||
|
# This is where the frontend code for an extension lives
|
||||||
|
# inside of its package.
|
||||||
|
content_folder_relative = os.path.join(
|
||||||
|
entry_point.name, 'bundle')
|
||||||
|
(root_module, _) = os.path.splitext(entry_point.module_name)
|
||||||
|
|
||||||
|
if not resource_isdir(root_module, content_folder_relative):
|
||||||
|
continue
|
||||||
|
|
||||||
|
content_folder = resource_filename(root_module, content_folder_relative)
|
||||||
|
|
||||||
|
# This is where we place our extensions folder.
|
||||||
|
destination = os.path.join(
|
||||||
|
EXTENSIONS_DIRECTORY,
|
||||||
|
entry_point.name)
|
||||||
|
|
||||||
|
copy_tree(content_folder, destination)
|
||||||
@@ -3,19 +3,21 @@ set -e
|
|||||||
|
|
||||||
worker() {
|
worker() {
|
||||||
WORKERS_COUNT=${WORKERS_COUNT:-2}
|
WORKERS_COUNT=${WORKERS_COUNT:-2}
|
||||||
QUEUES=${QUEUES:-queries,scheduled_queries,celery}
|
QUEUES=${QUEUES:-queries,scheduled_queries,celery,schemas}
|
||||||
|
WORKER_EXTRA_OPTIONS=${WORKER_EXTRA_OPTIONS:-}
|
||||||
|
|
||||||
echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..."
|
echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..."
|
||||||
exec /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair
|
exec /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --max-tasks-per-child=10 -Ofair $WORKER_EXTRA_OPTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduler() {
|
scheduler() {
|
||||||
WORKERS_COUNT=${WORKERS_COUNT:-1}
|
WORKERS_COUNT=${WORKERS_COUNT:-1}
|
||||||
QUEUES=${QUEUES:-celery}
|
QUEUES=${QUEUES:-celery}
|
||||||
|
SCHEDULE_DB=${SCHEDULE_DB:-celerybeat-schedule}
|
||||||
|
|
||||||
echo "Starting scheduler and $WORKERS_COUNT workers for queues: $QUEUES..."
|
echo "Starting scheduler and $WORKERS_COUNT workers for queues: $QUEUES..."
|
||||||
|
|
||||||
exec /usr/local/bin/celery worker --app=redash.worker --beat -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair
|
exec /usr/local/bin/celery worker --app=redash.worker --beat -s$SCHEDULE_DB -c$WORKERS_COUNT -Q$QUEUES -linfo --max-tasks-per-child=10 -Ofair
|
||||||
}
|
}
|
||||||
|
|
||||||
server() {
|
server() {
|
||||||
@@ -26,6 +28,10 @@ create_db() {
|
|||||||
exec /app/manage.py database create_tables
|
exec /app/manage.py database create_tables
|
||||||
}
|
}
|
||||||
|
|
||||||
|
celery_healthcheck() {
|
||||||
|
exec /usr/local/bin/celery inspect ping --app=redash.worker -d celery@$HOSTNAME
|
||||||
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo "Redash Docker."
|
echo "Redash Docker."
|
||||||
echo ""
|
echo ""
|
||||||
@@ -35,9 +41,11 @@ help() {
|
|||||||
echo "server -- start Redash server (with gunicorn)"
|
echo "server -- start Redash server (with gunicorn)"
|
||||||
echo "worker -- start Celery worker"
|
echo "worker -- start Celery worker"
|
||||||
echo "scheduler -- start Celery worker with a beat (scheduler) process"
|
echo "scheduler -- start Celery worker with a beat (scheduler) process"
|
||||||
|
echo "celery_healthcheck -- runs a Celery healthcheck. Useful for Docker's HEALTHCHECK mechanism."
|
||||||
echo ""
|
echo ""
|
||||||
echo "shell -- open shell"
|
echo "shell -- open shell"
|
||||||
echo "dev_server -- start Flask development server with debugger and auto reload"
|
echo "dev_server -- start Flask development server with debugger and auto reload"
|
||||||
|
echo "debug -- start Flask development server with remote debugger via ptvsd"
|
||||||
echo "create_db -- create database tables"
|
echo "create_db -- create database tables"
|
||||||
echo "manage -- CLI to manage redash"
|
echo "manage -- CLI to manage redash"
|
||||||
echo "tests -- run tests"
|
echo "tests -- run tests"
|
||||||
@@ -71,6 +79,11 @@ case "$1" in
|
|||||||
export FLASK_DEBUG=1
|
export FLASK_DEBUG=1
|
||||||
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
|
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
|
||||||
;;
|
;;
|
||||||
|
debug)
|
||||||
|
export FLASK_DEBUG=1
|
||||||
|
export REMOTE_DEBUG=1
|
||||||
|
exec /app/manage.py runserver --debugger --no-reload -h 0.0.0.0
|
||||||
|
;;
|
||||||
shell)
|
shell)
|
||||||
exec /app/manage.py shell
|
exec /app/manage.py shell
|
||||||
;;
|
;;
|
||||||
|
|||||||
7
bin/flake8_tests.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
flake8 --version ; pip --version
|
||||||
|
# stop the build if there are Python syntax errors or undefined names
|
||||||
|
flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
|
||||||
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||||
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/env python
|
#!/bin/env python
|
||||||
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -32,4 +33,4 @@ if __name__ == '__main__':
|
|||||||
changes = get_change_log(previous_sha)
|
changes = get_change_log(previous_sha)
|
||||||
|
|
||||||
for change in changes:
|
for change in changes:
|
||||||
print change
|
print(change)
|
||||||
8
bin/pack
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
NAME=redash
|
|
||||||
VERSION=$(python ./manage.py version)
|
|
||||||
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
|
|
||||||
FILENAME=$NAME.$FULL_VERSION.tar.gz
|
|
||||||
|
|
||||||
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
|
|
||||||
tar -zcv -f $FILENAME --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="node_modules" *
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import requests
|
import requests
|
||||||
|
import simplejson
|
||||||
|
|
||||||
github_token = os.environ['GITHUB_TOKEN']
|
github_token = os.environ['GITHUB_TOKEN']
|
||||||
auth = (github_token, 'x-oauth-basic')
|
auth = (github_token, 'x-oauth-basic')
|
||||||
@@ -17,7 +17,7 @@ def _github_request(method, path, params=None, headers={}):
|
|||||||
url = path
|
url = path
|
||||||
|
|
||||||
if params is not None:
|
if params is not None:
|
||||||
params = json.dumps(params)
|
params = simplejson.dumps(params)
|
||||||
|
|
||||||
response = requests.request(method, url, data=params, auth=auth)
|
response = requests.request(method, url, data=params, auth=auth)
|
||||||
return response
|
return response
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
{
|
{
|
||||||
"presets": ["env", "react", "stage-2"],
|
"presets": [
|
||||||
|
["@babel/preset-env", {
|
||||||
|
"exclude": [
|
||||||
|
"@babel/plugin-transform-async-to-generator",
|
||||||
|
"@babel/plugin-transform-arrow-functions"
|
||||||
|
],
|
||||||
|
"useBuiltIns": "usage"
|
||||||
|
}],
|
||||||
|
"@babel/preset-react"
|
||||||
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"angularjs-annotate",
|
"angularjs-annotate",
|
||||||
"transform-object-assign",
|
"@babel/plugin-proposal-class-properties",
|
||||||
|
"@babel/plugin-transform-object-assign",
|
||||||
["babel-plugin-transform-builtin-extend", {
|
["babel-plugin-transform-builtin-extend", {
|
||||||
"globals": ["Error"]
|
"globals": ["Error"]
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
build/*.js
|
build/*.js
|
||||||
config/*.js
|
config/*.js
|
||||||
node_modules
|
client/dist
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: "airbnb",
|
extends: ["airbnb", "plugin:compat/recommended"],
|
||||||
|
plugins: ["jest", "compat"],
|
||||||
settings: {
|
settings: {
|
||||||
"import/resolver": "webpack"
|
"import/resolver": "webpack"
|
||||||
},
|
},
|
||||||
parser: "babel-eslint",
|
parser: "babel-eslint",
|
||||||
env: {
|
env: {
|
||||||
"browser": true,
|
browser: true,
|
||||||
"node": true
|
node: true
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// allow debugger during development
|
// allow debugger during development
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
|
||||||
'no-param-reassign': 0,
|
"no-param-reassign": 0,
|
||||||
'no-mixed-operators': 0,
|
"no-mixed-operators": 0,
|
||||||
'no-underscore-dangle': 0,
|
"no-underscore-dangle": 0,
|
||||||
|
"no-use-before-define": ["error", "nofunc"],
|
||||||
"prefer-destructuring": "off",
|
"prefer-destructuring": "off",
|
||||||
"prefer-template": "off",
|
"prefer-template": "off",
|
||||||
"no-restricted-properties": "off",
|
"no-restricted-properties": "off",
|
||||||
@@ -23,19 +25,42 @@ module.exports = {
|
|||||||
"no-lonely-if": "off",
|
"no-lonely-if": "off",
|
||||||
"consistent-return": "off",
|
"consistent-return": "off",
|
||||||
"no-control-regex": "off",
|
"no-control-regex": "off",
|
||||||
|
"no-multiple-empty-lines": "warn",
|
||||||
|
"no-script-url": "off", // some <a> tags should have href="javascript:void(0)"
|
||||||
|
"operator-linebreak": "off",
|
||||||
|
"react/destructuring-assignment": "off",
|
||||||
"react/jsx-filename-extension": "off",
|
"react/jsx-filename-extension": "off",
|
||||||
|
"react/jsx-one-expression-per-line": "off",
|
||||||
"react/jsx-uses-react": "error",
|
"react/jsx-uses-react": "error",
|
||||||
"react/jsx-uses-vars": "error",
|
"react/jsx-uses-vars": "error",
|
||||||
|
"react/jsx-wrap-multilines": "warn",
|
||||||
|
"react/no-access-state-in-setstate": "warn",
|
||||||
"react/prefer-stateless-function": "warn",
|
"react/prefer-stateless-function": "warn",
|
||||||
"react/forbid-prop-types": "warn",
|
"react/forbid-prop-types": "warn",
|
||||||
"react/prop-types": "warn",
|
"react/prop-types": "warn",
|
||||||
"jsx-a11y/anchor-is-valid": "off",
|
"jsx-a11y/anchor-is-valid": "off",
|
||||||
"max-len": ['error', 120, 2, {
|
"jsx-a11y/click-events-have-key-events": "off",
|
||||||
|
"jsx-a11y/label-has-associated-control": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
controlComponents: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"jsx-a11y/label-has-for": "off",
|
||||||
|
"jsx-a11y/no-static-element-interactions": "off",
|
||||||
|
"max-len": [
|
||||||
|
"error",
|
||||||
|
120,
|
||||||
|
2,
|
||||||
|
{
|
||||||
ignoreUrls: true,
|
ignoreUrls: true,
|
||||||
ignoreComments: false,
|
ignoreComments: false,
|
||||||
ignoreRegExpLiterals: true,
|
ignoreRegExpLiterals: true,
|
||||||
ignoreStrings: true,
|
ignoreStrings: true,
|
||||||
ignoreTemplateLiterals: true,
|
ignoreTemplateLiterals: true
|
||||||
}]
|
}
|
||||||
|
],
|
||||||
|
"no-else-return": ["error", { allowElseIf: true }],
|
||||||
|
"object-curly-newline": ["error", { consistent: true }]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
7
client/app/.eslintrc.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: ["plugin:jest/recommended"],
|
||||||
|
plugins: ["jest"],
|
||||||
|
env: {
|
||||||
|
"jest/globals": true,
|
||||||
|
},
|
||||||
|
};
|
||||||
4
client/app/__tests__/enzyme_setup.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { configure } from 'enzyme';
|
||||||
|
import Adapter from 'enzyme-adapter-react-16';
|
||||||
|
|
||||||
|
configure({ adapter: new Adapter() });
|
||||||
5
client/app/__tests__/mocks.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import MockDate from 'mockdate';
|
||||||
|
|
||||||
|
const date = new Date('2000-01-01T02:00:00.000');
|
||||||
|
|
||||||
|
MockDate.set(date);
|
||||||
BIN
client/app/assets/images/db-logos/aws_es.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
client/app/assets/images/db-logos/couchbase.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
client/app/assets/images/db-logos/databricks.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
client/app/assets/images/db-logos/db2.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
client/app/assets/images/db-logos/drill.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
client/app/assets/images/db-logos/druid.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
client/app/assets/images/db-logos/hive_http.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
client/app/assets/images/db-logos/kylin.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.1 KiB |
BIN
client/app/assets/images/db-logos/phoenix.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
client/app/assets/images/db-logos/rockset.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
client/app/assets/images/db-logos/uptycs.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 11 KiB |
BIN
client/app/assets/images/destinations/hangouts_chat.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 12 KiB |
BIN
client/app/assets/images/destinations/pagerduty.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 6.7 KiB |
310
client/app/assets/less/ant.less
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
@import '~antd/lib/style/core/iconfont';
|
||||||
|
@import '~antd/lib/style/core/motion';
|
||||||
|
@import '~antd/lib/alert/style/index';
|
||||||
|
@import '~antd/lib/input/style/index';
|
||||||
|
@import '~antd/lib/input-number/style/index';
|
||||||
|
@import '~antd/lib/date-picker/style/index';
|
||||||
|
@import '~antd/lib/modal/style/index';
|
||||||
|
@import '~antd/lib/tooltip/style/index';
|
||||||
|
@import '~antd/lib/select/style/index';
|
||||||
|
@import '~antd/lib/checkbox/style/index';
|
||||||
|
@import '~antd/lib/upload/style/index';
|
||||||
|
@import '~antd/lib/form/style/index';
|
||||||
|
@import '~antd/lib/button/style/index';
|
||||||
|
@import '~antd/lib/radio/style/index';
|
||||||
|
@import '~antd/lib/time-picker/style/index';
|
||||||
|
@import '~antd/lib/pagination/style/index';
|
||||||
|
@import '~antd/lib/table/style/index';
|
||||||
|
@import '~antd/lib/popover/style/index';
|
||||||
|
@import '~antd/lib/icon/style/index';
|
||||||
|
@import '~antd/lib/tag/style/index';
|
||||||
|
@import '~antd/lib/grid/style/index';
|
||||||
|
@import '~antd/lib/switch/style/index';
|
||||||
|
@import '~antd/lib/empty/style/index';
|
||||||
|
@import '~antd/lib/drawer/style/index';
|
||||||
|
@import '~antd/lib/card/style/index';
|
||||||
|
@import '~antd/lib/steps/style/index';
|
||||||
|
@import '~antd/lib/divider/style/index';
|
||||||
|
@import '~antd/lib/dropdown/style/index';
|
||||||
|
@import '~antd/lib/menu/style/index';
|
||||||
|
@import '~antd/lib/list/style/index';
|
||||||
|
@import "~antd/lib/badge/style/index";
|
||||||
|
@import "~antd/lib/card/style/index";
|
||||||
|
@import "~antd/lib/spin/style/index";
|
||||||
|
@import "~antd/lib/tabs/style/index";
|
||||||
|
@import "~antd/lib/notification/style/index";
|
||||||
|
@import 'inc/ant-variables';
|
||||||
|
|
||||||
|
// Remove bold in labels for Ant checkboxes and radio buttons
|
||||||
|
.ant-checkbox-wrapper,
|
||||||
|
.ant-radio-wrapper {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix for disabled button styles inside Tooltip component.
|
||||||
|
// Tooltip wraps disabled buttons with `<span>` and moves all styles
|
||||||
|
// and classes to that `<span>`. This resets all button styles and
|
||||||
|
// turns it into simple inline element (because now it's wrapper is a button)
|
||||||
|
.btn {
|
||||||
|
button[disabled] {
|
||||||
|
-moz-appearance: none !important;
|
||||||
|
-webkit-appearance: none !important;
|
||||||
|
appearance: none !important;
|
||||||
|
border: 0 !important;
|
||||||
|
outline: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix for Ant dropdowns when they are used in Boootstrap modals
|
||||||
|
.ant-dropdown-in-bootstrap-modal {
|
||||||
|
z-index: 1050;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Button overrides
|
||||||
|
.@{btn-prefix-cls} {
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix ant input number showing duplicate arrows
|
||||||
|
.ant-input-number-input::-webkit-outer-spin-button,
|
||||||
|
.ant-input-number-input::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pagination overrides (based on existing Bootstrap overrides)
|
||||||
|
.@{pagination-prefix-cls} {
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: 18px;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
vertical-align: top;
|
||||||
|
|
||||||
|
&-item {
|
||||||
|
background-color: @pagination-bg;
|
||||||
|
border-color: transparent;
|
||||||
|
color: @pagination-color;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-right: 5px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus,
|
||||||
|
&:hover {
|
||||||
|
background-color: @pagination-hover-bg;
|
||||||
|
border-color: transparent;
|
||||||
|
color: @pagination-hover-color;
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-active {
|
||||||
|
&,
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
background-color: @pagination-active-bg;
|
||||||
|
color: @pagination-active-color;
|
||||||
|
border-color: transparent;
|
||||||
|
pointer-events: none;
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled {
|
||||||
|
&,
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
opacity: 0.5;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-prev,
|
||||||
|
&-next {
|
||||||
|
.@{pagination-prefix-cls}-item-link {
|
||||||
|
background-color: @pagination-bg;
|
||||||
|
border-color: transparent;
|
||||||
|
color: @pagination-color;
|
||||||
|
line-height: @pagination-item-size - 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus .@{pagination-prefix-cls}-item-link,
|
||||||
|
&:hover .@{pagination-prefix-cls}-item-link {
|
||||||
|
background-color: @pagination-hover-bg;
|
||||||
|
border-color: transparent;
|
||||||
|
color: @pagination-hover-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-prev,
|
||||||
|
&-jump-prev,
|
||||||
|
&-jump-next {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-jump-prev,
|
||||||
|
&-jump-next {
|
||||||
|
.@{pagination-prefix-cls}-item-container {
|
||||||
|
.@{pagination-prefix-cls}-item-link-icon {
|
||||||
|
color: @pagination-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Table
|
||||||
|
|
||||||
|
.@{table-prefix-cls} {
|
||||||
|
color: inherit;
|
||||||
|
|
||||||
|
tr,
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-thead > tr > th {
|
||||||
|
padding: @table-padding-vertical * 2 @table-padding-horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{table-prefix-cls}-column-sorters {
|
||||||
|
&:before,
|
||||||
|
&:hover:before {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-thead > tr > th {
|
||||||
|
.@{table-prefix-cls}-column-sorter {
|
||||||
|
&-up,
|
||||||
|
&-down {
|
||||||
|
&.on {
|
||||||
|
color: @table-header-icon-active-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Custom styles
|
||||||
|
|
||||||
|
&-headerless &-tbody > tr:first-child > td {
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// List
|
||||||
|
|
||||||
|
.@{list-prefix-cls} {
|
||||||
|
&-item {
|
||||||
|
// custom rule
|
||||||
|
&.selected {
|
||||||
|
background-color: #F6F8F9;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
background-color: fade(#F6F8F9, 40%);
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{dialog-prefix-cls} {
|
||||||
|
// styling for short modals (no lines)
|
||||||
|
&.shortModal {
|
||||||
|
.@{dialog-prefix-cls} {
|
||||||
|
&-header,
|
||||||
|
&-footer {
|
||||||
|
border: none;
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-body {
|
||||||
|
padding: 10px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-close-x {
|
||||||
|
width: 46px;
|
||||||
|
height: 46px;
|
||||||
|
line-height: 46px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// fullscreen modals
|
||||||
|
&-fullscreen {
|
||||||
|
.@{dialog-prefix-cls} {
|
||||||
|
position: absolute;
|
||||||
|
left: 15px;
|
||||||
|
top: 15px;
|
||||||
|
right: 15px;
|
||||||
|
bottom: 15px;
|
||||||
|
width: auto !important;
|
||||||
|
height: auto !important;
|
||||||
|
max-width: none;
|
||||||
|
max-height: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.@{dialog-prefix-cls}-content {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{dialog-prefix-cls}-body {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// description in modal header
|
||||||
|
.modal-header-desc {
|
||||||
|
font-size: @font-size-base;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
font-weight: normal;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-popover {
|
||||||
|
z-index: 1000; // make sure it doesn't cover drawer
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notification overrides
|
||||||
|
.@{notification-prefix-cls} {
|
||||||
|
// vertical centering
|
||||||
|
&-notice-close {
|
||||||
|
top: 20px;
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-notice-description {
|
||||||
|
max-width: 484px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{btn-prefix-cls} .@{iconfont-css-prefix}-ellipsis {
|
||||||
|
margin: 0 -7px;
|
||||||
|
}
|
||||||
80
client/app/assets/less/inc/ant-variables.less
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/* --------------------------------------------------------
|
||||||
|
Colors
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@lightblue: #03A9F4;
|
||||||
|
@primary-color: #2196F3;
|
||||||
|
|
||||||
|
@redash-gray: rgba(102, 136, 153, 1);
|
||||||
|
@redash-orange: rgba(255, 120, 100, 1);
|
||||||
|
@redash-black: rgba(0, 0, 0, 1);
|
||||||
|
@redash-yellow: rgba(252, 252, 161, 0.75);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Font
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@redash-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||||
|
@font-family-no-number: @redash-font;
|
||||||
|
@font-family: @redash-font;
|
||||||
|
@code-family: @redash-font;
|
||||||
|
@font-size-base: 13px;
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Typograpgy
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@text-color: #595959;
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Form
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@input-height-base: 35px;
|
||||||
|
@input-color: #595959;
|
||||||
|
@border-radius-base: 2px;
|
||||||
|
@border-color-base: #E8E8E8;
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Button
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@btn-danger-bg: fade(@redash-gray, 10%);
|
||||||
|
@btn-danger-border: fade(@redash-gray, 15%);
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Pagination
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@pagination-item-size: 33px;
|
||||||
|
@pagination-font-family: @redash-font;
|
||||||
|
@pagination-font-weight-active: normal;
|
||||||
|
|
||||||
|
@pagination-bg: fade(@redash-gray, 15%);
|
||||||
|
@pagination-color: #7E7E7E;
|
||||||
|
@pagination-active-bg: @lightblue;
|
||||||
|
@pagination-active-color: #FFF;
|
||||||
|
@pagination-disabled-bg: fade(@redash-gray, 15%);
|
||||||
|
@pagination-hover-color: #333;
|
||||||
|
@pagination-hover-bg: fade(@redash-gray, 25%);
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Table
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@table-border-radius-base: 0;
|
||||||
|
@table-header-color: #333;
|
||||||
|
@table-header-bg: fade(@redash-gray, 3%);
|
||||||
|
@table-header-icon-color: fade(@text-color, 20%);
|
||||||
|
@table-header-icon-active-color: @text-color;
|
||||||
|
@table-header-sort-bg: @table-header-bg;
|
||||||
|
@table-header-sort-active-bg: @table-header-bg;
|
||||||
|
@table-header-filter-active-bg: @table-header-bg;
|
||||||
|
@table-body-sort-bg: transparent;
|
||||||
|
@table-row-hover-bg: fade(@redash-gray, 5%);
|
||||||
|
@table-padding-vertical: 7px;
|
||||||
|
@table-padding-horizontal: 10px;
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Notification
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@notification-padding: @notification-padding-vertical 48px @notification-padding-vertical 17px;
|
||||||
|
@notification-width: auto;
|
||||||
@@ -21,17 +21,22 @@ html, body {
|
|||||||
body {
|
body {
|
||||||
padding-top: @header-height;
|
padding-top: @header-height;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: @footer-height;
|
|
||||||
&.headless {
|
&.headless {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
|
||||||
.nav.app-header {
|
.nav.app-header {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
div#footer {
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app-view {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
app-view, #app-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
@@ -73,6 +78,10 @@ strong {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.resize-vertical {
|
.resize-vertical {
|
||||||
resize: vertical !important;
|
resize: vertical !important;
|
||||||
transition: height 0s !important;
|
transition: height 0s !important;
|
||||||
|
|||||||
@@ -40,3 +40,10 @@
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide URLs next to links when printing (override `bootstrap` rules)
|
||||||
|
@media print {
|
||||||
|
a[href]:after {
|
||||||
|
content: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,15 +15,6 @@
|
|||||||
border-radius: @redash-radius;
|
border-radius: @redash-radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-in-place input,
|
|
||||||
.edit-in-place textarea {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-in-place.active span {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-in-place.active input,
|
.edit-in-place.active input,
|
||||||
.edit-in-place.active textarea {
|
.edit-in-place.active textarea {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
#footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
height: @footer-height;
|
|
||||||
color: #a2a2a2;
|
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
|
|
||||||
.f-menu {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
.list-inline();
|
|
||||||
margin-top: 8px;
|
|
||||||
|
|
||||||
& > li > a {
|
|
||||||
color: #a2a2a2;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #777;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: (@screen-lg-min + 80px)) {
|
|
||||||
padding-left: (@sidebar-left-width + @grid-gutter-width);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: @screen-sm-min) and (max-width: (@screen-md-max + 80px)) {
|
|
||||||
padding-left: (@sidebar-left-mid-width + @grid-gutter-width);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: (@screen-sm-min)) {
|
|
||||||
padding-left: @grid-gutter-width/2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
color: #818d9f;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
a {
|
|
||||||
color: #818d9f;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -146,6 +146,8 @@
|
|||||||
Width
|
Width
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.w-100 { width: 100% !important; }
|
.w-100 { width: 100% !important; }
|
||||||
|
.w-50 { width: 50% !important; }
|
||||||
|
.w-25 { width: 25% !important; }
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
|
|||||||
@@ -17,6 +17,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tags-list {
|
||||||
|
a {
|
||||||
|
line-height: 1.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tags-list__name {
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 88%;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max-character {
|
||||||
|
.text-overflow();
|
||||||
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
&.active {
|
&.active {
|
||||||
button {
|
button {
|
||||||
|
|||||||
@@ -226,3 +226,12 @@
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
width: 37px;
|
width: 37px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------
|
||||||
|
Percy
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
@media only percy {
|
||||||
|
.hide-in-percy, .pace {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
a.navbar-brand {
|
a.navbar-brand {
|
||||||
padding: 5px 5px 0px 0px;
|
padding: 5px 5px 0px 0px;
|
||||||
margin-left: 0px !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar .fa {
|
.navbar .fa {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#header,
|
#header,
|
||||||
#footer,
|
|
||||||
#sidebar,
|
#sidebar,
|
||||||
#chat,
|
#chat,
|
||||||
.growl-animated,
|
.growl-animated,
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
Template Variables
|
Template Variables
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
@header-height: 60px;
|
@header-height: 60px;
|
||||||
@footer-height: 95px;
|
|
||||||
@sidebar-left-width: 240px;
|
@sidebar-left-width: 240px;
|
||||||
@sidebar-left-mid-width: 64px;
|
@sidebar-left-mid-width: 64px;
|
||||||
@logo-width: @sidebar-left-width;
|
@logo-width: @sidebar-left-width;
|
||||||
@@ -55,6 +54,7 @@
|
|||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Form
|
Form
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
|
@input-color: #595959;
|
||||||
@input-color-placeholder: #b4b4b4;
|
@input-color-placeholder: #b4b4b4;
|
||||||
@input-border: #e8e8e8;
|
@input-border: #e8e8e8;
|
||||||
@input-border-radius: 0;
|
@input-border-radius: 0;
|
||||||
@@ -98,7 +98,6 @@
|
|||||||
@state-success-text: @green;
|
@state-success-text: @green;
|
||||||
@state-info-text: @blue;
|
@state-info-text: @blue;
|
||||||
@state-danger-text: lighten(@red, 5%);
|
@state-danger-text: lighten(@red, 5%);
|
||||||
@state-warning-text: @orange;
|
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
@@ -106,19 +105,16 @@
|
|||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
@alert-success-border: transparent;
|
@alert-success-border: transparent;
|
||||||
@alert-info-border: transparent;
|
@alert-info-border: transparent;
|
||||||
@alert-warning-border: transparent;
|
|
||||||
@alert-danger-border: transparent;
|
@alert-danger-border: transparent;
|
||||||
@alert-inverse-border: transparent;
|
@alert-inverse-border: transparent;
|
||||||
|
|
||||||
@alert-success-bg: fade(@green, 70%);
|
@alert-success-bg: fade(@green, 70%);
|
||||||
@alert-info-bg: fade(@blue, 70%);
|
@alert-info-bg: fade(@blue, 70%);
|
||||||
@alert-warning-bg: fade(@amber, 70%);
|
|
||||||
@alert-danger-bg: fade(@red, 70%);
|
@alert-danger-bg: fade(@red, 70%);
|
||||||
@alert-inverse-bg: #333;
|
@alert-inverse-bg: #333;
|
||||||
|
|
||||||
@alert-success-text: #fff;
|
@alert-success-text: #fff;
|
||||||
@alert-info-text: #fff;
|
@alert-info-text: #fff;
|
||||||
@alert-warning-text: #fff;
|
|
||||||
@alert-danger-text: #fff;
|
@alert-danger-text: #fff;
|
||||||
@alert-inverse-text: #fff;
|
@alert-inverse-text: #fff;
|
||||||
|
|
||||||
|
|||||||
@@ -3,52 +3,43 @@ counter-renderer {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 15px 10px;
|
padding: 15px 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
|
|
||||||
counter-renderer counter {
|
counter {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: block;
|
|
||||||
font-size: 80px;
|
font-size: 80px;
|
||||||
|
line-height: normal;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 200px;
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
counter-renderer value,
|
value,
|
||||||
counter-renderer counter-name,
|
counter-target {
|
||||||
counter-renderer counter-target {
|
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
line-height: 1em;
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
counter-renderer value .ruler,
|
counter-name {
|
||||||
counter-renderer counter-name .ruler,
|
|
||||||
counter-renderer counter-target .ruler {
|
|
||||||
display: block;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
counter-renderer counter-target {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
counter-renderer counter.positive value {
|
|
||||||
color: #5cb85c;
|
|
||||||
}
|
|
||||||
|
|
||||||
counter-renderer counter.negative value {
|
|
||||||
color: #d9534f;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
counter-renderer counter-name {
|
|
||||||
font-size: 0.5em;
|
font-size: 0.5em;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.positive value {
|
||||||
|
color: #5cb85c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.negative value {
|
||||||
|
color: #d9534f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
counter-target {
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
counter-name {
|
||||||
|
font-size: 0.5em;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
visualization-renderer .pagination {
|
visualization-renderer {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
.pagination,
|
||||||
|
.ant-pagination {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
pivot-table-renderer > table, grid-renderer > div, visualization-renderer > div {
|
.pivot-table-renderer > table, grid-renderer > div, visualization-renderer > div {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
@import '~antd/lib/style/core/iconfont.less';
|
|
||||||
@import '~antd/lib/input/style/index.less';
|
|
||||||
@import '~antd/lib/date-picker/style/index.less';
|
|
||||||
@import 'redash/ant';
|
|
||||||
|
|
||||||
/** LESS Plugins **/
|
/** LESS Plugins **/
|
||||||
@import 'inc/less-plugins/for';
|
@import 'inc/less-plugins/for';
|
||||||
|
|
||||||
@@ -12,10 +7,9 @@
|
|||||||
/** Load Vendors Dependencies **/
|
/** Load Vendors Dependencies **/
|
||||||
@import '~font-awesome/less/font-awesome';
|
@import '~font-awesome/less/font-awesome';
|
||||||
@import '~ui-select/dist/select.css';
|
@import '~ui-select/dist/select.css';
|
||||||
@import '~angular-toastr/src/toastr';
|
|
||||||
@import '~angular-resizable/src/angular-resizable.css';
|
@import '~angular-resizable/src/angular-resizable.css';
|
||||||
@import '~pace-progress/themes/blue/pace-theme-minimal.css';
|
|
||||||
@import '~material-design-iconic-font/dist/css/material-design-iconic-font.css';
|
@import '~material-design-iconic-font/dist/css/material-design-iconic-font.css';
|
||||||
|
@import '~pace-progress/themes/blue/pace-theme-minimal.css';
|
||||||
|
|
||||||
@import 'inc/angular';
|
@import 'inc/angular';
|
||||||
@import 'inc/variables';
|
@import 'inc/variables';
|
||||||
@@ -50,7 +44,6 @@
|
|||||||
@import 'inc/jumbotron';
|
@import 'inc/jumbotron';
|
||||||
@import 'inc/profile';
|
@import 'inc/profile';
|
||||||
@import 'inc/404';
|
@import 'inc/404';
|
||||||
@import 'inc/footer';
|
|
||||||
@import 'inc/ie-warning';
|
@import 'inc/ie-warning';
|
||||||
@import 'inc/navbar';
|
@import 'inc/navbar';
|
||||||
@import 'inc/edit-in-place';
|
@import 'inc/edit-in-place';
|
||||||
@@ -81,6 +74,7 @@
|
|||||||
@import 'redash/redash-newstyle';
|
@import 'redash/redash-newstyle';
|
||||||
@import 'redash/redash-table';
|
@import 'redash/redash-table';
|
||||||
@import 'redash/query';
|
@import 'redash/query';
|
||||||
|
@import 'redash/tags-control';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
// Overwritting Ant Design defaults to fit into Redash current style
|
|
||||||
@font-family-no-number : @redash-font;
|
|
||||||
@font-family : @redash-font;
|
|
||||||
@code-family : @redash-font;
|
|
||||||
|
|
||||||
@border-radius-base : @redash-input-radius;
|
|
||||||
@border-color-base : #e8e8e8;
|
|
||||||
|
|
||||||
@primary-color : @blue;
|
|
||||||
@@ -95,10 +95,6 @@ edit-in-place p.editable:hover {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.source-control {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.ace_editor.ace_autocomplete .ace_completion-highlight {
|
.ace_editor.ace_autocomplete .ace_completion-highlight {
|
||||||
text-shadow: none !important;
|
text-shadow: none !important;
|
||||||
background: #ffff005e;
|
background: #ffff005e;
|
||||||
@@ -176,6 +172,12 @@ edit-in-place p.editable:hover {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.query-log-line {
|
||||||
|
font-family: monospace;
|
||||||
|
white-space: pre;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.paginator-container {
|
.paginator-container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -206,9 +208,12 @@ edit-in-place p.editable:hover {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.visualization-renderer .pagination {
|
.visualization-renderer {
|
||||||
|
.pagination,
|
||||||
|
.ant-pagination {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.embed__vis {
|
.embed__vis {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -217,7 +222,7 @@ edit-in-place p.editable:hover {
|
|||||||
|
|
||||||
.widget-wrapper {
|
.widget-wrapper {
|
||||||
.body-container {
|
.body-container {
|
||||||
filters {
|
.filters-wrapper {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
}
|
}
|
||||||
@@ -225,26 +230,29 @@ edit-in-place p.editable:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.page-header--new {
|
.page-header--new {
|
||||||
.label-default {
|
.query-tags,
|
||||||
|
.query-tags__mobile {
|
||||||
|
.label-default,
|
||||||
|
.label-warning {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.page-header--query {
|
.page-header--query {
|
||||||
display: flex;
|
.page-title {
|
||||||
align-items: center;
|
display: block;
|
||||||
|
margin-left: 15px;
|
||||||
h3 {
|
margin-right: 15px;
|
||||||
display: inline-block;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a.label-tag {
|
a.label-tag {
|
||||||
background: fade(@redash-gray, 15%);
|
background: fade(@redash-gray, 15%);
|
||||||
color: #333;
|
color: darken(@redash-gray, 15%);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #333;
|
color: darken(@redash-gray, 15%);
|
||||||
background: fade(@redash-gray, 25%);
|
background: fade(@redash-gray, 25%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -256,6 +264,7 @@ a.label-tag {
|
|||||||
.query-page-wrapper {
|
.query-page-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.query-fullscreen {
|
.query-fullscreen {
|
||||||
@@ -334,7 +343,7 @@ a.label-tag {
|
|||||||
border-bottom: 1px solid #efefef;
|
border-bottom: 1px solid #efefef;
|
||||||
}
|
}
|
||||||
|
|
||||||
pivot-table-renderer > table, grid-renderer > div, visualization-renderer > div {
|
.pivot-table-renderer > table, grid-renderer > div, visualization-renderer > div {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,9 +536,63 @@ nav .rg-bottom {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.query-tags {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-top: -3px; // padding-top of tags
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-tags__mobile {
|
||||||
|
display: none;
|
||||||
|
margin: -5px 0 0 0;
|
||||||
|
padding: 0 0 0 23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table--permission {
|
||||||
|
.profile__image {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mp__permission-type {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-visualization {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
// Smaller screens
|
// Smaller screens
|
||||||
|
|
||||||
@media (max-width: 880px) {
|
@media (max-width: 880px) {
|
||||||
|
.page-header--query {
|
||||||
|
.page-title {
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-tags:not(.query-tags__empty) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-tags__mobile:not(.query-tags__empty) {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn--showhide,
|
||||||
|
.query-actions-menu .dropdown-toggle {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-publish {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-nav .tab-new-vis {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.query-fullscreen {
|
.query-fullscreen {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -541,45 +604,26 @@ nav .rg-bottom {
|
|||||||
.schema-container {
|
.schema-container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.query-page-wrapper {
|
.query-metadata__mobile {
|
||||||
.container {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.query-fullscreen .query-metadata__mobile {
|
|
||||||
display: block;
|
|
||||||
border-bottom: 1px solid #efefef;
|
border-bottom: 1px solid #efefef;
|
||||||
padding: 10px 0;
|
|
||||||
min-height: 0 !important;
|
min-height: 0 !important;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
padding: 10px 15px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.profile__image_thumb {
|
||||||
|
margin: 0 5px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.navbar-brand {
|
.query-metadata__property {
|
||||||
display: none;
|
white-space: nowrap;
|
||||||
}
|
|
||||||
|
|
||||||
.page-header--query {
|
|
||||||
padding-left: 0px !important;
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
line-height: 1.25;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.query-fullscreen .content {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.datasource-small {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.query-fullscreen {
|
|
||||||
|
|
||||||
main {
|
main {
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
|
|
||||||
@@ -600,18 +644,27 @@ nav .rg-bottom {
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
|
|
||||||
|
.static-position__mobile {
|
||||||
|
position: static !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bottom-controller-container {
|
||||||
@media (max-width: 438px) {
|
z-index: 9;
|
||||||
.btn--showhide {
|
}
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-publish {
|
.query-page-wrapper {
|
||||||
margin-bottom: 5px;
|
.container {
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.datasource-small {
|
||||||
|
visibility: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,15 +673,11 @@ nav .rg-bottom {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.navbar-brand {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-container {
|
.filter-container {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-edit-visualisation {
|
.btn-edit-visualisation {
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
@import (reference, less) '~bootstrap/less/labels.less';
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
@redash-gray: rgba(102, 136, 153, 1);
|
@redash-gray: rgba(102, 136, 153, 1);
|
||||||
@redash-orange: rgba(255, 120, 100, 1);
|
@redash-orange: rgba(255, 120, 100, 1);
|
||||||
@@ -21,16 +23,15 @@ body {
|
|||||||
|
|
||||||
&.headless {
|
&.headless {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 15px;
|
|
||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
div#footer {
|
.word-wrap-break {
|
||||||
display: none;
|
word-wrap: break-word;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.clearboth {
|
.clearboth {
|
||||||
@@ -52,27 +53,9 @@ body {
|
|||||||
border-left-color: #1b809e;
|
border-left-color: #1b809e;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-content {
|
|
||||||
@media (min-width: 992px) {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-control-r-b {
|
|
||||||
@media (max-width: 992px) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-control-t {
|
|
||||||
@media (min-width: 992px) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fixed width layout for specific pages
|
// Fixed width layout for specific pages
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
settings-screen, home-page, page-dashboard-list, page-queries-list, alerts-list-page, alert-page, queries-search-results-page, .fixed-container {
|
settings-screen, home-page, page-dashboard-list, page-queries-list, page-alerts-list, alert-page, queries-search-results-page, .fixed-container {
|
||||||
.container {
|
.container {
|
||||||
width: 750px;
|
width: 750px;
|
||||||
}
|
}
|
||||||
@@ -80,7 +63,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
@media (min-width: 992px) {
|
||||||
settings-screen, home-page, page-dashboard-list, page-queries-list, alerts-list-page, alert-page, queries-search-results-page, .fixed-container {
|
settings-screen, home-page, page-dashboard-list, page-queries-list, page-alerts-list, alert-page, queries-search-results-page, .fixed-container {
|
||||||
.container {
|
.container {
|
||||||
width: 970px;
|
width: 970px;
|
||||||
}
|
}
|
||||||
@@ -88,7 +71,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
settings-screen, home-page, page-dashboard-list, page-queries-list, alerts-list-page, alert-page, queries-search-results-page, .fixed-container {
|
settings-screen, home-page, page-dashboard-list, page-queries-list, page-alerts-list, alert-page, queries-search-results-page, .fixed-container {
|
||||||
.container {
|
.container {
|
||||||
width: 1170px;
|
width: 1170px;
|
||||||
}
|
}
|
||||||
@@ -166,16 +149,12 @@ body {
|
|||||||
box-shadow: inset 3px 0px 0px @brand-primary;
|
box-shadow: inset 3px 0px 0px @brand-primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table.table-data {
|
.table-data {
|
||||||
> tbody > tr > td {
|
tbody > tr > td {
|
||||||
padding-top: 5px !important;
|
padding-top: 5px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr:hover {
|
.btn-favourite, .btn-archive {
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-favourite {
|
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -188,7 +167,7 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-favourite {
|
.btn-favourite, .btn-archive {
|
||||||
color: #d4d4d4;
|
color: #d4d4d4;
|
||||||
transition: all .25s ease-in-out;
|
transition: all .25s ease-in-out;
|
||||||
|
|
||||||
@@ -201,7 +180,20 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header--new .btn-favourite {
|
.btn-archive {
|
||||||
|
color: #d4d4d4;
|
||||||
|
transition: all .25s ease-in-out;
|
||||||
|
|
||||||
|
&:hover, &:focus {
|
||||||
|
color: @gray-light;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa-archive {
|
||||||
|
color: @gray-light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-header--new .btn-favourite, .page-header--new .btn-archive {
|
||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +229,7 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar li a .btn-favourite .fa {
|
.navbar li a .btn-favourite .fa, .navbar li a .btn-archive .fa {
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,12 +237,6 @@ body {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.database-source {
|
|
||||||
display: inline-flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visual-card {
|
.visual-card {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border: 1px solid fade(@redash-gray, 15%);
|
border: 1px solid fade(@redash-gray, 15%);
|
||||||
@@ -265,7 +251,6 @@ body {
|
|||||||
transition-property: box-shadow;
|
transition-property: box-shadow;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
//flex-direction: row;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -287,31 +272,6 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.visual-card--selected {
|
|
||||||
background: fade(@redash-gray, 3%);
|
|
||||||
border: 1px solid fade(@redash-gray, 15%);
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 0 15px;
|
|
||||||
box-shadow: none;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
justify-content: space-around;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 64px;
|
|
||||||
height: 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
@media (max-width: 1200px) {
|
||||||
.visual-card {
|
.visual-card {
|
||||||
width: 217px;
|
width: 217px;
|
||||||
@@ -358,16 +318,10 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
.page-header-wrapper, .page-header--new {
|
||||||
height: auto;
|
|
||||||
line-height: 3;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
page-header, .page-header--new {
|
|
||||||
h3 {
|
h3 {
|
||||||
margin: 0;
|
margin: 0.2em 0;
|
||||||
line-height: 1.75;
|
line-height: 1.3;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -449,10 +403,27 @@ page-header, .page-header--new {
|
|||||||
background: fade(@redash-gray, 85%);
|
background: fade(@redash-gray, 85%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label-tag-unpublished {
|
||||||
|
background: fade(@redash-gray, 85%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-tag-archived {
|
||||||
|
.label-warning();
|
||||||
|
}
|
||||||
|
|
||||||
.label-tag {
|
.label-tag {
|
||||||
background: fade(@redash-gray, 10%);
|
background: fade(@redash-gray, 10%);
|
||||||
color: fade(@redash-gray, 75%);
|
color: fade(@redash-gray, 75%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-tag-unpublished,
|
||||||
|
.label-tag-archived,
|
||||||
|
.label-tag {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
|
display: inline;
|
||||||
|
margin-top: 2px;
|
||||||
|
max-width: 24ch;
|
||||||
|
.text-overflow();
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-nav > li > a {
|
.tab-nav > li > a {
|
||||||
@@ -621,11 +592,6 @@ page-header, .page-header--new {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
a.navbar-brand {
|
|
||||||
padding: 4px 0px 0px 0px;
|
|
||||||
margin-left: -3px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-group.open .dropdown-toggle {
|
.btn-group.open .dropdown-toggle {
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
@@ -636,6 +602,18 @@ page-header, .page-header--new {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-link-ANGULAR_REMOVE_ME {
|
||||||
|
line-height: 18px;
|
||||||
|
padding: 10px 15px;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
padding-top: 16px;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-link-ANGULAR_REMOVE_ME,
|
||||||
.navbar-default .navbar-nav > li > a {
|
.navbar-default .navbar-nav > li > a {
|
||||||
color: #000;
|
color: #000;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -687,6 +665,11 @@ page-header, .page-header--new {
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user_list__user--invitation-pending {
|
||||||
|
color: fade(@alert-danger-bg, 75%);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
.btn__new {
|
.btn__new {
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
@@ -698,11 +681,10 @@ page-header, .page-header--new {
|
|||||||
|
|
||||||
.navbar-brand {
|
.navbar-brand {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 49%;
|
left: 50%;
|
||||||
margin-left: -50px !important;
|
margin-left: -25px !important; // center
|
||||||
display: block;
|
display: block;
|
||||||
zoom: 0.9;
|
zoom: 0.9;
|
||||||
margin-top: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.va-top {
|
.va-top {
|
||||||
@@ -732,6 +714,14 @@ page-header, .page-header--new {
|
|||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags-list {
|
||||||
|
|
||||||
|
.badge-light {
|
||||||
|
background: fade(@redash-gray, 10%);
|
||||||
|
color: fade(@redash-gray, 75%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown-menu--profile {
|
.dropdown-menu--profile {
|
||||||
li {
|
li {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
@@ -779,11 +769,9 @@ page-header, .page-header--new {
|
|||||||
// Forms
|
// Forms
|
||||||
.form-control {
|
.form-control {
|
||||||
border-radius: @redash-input-radius;
|
border-radius: @redash-input-radius;
|
||||||
color: #9E9E9E;
|
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
color: #111;
|
|
||||||
border-color: @blue;
|
border-color: @blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -805,10 +793,6 @@ text.slicetext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.query-page-wrapper {
|
.query-page-wrapper {
|
||||||
.page-header--query {
|
|
||||||
padding-bottom: 5px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
@@ -820,6 +804,7 @@ text.slicetext {
|
|||||||
|
|
||||||
.navbar-brand {
|
.navbar-brand {
|
||||||
left: 2%;
|
left: 2%;
|
||||||
|
margin-left: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fix navbar collapse
|
//Fix navbar collapse
|
||||||
@@ -860,6 +845,31 @@ text.slicetext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
@media (max-width: 880px) {
|
||||||
|
.navbar-link-ANGULAR_REMOVE_ME,
|
||||||
|
.navbar-default .navbar-nav > li > a,
|
||||||
|
.navbar-form {
|
||||||
|
padding-left: 10px !important;
|
||||||
|
padding-right: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.navbar-brand {
|
||||||
|
margin-left: -15px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 810px) {
|
||||||
|
.menu-search {
|
||||||
|
width: 175px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.navbar-brand {
|
||||||
|
margin-left: 13px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 1084px) {
|
@media (max-width: 1084px) {
|
||||||
.dropdown--profile__username {
|
.dropdown--profile__username {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -900,3 +910,30 @@ text.slicetext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-select-choices-row.disabled > span {
|
||||||
|
background-color: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-group-item.inactive,
|
||||||
|
.ui-select-choices-row.disabled {
|
||||||
|
background-color: #eee !important;
|
||||||
|
border-color: transparent;
|
||||||
|
opacity: 0.5;
|
||||||
|
box-shadow: none;
|
||||||
|
color: #333;
|
||||||
|
pointer-events: none;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-option-divider {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-data .label-tag {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 135px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
22
client/app/assets/less/redash/tags-control.less
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
.tags-control {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: flex-start;
|
||||||
|
line-height: 1em;
|
||||||
|
|
||||||
|
&.inline-tags-control {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is for using .inline-tags-control in Angular which renders
|
||||||
|
// a little differently than React (e.g. in Alert.html)
|
||||||
|
.inline-tags-control .tags-control {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
43
client/app/components/AutocompleteToggle.jsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Tooltip from 'antd/lib/tooltip';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import '@/redash-font/style.less';
|
||||||
|
import recordEvent from '@/services/recordEvent';
|
||||||
|
|
||||||
|
export default function AutocompleteToggle({ state, disabled, onToggle }) {
|
||||||
|
let tooltipMessage = 'Live Autocomplete Enabled';
|
||||||
|
let icon = 'icon-flash';
|
||||||
|
if (!state) {
|
||||||
|
tooltipMessage = 'Live Autocomplete Disabled';
|
||||||
|
icon = 'icon-flash-off';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disabled) {
|
||||||
|
tooltipMessage = 'Live Autocomplete Not Available (Use Ctrl+Space to Trigger)';
|
||||||
|
icon = 'icon-flash-off';
|
||||||
|
}
|
||||||
|
|
||||||
|
const toggle = (newState) => {
|
||||||
|
recordEvent('toggle_autocomplete', 'screen', 'query_editor', { state: newState });
|
||||||
|
onToggle(newState);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip placement="top" title={tooltipMessage}>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={'btn btn-default m-r-5' + (disabled ? ' disabled' : '')}
|
||||||
|
onClick={() => toggle(!state)}
|
||||||
|
disabled={disabled}
|
||||||
|
>
|
||||||
|
<i className={'icon ' + icon} />
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AutocompleteToggle.propTypes = {
|
||||||
|
state: PropTypes.bool.isRequired,
|
||||||
|
disabled: PropTypes.bool.isRequired,
|
||||||
|
onToggle: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
@@ -2,9 +2,9 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { react2angular } from 'react2angular';
|
import { react2angular } from 'react2angular';
|
||||||
|
|
||||||
export function BigMessage({ message, icon, children }) {
|
export function BigMessage({ message, icon, children, className }) {
|
||||||
return (
|
return (
|
||||||
<div className="tiled bg-white p-15 text-center">
|
<div className={'p-15 text-center ' + className}>
|
||||||
<h3 className="m-t-0 m-b-0">
|
<h3 className="m-t-0 m-b-0">
|
||||||
<i className={'fa ' + icon} />
|
<i className={'fa ' + icon} />
|
||||||
</h3>
|
</h3>
|
||||||
@@ -19,13 +19,17 @@ BigMessage.propTypes = {
|
|||||||
message: PropTypes.string,
|
message: PropTypes.string,
|
||||||
icon: PropTypes.string.isRequired,
|
icon: PropTypes.string.isRequired,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
BigMessage.defaultProps = {
|
BigMessage.defaultProps = {
|
||||||
message: '',
|
message: '',
|
||||||
children: null,
|
children: null,
|
||||||
|
className: 'tiled bg-white',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function init(ngModule) {
|
export default function init(ngModule) {
|
||||||
ngModule.component('bigMessage', react2angular(BigMessage));
|
ngModule.component('bigMessage', react2angular(BigMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
|
|||||||
23
client/app/components/ColorBox.jsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
|
||||||
|
import './color-box.less';
|
||||||
|
|
||||||
|
export function ColorBox({ color }) {
|
||||||
|
return <span style={{ backgroundColor: color }} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorBox.propTypes = {
|
||||||
|
color: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
ColorBox.defaultProps = {
|
||||||
|
color: 'transparent',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('colorBox', react2angular(ColorBox));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
191
client/app/components/CreateSourceDialog.jsx
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { isEmpty, toUpper, includes } from 'lodash';
|
||||||
|
import Button from 'antd/lib/button';
|
||||||
|
import List from 'antd/lib/list';
|
||||||
|
import Modal from 'antd/lib/modal';
|
||||||
|
import Input from 'antd/lib/input';
|
||||||
|
import Steps from 'antd/lib/steps';
|
||||||
|
import { wrap as wrapDialog, DialogPropType } from '@/components/DialogWrapper';
|
||||||
|
import { PreviewCard } from '@/components/PreviewCard';
|
||||||
|
import EmptyState from '@/components/items-list/components/EmptyState';
|
||||||
|
import DynamicForm from '@/components/dynamic-form/DynamicForm';
|
||||||
|
import helper from '@/components/dynamic-form/dynamicFormHelper';
|
||||||
|
import { HelpTrigger, TYPES as HELP_TRIGGER_TYPES } from '@/components/HelpTrigger';
|
||||||
|
|
||||||
|
const { Step } = Steps;
|
||||||
|
const { Search } = Input;
|
||||||
|
|
||||||
|
const StepEnum = {
|
||||||
|
SELECT_TYPE: 0,
|
||||||
|
CONFIGURE_IT: 1,
|
||||||
|
DONE: 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
class CreateSourceDialog extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
dialog: DialogPropType.isRequired,
|
||||||
|
types: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
sourceType: PropTypes.string.isRequired,
|
||||||
|
imageFolder: PropTypes.string.isRequired,
|
||||||
|
helpTriggerPrefix: PropTypes.string,
|
||||||
|
onCreate: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
types: [],
|
||||||
|
helpTriggerPrefix: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
state = {
|
||||||
|
searchText: '',
|
||||||
|
selectedType: null,
|
||||||
|
savingSource: false,
|
||||||
|
currentStep: StepEnum.SELECT_TYPE,
|
||||||
|
};
|
||||||
|
|
||||||
|
selectType = (selectedType) => {
|
||||||
|
this.setState({ selectedType, currentStep: StepEnum.CONFIGURE_IT });
|
||||||
|
};
|
||||||
|
|
||||||
|
resetType = () => {
|
||||||
|
if (this.state.currentStep === StepEnum.CONFIGURE_IT) {
|
||||||
|
this.setState({ searchText: '', selectedType: null, currentStep: StepEnum.SELECT_TYPE });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
createSource = (values, successCallback, errorCallback) => {
|
||||||
|
const { selectedType, savingSource } = this.state;
|
||||||
|
if (!savingSource) {
|
||||||
|
this.setState({ savingSource: true, currentStep: StepEnum.DONE });
|
||||||
|
this.props.onCreate(selectedType, values).then((data) => {
|
||||||
|
successCallback('Saved.');
|
||||||
|
this.props.dialog.close({ success: true, data });
|
||||||
|
}).catch((error) => {
|
||||||
|
this.setState({ savingSource: false, currentStep: StepEnum.CONFIGURE_IT });
|
||||||
|
errorCallback(error.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
renderTypeSelector() {
|
||||||
|
const { types } = this.props;
|
||||||
|
const { searchText } = this.state;
|
||||||
|
const filteredTypes = types.filter(type => isEmpty(searchText) ||
|
||||||
|
includes(type.name.toLowerCase(), searchText.toLowerCase()));
|
||||||
|
return (
|
||||||
|
<div className="m-t-10">
|
||||||
|
<Search
|
||||||
|
placeholder="Search..."
|
||||||
|
onChange={e => this.setState({ searchText: e.target.value })}
|
||||||
|
autoFocus
|
||||||
|
data-test="SearchSource"
|
||||||
|
/>
|
||||||
|
<div className="scrollbox p-5 m-t-10" style={{ minHeight: '30vh', maxHeight: '40vh' }}>
|
||||||
|
{isEmpty(filteredTypes) ? (<EmptyState className="" />) : (
|
||||||
|
<List
|
||||||
|
size="small"
|
||||||
|
dataSource={filteredTypes}
|
||||||
|
renderItem={item => this.renderItem(item)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderForm() {
|
||||||
|
const { imageFolder, helpTriggerPrefix } = this.props;
|
||||||
|
const { selectedType } = this.state;
|
||||||
|
const fields = helper.getFields(selectedType);
|
||||||
|
const helpTriggerType = `${helpTriggerPrefix}${toUpper(selectedType.type)}`;
|
||||||
|
return (
|
||||||
|
<div className="p-5">
|
||||||
|
<div className="d-flex justify-content-center align-items-center">
|
||||||
|
<img
|
||||||
|
className="p-5"
|
||||||
|
src={`${imageFolder}/${selectedType.type}.png`}
|
||||||
|
alt={selectedType.name}
|
||||||
|
width="48"
|
||||||
|
/>
|
||||||
|
<h4 className="m-0">{selectedType.name}</h4>
|
||||||
|
</div>
|
||||||
|
<div className="text-right">
|
||||||
|
{HELP_TRIGGER_TYPES[helpTriggerType] && (
|
||||||
|
<HelpTrigger className="f-13" type={helpTriggerType}>
|
||||||
|
Setup Instructions <i className="fa fa-question-circle" />
|
||||||
|
</HelpTrigger>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<DynamicForm
|
||||||
|
id="sourceForm"
|
||||||
|
fields={fields}
|
||||||
|
onSubmit={this.createSource}
|
||||||
|
feedbackIcons
|
||||||
|
hideSubmitButton
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderItem(item) {
|
||||||
|
const { imageFolder } = this.props;
|
||||||
|
return (
|
||||||
|
<List.Item
|
||||||
|
className="p-l-10 p-r-10 clickable"
|
||||||
|
onClick={() => this.selectType(item)}
|
||||||
|
>
|
||||||
|
<PreviewCard title={item.name} imageUrl={`${imageFolder}/${item.type}.png`} roundedImage={false}>
|
||||||
|
<i className="fa fa-angle-double-right" />
|
||||||
|
</PreviewCard>
|
||||||
|
</List.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { currentStep, savingSource } = this.state;
|
||||||
|
const { dialog, sourceType } = this.props;
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
{...dialog.props}
|
||||||
|
title={`Create a New ${sourceType}`}
|
||||||
|
footer={(currentStep === StepEnum.SELECT_TYPE) ? [
|
||||||
|
(<Button key="cancel" onClick={() => dialog.dismiss()}>Cancel</Button>),
|
||||||
|
(<Button key="submit" type="primary" disabled>Create</Button>),
|
||||||
|
] : [
|
||||||
|
(<Button key="previous" onClick={this.resetType}>Previous</Button>),
|
||||||
|
(
|
||||||
|
<Button
|
||||||
|
key="submit"
|
||||||
|
htmlType="submit"
|
||||||
|
form="sourceForm"
|
||||||
|
type="primary"
|
||||||
|
loading={savingSource}
|
||||||
|
data-test="CreateSourceButton"
|
||||||
|
>
|
||||||
|
Create
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<div data-test="CreateSourceDialog">
|
||||||
|
<Steps className="hidden-xs m-b-10" size="small" current={currentStep} progressDot>
|
||||||
|
{currentStep === StepEnum.CONFIGURE_IT ? (
|
||||||
|
<Step
|
||||||
|
title={<a>Type Selection</a>}
|
||||||
|
className="clickable"
|
||||||
|
onClick={this.resetType}
|
||||||
|
/>
|
||||||
|
) : (<Step title="Type Selection" />)}
|
||||||
|
<Step title="Configuration" />
|
||||||
|
<Step title="Done" />
|
||||||
|
</Steps>
|
||||||
|
{currentStep === StepEnum.SELECT_TYPE && this.renderTypeSelector()}
|
||||||
|
{currentStep !== StepEnum.SELECT_TYPE && this.renderForm()}
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default wrapDialog(CreateSourceDialog);
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import moment from 'moment';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { react2angular } from 'react2angular';
|
import { react2angular } from 'react2angular';
|
||||||
import DatePicker from 'antd/lib/date-picker';
|
import DatePicker from 'antd/lib/date-picker';
|
||||||
|
import { clientConfig } from '@/services/auth';
|
||||||
|
import { Moment } from '@/components/proptypes';
|
||||||
|
|
||||||
function DateInput({
|
export function DateInput({
|
||||||
value,
|
value,
|
||||||
onSelect,
|
onSelect,
|
||||||
// eslint-disable-next-line react/prop-types
|
className,
|
||||||
clientConfig,
|
|
||||||
}) {
|
}) {
|
||||||
const format = clientConfig.dateFormat || 'YYYY-MM-DD';
|
const format = clientConfig.dateFormat || 'YYYY-MM-DD';
|
||||||
const additionalAttributes = {};
|
const additionalAttributes = {};
|
||||||
@@ -17,6 +17,7 @@ function DateInput({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
className={className}
|
||||||
{...additionalAttributes}
|
{...additionalAttributes}
|
||||||
format={format}
|
format={format}
|
||||||
placeholder="Select Date"
|
placeholder="Select Date"
|
||||||
@@ -26,22 +27,19 @@ function DateInput({
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateInput.propTypes = {
|
DateInput.propTypes = {
|
||||||
value: (props, propName, componentName) => {
|
value: Moment,
|
||||||
const value = props[propName];
|
|
||||||
if ((value !== null) && !moment.isMoment(value)) {
|
|
||||||
return new Error('Prop `' + propName + '` supplied to `' + componentName +
|
|
||||||
'` should be a Moment.js instance.');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect: PropTypes.func,
|
onSelect: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
DateInput.defaultProps = {
|
DateInput.defaultProps = {
|
||||||
value: null,
|
value: null,
|
||||||
onSelect: () => {},
|
onSelect: () => {},
|
||||||
|
className: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function init(ngModule) {
|
export default function init(ngModule) {
|
||||||
ngModule.component('dateInput', react2angular(DateInput, null, ['clientConfig']));
|
ngModule.component('dateInput', react2angular(DateInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
import moment from 'moment';
|
|
||||||
import { isArray } from 'lodash';
|
import { isArray } from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { react2angular } from 'react2angular';
|
import { react2angular } from 'react2angular';
|
||||||
import { RangePicker } from 'antd/lib/date-picker';
|
import DatePicker from 'antd/lib/date-picker';
|
||||||
import 'antd/lib/style/core/iconfont.less';
|
import { clientConfig } from '@/services/auth';
|
||||||
import 'antd/lib/input/style/index.less';
|
import { Moment } from '@/components/proptypes';
|
||||||
import 'antd/lib/date-picker/style/index.less';
|
|
||||||
|
|
||||||
function DateRangeInput({
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
|
export function DateRangeInput({
|
||||||
value,
|
value,
|
||||||
onSelect,
|
onSelect,
|
||||||
// eslint-disable-next-line react/prop-types
|
className,
|
||||||
clientConfig,
|
|
||||||
}) {
|
}) {
|
||||||
const format = clientConfig.dateFormat || 'YYYY-MM-DD';
|
const format = clientConfig.dateFormat || 'YYYY-MM-DD';
|
||||||
const additionalAttributes = {};
|
const additionalAttributes = {};
|
||||||
@@ -21,6 +20,7 @@ function DateRangeInput({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<RangePicker
|
<RangePicker
|
||||||
|
className={className}
|
||||||
{...additionalAttributes}
|
{...additionalAttributes}
|
||||||
format={format}
|
format={format}
|
||||||
onChange={onSelect}
|
onChange={onSelect}
|
||||||
@@ -29,27 +29,19 @@ function DateRangeInput({
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateRangeInput.propTypes = {
|
DateRangeInput.propTypes = {
|
||||||
value: (props, propName, componentName) => {
|
value: PropTypes.arrayOf(Moment),
|
||||||
const value = props[propName];
|
|
||||||
if (
|
|
||||||
(value !== null) && !(
|
|
||||||
isArray(value) && (value.length === 2) &&
|
|
||||||
moment.isMoment(value[0]) && moment.isMoment(value[1])
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return new Error('Prop `' + propName + '` supplied to `' + componentName +
|
|
||||||
'` should be an array of two Moment.js instances.');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect: PropTypes.func,
|
onSelect: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
DateRangeInput.defaultProps = {
|
DateRangeInput.defaultProps = {
|
||||||
value: null,
|
value: null,
|
||||||
onSelect: () => {},
|
onSelect: () => {},
|
||||||
|
className: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function init(ngModule) {
|
export default function init(ngModule) {
|
||||||
ngModule.component('dateRangeInput', react2angular(DateRangeInput, null, ['clientConfig']));
|
ngModule.component('dateRangeInput', react2angular(DateRangeInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import moment from 'moment';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { react2angular } from 'react2angular';
|
import { react2angular } from 'react2angular';
|
||||||
import DatePicker from 'antd/lib/date-picker';
|
import DatePicker from 'antd/lib/date-picker';
|
||||||
|
import { clientConfig } from '@/services/auth';
|
||||||
|
import { Moment } from '@/components/proptypes';
|
||||||
|
|
||||||
function DateTimeInput({
|
export function DateTimeInput({
|
||||||
value,
|
value,
|
||||||
withSeconds,
|
withSeconds,
|
||||||
onSelect,
|
onSelect,
|
||||||
// eslint-disable-next-line react/prop-types
|
className,
|
||||||
clientConfig,
|
|
||||||
}) {
|
}) {
|
||||||
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') +
|
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') +
|
||||||
(withSeconds ? ' HH:mm:ss' : ' HH:mm');
|
(withSeconds ? ' HH:mm:ss' : ' HH:mm');
|
||||||
@@ -19,6 +19,7 @@ function DateTimeInput({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
className={className}
|
||||||
showTime
|
showTime
|
||||||
{...additionalAttributes}
|
{...additionalAttributes}
|
||||||
format={format}
|
format={format}
|
||||||
@@ -29,24 +30,21 @@ function DateTimeInput({
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTimeInput.propTypes = {
|
DateTimeInput.propTypes = {
|
||||||
value: (props, propName, componentName) => {
|
value: Moment,
|
||||||
const value = props[propName];
|
|
||||||
if ((value !== null) && !moment.isMoment(value)) {
|
|
||||||
return new Error('Prop `' + propName + '` supplied to `' + componentName +
|
|
||||||
'` should be a Moment.js instance.');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
withSeconds: PropTypes.bool,
|
withSeconds: PropTypes.bool,
|
||||||
onSelect: PropTypes.func,
|
onSelect: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
DateTimeInput.defaultProps = {
|
DateTimeInput.defaultProps = {
|
||||||
value: null,
|
value: null,
|
||||||
withSeconds: false,
|
withSeconds: false,
|
||||||
onSelect: () => {},
|
onSelect: () => {},
|
||||||
|
className: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function init(ngModule) {
|
export default function init(ngModule) {
|
||||||
ngModule.component('dateTimeInput', react2angular(DateTimeInput, null, ['clientConfig']));
|
ngModule.component('dateTimeInput', react2angular(DateTimeInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
import moment from 'moment';
|
|
||||||
import { isArray } from 'lodash';
|
import { isArray } from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { react2angular } from 'react2angular';
|
import { react2angular } from 'react2angular';
|
||||||
import { RangePicker } from 'antd/lib/date-picker';
|
import DatePicker from 'antd/lib/date-picker';
|
||||||
import 'antd/lib/style/core/iconfont.less';
|
import { clientConfig } from '@/services/auth';
|
||||||
import 'antd/lib/input/style/index.less';
|
import { Moment } from '@/components/proptypes';
|
||||||
import 'antd/lib/date-picker/style/index.less';
|
|
||||||
|
|
||||||
function DateTimeRangeInput({
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
|
export function DateTimeRangeInput({
|
||||||
value,
|
value,
|
||||||
withSeconds,
|
withSeconds,
|
||||||
onSelect,
|
onSelect,
|
||||||
// eslint-disable-next-line react/prop-types
|
className,
|
||||||
clientConfig,
|
|
||||||
}) {
|
}) {
|
||||||
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') +
|
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') +
|
||||||
(withSeconds ? ' HH:mm:ss' : ' HH:mm');
|
(withSeconds ? ' HH:mm:ss' : ' HH:mm');
|
||||||
@@ -23,6 +22,7 @@ function DateTimeRangeInput({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<RangePicker
|
<RangePicker
|
||||||
|
className={className}
|
||||||
showTime
|
showTime
|
||||||
{...additionalAttributes}
|
{...additionalAttributes}
|
||||||
format={format}
|
format={format}
|
||||||
@@ -32,29 +32,21 @@ function DateTimeRangeInput({
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTimeRangeInput.propTypes = {
|
DateTimeRangeInput.propTypes = {
|
||||||
value: (props, propName, componentName) => {
|
value: PropTypes.arrayOf(Moment),
|
||||||
const value = props[propName];
|
|
||||||
if (
|
|
||||||
(value !== null) && !(
|
|
||||||
isArray(value) && (value.length === 2) &&
|
|
||||||
moment.isMoment(value[0]) && moment.isMoment(value[1])
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return new Error('Prop `' + propName + '` supplied to `' + componentName +
|
|
||||||
'` should be an array of two Moment.js instances.');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
withSeconds: PropTypes.bool,
|
withSeconds: PropTypes.bool,
|
||||||
onSelect: PropTypes.func,
|
onSelect: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
DateTimeRangeInput.defaultProps = {
|
DateTimeRangeInput.defaultProps = {
|
||||||
value: null,
|
value: null,
|
||||||
withSeconds: false,
|
withSeconds: false,
|
||||||
onSelect: () => {},
|
onSelect: () => {},
|
||||||
|
className: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function init(ngModule) {
|
export default function init(ngModule) {
|
||||||
ngModule.component('dateTimeRangeInput', react2angular(DateTimeRangeInput, null, ['clientConfig']));
|
ngModule.component('dateTimeRangeInput', react2angular(DateTimeRangeInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
|
|||||||
209
client/app/components/DialogWrapper.jsx
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
import { isFunction } from 'lodash';
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ReactDOM from 'react-dom';
|
||||||
|
|
||||||
|
/**
|
||||||
|
Wrapper for dialogs based on Ant's <Modal> component.
|
||||||
|
|
||||||
|
|
||||||
|
Using wrapped dialogs
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Wrapped component is an object with two fields:
|
||||||
|
|
||||||
|
{
|
||||||
|
showModal: (dialogProps) => object({
|
||||||
|
result: Promise,
|
||||||
|
close: (result) => void,
|
||||||
|
dismiss: (reason) => void,
|
||||||
|
}),
|
||||||
|
Component: React.Component, // wrapped dialog component
|
||||||
|
}
|
||||||
|
|
||||||
|
To open dialog, use `showModal` method; optionally you can pass additional properties that
|
||||||
|
will be expanded on wrapped component:
|
||||||
|
|
||||||
|
const dialog = SomeWrappedDialog.showModal()
|
||||||
|
|
||||||
|
const dialog = SomeWrappedDialog.showModal({ greeting: 'Hello' })
|
||||||
|
|
||||||
|
To get result of modal, use `result` property:
|
||||||
|
|
||||||
|
dialog.result
|
||||||
|
.then(...) // pressed OK button or used `close` method; resolved value is a result of dialog
|
||||||
|
.catch(...) // pressed Cancel button or used `dismiss` method; optional argument is a rejection reason.
|
||||||
|
|
||||||
|
Also, dialog has `close` and `dismiss` methods that allows to close dialog by caller. Passed arguments
|
||||||
|
will be used to resolve/reject `dialog.result` promise. `update` methods allows to pass new properties
|
||||||
|
to dialog.
|
||||||
|
|
||||||
|
|
||||||
|
Creating a dialog
|
||||||
|
================
|
||||||
|
|
||||||
|
1. Add imports:
|
||||||
|
|
||||||
|
import { wrap as wrapDialog, DialogPropType } from 'path/to/DialogWrapper';
|
||||||
|
|
||||||
|
2. define a `dialog` property on your component:
|
||||||
|
|
||||||
|
propTypes = {
|
||||||
|
dialog: DialogPropType.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
`dialog` property is an object:
|
||||||
|
|
||||||
|
{
|
||||||
|
props: object, // properties for <Modal> component;
|
||||||
|
close: (result) => void, // method to confirm dialog; `result` will be returned to caller
|
||||||
|
dismiss: (reason) => void, // method to reject dialog; `reason` will be returned to caller
|
||||||
|
}
|
||||||
|
|
||||||
|
3. expand additional properties on <Modal> component:
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { dialog } = this.props;
|
||||||
|
return (
|
||||||
|
<Modal {...dialog.props}>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
4. wrap your component and export it:
|
||||||
|
|
||||||
|
export default wrapDialog(YourComponent).
|
||||||
|
|
||||||
|
Your component is ready to use. Wrapper will manage <Modal>'s visibility and events.
|
||||||
|
If you want to override behavior of `onOk`/`onCancel` - don't forget to close dialog:
|
||||||
|
|
||||||
|
customOkHandler() {
|
||||||
|
this.saveData().then(() => {
|
||||||
|
this.props.dialog.close({ success: true }); // or dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { dialog } = this.props;
|
||||||
|
return (
|
||||||
|
<Modal {...dialog.props} onOk={() => this.customOkHandler()}>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Settings
|
||||||
|
========
|
||||||
|
|
||||||
|
You can setup this wrapper to use custom `Promise` library (for example, Bluebird):
|
||||||
|
|
||||||
|
import DialogWrapper from 'path/to/DialogWrapper';
|
||||||
|
import Promise from 'bluebird';
|
||||||
|
|
||||||
|
DialogWrapper.Promise = Promise;
|
||||||
|
|
||||||
|
It could be useful to avoid `unhandledrejection` exception that would fire with native Promises,
|
||||||
|
or when some custom Promise library is used in application.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const DialogPropType = PropTypes.shape({
|
||||||
|
props: PropTypes.shape({
|
||||||
|
visible: PropTypes.bool,
|
||||||
|
onOk: PropTypes.func,
|
||||||
|
onCancel: PropTypes.func,
|
||||||
|
afterClose: PropTypes.func,
|
||||||
|
}).isRequired,
|
||||||
|
close: PropTypes.func.isRequired,
|
||||||
|
dismiss: PropTypes.func.isRequired,
|
||||||
|
});
|
||||||
|
|
||||||
|
// default export of module
|
||||||
|
const DialogWrapper = {
|
||||||
|
Promise,
|
||||||
|
DialogPropType,
|
||||||
|
wrap() {},
|
||||||
|
};
|
||||||
|
|
||||||
|
function openDialog(DialogComponent, props) {
|
||||||
|
const dialog = {
|
||||||
|
props: {
|
||||||
|
visible: true,
|
||||||
|
onOk: () => {},
|
||||||
|
onCancel: () => {},
|
||||||
|
afterClose: () => {},
|
||||||
|
},
|
||||||
|
close: () => {},
|
||||||
|
dismiss: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
const dialogResult = {
|
||||||
|
resolve: () => {},
|
||||||
|
reject: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
const container = document.createElement('div');
|
||||||
|
document.body.appendChild(container);
|
||||||
|
|
||||||
|
function render() {
|
||||||
|
ReactDOM.render(<DialogComponent {...props} dialog={dialog} />, container);
|
||||||
|
}
|
||||||
|
|
||||||
|
function destroyDialog() {
|
||||||
|
// Allow calling chain to roll up, and then destroy component
|
||||||
|
setTimeout(() => {
|
||||||
|
ReactDOM.unmountComponentAtNode(container);
|
||||||
|
document.body.removeChild(container);
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeDialog(result) {
|
||||||
|
dialogResult.resolve(result);
|
||||||
|
dialog.props.visible = false;
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
|
||||||
|
function dismissDialog(reason) {
|
||||||
|
dialogResult.reject(reason);
|
||||||
|
dialog.props.visible = false;
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.props.onOk = closeDialog;
|
||||||
|
dialog.props.onCancel = dismissDialog;
|
||||||
|
dialog.props.afterClose = destroyDialog;
|
||||||
|
dialog.close = closeDialog;
|
||||||
|
dialog.dismiss = dismissDialog;
|
||||||
|
|
||||||
|
const result = {
|
||||||
|
close: closeDialog,
|
||||||
|
dismiss: dismissDialog,
|
||||||
|
update: (newProps) => {
|
||||||
|
props = { ...props, ...newProps };
|
||||||
|
render();
|
||||||
|
},
|
||||||
|
result: new DialogWrapper.Promise((resolve, reject) => {
|
||||||
|
dialogResult.resolve = resolve;
|
||||||
|
dialogResult.reject = reject;
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
render(); // show it only when all structures initialized to avoid unnecessary re-rendering
|
||||||
|
|
||||||
|
// Some known libraries support
|
||||||
|
// Bluebird: http://bluebirdjs.com/docs/api/suppressunhandledrejections.html
|
||||||
|
if (isFunction(result.result.suppressUnhandledRejections)) {
|
||||||
|
result.result.suppressUnhandledRejections();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function wrap(DialogComponent) {
|
||||||
|
return {
|
||||||
|
Component: DialogComponent,
|
||||||
|
showModal: props => openDialog(DialogComponent, props),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogWrapper.wrap = wrap;
|
||||||
|
|
||||||
|
export default DialogWrapper;
|
||||||
50
client/app/components/DynamicComponent.jsx
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { isFunction, isString } from 'lodash';
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
const componentsRegistry = new Map();
|
||||||
|
const activeInstances = new Set();
|
||||||
|
|
||||||
|
export function registerComponent(name, component) {
|
||||||
|
if (isString(name) && name !== '') {
|
||||||
|
componentsRegistry.set(name, isFunction(component) ? component : null);
|
||||||
|
// Refresh active DynamicComponent instances which use this component
|
||||||
|
activeInstances.forEach((dynamicComponent) => {
|
||||||
|
if (dynamicComponent.props.name === name) {
|
||||||
|
dynamicComponent.forceUpdate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unregisterComponent(name) {
|
||||||
|
registerComponent(name, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class DynamicComponent extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
children: PropTypes.node,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
children: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
activeInstances.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
activeInstances.delete(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { name, children, ...props } = this.props;
|
||||||
|
const RealComponent = componentsRegistry.get(name);
|
||||||
|
if (!RealComponent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return <RealComponent {...props}>{children}</RealComponent>;
|
||||||
|
}
|
||||||
|
}
|
||||||
93
client/app/components/EditInPlace.jsx
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import { trim } from 'lodash';
|
||||||
|
|
||||||
|
export class EditInPlace extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
ignoreBlanks: PropTypes.bool,
|
||||||
|
isEditable: PropTypes.bool,
|
||||||
|
editor: PropTypes.string.isRequired,
|
||||||
|
placeholder: PropTypes.string,
|
||||||
|
value: PropTypes.string,
|
||||||
|
onDone: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
ignoreBlanks: false,
|
||||||
|
isEditable: true,
|
||||||
|
placeholder: '',
|
||||||
|
value: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
editing: false,
|
||||||
|
};
|
||||||
|
this.inputRef = React.createRef();
|
||||||
|
const self = this;
|
||||||
|
this.componentDidUpdate = (prevProps, prevState) => {
|
||||||
|
if (self.state.editing && !prevState.editing) {
|
||||||
|
self.inputRef.current.focus();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
startEditing = () => {
|
||||||
|
if (this.props.isEditable) {
|
||||||
|
this.setState({ editing: true });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
stopEditing = () => {
|
||||||
|
const newValue = trim(this.inputRef.current.value);
|
||||||
|
const ignorableBlank = this.props.ignoreBlanks && newValue === '';
|
||||||
|
if (!ignorableBlank && newValue !== this.props.value) {
|
||||||
|
this.props.onDone(newValue);
|
||||||
|
}
|
||||||
|
this.setState({ editing: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
keyDown = (event) => {
|
||||||
|
if (event.keyCode === 13 && !event.shiftKey) {
|
||||||
|
event.preventDefault();
|
||||||
|
this.stopEditing();
|
||||||
|
} else if (event.keyCode === 27) {
|
||||||
|
this.setState({ editing: false });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
renderNormal = () => (
|
||||||
|
<span
|
||||||
|
role="presentation"
|
||||||
|
onFocus={this.startEditing}
|
||||||
|
onClick={this.startEditing}
|
||||||
|
className={this.props.isEditable ? 'editable' : ''}
|
||||||
|
>
|
||||||
|
{this.props.value || this.props.placeholder}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
|
||||||
|
renderEdit = () => React.createElement(this.props.editor, {
|
||||||
|
ref: this.inputRef,
|
||||||
|
className: 'rd-form-control',
|
||||||
|
defaultValue: this.props.value,
|
||||||
|
onBlur: this.stopEditing,
|
||||||
|
onKeyDown: this.keyDown,
|
||||||
|
});
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<span className={'edit-in-place' + (this.state.editing ? ' active' : '')}>
|
||||||
|
{this.state.editing ? this.renderEdit() : this.renderNormal()}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('editInPlace', react2angular(EditInPlace));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
218
client/app/components/EditParameterSettingsDialog.jsx
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
|
||||||
|
import { includes, startsWith, words, capitalize, clone, isNull } from 'lodash';
|
||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Modal from 'antd/lib/modal';
|
||||||
|
import Form from 'antd/lib/form';
|
||||||
|
import Checkbox from 'antd/lib/checkbox';
|
||||||
|
import Button from 'antd/lib/button';
|
||||||
|
import Select from 'antd/lib/select';
|
||||||
|
import Input from 'antd/lib/input';
|
||||||
|
import Divider from 'antd/lib/divider';
|
||||||
|
import { wrap as wrapDialog, DialogPropType } from '@/components/DialogWrapper';
|
||||||
|
import { QuerySelector } from '@/components/QuerySelector';
|
||||||
|
import { Query } from '@/services/query';
|
||||||
|
|
||||||
|
const { Option } = Select;
|
||||||
|
const formItemProps = { labelCol: { span: 6 }, wrapperCol: { span: 16 } };
|
||||||
|
|
||||||
|
function getDefaultTitle(text) {
|
||||||
|
return capitalize(words(text).join(' ')); // humanize
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTypeDate(type) {
|
||||||
|
return startsWith(type, 'date') && !isTypeDateRange(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTypeDateRange(type) {
|
||||||
|
return /-range/.test(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function NameInput({ name, type, onChange, existingNames, setValidation }) {
|
||||||
|
let helpText = '';
|
||||||
|
let validateStatus = '';
|
||||||
|
|
||||||
|
if (!name) {
|
||||||
|
helpText = 'Choose a keyword for this parameter';
|
||||||
|
setValidation(false);
|
||||||
|
} else if (includes(existingNames, name)) {
|
||||||
|
helpText = 'Parameter with this name already exists';
|
||||||
|
setValidation(false);
|
||||||
|
validateStatus = 'error';
|
||||||
|
} else {
|
||||||
|
if (isTypeDateRange(type)) {
|
||||||
|
helpText = (
|
||||||
|
<React.Fragment>
|
||||||
|
Appears in query as {' '}
|
||||||
|
<code style={{ display: 'inline-block', color: 'inherit' }}>
|
||||||
|
{`{{${name}.start}} {{${name}.end}}`}
|
||||||
|
</code>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
setValidation(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
required
|
||||||
|
label="Keyword"
|
||||||
|
help={helpText}
|
||||||
|
validateStatus={validateStatus}
|
||||||
|
{...formItemProps}
|
||||||
|
>
|
||||||
|
<Input onChange={e => onChange(e.target.value)} autoFocus />
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
NameInput.propTypes = {
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
existingNames: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||||
|
setValidation: PropTypes.func.isRequired,
|
||||||
|
type: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
function EditParameterSettingsDialog(props) {
|
||||||
|
const [param, setParam] = useState(clone(props.parameter));
|
||||||
|
const [isNameValid, setIsNameValid] = useState(true);
|
||||||
|
const [initialQuery, setInitialQuery] = useState();
|
||||||
|
|
||||||
|
const isNew = !props.parameter.name;
|
||||||
|
|
||||||
|
// fetch query by id
|
||||||
|
useEffect(() => {
|
||||||
|
const { queryId } = props.parameter;
|
||||||
|
if (queryId) {
|
||||||
|
Query.get({ id: queryId }, (query) => {
|
||||||
|
setInitialQuery(query);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
function isFulfilled() {
|
||||||
|
// name
|
||||||
|
if (!isNameValid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// title
|
||||||
|
if (param.title === '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// query
|
||||||
|
if (param.type === 'query' && !param.queryId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onConfirm(e) {
|
||||||
|
// update title to default
|
||||||
|
if (!param.title) {
|
||||||
|
// forced to do this cause param won't update in time for save
|
||||||
|
param.title = getDefaultTitle(param.name);
|
||||||
|
setParam(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
props.dialog.close(param);
|
||||||
|
|
||||||
|
e.preventDefault(); // stops form redirect
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
{...props.dialog.props}
|
||||||
|
title={isNew ? 'Add Parameter' : param.name}
|
||||||
|
width={600}
|
||||||
|
footer={[(
|
||||||
|
<Button key="cancel" onClick={props.dialog.dismiss}>Cancel</Button>
|
||||||
|
), (
|
||||||
|
<Button key="submit" htmlType="submit" disabled={!isFulfilled()} type="primary" form="paramForm" data-test="SaveParameterSettings">
|
||||||
|
{isNew ? 'Add Parameter' : 'OK'}
|
||||||
|
</Button>
|
||||||
|
)]}
|
||||||
|
>
|
||||||
|
<Form layout="horizontal" onSubmit={onConfirm} id="paramForm">
|
||||||
|
{isNew && (
|
||||||
|
<NameInput
|
||||||
|
name={param.name}
|
||||||
|
onChange={name => setParam({ ...param, name })}
|
||||||
|
setValidation={setIsNameValid}
|
||||||
|
existingNames={props.existingParams}
|
||||||
|
type={param.type}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Form.Item label="Title" {...formItemProps}>
|
||||||
|
<Input
|
||||||
|
value={isNull(param.title) ? getDefaultTitle(param.name) : param.title}
|
||||||
|
onChange={e => setParam({ ...param, title: e.target.value })}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="Type" {...formItemProps}>
|
||||||
|
<Select value={param.type} onChange={type => setParam({ ...param, type })} data-test="ParameterTypeSelect">
|
||||||
|
<Option value="text" data-test="TextParameterTypeOption">Text</Option>
|
||||||
|
<Option value="number" data-test="NumberParameterTypeOption">Number</Option>
|
||||||
|
<Option value="enum">Dropdown List</Option>
|
||||||
|
<Option value="query">Query Based Dropdown List</Option>
|
||||||
|
<Option disabled key="dv1">
|
||||||
|
<Divider className="select-option-divider" />
|
||||||
|
</Option>
|
||||||
|
<Option value="date">Date</Option>
|
||||||
|
<Option value="datetime-local">Date and Time</Option>
|
||||||
|
<Option value="datetime-with-seconds">Date and Time (with seconds)</Option>
|
||||||
|
<Option disabled key="dv2">
|
||||||
|
<Divider className="select-option-divider" />
|
||||||
|
</Option>
|
||||||
|
<Option value="date-range">Date Range</Option>
|
||||||
|
<Option value="datetime-range">Date and Time Range</Option>
|
||||||
|
<Option value="datetime-range-with-seconds">Date and Time Range (with seconds)</Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
{isTypeDate(param.type) && (
|
||||||
|
<Form.Item label=" " colon={false} {...formItemProps}>
|
||||||
|
<Checkbox
|
||||||
|
defaultChecked={param.useCurrentDateTime}
|
||||||
|
onChange={e => setParam({ ...param, useCurrentDateTime: e.target.checked })}
|
||||||
|
>
|
||||||
|
Default to Today/Now if no other value is set
|
||||||
|
</Checkbox>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
{param.type === 'enum' && (
|
||||||
|
<Form.Item label="Values" help="Dropdown list values (newline delimeted)" {...formItemProps}>
|
||||||
|
<Input.TextArea
|
||||||
|
rows={3}
|
||||||
|
value={param.enumOptions}
|
||||||
|
onChange={e => setParam({ ...param, enumOptions: e.target.value })}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
{param.type === 'query' && (
|
||||||
|
<Form.Item label="Query" help="Select query to load dropdown values from" {...formItemProps}>
|
||||||
|
<QuerySelector
|
||||||
|
selectedQuery={initialQuery}
|
||||||
|
onChange={q => setParam({ ...param, queryId: q && q.id })}
|
||||||
|
type="select"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
EditParameterSettingsDialog.propTypes = {
|
||||||
|
parameter: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
dialog: DialogPropType.isRequired,
|
||||||
|
existingParams: PropTypes.arrayOf(PropTypes.string),
|
||||||
|
};
|
||||||
|
|
||||||
|
EditParameterSettingsDialog.defaultProps = {
|
||||||
|
existingParams: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default wrapDialog(EditParameterSettingsDialog);
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Dropdown from 'antd/lib/dropdown';
|
||||||
|
import Menu from 'antd/lib/menu';
|
||||||
|
import Button from 'antd/lib/button';
|
||||||
|
import Icon from 'antd/lib/icon';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
|
||||||
|
import QueryResultsLink from './QueryResultsLink';
|
||||||
|
|
||||||
|
|
||||||
|
export function QueryControlDropdown(props) {
|
||||||
|
const menu = (
|
||||||
|
<Menu>
|
||||||
|
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
|
||||||
|
<Menu.Item>
|
||||||
|
<a target="_self" onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
|
||||||
|
<Icon type="plus-circle" theme="filled" /> Add to Dashboard
|
||||||
|
</a>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
|
{!props.query.isNew() && (
|
||||||
|
<Menu.Item>
|
||||||
|
<a onClick={() => props.showEmbedDialog(props.query, props.selectedTab)} data-test="ShowEmbedDialogButton">
|
||||||
|
<Icon type="share-alt" /> Embed elsewhere
|
||||||
|
</a>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
|
<Menu.Item>
|
||||||
|
<QueryResultsLink
|
||||||
|
disabled={props.queryExecuting || !props.queryResult.getData || !props.queryResult.getData()}
|
||||||
|
query={props.query}
|
||||||
|
queryResult={props.queryResult}
|
||||||
|
embed={props.embed}
|
||||||
|
apiKey={props.apiKey}
|
||||||
|
>
|
||||||
|
<Icon type="file" /> Download as CSV File
|
||||||
|
</QueryResultsLink>
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item>
|
||||||
|
<QueryResultsLink
|
||||||
|
fileType="xlsx"
|
||||||
|
disabled={props.queryExecuting || !props.queryResult.getData || !props.queryResult.getData()}
|
||||||
|
query={props.query}
|
||||||
|
queryResult={props.queryResult}
|
||||||
|
embed={props.embed}
|
||||||
|
apiKey={props.apiKey}
|
||||||
|
>
|
||||||
|
<Icon type="file-excel" /> Download as Excel File
|
||||||
|
</QueryResultsLink>
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dropdown trigger={['click']} overlay={menu}>
|
||||||
|
<Button data-test="QueryControlDropdownButton">
|
||||||
|
<Icon type="ellipsis" rotate={90} />
|
||||||
|
</Button>
|
||||||
|
</Dropdown>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryControlDropdown.propTypes = {
|
||||||
|
query: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
queryResult: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
queryExecuting: PropTypes.bool.isRequired,
|
||||||
|
showEmbedDialog: PropTypes.func.isRequired,
|
||||||
|
embed: PropTypes.bool,
|
||||||
|
apiKey: PropTypes.string,
|
||||||
|
selectedTab: PropTypes.oneOfType([
|
||||||
|
PropTypes.string,
|
||||||
|
PropTypes.number,
|
||||||
|
]),
|
||||||
|
openAddToDashboardForm: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
QueryControlDropdown.defaultProps = {
|
||||||
|
queryResult: {},
|
||||||
|
embed: false,
|
||||||
|
apiKey: '',
|
||||||
|
selectedTab: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('queryControlDropdown', react2angular(QueryControlDropdown));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
|
||||||
|
export default function QueryResultsLink(props) {
|
||||||
|
let href = '';
|
||||||
|
|
||||||
|
const { query, queryResult, fileType } = props;
|
||||||
|
const resultId = queryResult.getId && queryResult.getId();
|
||||||
|
const resultData = queryResult.getData && queryResult.getData();
|
||||||
|
|
||||||
|
if (resultId && resultData && query.name) {
|
||||||
|
if (query.id) {
|
||||||
|
href = `api/queries/${query.id}/results/${resultId}.${fileType}${
|
||||||
|
props.embed ? `?api_key=${props.apiKey}` : ''
|
||||||
|
}`;
|
||||||
|
} else {
|
||||||
|
href = `api/query_results/${resultId}.${fileType}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<a target="_self" disabled={props.disabled} href={href}>
|
||||||
|
{props.children}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryResultsLink.propTypes = {
|
||||||
|
query: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
queryResult: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
fileType: PropTypes.string,
|
||||||
|
disabled: PropTypes.bool.isRequired,
|
||||||
|
embed: PropTypes.bool,
|
||||||
|
apiKey: PropTypes.string,
|
||||||
|
children: PropTypes.oneOfType([
|
||||||
|
PropTypes.arrayOf(PropTypes.node),
|
||||||
|
PropTypes.node,
|
||||||
|
]).isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
QueryResultsLink.defaultProps = {
|
||||||
|
queryResult: {},
|
||||||
|
fileType: 'csv',
|
||||||
|
embed: false,
|
||||||
|
apiKey: '',
|
||||||
|
};
|
||||||
39
client/app/components/EditVisualizationButton/index.jsx
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Button from 'antd/lib/button';
|
||||||
|
import Icon from 'antd/lib/icon';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
|
||||||
|
|
||||||
|
export function EditVisualizationButton(props) {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
data-test="EditVisualization"
|
||||||
|
className="edit-visualization"
|
||||||
|
onClick={() => props.openVisualizationEditor(props.selectedTab)}
|
||||||
|
>
|
||||||
|
<Icon type="form" />
|
||||||
|
<span className="hidden-xs hidden-s hidden-m">
|
||||||
|
Edit Visualization
|
||||||
|
</span>
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
EditVisualizationButton.propTypes = {
|
||||||
|
openVisualizationEditor: PropTypes.func.isRequired,
|
||||||
|
selectedTab: PropTypes.oneOfType([
|
||||||
|
PropTypes.string,
|
||||||
|
PropTypes.number,
|
||||||
|
]),
|
||||||
|
};
|
||||||
|
|
||||||
|
EditVisualizationButton.defaultProps = {
|
||||||
|
selectedTab: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('editVisualizationButton', react2angular(EditVisualizationButton));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
22
client/app/components/EmailSettingsWarning.jsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import { currentUser, clientConfig } from '@/services/auth';
|
||||||
|
|
||||||
|
export function EmailSettingsWarning({ featureName }) {
|
||||||
|
return (clientConfig.mailSettingsMissing && currentUser.isAdmin) ? (
|
||||||
|
<p className="alert alert-danger">
|
||||||
|
{`It looks like your mail server isn't configured. Make sure to configure it for the ${featureName} to work.`}
|
||||||
|
</p>
|
||||||
|
) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
EmailSettingsWarning.propTypes = {
|
||||||
|
featureName: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('emailSettingsWarning', react2angular(EmailSettingsWarning));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
79
client/app/components/FavoritesControl.jsx
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import { $rootScope } from '@/services/ng';
|
||||||
|
|
||||||
|
export class FavoritesControl extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
item: PropTypes.shape({
|
||||||
|
is_favorite: PropTypes.bool.isRequired,
|
||||||
|
}).isRequired,
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
// Force component update when `item` changes.
|
||||||
|
// Remove this when `react2angular` will finally go to hell
|
||||||
|
forceUpdate: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
onChange: () => {},
|
||||||
|
forceUpdate: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
toggleItem(event, item, callback) {
|
||||||
|
const action = item.is_favorite ? item.$unfavorite.bind(item) : item.$favorite.bind(item);
|
||||||
|
const savedIsFavorite = item.is_favorite;
|
||||||
|
|
||||||
|
action().then(() => {
|
||||||
|
item.is_favorite = !savedIsFavorite;
|
||||||
|
this.forceUpdate();
|
||||||
|
$rootScope.$broadcast('reloadFavorites');
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { item, onChange } = this.props;
|
||||||
|
const icon = item.is_favorite ? 'fa fa-star' : 'fa fa-star-o';
|
||||||
|
const title = item.is_favorite ? 'Remove from favorites' : 'Add to favorites';
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
href="javascript:void(0)"
|
||||||
|
title={title}
|
||||||
|
className="btn-favourite"
|
||||||
|
onClick={event => this.toggleItem(event, item, onChange)}
|
||||||
|
>
|
||||||
|
<i className={icon} aria-hidden="true" />
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('favoritesControlImpl', react2angular(FavoritesControl));
|
||||||
|
ngModule.component('favoritesControl', {
|
||||||
|
template: `
|
||||||
|
<favorites-control-impl
|
||||||
|
ng-if="$ctrl.item"
|
||||||
|
item="$ctrl.item"
|
||||||
|
on-change="$ctrl.onChange"
|
||||||
|
force-update="$ctrl.forceUpdateTag"
|
||||||
|
></favorites-control-impl>
|
||||||
|
`,
|
||||||
|
bindings: {
|
||||||
|
item: '=',
|
||||||
|
},
|
||||||
|
controller($scope) {
|
||||||
|
// See comment for FavoritesControl.propTypes.forceUpdate
|
||||||
|
this.forceUpdateTag = 'force' + Date.now();
|
||||||
|
$scope.$on('reloadFavorites', () => {
|
||||||
|
this.forceUpdateTag = 'force' + Date.now();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.onChange = () => {
|
||||||
|
$scope.$applyAsync();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
122
client/app/components/Filters.jsx
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
import { isArray, map, includes, every, some } from 'lodash';
|
||||||
|
import moment from 'moment';
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import Select from 'antd/lib/select';
|
||||||
|
|
||||||
|
const ALL_VALUES = '###Redash::Filters::SelectAll###';
|
||||||
|
const NONE_VALUES = '###Redash::Filters::Clear###';
|
||||||
|
|
||||||
|
export const FilterType = PropTypes.shape({
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
friendlyName: PropTypes.string.isRequired,
|
||||||
|
multiple: PropTypes.bool,
|
||||||
|
current: PropTypes.oneOfType([
|
||||||
|
PropTypes.any,
|
||||||
|
PropTypes.arrayOf(PropTypes.any),
|
||||||
|
]).isRequired,
|
||||||
|
values: PropTypes.arrayOf(PropTypes.any).isRequired,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const FiltersType = PropTypes.arrayOf(FilterType);
|
||||||
|
|
||||||
|
function createFilterChangeHandler(filters, onChange) {
|
||||||
|
return (filter, value) => {
|
||||||
|
if (filter.multiple && includes(value, ALL_VALUES)) {
|
||||||
|
value = [...filter.values];
|
||||||
|
}
|
||||||
|
if (filter.multiple && includes(value, NONE_VALUES)) {
|
||||||
|
value = [];
|
||||||
|
}
|
||||||
|
filters = map(filters, f => (f.name === filter.name ? { ...filter, current: value } : f));
|
||||||
|
onChange(filters);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function filterData(rows, filters = []) {
|
||||||
|
if (!isArray(rows)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
let result = rows;
|
||||||
|
|
||||||
|
if (isArray(filters) && (filters.length > 0)) {
|
||||||
|
// "every" field's value should match "some" of corresponding filter's values
|
||||||
|
result = result.filter(row => every(
|
||||||
|
filters,
|
||||||
|
(filter) => {
|
||||||
|
const rowValue = row[filter.name];
|
||||||
|
const filterValues = isArray(filter.current) ? filter.current : [filter.current];
|
||||||
|
return some(filterValues, (filterValue) => {
|
||||||
|
if (moment.isMoment(rowValue)) {
|
||||||
|
return rowValue.isSame(filterValue);
|
||||||
|
}
|
||||||
|
// We compare with either the value or the String representation of the value,
|
||||||
|
// because Select2 casts true/false to "true"/"false".
|
||||||
|
return (filterValue === rowValue) || (String(rowValue) === filterValue);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Filters({ filters, onChange }) {
|
||||||
|
if (filters.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
onChange = createFilterChangeHandler(filters, onChange);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="filters-wrapper">
|
||||||
|
<div className="parameter-container container bg-white">
|
||||||
|
<div className="row">
|
||||||
|
{map(filters, (filter) => {
|
||||||
|
const options = map(filter.values, value => (
|
||||||
|
<Select.Option key={value}>{value}</Select.Option>
|
||||||
|
));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div key={filter.name} className="col-sm-6 p-l-0 filter-container">
|
||||||
|
<label>{filter.friendlyName}</label>
|
||||||
|
<Select
|
||||||
|
className="w-100"
|
||||||
|
mode={filter.multiple ? 'multiple' : 'default'}
|
||||||
|
value={filter.current}
|
||||||
|
allowClear={filter.multiple}
|
||||||
|
showSearch
|
||||||
|
onChange={value => onChange(filter, value)}
|
||||||
|
>
|
||||||
|
{!filter.multiple && options}
|
||||||
|
{filter.multiple && [
|
||||||
|
<Select.Option key={NONE_VALUES}><i className="fa fa-square-o m-r-5" />Clear</Select.Option>,
|
||||||
|
<Select.Option key={ALL_VALUES}><i className="fa fa-check-square-o m-r-5" />Select All</Select.Option>,
|
||||||
|
<Select.OptGroup key="Values" title="Values">{options}</Select.OptGroup>,
|
||||||
|
]}
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Filters.propTypes = {
|
||||||
|
filters: FiltersType.isRequired,
|
||||||
|
onChange: PropTypes.func, // (name, value) => void
|
||||||
|
};
|
||||||
|
|
||||||
|
Filters.defaultProps = {
|
||||||
|
onChange: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('filters', react2angular(Filters));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
185
client/app/components/HelpTrigger.jsx
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import cx from 'classnames';
|
||||||
|
import Tooltip from 'antd/lib/tooltip';
|
||||||
|
import Drawer from 'antd/lib/drawer';
|
||||||
|
import { BigMessage } from '@/components/BigMessage';
|
||||||
|
import DynamicComponent from '@/components/DynamicComponent';
|
||||||
|
|
||||||
|
import './HelpTrigger.less';
|
||||||
|
|
||||||
|
const DOMAIN = 'https://redash.io';
|
||||||
|
const HELP_PATH = '/help';
|
||||||
|
const IFRAME_TIMEOUT = 20000;
|
||||||
|
|
||||||
|
export const TYPES = {
|
||||||
|
HOME: [
|
||||||
|
'',
|
||||||
|
'Help',
|
||||||
|
],
|
||||||
|
VALUE_SOURCE_OPTIONS: [
|
||||||
|
'/user-guide/querying/query-parameters#Value-Source-Options',
|
||||||
|
'Guide: Value Source Options',
|
||||||
|
],
|
||||||
|
SHARE_DASHBOARD: [
|
||||||
|
'/user-guide/dashboards/sharing-dashboards',
|
||||||
|
'Guide: Sharing and Embedding Dashboards',
|
||||||
|
],
|
||||||
|
DS_ATHENA: [
|
||||||
|
'/data-sources/amazon-athena-setup',
|
||||||
|
'Guide: Help Setting up Amazon Athena',
|
||||||
|
],
|
||||||
|
DS_BIGQUERY: [
|
||||||
|
'/data-sources/bigquery-setup',
|
||||||
|
'Guide: Help Setting up BigQuery',
|
||||||
|
],
|
||||||
|
DS_URL: [
|
||||||
|
'/data-sources/querying-urls',
|
||||||
|
'Guide: Help Setting up URL',
|
||||||
|
],
|
||||||
|
DS_MONGODB: [
|
||||||
|
'/data-sources/mongodb-setup',
|
||||||
|
'Guide: Help Setting up MongoDB',
|
||||||
|
],
|
||||||
|
DS_GOOGLE_SPREADSHEETS: [
|
||||||
|
'/data-sources/querying-a-google-spreadsheet',
|
||||||
|
'Guide: Help Setting up Google Spreadsheets',
|
||||||
|
],
|
||||||
|
DS_GOOGLE_ANALYTICS: [
|
||||||
|
'/data-sources/google-analytics-setup',
|
||||||
|
'Guide: Help Setting up Google Analytics',
|
||||||
|
],
|
||||||
|
DS_AXIBASETSD: [
|
||||||
|
'/data-sources/axibase-time-series-database',
|
||||||
|
'Guide: Help Setting up Axibase Time Series',
|
||||||
|
],
|
||||||
|
DS_RESULTS: [
|
||||||
|
'/user-guide/querying/query-results-data-source',
|
||||||
|
'Guide: Help Setting up Query Results',
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export class HelpTrigger extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
type: PropTypes.oneOf(Object.keys(TYPES)).isRequired,
|
||||||
|
className: PropTypes.string,
|
||||||
|
children: PropTypes.node,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
className: null,
|
||||||
|
children: <i className="fa fa-question-circle" />,
|
||||||
|
};
|
||||||
|
|
||||||
|
iframeRef = null
|
||||||
|
|
||||||
|
iframeLoadingTimeout = null
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.iframeRef = React.createRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
state = {
|
||||||
|
visible: false,
|
||||||
|
loading: false,
|
||||||
|
error: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
clearTimeout(this.iframeLoadingTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
loadIframe = (url) => {
|
||||||
|
clearTimeout(this.iframeLoadingTimeout);
|
||||||
|
this.setState({ loading: true, error: false });
|
||||||
|
|
||||||
|
this.iframeRef.current.src = url;
|
||||||
|
this.iframeLoadingTimeout = setTimeout(() => {
|
||||||
|
this.setState({ error: url, loading: false });
|
||||||
|
}, IFRAME_TIMEOUT); // safety
|
||||||
|
};
|
||||||
|
|
||||||
|
onIframeLoaded = () => {
|
||||||
|
this.setState({ loading: false });
|
||||||
|
clearTimeout(this.iframeLoadingTimeout);
|
||||||
|
};
|
||||||
|
|
||||||
|
openDrawer = () => {
|
||||||
|
this.setState({ visible: true });
|
||||||
|
const [pagePath] = TYPES[this.props.type];
|
||||||
|
const url = DOMAIN + HELP_PATH + pagePath;
|
||||||
|
|
||||||
|
// wait for drawer animation to complete so there's no animation jank
|
||||||
|
setTimeout(() => this.loadIframe(url), 300);
|
||||||
|
};
|
||||||
|
|
||||||
|
closeDrawer = () => {
|
||||||
|
this.setState({ visible: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const [, tooltip] = TYPES[this.props.type];
|
||||||
|
const className = cx('help-trigger', this.props.className);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<Tooltip title={tooltip}>
|
||||||
|
<a href="javascript: void(0)" onClick={this.openDrawer} className={className}>
|
||||||
|
{this.props.children}
|
||||||
|
</a>
|
||||||
|
</Tooltip>
|
||||||
|
<Drawer
|
||||||
|
placement="right"
|
||||||
|
onClose={this.closeDrawer}
|
||||||
|
visible={this.state.visible}
|
||||||
|
className="help-drawer"
|
||||||
|
destroyOnClose
|
||||||
|
width={400}
|
||||||
|
>
|
||||||
|
<div className="drawer-wrapper">
|
||||||
|
{/* iframe */}
|
||||||
|
{!this.state.error && (
|
||||||
|
<iframe
|
||||||
|
ref={this.iframeRef}
|
||||||
|
title="Redash Help"
|
||||||
|
src="about:blank"
|
||||||
|
className={cx({ ready: !this.state.loading })}
|
||||||
|
onLoad={this.onIframeLoaded}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* loading indicator */}
|
||||||
|
{this.state.loading && (
|
||||||
|
<BigMessage icon="fa-spinner fa-2x fa-pulse" message="Loading..." className="help-message" />
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* error message */}
|
||||||
|
{this.state.error && (
|
||||||
|
<BigMessage icon="fa-exclamation-circle" className="help-message">
|
||||||
|
Something went wrong.<br />
|
||||||
|
{/* eslint-disable-next-line react/jsx-no-target-blank */}
|
||||||
|
<a href={this.state.error} target="_blank" rel="noopener">Click here</a>{' '}
|
||||||
|
to open the page in a new window.
|
||||||
|
</BigMessage>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* extra content */}
|
||||||
|
<DynamicComponent
|
||||||
|
name="HelpDrawerExtraContent"
|
||||||
|
onLeave={this.closeDrawer}
|
||||||
|
openPageUrl={this.loadIframe}
|
||||||
|
/>
|
||||||
|
</Drawer>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('helpTrigger', react2angular(HelpTrigger));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
34
client/app/components/HelpTrigger.less
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
.help-trigger {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.help-drawer {
|
||||||
|
.ant-drawer-body {
|
||||||
|
padding: 0;
|
||||||
|
height: 100%; // to allow iframe full dimensions
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
width: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe.ready {
|
||||||
|
border: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
57
client/app/components/InputWithCopy.jsx
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Input from 'antd/lib/input';
|
||||||
|
import Icon from 'antd/lib/icon';
|
||||||
|
import Tooltip from 'antd/lib/tooltip';
|
||||||
|
|
||||||
|
export default class InputWithCopy extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = { copied: null };
|
||||||
|
this.ref = React.createRef();
|
||||||
|
this.copyFeatureSupported = document.queryCommandSupported('copy');
|
||||||
|
this.resetCopyState = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
if (this.resetCopyState) {
|
||||||
|
clearTimeout(this.resetCopyState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
copy = () => {
|
||||||
|
// select text
|
||||||
|
this.ref.current.select();
|
||||||
|
|
||||||
|
// copy
|
||||||
|
try {
|
||||||
|
const success = document.execCommand('copy');
|
||||||
|
if (!success) {
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
this.setState({ copied: 'Copied!' });
|
||||||
|
} catch (err) {
|
||||||
|
this.setState({
|
||||||
|
copied: 'Copy failed',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset tooltip
|
||||||
|
this.resetCopyState = setTimeout(() => this.setState({ copied: null }), 2000);
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const copyButton = (
|
||||||
|
<Tooltip title={this.state.copied || 'Copy'}>
|
||||||
|
<Icon
|
||||||
|
type="copy"
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
|
onClick={this.copy}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Input {...this.props} ref={this.ref} addonAfter={this.copyFeatureSupported && copyButton} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,26 +1,27 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { react2angular } from 'react2angular';
|
import { react2angular } from 'react2angular';
|
||||||
import { BigMessage } from './BigMessage.jsx';
|
import { BigMessage } from '@/components/BigMessage';
|
||||||
|
import { TagsControl } from '@/components/tags-control/TagsControl';
|
||||||
|
|
||||||
function NoTaggedObjectsFound({ objectType, tags }) {
|
export function NoTaggedObjectsFound({ objectType, tags }) {
|
||||||
return (
|
return (
|
||||||
<BigMessage icon="fa-tags">
|
<BigMessage icon="fa-tags">
|
||||||
No {objectType} found tagged with
|
No {objectType} found tagged with <TagsControl className="inline-tags-control" tags={Array.from(tags)} />.
|
||||||
{Array.from(tags).map(tag => (
|
|
||||||
<span className="label label-tag" key={tag}>
|
|
||||||
{tag}
|
|
||||||
</span>
|
|
||||||
))}.
|
|
||||||
</BigMessage>
|
</BigMessage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
NoTaggedObjectsFound.propTypes = {
|
NoTaggedObjectsFound.propTypes = {
|
||||||
objectType: PropTypes.string.isRequired,
|
objectType: PropTypes.string.isRequired,
|
||||||
tags: PropTypes.objectOf(Set).isRequired,
|
tags: PropTypes.oneOfType([
|
||||||
|
PropTypes.array,
|
||||||
|
PropTypes.objectOf(Set),
|
||||||
|
]).isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function init(ngModule) {
|
export default function init(ngModule) {
|
||||||
ngModule.component('noTaggedObjectsFound', react2angular(NoTaggedObjectsFound));
|
ngModule.component('noTaggedObjectsFound', react2angular(NoTaggedObjectsFound));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
|
|||||||
23
client/app/components/PageHeader.jsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
|
||||||
|
export function PageHeader({ title }) {
|
||||||
|
return (
|
||||||
|
<div className="page-header-wrapper row p-l-15 p-r-15 m-b-10 m-l-0 m-r-0">
|
||||||
|
<div className="col-sm-9 p-l-0 p-r-0">
|
||||||
|
<h3>{ title }</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageHeader.propTypes = {
|
||||||
|
title: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('pageHeader', react2angular(PageHeader));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
60
client/app/components/Paginator.jsx
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import Pagination from 'antd/lib/pagination';
|
||||||
|
|
||||||
|
export function Paginator({
|
||||||
|
page,
|
||||||
|
itemsPerPage,
|
||||||
|
totalCount,
|
||||||
|
onChange,
|
||||||
|
}) {
|
||||||
|
if (totalCount <= itemsPerPage) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div className="paginator-container">
|
||||||
|
<Pagination
|
||||||
|
defaultCurrent={page}
|
||||||
|
defaultPageSize={itemsPerPage}
|
||||||
|
total={totalCount}
|
||||||
|
onChange={onChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Paginator.propTypes = {
|
||||||
|
page: PropTypes.number.isRequired,
|
||||||
|
itemsPerPage: PropTypes.number.isRequired,
|
||||||
|
totalCount: PropTypes.number.isRequired,
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
Paginator.defaultProps = {
|
||||||
|
onChange: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('paginatorImpl', react2angular(Paginator));
|
||||||
|
ngModule.component('paginator', {
|
||||||
|
template: `
|
||||||
|
<paginator-impl
|
||||||
|
page="$ctrl.paginator.page"
|
||||||
|
items-per-page="$ctrl.paginator.itemsPerPage"
|
||||||
|
total-count="$ctrl.paginator.totalCount"
|
||||||
|
on-change="$ctrl.onPageChanged"
|
||||||
|
></paginator-impl>`,
|
||||||
|
bindings: {
|
||||||
|
paginator: '<',
|
||||||
|
},
|
||||||
|
controller($scope) {
|
||||||
|
this.onPageChanged = (page) => {
|
||||||
|
this.paginator.setPage(page);
|
||||||
|
$scope.$applyAsync();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||
642
client/app/components/ParameterMappingInput.jsx
Normal file
@@ -0,0 +1,642 @@
|
|||||||
|
/* eslint-disable react/no-multi-comp */
|
||||||
|
|
||||||
|
import { isString, extend, each, map, includes, findIndex, find, fromPairs, clone, isEmpty } from 'lodash';
|
||||||
|
import React, { Fragment } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import Select from 'antd/lib/select';
|
||||||
|
import Table from 'antd/lib/table';
|
||||||
|
import Popover from 'antd/lib/popover';
|
||||||
|
import Button from 'antd/lib/button';
|
||||||
|
import Icon from 'antd/lib/icon';
|
||||||
|
import Tag from 'antd/lib/tag';
|
||||||
|
import Input from 'antd/lib/input';
|
||||||
|
import Radio from 'antd/lib/radio';
|
||||||
|
import Form from 'antd/lib/form';
|
||||||
|
import Tooltip from 'antd/lib/tooltip';
|
||||||
|
import { ParameterValueInput } from '@/components/ParameterValueInput';
|
||||||
|
import { ParameterMappingType } from '@/services/widget';
|
||||||
|
import { clientConfig } from '@/services/auth';
|
||||||
|
import { Query, Parameter } from '@/services/query';
|
||||||
|
import { HelpTrigger } from '@/components/HelpTrigger';
|
||||||
|
|
||||||
|
import './ParameterMappingInput.less';
|
||||||
|
|
||||||
|
const { Option } = Select;
|
||||||
|
|
||||||
|
export const MappingType = {
|
||||||
|
DashboardAddNew: 'dashboard-add-new',
|
||||||
|
DashboardMapToExisting: 'dashboard-map-to-existing',
|
||||||
|
WidgetLevel: 'widget-level',
|
||||||
|
StaticValue: 'static-value',
|
||||||
|
};
|
||||||
|
|
||||||
|
export function parameterMappingsToEditableMappings(mappings, parameters, existingParameterNames = []) {
|
||||||
|
return map(mappings, (mapping) => {
|
||||||
|
const result = extend({}, mapping);
|
||||||
|
const alreadyExists = includes(existingParameterNames, mapping.mapTo);
|
||||||
|
result.param = find(parameters, p => p.name === mapping.name);
|
||||||
|
switch (mapping.type) {
|
||||||
|
case ParameterMappingType.DashboardLevel:
|
||||||
|
result.type = alreadyExists ? MappingType.DashboardMapToExisting : MappingType.DashboardAddNew;
|
||||||
|
result.value = null;
|
||||||
|
break;
|
||||||
|
case ParameterMappingType.StaticValue:
|
||||||
|
result.type = MappingType.StaticValue;
|
||||||
|
result.param = result.param.clone();
|
||||||
|
result.param.setValue(result.value);
|
||||||
|
break;
|
||||||
|
case ParameterMappingType.WidgetLevel:
|
||||||
|
result.type = MappingType.WidgetLevel;
|
||||||
|
result.value = null;
|
||||||
|
break;
|
||||||
|
// no default
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editableMappingsToParameterMappings(mappings) {
|
||||||
|
return fromPairs(map( // convert to map
|
||||||
|
mappings,
|
||||||
|
(mapping) => {
|
||||||
|
const result = extend({}, mapping);
|
||||||
|
switch (mapping.type) {
|
||||||
|
case MappingType.DashboardAddNew:
|
||||||
|
result.type = ParameterMappingType.DashboardLevel;
|
||||||
|
result.value = null;
|
||||||
|
break;
|
||||||
|
case MappingType.DashboardMapToExisting:
|
||||||
|
result.type = ParameterMappingType.DashboardLevel;
|
||||||
|
result.value = null;
|
||||||
|
break;
|
||||||
|
case MappingType.StaticValue:
|
||||||
|
result.type = ParameterMappingType.StaticValue;
|
||||||
|
result.param = mapping.param.clone();
|
||||||
|
result.param.setValue(result.value);
|
||||||
|
result.value = result.param.value;
|
||||||
|
break;
|
||||||
|
case MappingType.WidgetLevel:
|
||||||
|
result.type = ParameterMappingType.WidgetLevel;
|
||||||
|
result.value = null;
|
||||||
|
break;
|
||||||
|
// no default
|
||||||
|
}
|
||||||
|
delete result.param;
|
||||||
|
return [result.name, result];
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function synchronizeWidgetTitles(sourceMappings, widgets) {
|
||||||
|
const affectedWidgets = [];
|
||||||
|
|
||||||
|
each(sourceMappings, (sourceMapping) => {
|
||||||
|
if (sourceMapping.type === ParameterMappingType.DashboardLevel) {
|
||||||
|
each(widgets, (widget) => {
|
||||||
|
const widgetMappings = widget.options.parameterMappings;
|
||||||
|
each(widgetMappings, (widgetMapping) => {
|
||||||
|
// check if mapped to the same dashboard-level parameter
|
||||||
|
if (
|
||||||
|
(widgetMapping.type === ParameterMappingType.DashboardLevel) &&
|
||||||
|
(widgetMapping.mapTo === sourceMapping.mapTo)
|
||||||
|
) {
|
||||||
|
// dirty check - update only when needed
|
||||||
|
if (widgetMapping.title !== sourceMapping.title) {
|
||||||
|
widgetMapping.title = sourceMapping.title;
|
||||||
|
affectedWidgets.push(widget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return affectedWidgets;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ParameterMappingInput extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
mapping: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
existingParamNames: PropTypes.arrayOf(PropTypes.string),
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
clientConfig: PropTypes.any, // eslint-disable-line react/forbid-prop-types
|
||||||
|
Query: PropTypes.any, // eslint-disable-line react/forbid-prop-types
|
||||||
|
inputError: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
mapping: {},
|
||||||
|
existingParamNames: [],
|
||||||
|
onChange: () => {},
|
||||||
|
clientConfig: null,
|
||||||
|
Query: null,
|
||||||
|
inputError: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
formItemProps = {
|
||||||
|
labelCol: { span: 5 },
|
||||||
|
wrapperCol: { span: 16 },
|
||||||
|
className: 'form-item',
|
||||||
|
};
|
||||||
|
|
||||||
|
updateSourceType = (type) => {
|
||||||
|
let { mapping: { mapTo } } = this.props;
|
||||||
|
const { existingParamNames } = this.props;
|
||||||
|
|
||||||
|
// if mapped name doesn't already exists
|
||||||
|
// default to first select option
|
||||||
|
if (
|
||||||
|
type === MappingType.DashboardMapToExisting &&
|
||||||
|
!includes(existingParamNames, mapTo)
|
||||||
|
) {
|
||||||
|
mapTo = existingParamNames[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateParamMapping({ type, mapTo });
|
||||||
|
};
|
||||||
|
|
||||||
|
updateParamMapping = (update) => {
|
||||||
|
const { onChange, mapping } = this.props;
|
||||||
|
const newMapping = extend({}, mapping, update);
|
||||||
|
onChange(newMapping);
|
||||||
|
};
|
||||||
|
|
||||||
|
renderMappingTypeSelector() {
|
||||||
|
const noExisting = isEmpty(this.props.existingParamNames);
|
||||||
|
return (
|
||||||
|
<Radio.Group
|
||||||
|
value={this.props.mapping.type}
|
||||||
|
onChange={e => this.updateSourceType(e.target.value)}
|
||||||
|
>
|
||||||
|
<Radio className="radio" value={MappingType.DashboardAddNew}>
|
||||||
|
New dashboard parameter
|
||||||
|
</Radio>
|
||||||
|
<Radio
|
||||||
|
className="radio"
|
||||||
|
value={MappingType.DashboardMapToExisting}
|
||||||
|
disabled={noExisting}
|
||||||
|
>
|
||||||
|
Existing dashboard parameter{' '}
|
||||||
|
{noExisting ? (
|
||||||
|
<Tooltip title="There are no dashboard parameters corresponding to this data type">
|
||||||
|
<Icon type="question-circle" theme="filled" />
|
||||||
|
</Tooltip>
|
||||||
|
) : null }
|
||||||
|
</Radio>
|
||||||
|
<Radio className="radio" value={MappingType.WidgetLevel}>
|
||||||
|
Widget parameter
|
||||||
|
</Radio>
|
||||||
|
<Radio className="radio" value={MappingType.StaticValue}>
|
||||||
|
Static value
|
||||||
|
</Radio>
|
||||||
|
</Radio.Group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDashboardAddNew() {
|
||||||
|
const { mapping: { mapTo } } = this.props;
|
||||||
|
return (
|
||||||
|
<Input
|
||||||
|
value={mapTo}
|
||||||
|
onChange={e => this.updateParamMapping({ mapTo: e.target.value })}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDashboardMapToExisting() {
|
||||||
|
const { mapping, existingParamNames } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
value={mapping.mapTo}
|
||||||
|
onChange={mapTo => this.updateParamMapping({ mapTo })}
|
||||||
|
dropdownMatchSelectWidth={false}
|
||||||
|
>
|
||||||
|
{map(existingParamNames, name => (
|
||||||
|
<Option value={name} key={name}>{ name }</Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderStaticValue() {
|
||||||
|
const { mapping } = this.props;
|
||||||
|
return (
|
||||||
|
<ParameterValueInput
|
||||||
|
type={mapping.param.type}
|
||||||
|
value={mapping.param.normalizedValue}
|
||||||
|
enumOptions={mapping.param.enumOptions}
|
||||||
|
queryId={mapping.param.queryId}
|
||||||
|
onSelect={value => this.updateParamMapping({ value })}
|
||||||
|
clientConfig={this.props.clientConfig}
|
||||||
|
Query={this.props.Query}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderInputBlock() {
|
||||||
|
const { mapping } = this.props;
|
||||||
|
switch (mapping.type) {
|
||||||
|
case MappingType.DashboardAddNew:
|
||||||
|
return [
|
||||||
|
'Key',
|
||||||
|
'Enter a new parameter keyword',
|
||||||
|
this.renderDashboardAddNew(),
|
||||||
|
];
|
||||||
|
case MappingType.DashboardMapToExisting:
|
||||||
|
return [
|
||||||
|
'Key',
|
||||||
|
'Select from a list of existing parameters',
|
||||||
|
this.renderDashboardMapToExisting(),
|
||||||
|
];
|
||||||
|
case MappingType.StaticValue:
|
||||||
|
return [
|
||||||
|
'Value',
|
||||||
|
null,
|
||||||
|
this.renderStaticValue(),
|
||||||
|
];
|
||||||
|
default: return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { inputError } = this.props;
|
||||||
|
const [label, help, input] = this.renderInputBlock();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Form layout="horizontal">
|
||||||
|
<Form.Item label="Source" {...this.formItemProps}>
|
||||||
|
{this.renderMappingTypeSelector()}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
style={{ height: 60, visibility: input ? 'visible' : 'hidden' }}
|
||||||
|
label={label}
|
||||||
|
{...this.formItemProps}
|
||||||
|
validateStatus={inputError ? 'error' : ''}
|
||||||
|
help={inputError || help} // empty space so line doesn't collapse
|
||||||
|
>
|
||||||
|
{input}
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MappingEditor extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
mapping: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
existingParamNames: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
visible: false,
|
||||||
|
mapping: clone(this.props.mapping),
|
||||||
|
inputError: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChange = (visible) => {
|
||||||
|
if (visible) this.show(); else this.hide();
|
||||||
|
};
|
||||||
|
|
||||||
|
onChange = (mapping) => {
|
||||||
|
let inputError = null;
|
||||||
|
|
||||||
|
if (mapping.type === MappingType.DashboardAddNew) {
|
||||||
|
if (isEmpty(mapping.mapTo)) {
|
||||||
|
inputError = 'Keyword must have a value';
|
||||||
|
} else if (includes(this.props.existingParamNames, mapping.mapTo)) {
|
||||||
|
inputError = 'A parameter with this name already exists';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ mapping, inputError });
|
||||||
|
};
|
||||||
|
|
||||||
|
save = () => {
|
||||||
|
this.props.onChange(this.props.mapping, this.state.mapping);
|
||||||
|
this.hide();
|
||||||
|
};
|
||||||
|
|
||||||
|
show = () => {
|
||||||
|
this.setState({
|
||||||
|
visible: true,
|
||||||
|
mapping: clone(this.props.mapping), // restore original state
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
hide = () => {
|
||||||
|
this.setState({ visible: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
renderContent() {
|
||||||
|
const { mapping, inputError } = this.state;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="parameter-mapping-editor">
|
||||||
|
<header>
|
||||||
|
Edit Source and Value <HelpTrigger type="VALUE_SOURCE_OPTIONS" />
|
||||||
|
</header>
|
||||||
|
<ParameterMappingInput
|
||||||
|
mapping={mapping}
|
||||||
|
existingParamNames={this.props.existingParamNames}
|
||||||
|
onChange={this.onChange}
|
||||||
|
clientConfig={clientConfig}
|
||||||
|
Query={Query}
|
||||||
|
inputError={inputError}
|
||||||
|
/>
|
||||||
|
<footer>
|
||||||
|
<Button onClick={this.hide}>Cancel</Button>
|
||||||
|
<Button onClick={this.save} disabled={!!inputError} type="primary">OK</Button>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Popover
|
||||||
|
placement="left"
|
||||||
|
trigger="click"
|
||||||
|
content={this.renderContent()}
|
||||||
|
visible={this.state.visible}
|
||||||
|
onVisibleChange={this.onVisibleChange}
|
||||||
|
>
|
||||||
|
<Button size="small" type="dashed">
|
||||||
|
<Icon type="edit" />
|
||||||
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TitleEditor extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
existingParams: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
mapping: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
existingParams: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
state = {
|
||||||
|
showPopup: false,
|
||||||
|
title: '', // will be set on editing
|
||||||
|
};
|
||||||
|
|
||||||
|
onPopupVisibleChange = (showPopup) => {
|
||||||
|
this.setState({
|
||||||
|
showPopup,
|
||||||
|
title: showPopup ? this.getMappingTitle() : '',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
onEditingTitleChange = (event) => {
|
||||||
|
this.setState({ title: event.target.value });
|
||||||
|
};
|
||||||
|
|
||||||
|
getMappingTitle() {
|
||||||
|
let { mapping } = this.props;
|
||||||
|
|
||||||
|
if (isString(mapping.title) && (mapping.title !== '')) {
|
||||||
|
return mapping.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if mapped to dashboard, find source param and return it's title
|
||||||
|
if (mapping.type === MappingType.DashboardMapToExisting) {
|
||||||
|
const source = find(this.props.existingParams, { name: mapping.mapTo });
|
||||||
|
if (source) {
|
||||||
|
mapping = source;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mapping.title || mapping.param.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
save = () => {
|
||||||
|
const newMapping = extend({}, this.props.mapping, { title: this.state.title });
|
||||||
|
this.props.onChange(newMapping);
|
||||||
|
this.hide();
|
||||||
|
};
|
||||||
|
|
||||||
|
hide = () => {
|
||||||
|
this.setState({ showPopup: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
renderPopover() {
|
||||||
|
const { param: { title: paramTitle } } = this.props.mapping;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="parameter-mapping-title-editor">
|
||||||
|
<Input
|
||||||
|
size="small"
|
||||||
|
value={this.state.title}
|
||||||
|
placeholder={paramTitle}
|
||||||
|
onChange={this.onEditingTitleChange}
|
||||||
|
onPressEnter={this.save}
|
||||||
|
maxLength={100}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
|
<Button size="small" type="dashed" onClick={this.hide}>
|
||||||
|
<Icon type="close" />
|
||||||
|
</Button>
|
||||||
|
<Button size="small" type="dashed" onClick={this.save}>
|
||||||
|
<Icon type="check" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderEditButton() {
|
||||||
|
const { mapping } = this.props;
|
||||||
|
if (mapping.type === MappingType.StaticValue) {
|
||||||
|
return (
|
||||||
|
<Tooltip placement="right" title="Titles for static values don't appear in widgets">
|
||||||
|
<i className="fa fa-eye-slash" />
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Popover
|
||||||
|
placement="right"
|
||||||
|
trigger="click"
|
||||||
|
content={this.renderPopover()}
|
||||||
|
visible={this.state.showPopup}
|
||||||
|
onVisibleChange={this.onPopupVisibleChange}
|
||||||
|
>
|
||||||
|
<Button size="small" type="dashed">
|
||||||
|
<Icon type="edit" />
|
||||||
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { mapping } = this.props;
|
||||||
|
// static value are non-editable hence disabled
|
||||||
|
const disabled = mapping.type === MappingType.StaticValue;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classNames('parameter-mapping-title', { disabled })}>
|
||||||
|
<span className="text">{this.getMappingTitle()}</span>
|
||||||
|
{this.renderEditButton()}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ParameterMappingListInput extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
mappings: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
existingParams: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
onChange: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
mappings: [],
|
||||||
|
existingParams: [],
|
||||||
|
onChange: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
static getStringValue(value) {
|
||||||
|
// null
|
||||||
|
if (!value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// range
|
||||||
|
if (value instanceof Object && 'start' in value && 'end' in value) {
|
||||||
|
return `${value.start} ~ ${value.end}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// just to be safe, array or object
|
||||||
|
if (typeof value === 'object') {
|
||||||
|
return map(value, v => this.getStringValue(v)).join(', ');
|
||||||
|
}
|
||||||
|
|
||||||
|
// rest
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
static getDefaultValue(mapping, existingParams) {
|
||||||
|
const { type, mapTo, name } = mapping;
|
||||||
|
let { param } = mapping;
|
||||||
|
|
||||||
|
// if mapped to another param, swap 'em
|
||||||
|
if (type === MappingType.DashboardMapToExisting && mapTo !== name) {
|
||||||
|
const mappedTo = find(existingParams, { name: mapTo });
|
||||||
|
if (mappedTo) { // just being safe
|
||||||
|
param = mappedTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static type is different since it's fed param.normalizedValue
|
||||||
|
} else if (type === MappingType.StaticValue) {
|
||||||
|
param = param.clone().setValue(mapping.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = Parameter.getValue(param);
|
||||||
|
return this.getStringValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static getSourceTypeLabel({ type, mapTo }) {
|
||||||
|
switch (type) {
|
||||||
|
case MappingType.DashboardAddNew:
|
||||||
|
case MappingType.DashboardMapToExisting:
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
Dashboard{' '}
|
||||||
|
<Tag className="tag">{mapTo}</Tag>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
case MappingType.WidgetLevel:
|
||||||
|
return 'Widget parameter';
|
||||||
|
case MappingType.StaticValue:
|
||||||
|
return 'Static value';
|
||||||
|
default:
|
||||||
|
return ''; // won't happen (typescript-ftw)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateParamMapping(oldMapping, newMapping) {
|
||||||
|
const mappings = [...this.props.mappings];
|
||||||
|
const index = findIndex(mappings, oldMapping);
|
||||||
|
if (index >= 0) {
|
||||||
|
// This should be the only possible case, but need to handle `else` too
|
||||||
|
mappings[index] = newMapping;
|
||||||
|
} else {
|
||||||
|
mappings.push(newMapping);
|
||||||
|
}
|
||||||
|
this.props.onChange(mappings);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { existingParams } = this.props; // eslint-disable-line react/prop-types
|
||||||
|
const dataSource = this.props.mappings.map(mapping => ({ mapping }));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="parameters-mapping-list">
|
||||||
|
<Table
|
||||||
|
dataSource={dataSource}
|
||||||
|
size="middle"
|
||||||
|
pagination={false}
|
||||||
|
rowKey={(record, idx) => `row${idx}`}
|
||||||
|
>
|
||||||
|
<Table.Column
|
||||||
|
title="Title"
|
||||||
|
dataIndex="mapping"
|
||||||
|
key="title"
|
||||||
|
render={mapping => (
|
||||||
|
<TitleEditor
|
||||||
|
existingParams={existingParams}
|
||||||
|
mapping={mapping}
|
||||||
|
onChange={newMapping => this.updateParamMapping(mapping, newMapping)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Table.Column
|
||||||
|
title="Keyword"
|
||||||
|
dataIndex="mapping"
|
||||||
|
key="keyword"
|
||||||
|
className="keyword"
|
||||||
|
render={mapping => <code>{`{{ ${mapping.name} }}`}</code>}
|
||||||
|
/>
|
||||||
|
<Table.Column
|
||||||
|
title="Default Value"
|
||||||
|
dataIndex="mapping"
|
||||||
|
key="value"
|
||||||
|
render={mapping => (
|
||||||
|
this.constructor.getDefaultValue(mapping, this.props.existingParams)
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Table.Column
|
||||||
|
title="Value Source"
|
||||||
|
dataIndex="mapping"
|
||||||
|
key="source"
|
||||||
|
render={(mapping) => {
|
||||||
|
const existingParamsNames = existingParams
|
||||||
|
.filter(({ type }) => type === mapping.param.type) // exclude mismatching param types
|
||||||
|
.map(({ name }) => name); // keep names only
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
{this.constructor.getSourceTypeLabel(mapping)}{' '}
|
||||||
|
<MappingEditor
|
||||||
|
mapping={mapping}
|
||||||
|
existingParamNames={existingParamsNames}
|
||||||
|
onChange={(oldMapping, newMapping) => this.updateParamMapping(oldMapping, newMapping)}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
83
client/app/components/ParameterMappingInput.less
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
@import '~antd/lib/modal/style/index'; // for ant @vars
|
||||||
|
|
||||||
|
.parameters-mapping-list {
|
||||||
|
.keyword {
|
||||||
|
max-width: 100px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
code {
|
||||||
|
white-space: nowrap; // so the curly braces don't line break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ant <Tag> overrides
|
||||||
|
.tag {
|
||||||
|
margin: 0;
|
||||||
|
pointer-events: none; // unclickable
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.parameter-mapping-editor {
|
||||||
|
width: 390px;
|
||||||
|
|
||||||
|
.radio {
|
||||||
|
display: block;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
padding: 0 16px 10px;
|
||||||
|
margin: 0 -16px 20px;
|
||||||
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||||
|
font-size: @font-size-lg;
|
||||||
|
font-weight: 500;
|
||||||
|
color: @heading-color;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
padding: 10px 16px 0;
|
||||||
|
margin: 0 -16px;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.parameter-mapping-title {
|
||||||
|
.text {
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled, .fa {
|
||||||
|
color: #a4a4a4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa-eye-slash {
|
||||||
|
margin-left: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.parameter-mapping-title-editor {
|
||||||
|
input {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
199
client/app/components/ParameterValueInput.jsx
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { react2angular } from 'react2angular';
|
||||||
|
import Select from 'antd/lib/select';
|
||||||
|
import Input from 'antd/lib/input';
|
||||||
|
import InputNumber from 'antd/lib/input-number';
|
||||||
|
import { DateInput } from './DateInput';
|
||||||
|
import { DateRangeInput } from './DateRangeInput';
|
||||||
|
import { DateTimeInput } from './DateTimeInput';
|
||||||
|
import { DateTimeRangeInput } from './DateTimeRangeInput';
|
||||||
|
import { QueryBasedParameterInput } from './QueryBasedParameterInput';
|
||||||
|
|
||||||
|
const { Option } = Select;
|
||||||
|
|
||||||
|
export class ParameterValueInput extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
type: PropTypes.string,
|
||||||
|
value: PropTypes.any, // eslint-disable-line react/forbid-prop-types
|
||||||
|
enumOptions: PropTypes.string,
|
||||||
|
queryId: PropTypes.number,
|
||||||
|
parameter: PropTypes.any, // eslint-disable-line react/forbid-prop-types
|
||||||
|
onSelect: PropTypes.func,
|
||||||
|
className: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
type: 'text',
|
||||||
|
value: null,
|
||||||
|
enumOptions: '',
|
||||||
|
queryId: null,
|
||||||
|
parameter: null,
|
||||||
|
onSelect: () => {},
|
||||||
|
className: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
renderDateTimeWithSecondsInput() {
|
||||||
|
const { value, onSelect } = this.props;
|
||||||
|
return (
|
||||||
|
<DateTimeInput
|
||||||
|
className={this.props.className}
|
||||||
|
value={value}
|
||||||
|
onSelect={onSelect}
|
||||||
|
withSeconds
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDateTimeInput() {
|
||||||
|
const { value, onSelect } = this.props;
|
||||||
|
return (
|
||||||
|
<DateTimeInput
|
||||||
|
className={this.props.className}
|
||||||
|
value={value}
|
||||||
|
onSelect={onSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDateInput() {
|
||||||
|
const { value, onSelect } = this.props;
|
||||||
|
return (
|
||||||
|
<DateInput
|
||||||
|
className={this.props.className}
|
||||||
|
value={value}
|
||||||
|
onSelect={onSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDateTimeRangeWithSecondsInput() {
|
||||||
|
const { value, onSelect } = this.props;
|
||||||
|
return (
|
||||||
|
<DateTimeRangeInput
|
||||||
|
className={this.props.className}
|
||||||
|
value={value}
|
||||||
|
onSelect={onSelect}
|
||||||
|
withSeconds
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDateTimeRangeInput() {
|
||||||
|
const { value, onSelect } = this.props;
|
||||||
|
return (
|
||||||
|
<DateTimeRangeInput
|
||||||
|
className={this.props.className}
|
||||||
|
value={value}
|
||||||
|
onSelect={onSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderDateRangeInput() {
|
||||||
|
const { value, onSelect } = this.props;
|
||||||
|
return (
|
||||||
|
<DateRangeInput
|
||||||
|
className={this.props.className}
|
||||||
|
value={value}
|
||||||
|
onSelect={onSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderEnumInput() {
|
||||||
|
const { value, onSelect, enumOptions } = this.props;
|
||||||
|
const enumOptionsArray = enumOptions.split('\n').filter(v => v !== '');
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
className={this.props.className}
|
||||||
|
disabled={enumOptionsArray.length === 0}
|
||||||
|
defaultValue={value}
|
||||||
|
onChange={onSelect}
|
||||||
|
dropdownMatchSelectWidth={false}
|
||||||
|
dropdownClassName="ant-dropdown-in-bootstrap-modal"
|
||||||
|
>
|
||||||
|
{enumOptionsArray.map(option => (<Option key={option} value={option}>{ option }</Option>))}
|
||||||
|
</Select>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderQueryBasedInput() {
|
||||||
|
const { value, onSelect, queryId, parameter } = this.props;
|
||||||
|
return (
|
||||||
|
<QueryBasedParameterInput
|
||||||
|
className={this.props.className}
|
||||||
|
parameter={parameter}
|
||||||
|
value={value}
|
||||||
|
queryId={queryId}
|
||||||
|
onSelect={onSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderNumberInput() {
|
||||||
|
const { value, onSelect, className } = this.props;
|
||||||
|
return (
|
||||||
|
<InputNumber
|
||||||
|
className={'form-control ' + className}
|
||||||
|
defaultValue={!isNaN(value) && value || 0}
|
||||||
|
onChange={onSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderTextInput() {
|
||||||
|
const { value, onSelect, className } = this.props;
|
||||||
|
return (
|
||||||
|
<Input
|
||||||
|
className={'form-control ' + className}
|
||||||
|
defaultValue={value || ''}
|
||||||
|
data-test="TextParamInput"
|
||||||
|
onChange={event => onSelect(event.target.value)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { type } = this.props;
|
||||||
|
switch (type) {
|
||||||
|
case 'datetime-with-seconds': return this.renderDateTimeWithSecondsInput();
|
||||||
|
case 'datetime-local': return this.renderDateTimeInput();
|
||||||
|
case 'date': return this.renderDateInput();
|
||||||
|
case 'datetime-range-with-seconds': return this.renderDateTimeRangeWithSecondsInput();
|
||||||
|
case 'datetime-range': return this.renderDateTimeRangeInput();
|
||||||
|
case 'date-range': return this.renderDateRangeInput();
|
||||||
|
case 'enum': return this.renderEnumInput();
|
||||||
|
case 'query': return this.renderQueryBasedInput();
|
||||||
|
case 'number': return this.renderNumberInput();
|
||||||
|
default: return this.renderTextInput();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function init(ngModule) {
|
||||||
|
ngModule.component('parameterValueInput', {
|
||||||
|
template: `
|
||||||
|
<parameter-value-input-impl
|
||||||
|
type="$ctrl.param.type"
|
||||||
|
value="$ctrl.param.normalizedValue"
|
||||||
|
parameter="$ctrl.param"
|
||||||
|
enum-options="$ctrl.param.enumOptions"
|
||||||
|
query-id="$ctrl.param.queryId"
|
||||||
|
on-select="$ctrl.setValue"
|
||||||
|
></parameter-value-input-impl>
|
||||||
|
`,
|
||||||
|
bindings: {
|
||||||
|
param: '<',
|
||||||
|
},
|
||||||
|
controller($scope) {
|
||||||
|
this.setValue = (value) => {
|
||||||
|
this.param.setValue(value);
|
||||||
|
$scope.$applyAsync();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
ngModule.component('parameterValueInputImpl', react2angular(ParameterValueInput));
|
||||||
|
}
|
||||||
|
|
||||||
|
init.init = true;
|
||||||