From bbb6e4ba8d0b712a2dc1ab5ba915e2229cdd6c83 Mon Sep 17 00:00:00 2001 From: Elwin Schmitz Date: Mon, 25 Nov 2024 09:46:59 +0100 Subject: [PATCH 1/2] fix: Use "name"-property to make data available in Matomo Format of contents is to be decided. Some more information is sometimes necessary, mostly nice-to-have. --- .../feedback-link/feedback-link.component.ts | 1 + .../components/q-a-set/q-a-set.component.ts | 1 + src/app/services/spreadsheet.service.ts | 35 ++++++------------- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/app/components/feedback-link/feedback-link.component.ts b/src/app/components/feedback-link/feedback-link.component.ts index e0e2d6c8..7a8d68ee 100644 --- a/src/app/components/feedback-link/feedback-link.component.ts +++ b/src/app/components/feedback-link/feedback-link.component.ts @@ -115,6 +115,7 @@ export class FeedbackLinkComponent implements OnChanges, OnInit { LoggingEventCategory.ai, LoggingEvent.FeedbackAnswered, { + name: value, // Use "name"-property for Matomo answer: value, }, ); diff --git a/src/app/components/q-a-set/q-a-set.component.ts b/src/app/components/q-a-set/q-a-set.component.ts index 4fca863b..7bfb38ef 100644 --- a/src/app/components/q-a-set/q-a-set.component.ts +++ b/src/app/components/q-a-set/q-a-set.component.ts @@ -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), }, diff --git a/src/app/services/spreadsheet.service.ts b/src/app/services/spreadsheet.service.ts index cd106ffe..1c67fde7 100644 --- a/src/app/services/spreadsheet.service.ts +++ b/src/app/services/spreadsheet.service.ts @@ -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; } From 35881ad652fa4a5c56b5e11d0dcf89199632d7ad Mon Sep 17 00:00:00 2001 From: Elwin Schmitz Date: Fri, 8 Nov 2024 13:02:56 +0100 Subject: [PATCH 2/2] fix: Cleanup unused imports --- src/app/components/offer/offer.component.ts | 3 +-- src/app/pages/search/search.page.ts | 3 +-- src/app/referral/referral.page.ts | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/components/offer/offer.component.ts b/src/app/components/offer/offer.component.ts index 17718cc9..7e19dae4 100644 --- a/src/app/components/offer/offer.component.ts +++ b/src/app/components/offer/offer.component.ts @@ -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 { @@ -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() diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 533ef66d..5624fc63 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -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'; @@ -21,7 +21,6 @@ import { AppPath } from 'src/routes'; standalone: true, imports: [ NgIf, - RouterLink, QASetListComponent, SearchInputComponent, ParentLinkComponent, diff --git a/src/app/referral/referral.page.ts b/src/app/referral/referral.page.ts index d3f32184..c1e5c8ce 100644 --- a/src/app/referral/referral.page.ts +++ b/src/app/referral/referral.page.ts @@ -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'; @@ -46,7 +46,6 @@ import { AppPath } from 'src/routes'; RouterOutlet, IonHeader, IonContent, - IonFooter, ], }) export class ReferralPageComponent implements OnInit {