Skip to content

Commit

Permalink
Merge pull request #1142 from rodekruis/tweak--logging-names
Browse files Browse the repository at this point in the history
fix: Use "name"-property to make data available in Matomo
  • Loading branch information
elwinschmitz authored Nov 25, 2024
2 parents 1382b8b + 35881ad commit 98abf6f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export class FeedbackLinkComponent implements OnChanges, OnInit {
LoggingEventCategory.ai,
LoggingEvent.FeedbackAnswered,
{
name: value, // Use "name"-property for Matomo
answer: value,
},
);
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/offer/offer.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NgFor, NgIf } from '@angular/common';
import { Component, Input } from '@angular/core';
import { RouterLink } from '@angular/router';
import { IonImg } from '@ionic/angular/standalone';
import { MarkdownModule } from 'ngx-markdown';
import {
Expand All @@ -17,7 +16,7 @@ import { formatPhoneNumberAsUrl } from 'src/app/shared/utils';
templateUrl: './offer.component.html',
styleUrls: ['./offer.component.scss'],
standalone: true,
imports: [MarkdownModule, IonImg, NgIf, NgFor, RouterLink],
imports: [MarkdownModule, IonImg, NgIf, NgFor],
})
export class OfferComponent {
@Input()
Expand Down
1 change: 1 addition & 0 deletions src/app/components/q-a-set/q-a-set.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class QASetComponent {
? LoggingEvent.QuestionOpen
: LoggingEvent.QuestionClose,
{
name: slug, // Use "name"-property for Matomo
questionSlug: slug,
question: question.substring(0, 100),
},
Expand Down
3 changes: 1 addition & 2 deletions src/app/pages/search/search.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgIf } from '@angular/common';
import type { OnInit } from '@angular/core';
import { Component } from '@angular/core';
import type { Params } from '@angular/router';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { ParentLinkComponent } from 'src/app/components/parent-link/parent-link.component';
import { QASetListComponent } from 'src/app/components/q-a-set-list/q-a-set-list.component';
import { SearchInputComponent } from 'src/app/components/search-input/search-input.component';
Expand All @@ -21,7 +21,6 @@ import { AppPath } from 'src/routes';
standalone: true,
imports: [
NgIf,
RouterLink,
QASetListComponent,
SearchInputComponent,
ParentLinkComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/referral/referral.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
RouterLink,
RouterOutlet,
} from '@angular/router';
import { IonContent, IonFooter, IonHeader } from '@ionic/angular/standalone';
import { IonContent, IonHeader } from '@ionic/angular/standalone';
import { MarkdownComponent } from 'ngx-markdown';
import { filter } from 'rxjs';
import { AppHeaderComponent } from 'src/app/components/header/header.component';
Expand Down Expand Up @@ -46,7 +46,6 @@ import { AppPath } from 'src/routes';
RouterOutlet,
IonHeader,
IonContent,
IonFooter,
],
})
export class ReferralPageComponent implements OnInit {
Expand Down
35 changes: 11 additions & 24 deletions src/app/services/spreadsheet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,30 +747,17 @@ export class SpreadsheetService {
const parentRow = all.find((row) => row.slug === element.parentSlug);

// When defined parentRow is missing, treat as a 'normal' question
if (!parentRow) {
this.loggingService.logEvent(
LoggingEventCategory.error,
LoggingEvent.NotFoundParentQuestion,
{
row: element.id,
slug: element.slug,
parentSlug: element.parentSlug,
},
);
return element;
}

// When pointing to itself, treat as a 'normal' question
if (parentRow === element) {
this.loggingService.logEvent(
LoggingEventCategory.error,
LoggingEvent.NotFoundParentQuestionIsSelf,
{
row: element.id,
slug: element.slug,
parentSlug: element.parentSlug,
},
);
if (!parentRow || parentRow === element) {
const errorType =
parentRow === element
? LoggingEvent.NotFoundParentQuestionIsSelf
: LoggingEvent.NotFoundParentQuestion;
this.loggingService.logEvent(LoggingEventCategory.error, errorType, {
name: `row=${element.id};slug=${element.slug};parent=${element.parentSlug}`,
row: element.id,
slug: element.slug,
parentSlug: element.parentSlug,
});
return element;
}

Expand Down

0 comments on commit 98abf6f

Please sign in to comment.