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

Temporary disable of compilation tool #160

Merged
merged 6 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
96 changes: 0 additions & 96 deletions src/pages/UxDashboard/UxForm/FormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,6 @@ export interface FormQuestion {
name: GetCampaignsByCampaignUxApiResponse["questions"][number]["name"];
id?: GetCampaignsByCampaignUxApiResponse["questions"][number]["id"];
}
export interface FormVideoPart {
id?: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["id"];
internalId: string;
end: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["end"];
description: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["description"];
start: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["start"];
mediaId: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["mediaId"];
streamUrl: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["streamUrl"];
url: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["videoParts"][number]["url"];
}
export interface FormInsight {
id?: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["id"];
internalId: string;
title: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["title"];
description: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["description"];
severity: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["severity"];
cluster: NonNullable<
GetCampaignsByCampaignUxApiResponse["insights"]
>[number]["clusters"];
videoParts: FormVideoPart[];
}

export interface FormSentiment {
clusterId: NonNullable<
Expand All @@ -75,7 +32,6 @@ export interface FormValuesInterface {
methodology: GetCampaignsByCampaignUxApiResponse["methodology"];
questions: FormQuestion[];
usersNumber?: GetCampaignsByCampaignUxApiResponse["usersNumber"];
insights: FormInsight[];
sentiments?: FormSentiment[];
}

Expand Down Expand Up @@ -110,32 +66,6 @@ const FormProvider = ({ children }: { children: ReactNode }) => {
};
}, []) || [],
usersNumber: currentData?.usersNumber,
insights:
currentData?.insights?.map((insight) => {
return {
id: insight.id,
internalId: uuidv4(),
title: insight.title,
description: insight.description,
severity: {
id: insight.severity.id,
name: insight.severity.name,
},
cluster: insight.clusters,
videoParts: insight.videoParts.map((video) => {
return {
id: video.id,
internalId: uuidv4(),
start: video.start,
end: video.end - video.start,
description: video.description,
mediaId: video.mediaId,
streamUrl: video.streamUrl,
url: video.url,
};
}),
};
}) || [],
sentiments:
currentData?.sentiments && currentData.sentiments.length
? currentData.sentiments.map((sentiment) => {
Expand Down Expand Up @@ -229,31 +159,6 @@ const FormProvider = ({ children }: { children: ReactNode }) => {
),
});

const mapFormInsightsForPatch = (insights: FormValuesInterface["insights"]) =>
insights?.map((insight, index) => {
return {
id: insight.id,
title: insight.title,
description: insight.description,
order: index,
severityId: insight.severity.id,
clusterIds: Array.isArray(insight.cluster)
? insight.cluster.map((cluster) => cluster.id)
: insight.cluster,
videoParts: !insight.videoParts
? []
: insight.videoParts.map((video, videoIndex) => {
return {
id: video.id,
order: videoIndex,
start: video.start,
end: Math.round(video.end) + video.start,
mediaId: video.mediaId,
description: video.description,
};
}),
};
});
return (
<Formik
initialValues={initialValues}
Expand All @@ -273,7 +178,6 @@ const FormProvider = ({ children }: { children: ReactNode }) => {
})),
methodology: values.methodology,
usersNumber: values.usersNumber,
insights: mapFormInsightsForPatch(values.insights) || [],
sentiments: values.sentiments || [],
},
});
Expand Down
144 changes: 0 additions & 144 deletions src/pages/UxDashboard/UxForm/Insights/InsightCard.tsx

This file was deleted.

Loading
Loading