Skip to content

Commit

Permalink
Bare variant D på klarspråk amplitude (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
tu55eladd authored Oct 4, 2023
1 parent e3d1ad7 commit fce260c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/amplitude/amplitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,14 @@ export function logToggleSpraksjekkToggle(enabled: boolean) {
return logAmplitudeEvent({ name: 'toggle', data: { text: 'Slå på klarspråkhjelp', enabled: enabled } });
}

export function logReferatFullfort(
analysis: TextCheckerResult,
referatPublisert: boolean,
spraksjekkEnabled: boolean,
variant: 'A' | 'C'
) {
export function logReferatFullfort(analysis: TextCheckerResult, referatPublisert: boolean, spraksjekkEnabled: boolean) {
const mappedAnalysis = mapSpraksjekkAnalysis(analysis);

return logAmplitudeEvent(
{
name: 'referat lagret',
data: { analysis: mappedAnalysis, referatPublisert, spraksjekkEnabled },
},
{ variant }
{ variant: 'D' },
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const InnerSamtalereferatForm = (props: Props) => {
erReferatPublisert,
}).then(() => {
const analysis = checkText(data.referat);
logReferatFullfort(analysis, erReferatPublisert, open, visSpraksjekk ? 'C' : 'A');
logReferatFullfort(analysis, erReferatPublisert, open);
});
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/moduler/aktivitet/visning/referat/OppdaterReferatForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const OppdaterReferatForm = (props: Props) => {
return dispatch(oppdaterReferat(aktivitetMedOppdatertReferat)).then((action) => {
if (log) {
const analysis = checkText(referatData.referat);
logReferatFullfort(analysis, aktivitet.erReferatPublisert, open, visSpraksjekk ? 'C' : 'A');
logReferatFullfort(analysis, aktivitet.erReferatPublisert, open);
}
if (isFulfilled(action)) {
onFerdig();
Expand All @@ -88,7 +88,7 @@ const OppdaterReferatForm = (props: Props) => {
if (action.payload) {
dispatch(publiserReferat(action.payload)).then(() => {
const analysis = checkText(values.referat);
logReferatFullfort(analysis, true, open, visSpraksjekk ? 'C' : 'A');
logReferatFullfort(analysis, true, open);
});
}
});
Expand Down

0 comments on commit fce260c

Please sign in to comment.