Adds an archive button. When a rule is archived, we set the rule as archived in the draft table. If there's a corresponding active rule in the live table, we set that rule as inactive.
It is worth nothing that we are mutating live rules here (previously each new version of a rule has been inserted as a new row). We think is okay, as we are modifying the 'is_active' column, rather than the rule contents.
The UX is a first pass - awaiting final design.
How to test
The automated tests should pass.
Try archiving draft and live rules using the archive button (prior to https://github.com/guardian/typerighter/pull/335, you may need to make rules live using Postman / Postgres). The status in the Rules table should change correspondingly.
In future passes we hope to add the ability to filter out archived rules, the ability to unarchive a rule, and the ability to see the archive action in the publication history (this last part might be a little complex given we do not model archiving on the live rule itself).
What does this change?
Adds an archive button. When a rule is archived, we set the rule as archived in the draft table. If there's a corresponding active rule in the live table, we set that rule as inactive.
https://github.com/guardian/typerighter/assets/40991816/e2f4cc99-3740-4960-b152-9e36275a44b6
It is worth nothing that we are mutating live rules here (previously each new version of a rule has been inserted as a new row). We think is okay, as we are modifying the 'is_active' column, rather than the rule contents.
The UX is a first pass - awaiting final design.
How to test
In future passes we hope to add the ability to filter out archived rules, the ability to unarchive a rule, and the ability to see the archive action in the publication history (this last part might be a little complex given we do not model archiving on the live rule itself).