Skip to content

Commit f92467f

Browse files
Merge pull request #913 from AppQuality/squashed-insights-page
Squashed insights page
2 parents 4a0e059 + 30a59cc commit f92467f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3446
-64
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@zendeskgarden/react-forms": "^8.49.0",
1414
"@zendeskgarden/react-tables": "^8.62.0",
1515
"@zendeskgarden/react-theming": "^8.48.2",
16-
"@zendeskgarden/svg-icons": "^6.31.1",
16+
"@zendeskgarden/svg-icons": "^7.2.0",
1717
"date-fns": "^2.28.0",
1818
"formik": "^2.2.9",
1919
"i18n-iso-countries": "^7.3.0",
@@ -37,11 +37,13 @@
3737
"react-scroll": "^1.8.7",
3838
"styled-components": "^6.1.1",
3939
"typescript": "^4.6.2",
40+
"uuid": "^10.0.0",
4041
"web-vitals": "^2.1.4",
4142
"yup": "^0.32.11"
4243
},
4344
"scripts": {
4445
"start": "craco start",
46+
"start:ssl": "craco --openssl-legacy-provider start",
4547
"build": "craco build",
4648
"test": "react-scripts test",
4749
"recover": "yarn install --check-files",
@@ -87,6 +89,7 @@
8789
"@types/react-scroll": "^1.8.3",
8890
"@types/react-transition-group": "^4.4.5",
8991
"@types/styled-components": "^5.1.24",
92+
"@types/uuid": "^10.0.0",
9093
"@typescript-eslint/eslint-plugin": "^5.26.0",
9194
"@typescript-eslint/parser": "^5.26.0",
9295
"cz-conventional-changelog": "3.3.0",

src/app/theme.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import {
66
// todo: check green 600
77
export const SEVERITY_COLORS: Record<Severities, string> = {
88
critical: baseTheme.palette.red[900],
9-
high: baseTheme.palette.yellow[600],
9+
high: baseTheme.palette.yellow[700],
1010
medium: baseTheme.palette.blue[600],
1111
low: baseTheme.palette.green[600],
1212
};
1313

1414
export const SEVERITY_HUES: Record<Severities, string> = {
15-
critical: baseTheme.palette.red[900],
16-
high: baseTheme.palette.yellow[600],
17-
medium: baseTheme.palette.blue[600],
18-
low: baseTheme.palette.green[600],
15+
critical: `${baseTheme.palette.red[900]}14`,
16+
high: `${baseTheme.palette.yellow[600]}14`,
17+
medium: `${baseTheme.palette.blue[600]}14`,
18+
low: `${baseTheme.palette.green[600]}14`,
1919
};
2020
// temporary fix for the bug state colors
2121
export const BUG_STATE_COLORS: Record<

src/assets/icons/copy-icon.svg

Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/common/Pages.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Catalog from 'src/pages/Services';
2323
import Manual from 'src/pages/Manual';
2424
import Videos from 'src/pages/Videos';
2525
import Video from 'src/pages/Video';
26+
import InsightsPage from 'src/pages/Insights';
2627
import SentryWrapper from 'src/features/SentryWrapper';
2728
import { Redirect } from './Redirect';
2829

@@ -88,6 +89,10 @@ const Pages = () => {
8889
path={`/${langPrefix}/campaigns/:campaignId/videos`}
8990
element={<Videos />}
9091
/>
92+
<Route
93+
path={`/${langPrefix}/campaigns/:campaignId/insights`}
94+
element={<InsightsPage />}
95+
/>
9196
<Route
9297
path={`/${langPrefix}/campaigns/:campaignId/videos/:videoId`}
9398
element={<Video />}

src/common/components/BugDetail/Meta/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const BugInfo = styled.div`
3030
`;
3131

3232
export function getDeviceIcon(device: string) {
33-
switch (device) {
33+
switch (device.toLocaleLowerCase()) {
3434
case 'smartphone':
3535
return <SmartphoneIcon />;
3636
case 'tablet':

src/common/schema.ts

Lines changed: 189 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,18 @@ export interface paths {
170170
};
171171
};
172172
};
173+
'/campaigns/{cid}/observations': {
174+
/**
175+
* Return all observations for a specificCampaigns.
176+
* You can group by observations for usecase and grapes (observations with same title) or get an ungrouped list.
177+
*/
178+
get: operations['get-campaigns-cid-observations'];
179+
parameters: {
180+
path: {
181+
cid: string;
182+
};
183+
};
184+
};
173185
'/campaigns/{cid}/os': {
174186
get: operations['get-campaigns-cid-os'];
175187
parameters: {
@@ -733,21 +745,37 @@ export interface components {
733745
os_version?: string;
734746
type?: string;
735747
};
748+
/** Grape */
749+
Grapes: {
750+
title: string;
751+
severity: string;
752+
usersNumber: number;
753+
observations: (components['schemas']['Observation'] & {
754+
uploaderId: number;
755+
mediaId: number;
756+
deviceType: string;
757+
usecaseTitle: string;
758+
})[];
759+
};
736760
/** Insight */
737761
Insight: {
738762
id: number;
739763
title: string;
740764
description: string;
741-
severity: components['schemas']['BugSeverity'];
765+
severity: {
766+
id: number;
767+
name: string;
768+
style: string;
769+
};
770+
visible?: number;
771+
comment?: string;
742772
observations: (components['schemas']['Observation'] & {
743773
video: {
744774
id: number;
745-
poster: string;
746-
url: string;
747-
streamUrl: string;
775+
deviceType: string;
748776
};
777+
uploaderId: number;
749778
})[];
750-
comment?: string;
751779
};
752780
/** Observation */
753781
Observation: {
@@ -758,8 +786,9 @@ export interface components {
758786
start: number;
759787
/** Format: float */
760788
end: number;
761-
tags: components['schemas']['VideoTag'][];
762789
quotes: string;
790+
uxNote?: string;
791+
tags: components['schemas']['VideoTag'][];
763792
};
764793
/**
765794
* Output
@@ -1074,6 +1103,41 @@ export interface components {
10741103
*/
10751104
kind: 'campaignUniqueBugs';
10761105
};
1106+
/**
1107+
* WidgetCampaignUxProgress
1108+
* @description Used to show an overview of Ux progress
1109+
*/
1110+
WidgetCampaignUxProgress: {
1111+
data: {
1112+
countMediaWithObservation?: number;
1113+
countMedia?: number;
1114+
countTitleTag?: number;
1115+
countObservation?: number;
1116+
countObservationNoTitle?: number;
1117+
countRecurrentTitles?: number;
1118+
severitiesDistribution?: {
1119+
countPositiveFindings: number;
1120+
countMinorIssue: number;
1121+
countMajorIssue: number;
1122+
countObservations: number;
1123+
};
1124+
mostUsedTitles?: {
1125+
title: string;
1126+
usage: number;
1127+
mainSeverityAssignment: string;
1128+
}[];
1129+
};
1130+
/**
1131+
* @default uxTaggingVideoCompletion
1132+
* @example uxTaggingVideoCompletion
1133+
* @enum {string}
1134+
*/
1135+
kind:
1136+
| 'uxTaggingVideoCompletion'
1137+
| 'uxTotalTitlesVsRecurrentTitles'
1138+
| 'uxSeveritiesDistribution'
1139+
| 'uxMostUsedTitles';
1140+
};
10771141
Word: {
10781142
start: number;
10791143
end: number;
@@ -1106,6 +1170,51 @@ export interface components {
11061170
/** @description Number of shared items */
11071171
sharedItems?: number;
11081172
};
1173+
/** WidgetCampaignUxTaggingVideoCompletionData */
1174+
WidgetCampaignUxTaggingVideoCompletionData: {
1175+
data: {
1176+
countMediaWithObservation: number;
1177+
countMedia: number;
1178+
};
1179+
/** @enum {undefined} */
1180+
kind: 'uxTaggingVideoCompletion';
1181+
};
1182+
/** WidgetCampaignUxTotalTitlesVsRecurrentTitles */
1183+
WidgetCampaignUxTotalTitlesVsRecurrentTitles: {
1184+
data: {
1185+
countTitleTag: number;
1186+
countObservationNoTitle: number;
1187+
countRecurrentTitles: number;
1188+
};
1189+
/** @enum {undefined} */
1190+
kind: 'uxTotalTitlesVsRecurrentTitles';
1191+
};
1192+
/** WidgetCampaignUxSeveritiesDistribution */
1193+
WidgetCampaignUxSeveritiesDistribution: {
1194+
data: {
1195+
countObservations: number;
1196+
severitiesDistribution: {
1197+
countPositiveFindings: number;
1198+
countMinorIssue: number;
1199+
countMajorIssue: number;
1200+
countObservationSeverity: number;
1201+
};
1202+
};
1203+
/** @enum {undefined} */
1204+
kind: 'uxSeveritiesDistribution';
1205+
};
1206+
/** WidgetCampaignUxMostUsedTitles */
1207+
WidgetCampaignUxMostUsedTitles: {
1208+
data: {
1209+
mostUsedTitles: {
1210+
title: string;
1211+
usage: number;
1212+
mainSeverityAssignment: string;
1213+
}[];
1214+
};
1215+
/** @enum {undefined} */
1216+
kind: 'uxMostUsedTitles';
1217+
};
11091218
};
11101219
responses: {
11111220
/** Shared error response */
@@ -1140,7 +1249,11 @@ export interface components {
11401249
| 'bugs-by-device'
11411250
| 'cp-progress'
11421251
| 'unique-bugs'
1143-
| 'bugs-by-duplicates';
1252+
| 'bugs-by-duplicates'
1253+
| 'ux-tagging-video-completion'
1254+
| 'ux-total-titles-vs-recurrent-titles'
1255+
| 'ux-severities-distribution'
1256+
| 'ux-most-used-titles';
11441257
/** @description keywords to search */
11451258
search: string;
11461259
/** @description Custom Status id */
@@ -1748,10 +1861,7 @@ export interface operations {
17481861
requestBody: {
17491862
content: {
17501863
'application/json': {
1751-
/**
1752-
* @description se esiste già questo parametro viene passato nel request body
1753-
* se invece non esiste ed il custom status deve essere creato, non viene passato
1754-
*/
1864+
/** @description se esiste già questo parametro viene passato nel request body\r\nse invece non esiste ed il custom status deve essere creato, non viene passato */
17551865
custom_status_id?: number;
17561866
name: string;
17571867
color: string;
@@ -1812,7 +1922,12 @@ export interface operations {
18121922
/** OK */
18131923
200: {
18141924
content: {
1815-
'application/json': components['schemas']['Insight'][];
1925+
'application/json': (components['schemas']['Insight'] & {
1926+
usecases: {
1927+
id: number;
1928+
name: string;
1929+
}[];
1930+
})[];
18161931
};
18171932
};
18181933
400: components['responses']['Error'];
@@ -1846,6 +1961,7 @@ export interface operations {
18461961
severity_id: number;
18471962
observations_ids: number[];
18481963
comment?: string;
1964+
visible?: number;
18491965
};
18501966
};
18511967
};
@@ -1875,6 +1991,61 @@ export interface operations {
18751991
500: components['responses']['Error'];
18761992
};
18771993
};
1994+
/**
1995+
* Return all observations for a specificCampaigns.
1996+
* You can group by observations for usecase and grapes (observations with same title) or get an ungrouped list.
1997+
*/
1998+
'get-campaigns-cid-observations': {
1999+
parameters: {
2000+
path: {
2001+
cid: string;
2002+
};
2003+
query: {
2004+
groupBy?: 'usecase-grapes';
2005+
};
2006+
};
2007+
responses: {
2008+
/** OK */
2009+
200: {
2010+
content: {
2011+
'application/json':
2012+
| {
2013+
results: {
2014+
usecaseId: number;
2015+
usecaseTitle: string;
2016+
grapes: components['schemas']['Grapes'][];
2017+
ungrouped: (components['schemas']['Observation'] & {
2018+
uploaderId: number;
2019+
mediaId: number;
2020+
deviceType: string;
2021+
usecaseTitle: string;
2022+
})[];
2023+
}[];
2024+
/**
2025+
* @default usecase-grapes
2026+
* @example usecase-grapes
2027+
* @enum {string}
2028+
*/
2029+
kind: 'usecase-grapes';
2030+
}
2031+
| {
2032+
results: (components['schemas']['Observation'] & {
2033+
uploaderId: number;
2034+
mediaId: number;
2035+
deviceType: string;
2036+
usecaseTitle: string;
2037+
})[];
2038+
/**
2039+
* @default ungrouped
2040+
* @example ungrouped
2041+
* @enum {string}
2042+
*/
2043+
kind: 'ungrouped';
2044+
};
2045+
};
2046+
};
2047+
};
2048+
};
18782049
'get-campaigns-cid-os': {
18792050
parameters: {
18802051
path: {
@@ -2301,7 +2472,11 @@ export interface operations {
23012472
| components['schemas']['WidgetBugsByDevice']
23022473
| components['schemas']['WidgetCampaignProgress']
23032474
| components['schemas']['WidgetCampaignUniqueBugs']
2304-
| components['schemas']['WidgetBugsByDuplicates'];
2475+
| components['schemas']['WidgetBugsByDuplicates']
2476+
| components['schemas']['WidgetCampaignUxTaggingVideoCompletionData']
2477+
| components['schemas']['WidgetCampaignUxTotalTitlesVsRecurrentTitles']
2478+
| components['schemas']['WidgetCampaignUxSeveritiesDistribution']
2479+
| components['schemas']['WidgetCampaignUxMostUsedTitles'];
23052480
};
23062481
};
23072482
400: components['responses']['Error'];
@@ -2370,6 +2545,7 @@ export interface operations {
23702545
severity_id?: number;
23712546
observations_ids?: number[];
23722547
comment?: string;
2548+
visible?: number;
23732549
};
23742550
};
23752551
};

0 commit comments

Comments
 (0)