guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Allow users to archive a rule #347

Closed Fweddi closed 1 year ago

Fweddi commented 1 year ago

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).