Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Main class component to functional component #3317

Closed
wants to merge 243 commits into from
Closed
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
8541e0d
Update dashboard/src/main/Main.tsx
sweep-ai[bot] Jul 26, 2023
cc7b966
Update dashboard/src/main/Main.tsx
sweep-ai[bot] Jul 26, 2023
e3be9fa
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 26, 2023
dbc9e13
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 26, 2023
81f26a3
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 27, 2023
cb274a1
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 27, 2023
5fccc4c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 27, 2023
27eca0d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 27, 2023
a57f7f2
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 27, 2023
1b84ba7
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 27, 2023
c769f55
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 28, 2023
0535a39
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 28, 2023
cedac7f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 28, 2023
56145d5
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 28, 2023
13cfe50
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 31, 2023
a588795
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 31, 2023
16cd586
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 31, 2023
1d63a9b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 31, 2023
c2010e8
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 31, 2023
177211f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Jul 31, 2023
b473090
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 1, 2023
fe129cc
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 1, 2023
940f31c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 1, 2023
1c3a587
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
3f4c97a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
3163d11
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
0d25150
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
01cd960
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
9d7177e
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
201da4e
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
f6cb922
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 2, 2023
2e3ace9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 3, 2023
af387e9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 3, 2023
7c62384
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 3, 2023
33a17ca
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 4, 2023
af7ed70
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 7, 2023
bcb5150
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 8, 2023
143171f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 8, 2023
a932a31
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 8, 2023
76e7ad7
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 8, 2023
bc5384e
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 8, 2023
ee3c9ba
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 9, 2023
4950194
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 9, 2023
81b1f7a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 9, 2023
f6eadaf
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 10, 2023
f130fb5
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 10, 2023
975f6ef
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 10, 2023
5f872c0
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 10, 2023
01466af
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 11, 2023
4ecc289
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 11, 2023
4de3059
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 14, 2023
cc92f97
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 14, 2023
5c6235f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 14, 2023
dff73f0
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 15, 2023
12eb6b9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 15, 2023
541b08c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 15, 2023
6571112
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 15, 2023
db75db6
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 15, 2023
24d8483
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 15, 2023
db69fb8
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 16, 2023
d623cc1
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 16, 2023
edb1474
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 16, 2023
6d48f3a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 16, 2023
89e05c6
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 16, 2023
9b09c4d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 17, 2023
3e9a44a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 17, 2023
6e6f85a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 17, 2023
0415351
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 17, 2023
01008d9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 17, 2023
8841414
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 18, 2023
427db67
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 18, 2023
b83e776
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 18, 2023
e94f2af
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 18, 2023
75b22c4
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 18, 2023
14de94b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 21, 2023
7037ba2
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 21, 2023
866ee41
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 21, 2023
f0e4f83
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 21, 2023
2e4f167
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 22, 2023
a3269c7
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 22, 2023
456dc1b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 22, 2023
f7106c1
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 22, 2023
15e8865
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 22, 2023
960e901
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
c4ae164
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
d79be0f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
d1f0351
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
8580962
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
0dde040
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
0909aee
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
3552bd9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
3308222
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
98fb685
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
c6bb395
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
d3ec999
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 23, 2023
a1be8f6
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
9aa48b1
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
756b012
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
de7e841
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
681b83a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
9cd084c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
204577c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
aee846a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
30f1c47
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
b53f51b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
f4126a9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
425e7e6
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
b5ef337
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 24, 2023
2238b7c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 25, 2023
1d1b2aa
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 25, 2023
c106877
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 25, 2023
10a15f5
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 25, 2023
e230808
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 25, 2023
57b7e95
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 25, 2023
a6d3696
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 27, 2023
5b7d8e7
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 28, 2023
e4abd1c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 28, 2023
d4e4390
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 28, 2023
ed9436f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 28, 2023
b120bd3
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 28, 2023
7ab9a29
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 28, 2023
08d73eb
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
ec63061
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
6da14f4
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
a0d265c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
dccde4b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
956017c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
a0e3e56
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
5decfc5
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
c617d7e
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
1047a4c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 29, 2023
3f7ebbb
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
d02d482
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
0fdb0f0
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
2e1e00a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
681809f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
966d0a9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
faae835
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
e32770c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
d98fc49
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
8848c14
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
b384ddf
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
7c00fd6
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
2adabd6
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 30, 2023
a8bfc5f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
82c1b9f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
7d82f27
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
a9d0d16
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
3b17932
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
f594a9f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
72b663d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
25ed664
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
bf04ef2
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
0eb9c54
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
e516025
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
e99325b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
acb7228
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Aug 31, 2023
da996c9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 1, 2023
0cffbf4
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 1, 2023
3436e86
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 1, 2023
82a69fa
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 1, 2023
46db457
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 1, 2023
6bd54c5
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 1, 2023
393c6c8
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 5, 2023
e4cb9b2
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 5, 2023
9841468
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 5, 2023
b0fe872
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 5, 2023
623a454
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 5, 2023
012f526
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 6, 2023
4b758bb
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 6, 2023
5dc3ccf
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 6, 2023
9bca831
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 7, 2023
0904c83
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 7, 2023
75998cc
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 7, 2023
a6dc93b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 7, 2023
b40efbd
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
ee365a3
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
4b89aad
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
a04a8a4
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
67632f3
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
0ed4dc7
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
f384ae3
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
6deff3c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 8, 2023
0f23662
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
e07956d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
7e5c480
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
b9143cc
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
b277ea0
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
11311ac
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
2481bf0
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 11, 2023
d524a3a
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
3a2bbf9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
244322d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
e18a32c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
1df9960
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
6a81f13
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
ba43cf1
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
cd94cf1
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
88fef78
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
6d4b365
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
8afedc9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 12, 2023
b6f517f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 15, 2023
280b1eb
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 15, 2023
0b1e678
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 15, 2023
74e3d9b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 18, 2023
aa87919
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 18, 2023
6ac34da
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 18, 2023
5f4f127
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 18, 2023
94a3b32
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 18, 2023
f8c0020
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
a2fb811
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
8288a90
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
c83735d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
b87575d
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
f044af8
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
cac40a9
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
b9e8800
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
ab6c91f
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 19, 2023
99de77b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
cef8d67
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
4e2d520
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
942db24
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
5a8ad51
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
7a6e635
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
839e75c
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
87b2b18
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
9f7d297
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
1bffeb3
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
95a0500
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
3ad12fc
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
c34c2d4
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
a233b4b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
9f8aba4
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
8185785
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
fa39ab0
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 20, 2023
d590a53
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
8a9e8f7
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
405aa1b
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
3118e41
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
f202868
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
3208c12
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
56649a8
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
c9cf268
Merge main into sweep/convert-main-to-functional-component
sweep-ai[bot] Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 105 additions & 82 deletions dashboard/src/main/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from "react";
import React, { useState, useEffect, useContext } from "react";
import { Route, Redirect, Switch } from "react-router-dom";

