Some UX improvements
This commit is contained in:
parent
48c0067076
commit
8c81237501
81 changed files with 791 additions and 151 deletions
|
|
@ -1,5 +1,5 @@
|
|||
class Check < ApplicationRecord
|
||||
enum :level, %i[A AA AAA]
|
||||
validates :position, :name, :success_criterion, :level, presence: true
|
||||
validates :position, numericality: { less_than: 200 }
|
||||
|
||||
has_rich_text :success_criterion_html
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,5 +2,7 @@ class Checklist < ApplicationRecord
|
|||
has_many :checklist_entries, -> { order(position: :asc) }, dependent: :destroy, inverse_of: :checklist
|
||||
has_many :checks, through: :checklist_entries
|
||||
|
||||
accepts_nested_attributes_for :checklist_entries
|
||||
has_rich_text :description_html
|
||||
|
||||
accepts_nested_attributes_for :checklist_entries, reject_if: :all_blank, allow_destroy: true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
class Element < ApplicationRecord
|
||||
attr_accessor :checklist_id
|
||||
|
||||
has_rich_text :description_html
|
||||
|
||||
belongs_to :report
|
||||
has_many :success_criteria, dependent: :destroy
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
class Report < ApplicationRecord
|
||||
has_many :elements, dependent: :destroy
|
||||
|
||||
has_rich_text :comment_html
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
class SuccessCriterion < ApplicationRecord
|
||||
enum :result, %i[passed failed not_applicable]
|
||||
|
||||
has_rich_text :comment_html
|
||||
has_rich_text :description_html
|
||||
|
||||
belongs_to :element
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue