Skip to content

Commit 4ea7581

Browse files
authored
Add feature to filter by date in users analysis table (#1010)
1 parent 53b93ac commit 4ea7581

19 files changed

+709
-369
lines changed

screenshot-test/App.screenshot.js

+14
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,20 @@ function getMockResponse(url) {
270270
body: usageUserDetail,
271271
};
272272
break;
273+
case `${SERVER_URL}api/usage/users/3`:
274+
res = {
275+
status: 200,
276+
contentType: 'application/json',
277+
body: usageUserDetail,
278+
};
279+
break;
280+
case `${SERVER_URL}api/usage/users/4`:
281+
res = {
282+
status: 200,
283+
contentType: 'application/json',
284+
body: usageUserDetail,
285+
};
286+
break;
273287
case `${SERVER_URL}api/usage/resources?endpoint=%2Fapi%2Fv1%2Fexample`:
274288
res = {
275289
status: 200,
Loading
Loading
Loading
Loading
Loading
Loading
+101-209
Original file line numberDiff line numberDiff line change
@@ -1,209 +1,101 @@
1-
[ {
2-
"userId" : "1461",
3-
"userEmail" : "[email protected]",
4-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
5-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
6-
"maxUsage" : 100,
7-
"noPrivateMaxUsage" : 100,
8-
"totalUsage" : 132
9-
}, {
10-
"userId" : "1460",
11-
"userEmail" : "[email protected]",
12-
"endpoint" : "/api/v1/utils/allCuratedGenes",
13-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
14-
"maxUsage" : 1,
15-
"noPrivateMaxUsage" : 1,
16-
"totalUsage" : 2
17-
}, {
18-
"userId" : "1217",
19-
"userEmail" : "[email protected]",
20-
"endpoint" : "/api/v1/utils/allCuratedGenes",
21-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
22-
"maxUsage" : 3,
23-
"noPrivateMaxUsage" : 3,
24-
"totalUsage" : 6
25-
}, {
26-
"userId" : "1216",
27-
"userEmail" : "[email protected]",
28-
"endpoint" : "/api/v1/utils/allCuratedGenes",
29-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
30-
"maxUsage" : 1,
31-
"noPrivateMaxUsage" : 1,
32-
"totalUsage" : 2
33-
}, {
34-
"userId" : "1699",
35-
"userEmail" : "[email protected]",
36-
"endpoint" : "/api/private/search/typeahead",
37-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
38-
"maxUsage" : 7,
39-
"noPrivateMaxUsage" : 6,
40-
"totalUsage" : 68
41-
}, {
42-
"userId" : "1698",
43-
"userEmail" : "[email protected]",
44-
"endpoint" : "/api/private/search/typeahead",
45-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
46-
"maxUsage" : 28,
47-
"noPrivateMaxUsage" : 5,
48-
"totalUsage" : 146
49-
}, {
50-
"userId" : "1213",
51-
"userEmail" : "[email protected]",
52-
"endpoint" : "/api/private/utils/numbers/levels/",
53-
"noPrivateEndpoint" : "",
54-
"maxUsage" : 1,
55-
"noPrivateMaxUsage" : 0,
56-
"totalUsage" : 2
57-
}, {
58-
"userId" : "1696",
59-
"userEmail" : "[email protected]",
60-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
61-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
62-
"maxUsage" : 30005,
63-
"noPrivateMaxUsage" : 30005,
64-
"totalUsage" : 30184
65-
}, {
66-
"userId" : "1210",
67-
"userEmail" : "[email protected]",
68-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
69-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
70-
"maxUsage" : 36744,
71-
"noPrivateMaxUsage" : 36744,
72-
"totalUsage" : 37040
73-
}, {
74-
"userId" : "1219",
75-
"userEmail" : "[email protected]",
76-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
77-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
78-
"maxUsage" : 1174895,
79-
"noPrivateMaxUsage" : 1174895,
80-
"totalUsage" : 1174895
81-
}, {
82-
"userId" : "1218",
83-
"userEmail" : "[email protected]",
84-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
85-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
86-
"maxUsage" : 3786,
87-
"noPrivateMaxUsage" : 3786,
88-
"totalUsage" : 4034
89-
}, {
90-
"userId" : "1473",
91-
"userEmail" : "[email protected]",
92-
"endpoint" : "/api/private/search/typeahead",
93-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
94-
"maxUsage" : 69,
95-
"noPrivateMaxUsage" : 46,
96-
"totalUsage" : 539
97-
}, {
98-
"userId" : "1230",
99-
"userEmail" : "[email protected]",
100-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
101-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
102-
"maxUsage" : 164191,
103-
"noPrivateMaxUsage" : 164191,
104-
"totalUsage" : 164677
105-
}, {
106-
"userId" : "1470",
107-
"userEmail" : "[email protected]",
108-
"endpoint" : "/api/v1/utils/allCuratedGenes",
109-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
110-
"maxUsage" : 3,
111-
"noPrivateMaxUsage" : 3,
112-
"totalUsage" : 6
113-
}, {
114-
"userId" : "1228",
115-
"userEmail" : "[email protected]",
116-
"endpoint" : "/api/private/search/variants/clinical",
117-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
118-
"maxUsage" : 11,
119-
"noPrivateMaxUsage" : 4,
120-
"totalUsage" : 100
121-
}, {
122-
"userId" : "1226",
123-
"userEmail" : "[email protected]",
124-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
125-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
126-
"maxUsage" : 1948,
127-
"noPrivateMaxUsage" : 1948,
128-
"totalUsage" : 1951
129-
}, {
130-
"userId" : "1468",
131-
"userEmail" : "[email protected]",
132-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
133-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
134-
"maxUsage" : 3839,
135-
"noPrivateMaxUsage" : 3839,
136-
"totalUsage" : 3935
137-
}, {
138-
"userId" : "1225",
139-
"userEmail" : "[email protected]",
140-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
141-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
142-
"maxUsage" : 1384,
143-
"noPrivateMaxUsage" : 1384,
144-
"totalUsage" : 1770
145-
}, {
146-
"userId" : "4",
147-
"userEmail" : "[email protected]",
148-
"endpoint" : "/api/v1/utils/allCuratedGenes",
149-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
150-
"maxUsage" : 3,
151-
"noPrivateMaxUsage" : 3,
152-
"totalUsage" : 6
153-
}, {
154-
"userId" : "1224",
155-
"userEmail" : "[email protected]",
156-
"endpoint" : "/api/v1/utils/allCuratedGenes",
157-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
158-
"maxUsage" : 1,
159-
"noPrivateMaxUsage" : 1,
160-
"totalUsage" : 2
161-
}, {
162-
"userId" : "1466",
163-
"userEmail" : "[email protected]",
164-
"endpoint" : "/api/v1/annotate/structuralVariants",
165-
"noPrivateEndpoint" : "/api/v1/annotate/structuralVariants",
166-
"maxUsage" : 1011,
167-
"noPrivateMaxUsage" : 1011,
168-
"totalUsage" : 1334
169-
}, {
170-
"userId" : "5",
171-
"userEmail" : "[email protected]",
172-
"endpoint" : "/api/private/search/typeahead",
173-
"noPrivateEndpoint" : "/api/v1/utils/cancerGeneList",
174-
"maxUsage" : 499410,
175-
"noPrivateMaxUsage" : 39288,
176-
"totalUsage" : 2917827
177-
}, {
178-
"userId" : "1465",
179-
"userEmail" : "[email protected]",
180-
"endpoint" : "/api/v1/utils/allCuratedGenes",
181-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
182-
"maxUsage" : 1,
183-
"noPrivateMaxUsage" : 1,
184-
"totalUsage" : 2
185-
}, {
186-
"userId" : "6",
187-
"userEmail" : "[email protected]",
188-
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
189-
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
190-
"maxUsage" : 286647,
191-
"noPrivateMaxUsage" : 286647,
192-
"totalUsage" : 298818
193-
}, {
194-
"userId" : "1222",
195-
"userEmail" : "[email protected]",
196-
"endpoint" : "/api/private/search/typeahead",
197-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
198-
"maxUsage" : 14,
199-
"noPrivateMaxUsage" : 8,
200-
"totalUsage" : 71
201-
}, {
202-
"userId" : "1464",
203-
"userEmail" : "[email protected]",
204-
"endpoint" : "/api/v1/utils/allCuratedGenes",
205-
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
206-
"maxUsage" : 1,
207-
"noPrivateMaxUsage" : 1,
208-
"totalUsage" : 2
209-
}]
1+
[{
2+
"userId" : "1461",
3+
"userEmail" : "[email protected]",
4+
"endpoint" : "/api/v1/annotate/mutations/byProteinChange",
5+
"noPrivateEndpoint" : "/api/v1/annotate/mutations/byProteinChange",
6+
"maxUsageProportion" : 55.6,
7+
"noPrivateMaxUsageProportion" : 100,
8+
"totalUsage" : 2152142550,
9+
"dayUsage" : {
10+
"2020-12-01" : 123489012,
11+
"2020-11-01" : 374810,
12+
"2020-11-05" : 213,
13+
"2020-11-06" : 51515,
14+
"2020-11-11" : 532555,
15+
"2020-11-21" : 65378
16+
},
17+
"monthUsage" : {}
18+
}, {
19+
"userId" : "1460",
20+
"userEmail" : "[email protected]",
21+
"endpoint" : "/api/v1/utils/allCuratedGenes",
22+
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
23+
"maxUsageProportion" : 70.7,
24+
"noPrivateMaxUsageProportion" : 30.5,
25+
"totalUsage" : 108421,
26+
"dayUsage" : {
27+
"2020-12-05" : 124,
28+
"2021-11-05" : 4,
29+
"2021-11-09" : 41,
30+
"2022-11-06" : 421,
31+
"2023-11-11" : 3412414414,
32+
"2024-11-21" : 14444
33+
},
34+
"monthUsage" : {}
35+
}, {
36+
"userId" : "1217",
37+
"userEmail" : "[email protected]",
38+
"endpoint" : "/api/v1/utils/allCuratedGenes",
39+
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
40+
"maxUsageProportion" : 15.6,
41+
"noPrivateMaxUsageProportion" : 59.5,
42+
"totalUsage" : 1234,
43+
"dayUsage" : {
44+
"2019-04-01" : 1,
45+
"2018-05-01" : 1,
46+
"2018-11-05" : 1,
47+
"2020-11-06" : 12,
48+
"2020-11-11" : 14721847,
49+
"2020-11-21" : 1
50+
},
51+
"monthUsage" : {}
52+
}, {
53+
"userId" : "1216",
54+
"userEmail" : "[email protected]",
55+
"endpoint" : "/api/v1/utils/allCuratedGenes",
56+
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
57+
"maxUsageProportion" : 65.7,
58+
"noPrivateMaxUsageProportion" : 53.6,
59+
"totalUsage" : 431241,
60+
"dayUsage" : {},
61+
"monthUsage" : {}
62+
}, {
63+
"userId" : "1699",
64+
"userEmail" : "[email protected]",
65+
"endpoint" : "/api/private/search/typeahead",
66+
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
67+
"maxUsageProportion" : 55.6,
68+
"noPrivateMaxUsageProportion" : 55.6,
69+
"totalUsage" : 134444412,
70+
"dayUsage" : {
71+
"2020-12-01" : 1124321313
72+
},
73+
"monthUsage" : {}
74+
}, {
75+
"userId" : "1698",
76+
"userEmail" : "[email protected]",
77+
"endpoint" : "/api/private/search/typeahead",
78+
"noPrivateEndpoint" : "/api/v1/utils/allCuratedGenes",
79+
"maxUsageProportion" : 55.6,
80+
"noPrivateMaxUsageProportion" : 55.6,
81+
"totalUsage" : 132,
82+
"dayUsage" : {},
83+
"monthUsage" : {}
84+
}, {
85+
"userId" : "1213",
86+
"userEmail" : "[email protected]",
87+
"endpoint" : "/api/private/utils/numbers/levels/",
88+
"noPrivateEndpoint" : "",
89+
"maxUsageProportion" : 55.6,
90+
"noPrivateMaxUsageProportion" : 55.6,
91+
"totalUsage" : 132,
92+
"dayUsage" : {
93+
"1999-05-29" : 1242141,
94+
"2018-04-04" : 10838282,
95+
"2019-04-04" : 10838282,
96+
"2020-04-04" : 10838282,
97+
"2021-04-04" : 10838282,
98+
"2022-04-04" : 10838282
99+
},
100+
"monthUsage" : {}
101+
}]

screenshot-test/data/api-usage-users-2021.json

+20
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@
77
"company" : "MSKCC",
88
"summary" : {
99
"day" : {
10+
"2021-04-01" : {
11+
"/api/example/endpoint10" : 1.0,
12+
"/api/example/endpoint11" : 12340.0,
13+
"/api/example/endpoint12" : 832461.0
14+
},
15+
"2021-03-01" : {
16+
"/api/example/endpoint10" : 1.0,
17+
"/api/example/endpoint11" : 123490.0,
18+
"/api/example/endpoint12" : 8324461.0
19+
},
20+
"2021-02-01" : {
21+
"/api/example/endpoint10" : 1.0,
22+
"/api/example/endpoint11" : 123490.0,
23+
"/api/example/endpoint12" : 8324461.0
24+
},
25+
"2021-01-01" : {
26+
"/api/example/endpoint10" : 1.0,
27+
"/api/example/endpoint11" : 123490.0,
28+
"/api/example/endpoint12" : 8324461.0
29+
},
1030
"2020-12-01" : {
1131
"/api/example/endpoint1" : 2.0,
1232
"/api/example/endpoint2" : 3.0,

0 commit comments

Comments
 (0)