import api from "shared/api";
Expand Down Expand Up @@ -27,30 +27,29 @@ type StateType = {
version: string;
};

export default class Main extends Component<PropsType, StateType> {
state = {
loading: true,
isLoggedIn: false,
isEmailVerified: false,
hasInfo: false,
initialized: localStorage.getItem("init") === "true",
local: false,
userId: null as number,
version: null as string,
};
const Main: React.FC<PropsType> = () => {
const [loading, setLoading] = useState(true);
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [isEmailVerified, setIsEmailVerified] = useState(false);
const [hasInfo, setHasInfo] = useState(false);
const [initialized, setInitialized] = useState(localStorage.getItem("init") === "true");
const [local, setLocal] = useState(false);
const [userId, setUserId] = useState<number | null>(null);
const [version, setVersion] = useState<string | null>(null);

componentDidMount() {
const context = useContext(Context);

useEffect(() => {
// Get capabilities to case on user info requirements
api.getMetadata("", {}, {})
.then((res) => {
this.setState({
version: res.data?.version,
})
if (res.data?.version !== version) {
setVersion(res.data?.version);
}
})
.catch((err) => console.log(err));

let { setUser, setCurrentError } = this.context;
let { setUser, setCurrentError } = context;
let urlParams = new URLSearchParams(window.location.search);
let error = urlParams.get("error");
error && setCurrentError(error);
Expand All @@ -59,88 +58,114 @@ export default class Main extends Component<PropsType, StateType> {
.then((res) => {
if (res && res?.data) {
setUser(res.data.id, res.data.email);
this.setState({
isLoggedIn: true,
isEmailVerified: res.data.email_verified,
initialized: true,
hasInfo: res.data.company_name && true,
loading: false,
userId: res.data.id,
});
if (!isLoggedIn) {
setIsLoggedIn(true);
}
if (!isEmailVerified) {
setIsEmailVerified(res.data.email_verified);
}
if (!initialized) {
setInitialized(true);
}
if (!hasInfo) {
setHasInfo(res.data.company_name && true);
}
if (loading) {
setLoading(false);
}
if (userId !== res.data.id) {
setUserId(res.data.id);
}
} else {
this.setState({ isLoggedIn: false, loading: false });
if (isLoggedIn) {
setIsLoggedIn(false);
}
if (loading) {
setLoading(false);
}
}
})
.catch((err) => this.setState({ isLoggedIn: false, loading: false }));
.catch((err) => {
if (isLoggedIn) {
setIsLoggedIn(false);
}
if (loading) {
setLoading(false);
}
});

api
.getMetadata("", {}, {})
.then((res) => {
this.context.setEdition(res.data?.version);
this.setState({ local: !res.data?.provisioner });
this.context.setEnableGitlab(res.data?.gitlab ? true : false);
useContext(Context).setEdition(res.data?.version);
setLocal(!res.data?.provisioner);
useContext(Context).setEnableGitlab(res.data?.gitlab ? true : false);
})
.catch((err) => console.log(err));
}
}, []);

initialize = () => {
this.setState({ isLoggedIn: true, initialized: true });
const initialize = () => {
setIsLoggedIn(true);
setInitialized(true);
localStorage.setItem("init", "true");
};

authenticate = () => {
const authenticate = () => {
api
.checkAuth("", {}, {})
.then((res) => {
if (res && res?.data) {
this.context.setUser(res?.data?.id, res?.data?.email);
this.setState({
isLoggedIn: true,
isEmailVerified: res?.data?.email_verified,
initialized: true,
hasInfo: res.data.company_name && true,
loading: false,
userId: res.data.id,
});
useContext(Context).setUser(res?.data?.id, res?.data?.email);
setIsLoggedIn(true);
setIsEmailVerified(res?.data?.email_verified);
setInitialized(true);
setHasInfo(res.data.company_name && true);
setLoading(false);
setUserId(res.data.id);
} else {
this.setState({ isLoggedIn: false, loading: false });
setIsLoggedIn(false);
setLoading(false);
}
})
.catch((err) => this.setState({ isLoggedIn: false, loading: false }));
.catch((err) => {
setIsLoggedIn(false);
setLoading(false);
});
};

handleLogOut = () => {
const handleLogOut = () => {
// Clears local storage for proper rendering of clusters
// Attempt user logout
api
.logOutUser("<token>", {}, {})
.then(() => {
this.context.clearContext();
this.setState({ isLoggedIn: false, initialized: true });
useContext(Context).clearContext();
setIsLoggedIn(false);
setInitialized(true);
localStorage.clear();
})
.catch((err) =>
this.context.setCurrentError(err.response?.data.errors[0])
useContext(Context).setCurrentError(err.response?.data.errors[0])
);
};

renderMain = () => {
if (this.state.loading || !this.state.version) {
const renderMain = () => {
if (loading || !version) {
return <Loading />;
}

// if logged in but not verified, block until email verification
if (
!this.state.local &&
this.state.isLoggedIn &&
!this.state.isEmailVerified
!local &&
isLoggedIn &&
!isEmailVerified
) {
return (
<Switch>
<Route
path="/"
render={() => {
return <VerifyEmail handleLogOut={this.handleLogOut} />;
return <VerifyEmail handleLogOut={handleLogOut} />;
}}
/>
</Switch>
Expand All @@ -149,10 +174,10 @@ export default class Main extends Component<PropsType, StateType> {

// Handle case where new user signs up via OAuth and has not set name and company
if (
this.state.version === "production" &&
!this.state.hasInfo &&
this.state.userId > 9312 &&
this.state.isLoggedIn
version === "production" &&
!hasInfo &&
userId > 9312 &&
isLoggedIn
) {
return (
<Switch>
Expand All @@ -161,8 +186,8 @@ export default class Main extends Component<PropsType, StateType> {
render={() => {
return (
<SetInfo
handleLogOut={this.handleLogOut}
authenticate={this.authenticate}
handleLogOut={handleLogOut}
authenticate={authenticate}
/>
);
}}
Expand All @@ -176,8 +201,8 @@ export default class Main extends Component<PropsType, StateType> {
<Route
path="/login"
render={() => {
if (!this.state.isLoggedIn) {
return <Login authenticate={this.authenticate} />;
if (!isLoggedIn) {
return <Login authenticate={authenticate} />;
} else {
return <Redirect to="/" />;
}
Expand All @@ -186,8 +211,8 @@ export default class Main extends Component<PropsType, StateType> {
<Route
path="/register"
render={() => {
if (!this.state.isLoggedIn) {
return <Register authenticate={this.authenticate} />;
if (!isLoggedIn) {
return <Register authenticate={authenticate} />;
} else {
return <Redirect to="/" />;
}
Expand All @@ -196,7 +221,7 @@ export default class Main extends Component<PropsType, StateType> {
<Route
path="/password/reset/finalize"
render={() => {
if (!this.state.isLoggedIn) {
if (!isLoggedIn) {
return <ResetPasswordFinalize />;
} else {
return <Redirect to="/" />;
Expand All @@ -206,7 +231,7 @@ export default class Main extends Component<PropsType, StateType> {
<Route
path="/password/reset"
render={() => {
if (!this.state.isLoggedIn) {
if (!isLoggedIn) {
return <ResetPasswordInit />;
} else {
return <Redirect to="/" />;
Expand All @@ -217,7 +242,7 @@ export default class Main extends Component<PropsType, StateType> {
exact
path="/"
render={() => {
if (this.state.isLoggedIn) {
if (isLoggedIn) {
return <Redirect to="/dashboard" />;
} else {
return <Redirect to="/login" />;
Expand All @@ -229,17 +254,17 @@ export default class Main extends Component<PropsType, StateType> {
render={(routeProps) => {
const baseRoute = routeProps.match.params.baseRoute;
if (
this.state.isLoggedIn &&
this.state.initialized &&
isLoggedIn &&
initialized &&
PorterUrls.includes(baseRoute)
) {
return (
<Home
key="home"
currentProject={this.context.currentProject}
currentCluster={this.context.currentCluster}
currentProject={useContext(Context).currentProject}
currentCluster={useContext(Context).currentCluster}
currentRoute={baseRoute as PorterUrl}
logOut={this.handleLogOut}
logOut={handleLogOut}
/>
);
} else {
Expand All @@ -251,14 +276,12 @@ export default class Main extends Component<PropsType, StateType> {
);
};

render() {
return (
<>
{this.renderMain()}
<CurrentError currentError={this.context.currentError} />
</>
);
}
return (
<>
{renderMain()}
<CurrentError currentError={useContext(Context).currentError} />
</>
);
}

Main.contextType = Context;
export default Main;
Loading