Skip to content

Commit

Permalink
Merge pull request #59 from maxfordham/57-issue-history-saving-problem
Browse files Browse the repository at this point in the history
57 issue history saving problem
  • Loading branch information
ollyhensby authored Jun 17, 2024
2 parents 661d578 + 0310a0c commit 0190f81
Show file tree
Hide file tree
Showing 20 changed files with 293 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ def construct_title_block_data(
"",
document_issue.current_issue.status_code,
document_issue.current_issue.revision,
document_issue.current_issue.status_description,
document_issue.current_issue.status_description.replace(
"Suitable for ", ""
).replace(
"Issued for ", ""
), # TODO: Need to deal with length of status codes more robustly
"",
"",
document_code,
Expand Down
56 changes: 54 additions & 2 deletions packages/document-issue-io/tests/test_markdown_document_issue.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import pytest
import shutil
import datetime
from polyfactory.factories.pydantic_factory import ModelFactory

from document_issue.document_issue import DocumentIssue
from document_issue.document_issue import DocumentIssue, Issue
from document_issue.issue import StatusRevisionEnum
from document_issue_io.markdown_document_issue import (
MarkdownDocumentIssue,
document_issue_md_to_pdf,
Expand Down Expand Up @@ -162,7 +164,57 @@ def test_to_pdf_loads_of_notes_and_issues(self):
FDIR_RENDER.mkdir(parents=True, exist_ok=True)
document_issue = create_test_document_issue()
document_issue.document_role = document_issue.document_role * 5
document_issue.issue_history = document_issue.issue_history * 10
document_issue.issue_history = document_issue.issue_history * 5
document_issue.issue_history += [
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S1_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S2_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S3_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S4_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S5_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S6_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S7_P,
date=datetime.date(2024, 1, 1),
),
Issue(
author="OH",
checked_by="JG",
status_revision=StatusRevisionEnum.S8_P,
date=datetime.date(2024, 1, 2),
),
]
document_issue.notes[2] = document_issue.notes[2] * 5
document_issue.notes = document_issue.notes * 5
document_issue.format_configuration.output_author = True
Expand Down
15 changes: 8 additions & 7 deletions packages/document-issue-io/tests/testoutput/test_to_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ document_description: A description of a Max Fordham Project
document_code: 06667-MXF-XX-XX-SH-M-20003
name_nomenclature: project-originator-volume-level-type-role-number
current_issue:
date: 2020-01-02
date: 2023-12-01
revision: P01
status_code: S0
status_description: Initial Status
Expand Down Expand Up @@ -53,6 +53,8 @@ Fordham LLP\
+================+====================+
| OH | Director in Charge |
+----------------+--------------------+
| | Project Engineer |
+----------------+--------------------+

: {tbl-colwidths="[30,70]"}

Expand All @@ -62,13 +64,12 @@ Fordham LLP\

### Issue History

+------------+-----------+--------------+-------------------+-----------------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** |
+============+===========+==============+===================+=======================+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note |
+------------+-----------+--------------+-------------------+-----------------------+
+------------+-----------+--------------+--------------------------+-----------------------+--------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** | **Author** |
+============+===========+==============+==========================+=======================+==============+
| 01 DEC 23 | P01 | S2 | Suitable for information | This is an issue note | OH |
+------------+-----------+--------------+--------------------------+-----------------------+--------------+

: {tbl-colwidths="[12,5,7.5,30,45.5]"}


### Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ document_description: A description of a Max Fordham Project
document_code: 06667-MXF-XX-XX-SH-M-20003
name_nomenclature: project-originator-volume-level-type-role-number
current_issue:
date: 2020-01-02
date: 2024-04-04
revision: P01
status_code: S0
status_description: Initial Status
Expand Down Expand Up @@ -53,6 +53,10 @@ Fordham LLP\
+================+====================+
| OH | Director in Charge |
+----------------+--------------------+
| 9605 | Project Engineer |
+----------------+--------------------+
| 02ce | Project Engineer |
+----------------+--------------------+

: {tbl-colwidths="[30,70]"}

Expand All @@ -62,11 +66,11 @@ Fordham LLP\

### Issue History

+------------+-----------+--------------+-------------------+-----------------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** |
+============+===========+==============+===================+=======================+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note |
+------------+-----------+--------------+-------------------+-----------------------+
+------------+-----------+--------------+--------------------------+-----------------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** |
+============+===========+==============+==========================+=======================+
| 04 APR 24 | P01 | S2 | Suitable for information | This is an issue note |
+------------+-----------+--------------+--------------------------+-----------------------+

: {tbl-colwidths="[12,5,7.5,30,45.5]"}

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ document_description: A description of a Max Fordham Project
document_code: 06667-MXF-XX-XX-SH-M-20003
name_nomenclature: project-originator-volume-level-type-role-number
current_issue:
date: 2020-01-02
date: 2024-01-02
revision: P01
status_code: S0
status_description: Initial Status
status_code: S8
status_description: Suitable for AIM Authorization
footer-logo: footer-logo.png
title-page: title-page.pdf
---
Expand Down Expand Up @@ -48,19 +48,39 @@ Fordham LLP\

### Contributions

+----------------+--------------------+
| **Initials** | **Role** |
+================+====================+
| OH | Director in Charge |
+----------------+--------------------+
| OH | Director in Charge |
+----------------+--------------------+
| OH | Director in Charge |
+----------------+--------------------+
| OH | Director in Charge |
+----------------+--------------------+
| OH | Director in Charge |
+----------------+--------------------+
+----------------+----------------------+
| **Initials** | **Role** |
+================+======================+
| OH | Director in Charge |
+----------------+----------------------+
| b | BIM Strategy Advisor |
+----------------+----------------------+
| 87 | Acoustician |
+----------------+----------------------+
| OH | Director in Charge |
+----------------+----------------------+
| b | BIM Strategy Advisor |
+----------------+----------------------+
| 87 | Acoustician |
+----------------+----------------------+
| OH | Director in Charge |
+----------------+----------------------+
| b | BIM Strategy Advisor |
+----------------+----------------------+
| 87 | Acoustician |
+----------------+----------------------+
| OH | Director in Charge |
+----------------+----------------------+
| b | BIM Strategy Advisor |
+----------------+----------------------+
| 87 | Acoustician |
+----------------+----------------------+
| OH | Director in Charge |
+----------------+----------------------+
| b | BIM Strategy Advisor |
+----------------+----------------------+
| 87 | Acoustician |
+----------------+----------------------+

: {tbl-colwidths="[30,70]"}

Expand All @@ -70,29 +90,35 @@ Fordham LLP\

### Issue History

+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** | **Author** | **Checker** |
+============+===========+==============+===================+=======================+==============+===============+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH | JG |
+------------+-----------+--------------+-------------------+-----------------------+--------------+---------------+
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** | **Author** | **Checker** |
+============+===========+==============+====================================+=======================+==============+===============+
| 02 JAN 24 | P01 | S8 | Suitable for AIM Authorization | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S1 | Suitable for Coordination | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S2 | Suitable for Information | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S3 | Suitable for Review and Comment | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S4 | Suitable for Stage Approval | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S5 | Suitable for Review and Acceptance | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S6 | Withdrawn | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 01 JAN 24 | P01 | S7 | Suitable for PIM Authorization | | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 12 FEB 20 | P01 | S2 | Suitable for information | This is an issue note | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 12 FEB 20 | P01 | S2 | Suitable for information | This is an issue note | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 12 FEB 20 | P01 | S2 | Suitable for information | This is an issue note | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 12 FEB 20 | P01 | S2 | Suitable for information | This is an issue note | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+
| 12 FEB 20 | P01 | S2 | Suitable for information | This is an issue note | OH | JG |
+------------+-----------+--------------+------------------------------------+-----------------------+--------------+---------------+

: {tbl-colwidths="[12,5,7.5,30,30,7,8.5]"}

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ document_description: A description of a Max Fordham Project
document_code: 06667-MXF-XX-XX-SH-M-20003
name_nomenclature: project-originator-volume-level-type-role-number
current_issue:
date: 2020-01-02
date: 2020-03-07
revision: P01
status_code: S0
status_description: Initial Status
Expand Down Expand Up @@ -48,11 +48,15 @@ Fordham LLP\

### Contributions

+----------------+--------------------+
| **Initials** | **Role** |
+================+====================+
| OH | Director in Charge |
+----------------+--------------------+
+----------------+------------------------------------+
| **Initials** | **Role** |
+================+====================================+
| OH | Director in Charge |
+----------------+------------------------------------+
| 37 | Lead Building Performance Modeller |
+----------------+------------------------------------+
| | Lead Sustainability Consultant |
+----------------+------------------------------------+

: {tbl-colwidths="[30,70]"}

Expand All @@ -62,11 +66,11 @@ Fordham LLP\

### Issue History

+------------+-----------+--------------+-------------------+-----------------------+--------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** | **Author** |
+============+===========+==============+===================+=======================+==============+
| 02 JAN 20 | P01 | S0 | Initial Status | This is an issue note | OH |
+------------+-----------+--------------+-------------------+-----------------------+--------------+
+------------+-----------+--------------+--------------------------+-----------------------+--------------+
| **Date** | **Rev** | **Status** | **Description** | **Issue Notes** | **Author** |
+============+===========+==============+==========================+=======================+==============+
| 07 MAR 20 | P01 | S2 | Suitable for information | This is an issue note | OH |
+------------+-----------+--------------+--------------------------+-----------------------+--------------+

: {tbl-colwidths="[12,5,7.5,30,35,10.5]"}

Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 0190f81

Please sign in to comment.