ShtukbaseStandard
package page→ /work/approvals.md

pages/work/approvals.md

40 lines, 1.6 KB. As a page.

  1. ---
  2. type: Collection
  3. title: Approvals
  4. description: "The agent asks, the person answers: one record is one command that the agent will run only after a \"yes\"."
  5. itemType: Approval
  6. items: {mode: path, path: /work/approvals, recursive: false}
  7. writeTo: /work/approvals
  8. properties:
  9. command: {kind: text, label: "Command (exactly the one that will be run)"}
  10. why: {kind: text, label: "What will happen and whether it can be rolled back"}
  11. askedOn: {kind: date, label: "Asked"}
  12. answer:
  13. kind: select
  14. label: "Person's answer"
  15. options:
  16. - {name: "yes", label: "Yes", color: green}
  17. - {name: "no", label: "No", color: red}
  18. answeredOn: {kind: date, label: "Answered"}
  19. usedOn: {kind: date, label: "Used"}
  20. views:
  21. - id: approvals--table
  22. name: All approvals
  23. layout: table
  24. fields: {}
  25. sorting:
  26. - {propertyId: askedOn, direction: descending}
  27. properties:
  28. - {name: title, visible: true, width: 360}
  29. - {name: command, visible: true, width: 320}
  30. - {name: answer, visible: true}
  31. - {name: askedOn, visible: true}
  32. - {name: answeredOn, visible: true}
  33. - {name: usedOn, visible: true}
  34. ---
  35. The agent creates a record when the hook did not let through a command from the [gate list](/base/human-gate.md). In the header: `title` is what and why, `command` is exactly that command, `why` is what will happen and whether it can be rolled back, and `askedOn`.
  36. The person answers in the same record: `answer: yes` or `answer: no` and `answeredOn`. The agent does not write these fields: the hook will not let it.
  37. One "yes" lets one run through: the hook writes `usedOn` into the record. A repeat needs a new record.