From 5a1ee3831afbd94a1fd5231050c490c2eaa37a94 Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Sat, 17 Aug 2024 16:09:16 +0200 Subject: [PATCH 1/9] fix all tables in newNodes before replacing oldNode --- indigo_app/static/javascript/indigo/models.js | 1 + 1 file changed, 1 insertion(+) diff --git a/indigo_app/static/javascript/indigo/models.js b/indigo_app/static/javascript/indigo/models.js index 6e3f8afe7..1aee82417 100644 --- a/indigo_app/static/javascript/indigo/models.js +++ b/indigo_app/static/javascript/indigo/models.js @@ -80,6 +80,7 @@ * @param {Element[]} newNodes the nodes to replace the old one with, or null to delete the node */ replaceNode: function(oldNode, newNodes) { + indigoAkn.fixTables(newNodes); var del = !newNodes; var first = del ? null : newNodes[0]; From 797ff62a6d7ad5aa19e769274dfb7ec94994a8be Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:19:37 +0200 Subject: [PATCH 2/9] pass an empty list, not null, as newNodes if empty --- indigo_app/static/javascript/indigo/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indigo_app/static/javascript/indigo/models.js b/indigo_app/static/javascript/indigo/models.js index 1aee82417..a544c61ce 100644 --- a/indigo_app/static/javascript/indigo/models.js +++ b/indigo_app/static/javascript/indigo/models.js @@ -80,7 +80,7 @@ * @param {Element[]} newNodes the nodes to replace the old one with, or null to delete the node */ replaceNode: function(oldNode, newNodes) { - indigoAkn.fixTables(newNodes); + indigoAkn.fixTables(newNodes || []); var del = !newNodes; var first = del ? null : newNodes[0]; From 670dcaec07aa8e4dab1cb06951ec19cd3f8a02fb Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Sun, 18 Aug 2024 14:07:07 +0200 Subject: [PATCH 3/9] update resize_tables to match fixTables in indigo-akn --- indigo_api/exporters.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/indigo_api/exporters.py b/indigo_api/exporters.py index 9a858d684..cd3c4da12 100644 --- a/indigo_api/exporters.py +++ b/indigo_api/exporters.py @@ -395,19 +395,11 @@ def resize_tables(self, doc): """ Ensure that tables have the correct number of columns and rows, otherwise PDF generation fails. """ + # there should never be a completely empty row -- check for this first for table in doc.root.xpath('//a:table', namespaces={'a': doc.namespace}): - # a cell can't span more rows than actually come after it - # there should also never be a completely empty row -- check for this first for row in table.xpath('a:tr', namespaces={'a': doc.namespace}): if not row.xpath('a:td|a:th', namespaces={'a': doc.namespace}): table.remove(row) - for row in table.xpath('a:tr', namespaces={'a': doc.namespace}): - actual = len(list(row.itersiblings(f'{{{doc.namespace}}}tr'))) - for cell in row.xpath('a:td[@rowspan] | a:th[@rowspan]', namespaces={'a': doc.namespace}): - rowspan = int(cell.get('rowspan', 1)) - if rowspan > 1: - # rowspan is the smaller of the current rowspan, and the actual number of rows (plus this one) - cell.set('rowspan', str(min(rowspan, actual + 1))) matrix = self.map_table(table, doc) @@ -426,7 +418,9 @@ def resize_tables(self, doc): missing_cells = n_cols - len(matrix[y]) for x in range(missing_cells): log.debug(f"Adding missing cell in table {table.get('eId')} on row {y+1}") - row.append(doc.maker('td')) + cell = doc.maker('td') + cell.append(doc.maker('p')) + row.append(cell) # update the matrix for x in range(n_cols): matrix[y][x] = True From 0b577a8ce604186723a52070f65ba5339265d41a Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Sun, 18 Aug 2024 17:16:34 +0200 Subject: [PATCH 4/9] update test outputs to match new behaviour --- .../pdf_fixtures/tables/bad_spans_out.xml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml b/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml index 75f3f5691..38d153f77 100644 --- a/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml +++ b/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml @@ -8,13 +8,13 @@ - - + - + - - -
+

Nature of ownership
or control the
beneficial owner has
in the company ,
whether individually
or jointly*

.The percentage of issued shares a person holds in the company - Directly.........%of shares
-Indirectly.........%of shares

The percentage of voting rights a person holds in the company 
- Directly.........%of shares
-Indirectly.........%of shares

@@ -24,18 +24,18 @@

.A person holds a right to appoint or remove a majority of the members of the board of directors of the company : 
- Directly
-Indirectly

A person exercises significant influence or control over the company.
- Directly
-Indirectly

+

.A person holds the highest percentage of the issued
shares but does not meet the above
four criteria . 
- Directly.........%of shares
-Indirectly.........%of shares

+

+

- +
@@ -180,14 +180,14 @@

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +

Part C: Details of owner(s)(If different from applicant)

Full name(s)

@@ -195,7 +195,7 @@

Physical address(es)

@@ -206,7 +206,7 @@

@@ -217,7 +217,7 @@

E-mail

@@ -225,7 +225,7 @@

Tel.

@@ -242,12 +242,12 @@

Part D: Property details (In accordance with title deed)

Property description (Number(s) of Erf/ Erven/Portion(s) or Farm(s))

@@ -255,7 +255,7 @@

Physical address

@@ -269,7 +269,7 @@

Current zoning

@@ -300,7 +300,7 @@

Title deed number and date

@@ -311,7 +311,7 @@

Any restrictive conditions?

@@ -328,7 +328,7 @@

Is the property encumbered by a bond?

@@ -345,12 +345,12 @@

Part E: Pre-application consultation (regulation 11)

Has there been any pre-application consultation?

@@ -364,7 +364,7 @@

If yes, complete the information below and attach the minutes of the pre-application consultation.

Official’s name

@@ -375,7 +375,7 @@

Date of consultation

@@ -543,7 +543,7 @@ - +

From 6635b379047b507a2f7b9b176f44b932b6bdd4e9 Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:27:09 +0200 Subject: [PATCH 5/9] handle overlapping spans for PDF; add more bad spans tests --- indigo_api/exporters.py | 6 +- .../pdf_fixtures/tables/bad_spans_in.xml | 364 ++++++++++++++++++ .../pdf_fixtures/tables/bad_spans_out.xml | 364 ++++++++++++++++++ 3 files changed, 733 insertions(+), 1 deletion(-) diff --git a/indigo_api/exporters.py b/indigo_api/exporters.py index cd3c4da12..8f5e31647 100644 --- a/indigo_api/exporters.py +++ b/indigo_api/exporters.py @@ -544,7 +544,11 @@ def cells(r): # mark matrix elements occupied by current cell with true for xx in range(x, x + int(cell.get('colspan', 1))): for yy in range(y, y + int(cell.get('rowspan', 1))): - matrix[yy][xx] = True + # skip already occupied cells due to overlapping spans + xxx = xx + while matrix[yy][xxx]: + xxx += 1 + matrix[yy][xxx] = True return matrix diff --git a/indigo_api/tests/pdf_fixtures/tables/bad_spans_in.xml b/indigo_api/tests/pdf_fixtures/tables/bad_spans_in.xml index a4bcc3cf3..aeb5e32e5 100644 --- a/indigo_api/tests/pdf_fixtures/tables/bad_spans_in.xml +++ b/indigo_api/tests/pdf_fixtures/tables/bad_spans_in.xml @@ -547,6 +547,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

No.

+
+

Security plan

+
+

Check box

+
+

1.

+
+

The floor plan of the proposed site or area.

+
+

Yes

+
+

No

+
+

2.

+
+

The access point (entry and exit).

+
+

Yes

+
+

No

+
+

3.

+
+

The entry/ exit point to be manned at all times.

+
+

Yes

+
+

No

+
+

4.

+
+

Patrons to be searched at point of arrival and departure.

+
+

Yes

+
+

No

+
+

5.

+
+

Storage facilities for licensed firearms to be provided.

+
+

Yes

+
+

No

+
+

6.

+
+

The point of sale to be cordoned off (indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

7.

+
+

The restricted part for consumption of liquor to be cordoned off (to be indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

8.

+
+

Parking to be provided.

+
+

Yes

+
+

No

+
+

9.

+
+

Ablution facilities for males and females to be provided.

+
+

Yes

+
+

No

+
+

+

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

1. Details of licensed outlet or premises

+
+

(a) Name of outlet:

+
+

(b) Trade name/s (if any):

+
+

(c) Registration number:

+
+

(d) Name of the metropolitan municipality/district municipality or local municipality where the licensed premises are situated:

+
+

(e) Physical business address of applicant:

+
+

2. Personal details of the applicant

+
+

(a) Names and surname:

+
+

(b) Designation of applicant:

+
+

(c) Contact details:

+
+

Cell: __________________________ Tel: __________________________ Fax: __________________________ Email: _________________________________

+
+

(Please attach certified copies of the documents requested in terms of regulation 25(3) to this form)

+

1. During the past 12 months, has the applicant, or any person holding an interest in the applicant, become disqualified from holding this liquor licence, as contemplated in section 40 of the Act?

+
+

Yes

+
+

No

+
+

2. If the answer to the above question is in the affirmative, please provide details of any decision taken by the relevant provincial licensing authority in terms of section 40 of the Act

+
+

3. Has the applicant or any of its owners, directors or subsidiaries been indicted or charged with any criminal offence, excluding traffic offences, during the past 12 months?

+
+

Yes

+
+

No

+
+

+

+

4. Has the applicant or any of its subsidiaries been a party to a law suit during the past 12 months?

+
+

If yes, provide details: __________________________

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Notice of intention to apply for a liquor licence for the undermentioned premises and proof of service

+

Name of premises

+

_____________________________________________________________

+
+

Physical address of the premises:

+

_____________________________________________________________

+

______________________________________________________________

+

Category of licence ________________________________________

+

Type of premises ________________________________________

+
+

Full name

+
+

Surname

+
+

I.D. Number

+
+

Full address

+
+

Signature

+
+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

diff --git a/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml b/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml index 38d153f77..fb89b93b1 100644 --- a/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml +++ b/indigo_api/tests/pdf_fixtures/tables/bad_spans_out.xml @@ -545,6 +545,370 @@

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

No.

+
+

Security plan

+
+

Check box

+
+

1.

+
+

The floor plan of the proposed site or area.

+
+

Yes

+
+

No

+
+

2.

+
+

The access point (entry and exit).

+
+

Yes

+
+

No

+
+

3.

+
+

The entry/ exit point to be manned at all times.

+
+

Yes

+
+

No

+
+

4.

+
+

Patrons to be searched at point of arrival and departure.

+
+

Yes

+
+

No

+
+

5.

+
+

Storage facilities for licensed firearms to be provided.

+
+

Yes

+
+

No

+
+

6.

+
+

The point of sale to be cordoned off (indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

7.

+
+

The restricted part for consumption of liquor to be cordoned off (to be indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

8.

+
+

Parking to be provided.

+
+

Yes

+
+

No

+
+

9.

+
+

Ablution facilities for males and females to be provided.

+
+

Yes

+
+

No

+
+

+

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

1. Details of licensed outlet or premises

+
+

(a) Name of outlet:

+
+

(b) Trade name/s (if any):

+
+

(c) Registration number:

+
+

(d) Name of the metropolitan municipality/district municipality or local municipality where the licensed premises are situated:

+
+

(e) Physical business address of applicant:

+
+

2. Personal details of the applicant

+
+

(a) Names and surname:

+
+

(b) Designation of applicant:

+
+

(c) Contact details:

+
+

Cell: __________________________ Tel: __________________________ Fax: __________________________ Email: _________________________________

+
+

(Please attach certified copies of the documents requested in terms of regulation 25(3) to this form)

+

1. During the past 12 months, has the applicant, or any person holding an interest in the applicant, become disqualified from holding this liquor licence, as contemplated in section 40 of the Act?

+
+

Yes

+
+

No

+
+

2. If the answer to the above question is in the affirmative, please provide details of any decision taken by the relevant provincial licensing authority in terms of section 40 of the Act

+
+

3. Has the applicant or any of its owners, directors or subsidiaries been indicted or charged with any criminal offence, excluding traffic offences, during the past 12 months?

+
+

Yes

+
+

No

+
+

+

+

4. Has the applicant or any of its subsidiaries been a party to a law suit during the past 12 months?

+
+

If yes, provide details: __________________________

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Notice of intention to apply for a liquor licence for the undermentioned premises and proof of service

+

Name of premises

+

_____________________________________________________________

+

+

Physical address of the premises:

+

_____________________________________________________________

+

______________________________________________________________

+

Category of licence ________________________________________

+

Type of premises ________________________________________

+

+

Full name

+
+

Surname

+
+

I.D. Number

+
+

Full address

+
+

Signature

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

From 6c3d10dc86b41bb88497257d96c8e586e1af1d91 Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:35:56 +0200 Subject: [PATCH 6/9] add adjustment test output to PDF generation test input --- indigo_api/tests/pdf_fixtures/tables_in.xml | 364 +++++++++ indigo_api/tests/pdf_fixtures/tables_out.xml | 778 +++++++++++++++++++ 2 files changed, 1142 insertions(+) diff --git a/indigo_api/tests/pdf_fixtures/tables_in.xml b/indigo_api/tests/pdf_fixtures/tables_in.xml index 9fa879c1c..c11b56c8a 100644 --- a/indigo_api/tests/pdf_fixtures/tables_in.xml +++ b/indigo_api/tests/pdf_fixtures/tables_in.xml @@ -668,6 +668,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

No.

+
+

Security plan

+
+

Check box

+
+

1.

+
+

The floor plan of the proposed site or area.

+
+

Yes

+
+

No

+
+

2.

+
+

The access point (entry and exit).

+
+

Yes

+
+

No

+
+

3.

+
+

The entry/ exit point to be manned at all times.

+
+

Yes

+
+

No

+
+

4.

+
+

Patrons to be searched at point of arrival and departure.

+
+

Yes

+
+

No

+
+

5.

+
+

Storage facilities for licensed firearms to be provided.

+
+

Yes

+
+

No

+
+

6.

+
+

The point of sale to be cordoned off (indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

7.

+
+

The restricted part for consumption of liquor to be cordoned off (to be indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

8.

+
+

Parking to be provided.

+
+

Yes

+
+

No

+
+

9.

+
+

Ablution facilities for males and females to be provided.

+
+

Yes

+
+

No

+
+

+

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

1. Details of licensed outlet or premises

+
+

(a) Name of outlet:

+
+

(b) Trade name/s (if any):

+
+

(c) Registration number:

+
+

(d) Name of the metropolitan municipality/district municipality or local municipality where the licensed premises are situated:

+
+

(e) Physical business address of applicant:

+
+

2. Personal details of the applicant

+
+

(a) Names and surname:

+
+

(b) Designation of applicant:

+
+

(c) Contact details:

+
+

Cell: __________________________ Tel: __________________________ Fax: __________________________ Email: _________________________________

+
+

(Please attach certified copies of the documents requested in terms of regulation 25(3) to this form)

+

1. During the past 12 months, has the applicant, or any person holding an interest in the applicant, become disqualified from holding this liquor licence, as contemplated in section 40 of the Act?

+
+

Yes

+
+

No

+
+

2. If the answer to the above question is in the affirmative, please provide details of any decision taken by the relevant provincial licensing authority in terms of section 40 of the Act

+
+

3. Has the applicant or any of its owners, directors or subsidiaries been indicted or charged with any criminal offence, excluding traffic offences, during the past 12 months?

+
+

Yes

+
+

No

+
+

+

+

4. Has the applicant or any of its subsidiaries been a party to a law suit during the past 12 months?

+
+

If yes, provide details: __________________________

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Notice of intention to apply for a liquor licence for the undermentioned premises and proof of service

+

Name of premises

+

_____________________________________________________________

+

+

Physical address of the premises:

+

_____________________________________________________________

+

______________________________________________________________

+

Category of licence ________________________________________

+

Type of premises ________________________________________

+

+

Full name

+
+

Surname

+
+

I.D. Number

+
+

Full address

+
+

Signature

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

diff --git a/indigo_api/tests/pdf_fixtures/tables_out.xml b/indigo_api/tests/pdf_fixtures/tables_out.xml index bfb22dc62..5a8c5a363 100644 --- a/indigo_api/tests/pdf_fixtures/tables_out.xml +++ b/indigo_api/tests/pdf_fixtures/tables_out.xml @@ -1319,6 +1319,784 @@ + + + + + + + + + + No. + + + + + Security plan + + + + + Check box + + + + + + + + + 1. + + + + + The floor plan of the proposed site or area. + + + + + Yes + + + + + No + + + + + + + 2. + + + + + The access point (entry and exit). + + + + + Yes + + + + + No + + + + + + + 3. + + + + + The entry/ exit point to be manned at all times. + + + + + Yes + + + + + No + + + + + + + 4. + + + + + Patrons to be searched at point of arrival and departure. + + + + + Yes + + + + + No + + + + + + + 5. + + + + + Storage facilities for licensed firearms to be provided. + + + + + Yes + + + + + No + + + + + + + 6. + + + + + The point of sale to be cordoned off (indicated on the floor plan submitted). + + + + + Yes + + + + + No + + + + + + + 7. + + + + + The restricted part for consumption of liquor to be cordoned off (to be indicated on the floor plan submitted). + + + + + Yes + + + + + No + + + + + + + 8. + + + + + Parking to be provided. + + + + + Yes + + + + + No + + + + + + + 9. + + + + + Ablution facilities for males and females to be provided. + + + + + Yes + + + + + No + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1. Details of licensed outlet or premises + + + + + + + + + (a) Name of outlet: + + + + + + + (b) Trade name/s (if any): + + + + + + + (c) Registration number: + + + + + + + (d) Name of the metropolitan municipality/district municipality or local municipality where the licensed premises are situated: + + + + + + + (e) Physical business address of applicant: + + + + + + + 2. Personal details of the applicant + + + + + + + (a) Names and surname: + + + + + + + (b) Designation of applicant: + + + + + + + (c) Contact details: + + + + + + + Cell: __________________________ Tel: __________________________ Fax: __________________________ Email: _________________________________ + + + + + + + + + (Please attach certified copies of the documents requested in terms of regulation 25(3) to this form) + + + 1. During the past 12 months, has the applicant, or any person holding an interest in the applicant, become disqualified from holding this liquor licence, as contemplated in section 40 of the Act? + + + + + + + Yes + + + + + No + + + + + + + 2. If the answer to the above question is in the affirmative, please provide details of any decision taken by the relevant provincial licensing authority in terms of section 40 of the Act + + + + + + + 3. Has the applicant or any of its owners, directors or subsidiaries been indicted or charged with any criminal offence, excluding traffic offences, during the past 12 months? + + + + + + + Yes + + + + + No + + + + + + + + + + + + + + + + + + + 4. Has the applicant or any of its subsidiaries been a party to a law suit during the past 12 months? + + + + + + + If yes, provide details: __________________________ + + + + + + + + + + + + + + + + + + + + + + Notice of intention to apply for a liquor licence for the undermentioned premises and proof of service + + Name of premises + _____________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Physical address of the premises: + _____________________________________________________________ + ______________________________________________________________ + Category of licence ________________________________________ + Type of premises ________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Full name + + + + + Surname + + + + + I.D. Number + + + + + Full address + + + + + Signature + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3c77129c844d5c6f3cda932b2ba8944f6960e07f Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:09:59 +0200 Subject: [PATCH 7/9] show fixes or error when fixing tables on update --- indigo_app/static/javascript/indigo/models.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/indigo_app/static/javascript/indigo/models.js b/indigo_app/static/javascript/indigo/models.js index a544c61ce..7c75f41aa 100644 --- a/indigo_app/static/javascript/indigo/models.js +++ b/indigo_app/static/javascript/indigo/models.js @@ -80,7 +80,15 @@ * @param {Element[]} newNodes the nodes to replace the old one with, or null to delete the node */ replaceNode: function(oldNode, newNodes) { - indigoAkn.fixTables(newNodes || []); + try { + let fixes = indigoAkn.fixTables(newNodes || []); + if (fixes.length) { + Indigo.errorView.show("These tables have been fixed:", "

"); + } + } catch (e) { + Indigo.errorView.show(e); + return; + } var del = !newNodes; var first = del ? null : newNodes[0]; From ad4d9e82620a621aeb9a00f4f6a3e9f2574274de Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:12:04 +0200 Subject: [PATCH 8/9] use indigo-akn 5.6.0 (includes fixTables) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a13425637..262d29876 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@fortawesome/fontawesome-free": "^5.2.0", "@lawsafrica/bluebell-monaco": "^4.7.3", - "@lawsafrica/indigo-akn": "^5.5.0", + "@lawsafrica/indigo-akn": "^5.6.0", "@lawsafrica/law-widgets": "^2.0.1", "bootstrap-select": "^1.13.18", "bower": "^1.8.8", From 3eacb1025d261d0b653cd9c8ad0c8d96910e4e13 Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:23:09 +0200 Subject: [PATCH 9/9] =?UTF-8?q?install=20indigo-akn=20=C3=825.6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92a09e542..24b684c66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "devDependencies": { "@fortawesome/fontawesome-free": "^5.2.0", "@lawsafrica/bluebell-monaco": "^4.7.3", - "@lawsafrica/indigo-akn": "^5.5.0", + "@lawsafrica/indigo-akn": "^5.6.0", "@lawsafrica/law-widgets": "^2.0.1", "bootstrap-select": "^1.13.18", "bower": "^1.8.8", @@ -683,9 +683,9 @@ } }, "node_modules/@lawsafrica/indigo-akn": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@lawsafrica/indigo-akn/-/indigo-akn-5.5.0.tgz", - "integrity": "sha512-5AS1vqY4mxS0yTNtys+zbO2801AouYDCx45Q/BRX8gN3q0v6WIFJ7riy+78b2QyToKhXvBLXsceJtWJFicqkVA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@lawsafrica/indigo-akn/-/indigo-akn-5.6.0.tgz", + "integrity": "sha512-0OMbQYxHNnQMwjMmJPe81H6TtFIDVxcRfwvb+Luj/w+lZI/YZx5kj6+Cl4ZKV4w4WSTj51YzxDbEbd7U/p6zXg==", "dev": true, "dependencies": { "@lawsafrica/dom-anchor-text-quote": "^5.0.0", @@ -7020,9 +7020,9 @@ } }, "@lawsafrica/indigo-akn": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@lawsafrica/indigo-akn/-/indigo-akn-5.5.0.tgz", - "integrity": "sha512-5AS1vqY4mxS0yTNtys+zbO2801AouYDCx45Q/BRX8gN3q0v6WIFJ7riy+78b2QyToKhXvBLXsceJtWJFicqkVA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@lawsafrica/indigo-akn/-/indigo-akn-5.6.0.tgz", + "integrity": "sha512-0OMbQYxHNnQMwjMmJPe81H6TtFIDVxcRfwvb+Luj/w+lZI/YZx5kj6+Cl4ZKV4w4WSTj51YzxDbEbd7U/p6zXg==", "dev": true, "requires": { "@lawsafrica/dom-anchor-text-quote": "^5.0.0",