cdisc-org / conformance-rules-editor

MIT License
6 stars 3 forks source link

There needs to be protections for published rules in editor #236

Open SFJohnson24 opened 1 week ago

SFJohnson24 commented 1 week ago

In looking through editor with Gerry, the saveRule and deleteRule functions in Controls.ts, the modified and original rule are sent as payloads. We could modify to add a check for published status of the rule.
There is already a dialog for deletion, setDeleteDialog. We would need one for edits--this is also in the Controls. The old rule ID and new rule ID could be displayed. A red warning image could also be used to further draw attention to this.

chowsanthony commented 1 week ago

Can we also capture a reason when a published rule is being deleted or modified? Prompting the user to provide a reason encourages them to think twice before proceeding. This safeguard helps prevent both accidental and intentional actions. The reason, along with a timestamp and username, will be stored for recordkeeping purposes. The reason text will have a minimum length requirement to prevent junk.

SFJohnson24 commented 1 week ago

@chowsanthony we could also do this yes. We will need to setup a new collection to store the username/rule/reason in the DB and a new endpoint to send the requests to for storage but I dont think grabbing the info and storing it should be a big lift.