Skip to content
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
8 changes: 8 additions & 0 deletions .changeset/poor-badgers-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@o2s/integrations.zendesk': minor
'@o2s/integrations.mocked': patch
'@o2s/frontend': patch
'@o2s/ui': minor
---

update article slugs to be relative and adjust mapping logic
4 changes: 4 additions & 0 deletions apps/frontend/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const nextConfig: NextConfig = {
protocol: 'https',
hostname: 'composable-css-public.s3.eu-central-1.amazonaws.com',
},
{
protocol: 'https',
hostname: '*.zendesk.com',
},
],
},
sassOptions: {
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"date-fns": "^4.1.0",
"dotenv-cli": "^11.0.0",
"formik": "^2.4.9",
"markdown-to-jsx": "^9.7.4",
"markdown-to-jsx": "9.7.0",
"next": "16.1.6",
"next-auth": "^5.0.0-beta.30",
"next-compose-plugins": "^2.2.1",
Expand Down
88 changes: 58 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const mapCategories = (

export const mapArticle = (locale: string, slug: string): Articles.Model.Article | undefined => {
const articles = locale === 'pl' ? MOCK_ARTICLES_PL : locale === 'de' ? MOCK_ARTICLES_DE : MOCK_ARTICLES_EN;
return articles.find((article) => article.slug === slug);
return articles.find((article) => slug.endsWith(article.slug));
};

export const mapArticles = (locale: string, options: Articles.Request.GetArticleListQuery): Articles.Model.Articles => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';
import { Observable, map, of } from 'rxjs';
import { Observable, defer, map, of } from 'rxjs';

import { Articles, Search } from '@o2s/framework/modules';

Expand All @@ -10,7 +10,7 @@ export class ArticlesService implements Articles.Service {
constructor(private readonly searchService: Search.Service) {}

getCategory(options: Articles.Request.GetCategoryParams): Observable<Articles.Model.Category> {
return of(mapCategory(options.locale, options.id));
return defer(() => of(mapCategory(options.locale, options.id)));
}

getCategoryList(options: Articles.Request.GetCategoryListQuery): Observable<Articles.Model.Categories> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Articles } from '@o2s/framework/modules';
export const MOCK_ARTICLE1_EN: Articles.Model.Article[] = [
{
id: 'art-002',
slug: '/help-and-support/maintenance/powerpro-tool-maintenance-guide',
slug: 'maintenance/powerpro-tool-maintenance-guide',
roles: [],
createdAt: '2023-06-10T10:15:00Z',
updatedAt: '2023-07-20T16:30:00Z',
Expand Down Expand Up @@ -231,7 +231,7 @@ For additional assistance with tool maintenance, contact our customer support te
export const MOCK_ARTICLE1_DE: Articles.Model.Article[] = [
{
id: 'art-002',
slug: '/hilfe-und-support/wartung/powerpro-werkzeug-wartungsanleitung',
slug: 'wartung/powerpro-werkzeug-wartungsanleitung',
roles: [],
createdAt: '2023-06-10T10:15:00Z',
updatedAt: '2023-07-20T16:30:00Z',
Expand Down Expand Up @@ -459,7 +459,7 @@ Für zusätzliche Unterstützung bei der Werkzeugwartung kontaktieren Sie unser
export const MOCK_ARTICLE1_PL: Articles.Model.Article[] = [
{
id: 'art-002',
slug: '/pomoc-i-wsparcie/konserwacja/przewodnik-konserwacji-narzedzi-powerpro',
slug: 'konserwacja/przewodnik-konserwacji-narzedzi-powerpro',
roles: [],
createdAt: '2023-06-10T10:15:00Z',
updatedAt: '2023-07-20T16:30:00Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Aby uzyskać dodatkowe wsparcie, skontaktuj się z naszym zespołem obsługi kli
export const MOCK_ARTICLE10_EN: Articles.Model.Article[] = [
{
id: 'art-010',
slug: '/help-and-support/troubleshooting/troubleshooting-guide-for-powerpro-tools',
slug: 'troubleshooting/troubleshooting-guide-for-powerpro-tools',
roles: [],
createdAt: '2023-03-20T10:15:00Z',
updatedAt: '2023-06-05T16:30:00Z',
Expand Down Expand Up @@ -476,7 +476,7 @@ export const MOCK_ARTICLE10_EN: Articles.Model.Article[] = [
export const MOCK_ARTICLE10_DE: Articles.Model.Article[] = [
{
id: 'art-010',
slug: '/hilfe-und-support/fehlerbehebung/fehlerbehebung-fur-powerpro-werkzeuge',
slug: 'fehlerbehebung/fehlerbehebung-fur-powerpro-werkzeuge',
roles: [],
createdAt: '2023-03-20T10:15:00Z',
updatedAt: '2023-06-05T16:30:00Z',
Expand Down Expand Up @@ -542,7 +542,7 @@ export const MOCK_ARTICLE10_DE: Articles.Model.Article[] = [
export const MOCK_ARTICLE10_PL: Articles.Model.Article[] = [
{
id: 'art-010',
slug: '/pomoc-i-wsparcie/rozwiazywanie-problemow/przewodnik-rozwiazywania-problemow-z-narzedziami-powerpro',
slug: 'rozwiazywanie-problemow/przewodnik-rozwiazywania-problemow-z-narzedziami-powerpro',
roles: [],
createdAt: '2023-03-20T10:15:00Z',
updatedAt: '2023-06-05T16:30:00Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Articles } from '@o2s/framework/modules';
export const MOCK_ARTICLE11_EN: Articles.Model.Article[] = [
{
id: 'art-011',
slug: '/help-and-support/warranty-and-repair/powerpro-tool-certification-program',
slug: 'warranty-and-repair/powerpro-tool-certification-program',
roles: [],
createdAt: '2023-09-12T14:50:00Z',
updatedAt: '2023-09-12T14:50:00Z',
Expand Down Expand Up @@ -67,7 +67,7 @@ export const MOCK_ARTICLE11_EN: Articles.Model.Article[] = [
},
{
id: 'art-015',
slug: '/help-and-support/warranty/expedited-repair-service-options',
slug: 'warranty/expedited-repair-service-options',
roles: [],
createdAt: '2023-07-30T12:10:00Z',
updatedAt: '2023-07-30T12:10:00Z',
Expand Down Expand Up @@ -110,7 +110,7 @@ export const MOCK_ARTICLE11_EN: Articles.Model.Article[] = [
},
{
id: 'art-017',
slug: '/help-and-support/warranty/repair-tracking-system-benefits',
slug: 'warranty/repair-tracking-system-benefits',
roles: [],
createdAt: '2023-01-15T13:30:00Z',
updatedAt: '2023-04-22T15:45:00Z',
Expand Down Expand Up @@ -168,7 +168,7 @@ export const MOCK_ARTICLE11_EN: Articles.Model.Article[] = [
export const MOCK_ARTICLE11_DE: Articles.Model.Article[] = [
{
id: 'art-011',
slug: '/hilfe-und-support/garantie/powerpro-werkzeug-zertifizierungsprogramm',
slug: 'garantie/powerpro-werkzeug-zertifizierungsprogramm',
roles: [],
createdAt: '2023-09-12T14:50:00Z',
updatedAt: '2023-09-12T14:50:00Z',
Expand Down Expand Up @@ -235,7 +235,7 @@ export const MOCK_ARTICLE11_DE: Articles.Model.Article[] = [
export const MOCK_ARTICLE11_PL: Articles.Model.Article[] = [
{
id: 'art-011',
slug: '/pomoc-i-wsparcie/gwarancja/program-certyfikacji-narzedzi-powerpro',
slug: 'gwarancja/program-certyfikacji-narzedzi-powerpro',
roles: [],
createdAt: '2023-09-12T14:50:00Z',
updatedAt: '2023-09-12T14:50:00Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Articles } from '@o2s/framework/modules';
export const MOCK_ARTICLE12_EN: Articles.Model.Article[] = [
{
id: 'art-004',
slug: '/help-and-support/warranty-and-repair/understanding-powerpro-warranty',
slug: 'warranty-and-repair/understanding-powerpro-warranty',
roles: [],
createdAt: '2023-06-24T10:15:00Z',
updatedAt: '2023-08-15T16:40:00Z',
Expand Down Expand Up @@ -66,7 +66,7 @@ export const MOCK_ARTICLE12_EN: Articles.Model.Article[] = [
},
{
id: 'art-009',
slug: '/help-and-support/warranty/repair-or-replace-decision-guide',
slug: 'warranty/repair-or-replace-decision-guide',
roles: [],
createdAt: '2023-05-19T09:10:00Z',
updatedAt: '2023-06-30T14:25:00Z',
Expand Down Expand Up @@ -132,7 +132,7 @@ export const MOCK_ARTICLE12_EN: Articles.Model.Article[] = [
export const MOCK_ARTICLE12_DE: Articles.Model.Article[] = [
{
id: 'art-004',
slug: '/hilfe-und-support/garantie/powerpro-garantie-verstehen',
slug: 'garantie/powerpro-garantie-verstehen',
roles: [],
createdAt: '2023-06-24T10:15:00Z',
updatedAt: '2023-08-15T16:40:00Z',
Expand Down Expand Up @@ -198,7 +198,7 @@ export const MOCK_ARTICLE12_DE: Articles.Model.Article[] = [
export const MOCK_ARTICLE12_PL: Articles.Model.Article[] = [
{
id: 'art-004',
slug: '/pomoc-i-wsparcie/gwarancja/rozumienie-gwarancji-powerpro',
slug: 'gwarancja/rozumienie-gwarancji-powerpro',
roles: [],
createdAt: '2023-06-24T10:15:00Z',
updatedAt: '2023-08-15T16:40:00Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Articles } from '@o2s/framework/modules';
export const MOCK_ARTICLE13_EN: Articles.Model.Article[] = [
{
id: 'art-012',
slug: '/help-and-support/warranty-and-repair/preventive-maintenance-guide',
slug: 'warranty-and-repair/preventive-maintenance-guide',
roles: [],
createdAt: '2023-08-20T11:30:00Z',
updatedAt: '2023-09-05T15:20:00Z',
Expand Down Expand Up @@ -69,7 +69,7 @@ export const MOCK_ARTICLE13_EN: Articles.Model.Article[] = [
export const MOCK_ARTICLE13_DE: Articles.Model.Article[] = [
{
id: 'art-012',
slug: '/hilfe-und-support/garantie/vorbeugende-wartung-leitfaden',
slug: 'garantie/vorbeugende-wartung-leitfaden',
roles: [],
createdAt: '2023-08-20T11:30:00Z',
updatedAt: '2023-09-05T15:20:00Z',
Expand Down Expand Up @@ -136,7 +136,7 @@ export const MOCK_ARTICLE13_DE: Articles.Model.Article[] = [
export const MOCK_ARTICLE13_PL: Articles.Model.Article[] = [
{
id: 'art-012',
slug: '/pomoc-i-wsparcie/gwarancja/przewodnik-po-konserwacji-zapobiegawczej',
slug: 'gwarancja/przewodnik-po-konserwacji-zapobiegawczej',
roles: [],
createdAt: '2023-08-20T11:30:00Z',
updatedAt: '2023-09-05T15:20:00Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Articles } from '@o2s/framework/modules';
export const MOCK_ARTICLE2_EN: Articles.Model.Article[] = [
{
id: 'art-003',
slug: '/help-and-support/safety/powerpro-tool-safety-guidelines',
slug: 'safety/powerpro-tool-safety-guidelines',
roles: [],
createdAt: '2023-07-15T09:45:00Z',
updatedAt: '2023-08-25T13:20:00Z',
Expand Down Expand Up @@ -241,7 +241,7 @@ For additional safety information or to report a safety concern with a PowerPro
export const MOCK_ARTICLE2_DE: Articles.Model.Article[] = [
{
id: 'art-003',
slug: '/hilfe-und-support/sicherheit/powerpro-werkzeug-sicherheitsrichtlinien',
slug: 'sicherheit/powerpro-werkzeug-sicherheitsrichtlinien',
roles: [],
createdAt: '2023-07-15T09:45:00Z',
updatedAt: '2023-08-25T13:20:00Z',
Expand Down Expand Up @@ -479,7 +479,7 @@ Für zusätzliche Sicherheitsinformationen oder um ein Sicherheitsanliegen mit e
export const MOCK_ARTICLE2_PL: Articles.Model.Article[] = [
{
id: 'art-003',
slug: '/pomoc-i-wsparcie/bezpieczenstwo/wytyczne-bezpieczenstwa-narzedzi-powerpro',
slug: 'bezpieczenstwo/wytyczne-bezpieczenstwa-narzedzi-powerpro',
roles: [],
createdAt: '2023-07-15T09:45:00Z',
updatedAt: '2023-08-25T13:20:00Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Articles } from '@o2s/framework/modules';
export const MOCK_ARTICLE3_EN: Articles.Model.Article[] = [
{
id: 'art-004',
slug: '/help-and-support/accessories/essential-powerpro-tool-accessories',
slug: 'accessories/essential-powerpro-tool-accessories',
roles: [],
createdAt: '2023-08-20T11:30:00Z',
updatedAt: '2023-09-30T15:45:00Z',
Expand Down Expand Up @@ -312,7 +312,7 @@ For personalized accessory recommendations based on your specific tools and proj
export const MOCK_ARTICLE3_DE: Articles.Model.Article[] = [
{
id: 'art-004',
slug: '/hilfe-und-support/zubehor/wesentliches-powerpro-werkzeugzubehor',
slug: 'zubehor/wesentliches-powerpro-werkzeugzubehor',
roles: [],
createdAt: '2023-08-20T11:30:00Z',
updatedAt: '2023-09-30T15:45:00Z',
Expand Down Expand Up @@ -621,7 +621,7 @@ Für personalisierte Zubehörempfehlungen basierend auf Ihren spezifischen Werkz
export const MOCK_ARTICLE3_PL: Articles.Model.Article[] = [
{
id: 'art-004',
slug: '/pomoc-i-wsparcie/akcesoria/niezbedne-akcesoria-do-narzedzi-powerpro',
slug: 'akcesoria/niezbedne-akcesoria-do-narzedzi-powerpro',
roles: [],
createdAt: '2023-08-20T11:30:00Z',
updatedAt: '2023-09-30T15:45:00Z',
Expand Down
Loading