Skip to content

Commit

Permalink
Merge branch 'main' into fix-colorpicker-focus-blip
Browse files Browse the repository at this point in the history
  • Loading branch information
staxly[bot] authored Apr 11, 2024
2 parents 11717c5 + ffaa8cf commit c3b0c3e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/content/hooks/locationChange.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ describe('contentRouteHookBody', () => {
meta: {
slug: 'new-book',
},
polish_site_link: '',
promote_image: null,
publish_date: '2012-06-21',
};
Expand Down
1 change: 1 addition & 0 deletions src/app/content/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface BookWithOSWebData extends VersionedArchiveBookWithConfig {
};
publish_date: string;
amazon_link: string;
polish_site_link: string;
subject: string;
subjects: Array<{subject_name: string}>;
categories: Array<{subject_name: string; subject_category: string}>;
Expand Down
1 change: 1 addition & 0 deletions src/app/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const formatBookData = <O extends OSWebBook | undefined>(
return {
...pickArchiveFields(archiveBook),
amazon_link: osWebBook.amazon_link,
polish_site_link: osWebBook.polish_site_link,
authors: osWebBook.authors,
book_state: osWebBook.book_state,
categories: osWebBook.book_categories,
Expand Down
1 change: 1 addition & 0 deletions src/app/content/utils/seoUtils.spec.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const mockOsWebBook: OSWebBook = {
promote_image: null,
cnx_id: '',
amazon_link: '',
polish_site_link: '',
};

export const emptyPage = {
Expand Down
2 changes: 1 addition & 1 deletion src/app/content/utils/urlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { findArchiveTreeNodeById, findArchiveTreeNodeByPageParam } from './archi
import { stripIdVersion } from './idUtils';

export function bookDetailsUrl(book: BookWithOSWebData) {
return `/details/books/${book.slug}`;
return book.polish_site_link || `/details/books/${book.slug}`;
}

export const getBookPageUrlAndParams = (
Expand Down
2 changes: 2 additions & 0 deletions src/gateways/createOSWebLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface OSWebBook {
book_categories: Array<{subject_name: string; subject_category: string}>;
cnx_id: string;
amazon_link: string;
polish_site_link: string;
}

interface OSWebResponse {
Expand All @@ -35,6 +36,7 @@ export const fields = [
'publish_date',
'cover_color',
'amazon_link',
'polish_site_link',
'book_state',
'promote_image',
'book_subjects',
Expand Down
1 change: 1 addition & 0 deletions src/test/mocks/osWebLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { OSWebBook } from '../../gateways/createOSWebLoader';

export const mockCmsBook: OSWebBook = {
amazon_link: '',
polish_site_link: '',
authors: [{value: {name: 'Bam Bammerson', senior_author: true}}],
book_categories: [{subject_name: 'test subject', subject_category: 'test category'}],
book_state: 'live',
Expand Down

0 comments on commit c3b0c3e

Please sign in to comment.