Skip to content

Commit

Permalink
Merge pull request #735 from AppQuality/develop
Browse files Browse the repository at this point in the history
release 2024-01-10
  • Loading branch information
cannarocks authored Jan 11, 2024
2 parents 4f15fad + 072c78a commit 68b59fa
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.4.0",
"private": true,
"dependencies": {
"@appquality/unguess-design-system": "3.1.63",
"@appquality/unguess-design-system": "3.1.64",
"@headwayapp/react-widget": "^0.0.4",
"@reduxjs/toolkit": "^1.8.0",
"@rtk-query/codegen-openapi": "1.2.0",
Expand Down
66 changes: 58 additions & 8 deletions src/features/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { apiSlice as api } from './api';
const injectedRtkApi = api.injectEndpoints({
endpoints: (build) => ({
get: build.query<GetApiResponse, GetApiArg>({
$get: build.query<$getApiResponse, $getApiArg>({
query: () => ({ url: `/` }),
}),
postAuthenticate: build.mutation<
Expand Down Expand Up @@ -281,7 +281,12 @@ const injectedRtkApi = api.injectEndpoints({
>({
query: (queryArg) => ({
url: `/projects/${queryArg.pid}/campaigns`,
params: { limit: queryArg.limit, start: queryArg.start },
params: {
limit: queryArg.limit,
start: queryArg.start,
order: queryArg.order,
orderBy: queryArg.orderBy,
},
}),
}),
getProjectsByPidUsers: build.query<
Expand Down Expand Up @@ -482,8 +487,8 @@ const injectedRtkApi = api.injectEndpoints({
overrideExisting: false,
});
export { injectedRtkApi as unguessApi };
export type GetApiResponse = /** status 200 OK */ {};
export type GetApiArg = void;
export type $getApiResponse = /** status 200 OK */ {};
export type $getApiArg = void;
export type PostAuthenticateApiResponse = /** status 200 OK */ Authentication;
export type PostAuthenticateApiArg = {
body: {
Expand Down Expand Up @@ -512,11 +517,16 @@ export type PostCampaignsApiArg = {
project_id: number;
pm_id: number;
platforms: PlatformObject[];
/** Da togliere */
page_preview_id?: number;
/** Da togliere */
page_manual_id?: number;
/** Used to check available coins */
customer_id: number;
has_bug_form?: number;
/** if has_bug_form is 0 this has to be 0 */
has_bug_parade?: number;
/** Useless value required by Tryber BackOffice */
description?: string;
base_bug_internal_id?: string;
express_slug: string;
Expand Down Expand Up @@ -568,9 +578,9 @@ export type GetCampaignsByCidBugsApiArg = {
};
export type GetCampaignsByCidBugsAndBidApiResponse =
/** status 200 OK */ Bug & {
media?: BugMedia[];
tags?: BugTag[];
additional_fields?: BugAdditionalField[];
media: BugMedia[];
tags: BugTag[];
additional_fields: BugAdditionalField[];
reporter: {
tester_id: number;
name: string;
Expand Down Expand Up @@ -669,6 +679,8 @@ export type PatchCampaignsByCidCustomStatusesApiArg = {
/** Campaign id */
cid: string;
body: {
/** se esiste già questo parametro viene passato nel request body
se invece non esiste ed il custom status deve essere creato, non viene passato */
custom_status_id?: number;
name: string;
color: string;
Expand Down Expand Up @@ -705,6 +717,7 @@ export type PutCampaignsByCidFindingsAndFidApiArg = {
};
export type GetCampaignsByCidMetaApiResponse = /** status 200 OK */ Campaign & {
selected_testers: number;
/** Array of form factors */
allowed_devices: string[];
};
export type GetCampaignsByCidMetaApiArg = {
Expand Down Expand Up @@ -809,6 +822,7 @@ export type DeleteCampaignsByCidUsersApiArg = {
/** Campaign id */
cid: string;
body: {
/** Tryber WP USER ID */
user_id: number;
};
};
Expand All @@ -817,6 +831,7 @@ export type GetCampaignsByCidUxApiResponse = /** status 200 OK */ {
goal: string;
users: number;
findings?: {
/** this field is the Finding ID */
id: number;
title: string;
description: string;
Expand Down Expand Up @@ -917,6 +932,10 @@ export type GetProjectsByPidCampaignsApiArg = {
limit?: number;
/** Start pagination parameter */
start?: number;
/** Order value (ASC, DESC) */
order?: string;
/** Order by accepted field */
orderBy?: string;
};
export type GetProjectsByPidUsersApiResponse = /** status 200 OK */ {
items: Tenant[];
Expand Down Expand Up @@ -962,6 +981,7 @@ export type DeleteProjectsByPidUsersApiArg = {
/** Project id */
pid: string;
body: {
/** Tryber WP USER ID */
user_id: number;
include_shared?: boolean;
};
Expand Down Expand Up @@ -1136,6 +1156,7 @@ export type DeleteWorkspacesByWidUsersApiArg = {
/** Workspace (company, customer) id */
wid: string;
body: {
/** Tryber WP USER ID */
user_id: number;
include_shared?: boolean;
};
Expand Down Expand Up @@ -1196,6 +1217,9 @@ export type Campaign = {
title: string;
customer_title: string;
is_public: number;
/** -1: no bug form;
0: only bug form;
1: bug form with bug parade'; */
bug_form?: number;
type: {
id: number;
Expand All @@ -1221,7 +1245,16 @@ export type Campaign = {
base_bug_internal_id?: string;
};
export type PlatformObject = {
/** os */
id: number;
/** form_factor
0 => smartphone,
1 => tablet
2 => pc
3 => smartwatch
4 => console
5 => tv */
deviceType: number;
};
export type TemplateCategory = {
Expand All @@ -1230,17 +1263,21 @@ export type TemplateCategory = {
};
export type Template = {
title: string;
/** Short description used as preview of template or in templates dropdown */
description?: string;
/** HTML content used to pre-fill the use case editor */
content?: string;
category?: TemplateCategory;
device_type?: 'webapp' | 'mobileapp';
locale?: 'en' | 'it';
image?: string;
/** The use case created by this template needs a login or not? */
requiresLogin?: boolean;
};
export type UseCase = {
title: string;
description: string;
/** Optional in experiential campaigns */
functionality?: {
id?: number;
} & Template;
Expand All @@ -1253,6 +1290,7 @@ export type CampaignWithOutput = Campaign & {
};
export type BugTitle = {
full: string;
/** Bug title without context. */
compact: string;
context?: string[];
};
Expand Down Expand Up @@ -1407,6 +1445,7 @@ export type Report = {
update_date?: string;
};
export type Tenant = {
/** tryber wp_user_id */
id: number;
profile_id: number;
name: string;
Expand Down Expand Up @@ -1436,6 +1475,7 @@ export type WidgetBugsByUseCase = {
export type WidgetBugsByDevice = {
data: ((Smartphone | Desktop | Tablet) & {
unique_bugs: number;
/** Unique bugs */
bugs: number;
})[];
kind: 'bugsByDevice';
Expand All @@ -1444,8 +1484,11 @@ export type WidgetCampaignProgress = {
data: {
start_date: string;
end_date: string;
/** Percentage fixed rate of completion */
usecase_completion: 12.5 | 37.5 | 62.5 | 87.5 | 100;
/** Number of hours from start_date */
time_elapsed: number;
/** Expected amount of hours required to complete the campaign */
expected_duration: number;
};
kind: 'campaignProgress';
Expand Down Expand Up @@ -1475,6 +1518,7 @@ export type Feature = {
name?: string;
};
export type User = {
/** This is the main id of the user. Currently is equal to tryber_wp_user_id */
id: number;
email: string;
role: string;
Expand All @@ -1499,17 +1543,23 @@ export type Workspace = {
picture?: string;
url?: string;
};
/** express coins */
coins?: number;
/** Do this workspace have shared items? */
isShared?: boolean;
/** Number of shared items */
sharedItems?: number;
};
export type Coin = {
id: number;
customer_id: number;
/** Number of available coin */
amount: number;
agreement_id?: number;
/** This is the single coin price */
price?: number;
created_on?: string;
/** On each coin use, the related package will be updated */
updated_on?: string;
};
export type BugComment = {
Expand All @@ -1522,7 +1572,7 @@ export type BugComment = {
};
};
export const {
useGetQuery,
use$getQuery,
usePostAuthenticateMutation,
usePostAnalyticsViewsCampaignsByCidMutation,
usePostCampaignsMutation,
Expand Down
2 changes: 1 addition & 1 deletion src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"__BUG_COMMENTS_CHAT_CONFIRM__": "Invia",
"__BUG_COMMENTS_CHAT_DELETE__": "Elimina",
"__BUG_COMMENTS_CHAT_HEADER__": "Comunica con UNGUESS e il tuo team",
"__BUG_COMMENTS_CHAT_PLACEHOLDER": "Scrivi e condividi la tua opinione o un feedback",
"__BUG_COMMENTS_CHAT_PLACEHOLDER": "Condividi la tua opinione",
"__BUG_COMMENTS_DELETE_MODAL_BODY__": "Se lo elimini, non comparirà più tra i commenti.",
"__BUG_COMMENTS_DELETE_MODAL_CANCEL__": "Torna al commento",
"__BUG_COMMENTS_DELETE_MODAL_DELETE__": "Elimina",
Expand Down
10 changes: 7 additions & 3 deletions src/pages/Bug/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const BreadCrumbs = ({
);
};

const StyledContainer = styled(LayoutWrapper)`
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[200]};
`;

export const Header = ({ campaignId, bug }: Props) => {
const dispatch = useAppDispatch();
const {
Expand Down Expand Up @@ -118,8 +122,8 @@ export const Header = ({ campaignId, bug }: Props) => {
}

return (
<LayoutWrapper isNotBoxed>
<PageHeader>
<StyledContainer isNotBoxed>
<PageHeader style={{ border: 'none' }}>
<BreadCrumbs campaign={campaign}>
<ShareButton bug={bug}>
{(setModalOpen) => (
Expand All @@ -133,6 +137,6 @@ export const Header = ({ campaignId, bug }: Props) => {
</ShareButton>
</BreadCrumbs>
</PageHeader>
</LayoutWrapper>
</StyledContainer>
);
};
2 changes: 1 addition & 1 deletion src/pages/Bug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const Bug = () => {
{...(!hideActions && { style: { paddingRight: 0 } })}
>
<Grid gutters="xxl">
<Row>
<Row style={{ marginRight: 0 }}>
<Col lg={8} style={{ marginBottom: 0 }}>
<Content bug={bug} campaignId={campaignId} />
</Col>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Bugs/Content/components/BugHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const CommentsIconContainer = styled.div`
display: flex;
width: 100%;
justify-content: center;
margin-bottom: ${appTheme.space.xxs};
`;

const CommentsBadge = styled.span`
Expand All @@ -50,14 +49,15 @@ const CommentsBadge = styled.span`
justify-content: center;
position: absolute;
top: -${appTheme.space.xxs};
right: -${appTheme.space.xs};
right: -${appTheme.space.xxs};
background-color: ${appTheme.palette.azure[600]};
color: ${appTheme.palette.white};
width: 16px;
height: ${appTheme.space.sm};
border: 1px solid ${appTheme.palette.white};
font-size: 8px;
border-radius: ${appTheme.borderRadii.lg};
z-index: 2;
`;

export default ({
Expand Down Expand Up @@ -115,7 +115,7 @@ export default ({
type="light"
placement="auto"
>
<IconButton size="medium" className="bug-detail-go-to-bug-link">
<IconButton size="small" className="bug-detail-go-to-bug-link">
<CommentsIconContainer>
<SpeechBubble />
{comments?.items && comments.items.length > 0 && (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Campaign/widgetCards/FlipCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const FlipCard = ({
activateSwitchFromBreakpoint,
...props
}: FlipCardProps) => (
<FlipCardContextProvider breakpoint={activateSwitchFromBreakpoint || 500}>
<FlipCardContextProvider breakpoint={activateSwitchFromBreakpoint || 380}>
<FlipCardContainer {...props} height={height}>
{children}
</FlipCardContainer>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Dashboard/campaigns-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export const CampaignsList = () => {

const { filteredCampaigns, isLoading, isFetching, isError } =
useGetWorkspacesByWidCampaignsQuery(
{ wid: activeWorkspace?.id.toString() || '' },
{
wid: activeWorkspace?.id.toString() || '',
orderBy: 'start_date',
order: 'DESC',
},
{
selectFromResult: (result) => ({
...result,
Expand Down
7 changes: 6 additions & 1 deletion src/pages/Dashboard/project-items/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export const ProjectItems = ({ projectId }: { projectId: number }) => {

const { filteredCampaigns, isLoading, isFetching } =
useGetProjectsByPidCampaignsQuery(
{ pid: projectId.toString(), limit: 10000 },
{
pid: projectId.toString(),
limit: 10000,
orderBy: 'start_date',
order: 'DESC',
},
{
selectFromResult: (result) => ({
...result,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
dependencies:
hls.js "^1.4.8"

"@appquality/unguess-design-system@3.1.63":
version "3.1.63"
resolved "https://registry.yarnpkg.com/@appquality/unguess-design-system/-/unguess-design-system-3.1.63.tgz#5dd6bfcfc060eac9b71b8fabe94fd5277f700d73"
integrity sha512-WXHigrq9Pux+8tYLBI8zmaUPtCkhR5jtqsapFQMQJcFMRVz18JbZz/QsB55FnXcvsAWARFffUdRTKI2T/5fkzA==
"@appquality/unguess-design-system@3.1.64":
version "3.1.64"
resolved "https://registry.yarnpkg.com/@appquality/unguess-design-system/-/unguess-design-system-3.1.64.tgz#b3573e0d98508f1f3fe6507dc038a4368b55d69e"
integrity sha512-7CN3uyr3r0LaJYKUUJ/d5FZZC1k4O0Hjz3sysc9AFNsDwjNogaQObnqygEchR0ZIzzbSJXzN7XXUKnPsXSyIJQ==
dependencies:
"@appquality/stream-player" "^1.0.3"
"@nivo/bar" "^0.80.0"
Expand Down

0 comments on commit 68b59fa

Please sign in to comment.