Skip to content

Commit 44bb584

Browse files
authored
Merge pull request #248 from WycliffeAssociates/fix-for-aba-phi
Handle many more heart languages that have unusual repo URL patterns
2 parents 6bb6c52 + eb2ae48 commit 44bb584

File tree

7 files changed

+249
-22
lines changed

7 files changed

+249
-22
lines changed

backend/doc/domain/resource_lookup.py

Lines changed: 200 additions & 9 deletions
Large diffs are not rendered by default.

backend/stet/data/stet_en.docx

-151 Bytes
Binary file not shown.

backend/stet/data/stet_pt-br.docx

8 Bytes
Binary file not shown.

frontend/src/routes/books/+page.svelte

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import DesktopBookDisplay from './DesktopBookDisplay.svelte'
1717
import Modal from '$lib/Modal.svelte'
1818
import ProgressIndicator from '$lib/ProgressIndicator.svelte'
19+
import { errorStore } from '$lib/stores/NotificationStore'
1920
2021
async function getSharedBookCodesAndNames(
2122
lang0Code: string,
@@ -109,7 +110,11 @@
109110
}
110111
}
111112
})
112-
.catch((err) => console.error(err))
113+
.catch((err) => {
114+
console.error(err)
115+
// Stop progress bar
116+
$errorStore = err
117+
})
113118
} else {
114119
getBookCodesAndNames($langCodesStore[0])
115120
.then((bookCodesAndNames) => {
@@ -149,7 +154,11 @@
149154
})
150155
}
151156
})
152-
.catch((err) => console.error(err))
157+
.catch((err) => {
158+
console.error(err)
159+
// Stop progress bar
160+
$errorStore = err
161+
})
153162
}
154163
155164
// Derive and set the count of books for use here and in other
@@ -218,7 +227,6 @@
218227
<svelte:window bind:innerWidth={windowWidth} />
219228

220229
<WizardBreadcrumb />
221-
222230
<!-- container for "center" div -->
223231
<div class="flex flex-grow flex-row overflow-y-auto overflow-x-hidden">
224232
<!-- center -->
@@ -230,7 +238,7 @@
230238
Select books
231239
</h3>
232240
<div class="ml-4 mt-2 flex items-center bg-white px-2 py-2">
233-
{#if !otBookCodes || !ntBookCodes}
241+
{#if !$errorStore && (!otBookCodes || !ntBookCodes)}
234242
<div class="ml-4">
235243
<ProgressIndicator
236244
labelString="Acquiring and analyzing books available for
@@ -499,7 +507,27 @@
499507
{/if}
500508
</div>
501509

502-
{#if $langCountStore > 0}
510+
{#if $errorStore}
511+
<div class="bg-white">
512+
<svg
513+
class="m-auto"
514+
width="44"
515+
height="38"
516+
viewBox="0 0 44 38"
517+
fill="none"
518+
xmlns="http://www.w3.org/2000/svg"
519+
>
520+
<path d="M24 24H20V14H24V24ZM24 32H20V28H24V32ZM0 38H44L22 0L0 38Z" fill="#B85659" />
521+
</svg>
522+
<div class="m-auto"><h3 class="text-center text-[#B85659]">Uh Oh...</h3></div>
523+
<div class="m-auto">
524+
<p class="text-xl text-[#B3B9C2]">
525+
Something went wrong. Please review your selections or contact tech support for
526+
assistance.
527+
</p>
528+
</div>
529+
</div>
530+
{:else if $langCountStore > 0}
503531
{#if windowWidth < TAILWIND_SM_MIN_WIDTH}
504532
<MobileBookDisplay
505533
{showOldTestament}

frontend/tests/e2e/test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,19 @@ test('test optional settings', async ({ page }) => {
149149
await page.getByRole('button', { name: '▶ Show Optional Settings' }).click()
150150
await expect(page.getByRole('main')).toContainText('Use chapter labels, e.g., \'Chapter 1\' instead of \'1\'')
151151
})
152+
153+
154+
test('test aba philemon', async ({ page }) => {
155+
await page.goto('http://localhost:8001/')
156+
await page.getByRole('button', { name: 'Heart' }).click()
157+
await page.getByText('Abé aba').click()
158+
await page.getByRole('button', { name: 'Next' }).click()
159+
await page.getByText('Philémon').click()
160+
await page.getByRole('button', { name: 'Next' }).click()
161+
await page.getByText('Bible').click()
162+
await page.getByRole('button', { name: 'Next' }).click()
163+
await page.getByText('PDF').click()
164+
await page.getByRole('button', { name: 'Generate File' }).click()
165+
await expect(page.locator('body')).toContainText('Philémon')
166+
await expect(page.locator('body')).toContainText('Bible (aba)')
167+
})

tests/unit/test_parsing.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from doc.domain.parsing import ensure_chapter_label, ensure_chapter_marker
55

66

7-
@pytest.mark.focus
87
def test_ensure_chapter_marker_unchanged_if_exists() -> None:
98
chapter_num = 5
109

@@ -20,7 +19,6 @@ def test_ensure_chapter_marker_unchanged_if_exists() -> None:
2019
)
2120

2221

23-
@pytest.mark.focus
2422
def test_ensure_chapter_marker_inserted_at_beginning() -> None:
2523
chapter_num = 5
2624
# Case 2: No chapter marker, insert at beginning
@@ -40,7 +38,6 @@ def test_ensure_chapter_marker_inserted_at_beginning() -> None:
4038
assert actual_output == expected_output
4139

4240

43-
@pytest.mark.focus
4441
def test_ensure_chapter_marker_inserted_at_before_chapter_label() -> None:
4542
chapter_num = 5
4643
# Case 3: Chapter marker missing, but \cl exists (insert before \cl)
@@ -52,7 +49,6 @@ def test_ensure_chapter_marker_inserted_at_before_chapter_label() -> None:
5249
assert actual_output == expected_output
5350

5451

55-
@pytest.mark.focus
5652
def test_ensure_chapter_marker_inserted() -> None:
5753
chapter_num = 5
5854

@@ -65,7 +61,6 @@ def test_ensure_chapter_marker_inserted() -> None:
6561
assert actual_output == expected_output
6662

6763

68-
@pytest.mark.focus
6964
def test_adds_missing_chapter_label() -> None:
7065
input_text = "\n\\c 1\n\\v 1 In the beginning..."
7166
expected_output = "\n\n\\c 1\n\\cl Chapter 1\n\n\\v 1 In the beginning..."
@@ -75,14 +70,12 @@ def test_adds_missing_chapter_label() -> None:
7570
assert actual_output == expected_output
7671

7772

78-
@pytest.mark.focus
7973
def test_keeps_existing_chapter_label() -> None:
8074
input_text = "\n\\c 1\n\\cl Chapter\n\\v 1 In the beginning..."
8175
expected_output = "\n\\c 1\n\\cl Chapter 1\n\\v 1 In the beginning..."
8276
assert ensure_chapter_label(input_text, 1) == expected_output
8377

8478

85-
@pytest.mark.focus
8679
def test_no_chapter_marker() -> None:
8780
input_text = "\n\\v 1 In the beginning..."
8881
assert ensure_chapter_label(input_text, 1) == input_text

tests/unit/test_usfm_error_detection_and_fixes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ def test_fix_space_after_section_marker(self) -> None:
632632
r"\s5 5Some text.",
633633
)
634634

635-
@pytest.mark.focus
636635
@pytest.mark.usfm_fixes
637636
def test_replace_cc_with_c(self) -> None:
638637
expected_output = r"""

0 commit comments

Comments
 (0)