Merge branch 'main' into fizzy-do-prompts
* main: (57 commits) Untenanted access in authenticated controllers should request auth dep: bundle update dep: update Rails dep: bump AR::Tenanted Clean up the cable meta tag Fix activity feed pagination to fetch on demand Create a "published" event if a card is created published Scatter Honcho seeds over a 30 day period Fix the PWA manifest to use slugged URLs Collection publication edits render a turbo frame Collection workflow edits render a turbo frame Collection entropy config edits render a turbo frame Use automatic sizing where supported Introduce a separate controller for collection entropy config Add `card_id` to index Move to scope and inline method Prefer modern syntax Fix that stage should be visible above card background Indicate opens menu Hide dialog targets from screen readers when closed ... # Conflicts: # db/schema.rb # db/schema_cache.yml
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class AddStepsToCards < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :steps do |t|
|
||||
t.references :card, null: false, foreign_key: true
|
||||
t.text :content, null: false
|
||||
t.boolean :completed, default: false, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :steps, :completed
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemovePasswordFromUsers < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
remove_column :users, :password, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddNotNullToAccountsQueenbeeId < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
change_column_null :accounts, :queenbee_id, false
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class ChangeStepsIndex < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
remove_index :steps, :completed
|
||||
add_index :steps, %i[ card_id completed ]
|
||||
end
|
||||
end
|
||||
Generated
+13
-9
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_06_26_000000) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_07_02_211937) do
|
||||
create_table "accesses", force: :cascade do |t|
|
||||
t.datetime "accessed_at"
|
||||
t.integer "collection_id", null: false
|
||||
@@ -28,7 +28,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_06_26_000000) do
|
||||
t.datetime "created_at", null: false
|
||||
t.string "join_code"
|
||||
t.string "name", null: false
|
||||
t.integer "queenbee_id"
|
||||
t.integer "queenbee_id", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["queenbee_id"], name: "index_accounts_on_queenbee_id", unique: true
|
||||
end
|
||||
@@ -133,13 +133,6 @@ ActiveRecord::Schema[8.1].define(version: 2025_06_26_000000) do
|
||||
t.index ["stage_id"], name: "index_cards_on_stage_id"
|
||||
end
|
||||
|
||||
create_table "closers_filters", id: false, force: :cascade do |t|
|
||||
t.integer "closer_id", null: false
|
||||
t.integer "filter_id", null: false
|
||||
t.index ["closer_id"], name: "index_closers_filters_on_closer_id"
|
||||
t.index ["filter_id"], name: "index_closers_filters_on_filter_id"
|
||||
end
|
||||
|
||||
create_table "closure_reasons", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "label"
|
||||
@@ -332,6 +325,16 @@ ActiveRecord::Schema[8.1].define(version: 2025_06_26_000000) do
|
||||
t.index ["user_id"], name: "index_sessions_on_user_id"
|
||||
end
|
||||
|
||||
create_table "steps", force: :cascade do |t|
|
||||
t.integer "card_id", null: false
|
||||
t.boolean "completed", default: false, null: false
|
||||
t.text "content", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["card_id", "completed"], name: "index_steps_on_card_id_and_completed"
|
||||
t.index ["card_id"], name: "index_steps_on_card_id"
|
||||
end
|
||||
|
||||
create_table "taggings", force: :cascade do |t|
|
||||
t.integer "card_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
@@ -407,6 +410,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_06_26_000000) do
|
||||
add_foreign_key "pins", "users"
|
||||
add_foreign_key "search_queries", "users"
|
||||
add_foreign_key "sessions", "users"
|
||||
add_foreign_key "steps", "cards"
|
||||
add_foreign_key "taggings", "cards"
|
||||
add_foreign_key "taggings", "tags"
|
||||
add_foreign_key "watches", "cards"
|
||||
|
||||
+73
-59
@@ -128,7 +128,7 @@ columns:
|
||||
name: queenbee_id
|
||||
cast_type: *3
|
||||
sql_type_metadata: *4
|
||||
'null': true
|
||||
'null': false
|
||||
default:
|
||||
default_function:
|
||||
collation:
|
||||
@@ -451,7 +451,7 @@ columns:
|
||||
default_function:
|
||||
collation:
|
||||
comment:
|
||||
- &31 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
- &33 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: title
|
||||
cast_type: *7
|
||||
@@ -462,18 +462,6 @@ columns:
|
||||
collation:
|
||||
comment:
|
||||
- *9
|
||||
closers_filters:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: closer_id
|
||||
cast_type: *3
|
||||
sql_type_metadata: *4
|
||||
'null': false
|
||||
default:
|
||||
default_function:
|
||||
collation:
|
||||
comment:
|
||||
- *19
|
||||
closure_reasons:
|
||||
- *5
|
||||
- *6
|
||||
@@ -532,11 +520,11 @@ columns:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: all_access
|
||||
cast_type: &32 !ruby/object:ActiveModel::Type::Boolean
|
||||
cast_type: &30 !ruby/object:ActiveModel::Type::Boolean
|
||||
precision:
|
||||
scale:
|
||||
limit:
|
||||
sql_type_metadata: &33 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata
|
||||
sql_type_metadata: &31 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata
|
||||
sql_type: boolean
|
||||
type: :boolean
|
||||
limit:
|
||||
@@ -756,7 +744,7 @@ columns:
|
||||
comment:
|
||||
filters_tags:
|
||||
- *19
|
||||
- &30 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
- &32 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: tag_id
|
||||
cast_type: *3
|
||||
@@ -952,23 +940,48 @@ columns:
|
||||
collation:
|
||||
comment:
|
||||
- *25
|
||||
steps:
|
||||
- *22
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: completed
|
||||
cast_type: *30
|
||||
sql_type_metadata: *31
|
||||
'null': false
|
||||
default: false
|
||||
default_function:
|
||||
collation:
|
||||
comment:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: content
|
||||
cast_type: *15
|
||||
sql_type_metadata: *16
|
||||
'null': false
|
||||
default:
|
||||
default_function:
|
||||
collation:
|
||||
comment:
|
||||
- *5
|
||||
- *6
|
||||
- *9
|
||||
taggings:
|
||||
- *22
|
||||
- *5
|
||||
- *6
|
||||
- *30
|
||||
- *32
|
||||
- *9
|
||||
tags:
|
||||
- *5
|
||||
- *6
|
||||
- *31
|
||||
- *33
|
||||
- *9
|
||||
users:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: active
|
||||
cast_type: *32
|
||||
sql_type_metadata: *33
|
||||
cast_type: *30
|
||||
sql_type_metadata: *31
|
||||
'null': false
|
||||
default: true
|
||||
default_function:
|
||||
@@ -1027,8 +1040,8 @@ columns:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
|
||||
auto_increment:
|
||||
name: watching
|
||||
cast_type: *32
|
||||
sql_type_metadata: *33
|
||||
cast_type: *30
|
||||
sql_type_metadata: *31
|
||||
'null': false
|
||||
default: true
|
||||
default_function:
|
||||
@@ -1079,7 +1092,6 @@ primary_keys:
|
||||
card_engagements: id
|
||||
card_goldnesses: id
|
||||
cards: id
|
||||
closers_filters:
|
||||
closure_reasons: id
|
||||
closures: id
|
||||
collection_publications: id
|
||||
@@ -1101,6 +1113,7 @@ primary_keys:
|
||||
search_queries: id
|
||||
search_results: id
|
||||
sessions: id
|
||||
steps: id
|
||||
taggings: id
|
||||
tags: id
|
||||
users: id
|
||||
@@ -1122,7 +1135,6 @@ data_sources:
|
||||
card_engagements: true
|
||||
card_goldnesses: true
|
||||
cards: true
|
||||
closers_filters: true
|
||||
closure_reasons: true
|
||||
closures: true
|
||||
collection_publications: true
|
||||
@@ -1144,6 +1156,7 @@ data_sources:
|
||||
search_queries: true
|
||||
search_results: true
|
||||
sessions: true
|
||||
steps: true
|
||||
taggings: true
|
||||
tags: true
|
||||
users: true
|
||||
@@ -1542,39 +1555,6 @@ indexes:
|
||||
nulls_not_distinct:
|
||||
comment:
|
||||
valid: true
|
||||
closers_filters:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
|
||||
table: closers_filters
|
||||
name: index_closers_filters_on_closer_id
|
||||
unique: false
|
||||
columns:
|
||||
- closer_id
|
||||
lengths: {}
|
||||
orders: {}
|
||||
opclasses: {}
|
||||
where:
|
||||
type:
|
||||
using:
|
||||
include:
|
||||
nulls_not_distinct:
|
||||
comment:
|
||||
valid: true
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
|
||||
table: closers_filters
|
||||
name: index_closers_filters_on_filter_id
|
||||
unique: false
|
||||
columns:
|
||||
- filter_id
|
||||
lengths: {}
|
||||
orders: {}
|
||||
opclasses: {}
|
||||
where:
|
||||
type:
|
||||
using:
|
||||
include:
|
||||
nulls_not_distinct:
|
||||
comment:
|
||||
valid: true
|
||||
closure_reasons: []
|
||||
closures:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
|
||||
@@ -2303,6 +2283,40 @@ indexes:
|
||||
nulls_not_distinct:
|
||||
comment:
|
||||
valid: true
|
||||
steps:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
|
||||
table: steps
|
||||
name: index_steps_on_card_id
|
||||
unique: false
|
||||
columns:
|
||||
- card_id
|
||||
lengths: {}
|
||||
orders: {}
|
||||
opclasses: {}
|
||||
where:
|
||||
type:
|
||||
using:
|
||||
include:
|
||||
nulls_not_distinct:
|
||||
comment:
|
||||
valid: true
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
|
||||
table: steps
|
||||
name: index_steps_on_card_id_and_completed
|
||||
unique: false
|
||||
columns:
|
||||
- card_id
|
||||
- completed
|
||||
lengths: {}
|
||||
orders: {}
|
||||
opclasses: {}
|
||||
where:
|
||||
type:
|
||||
using:
|
||||
include:
|
||||
nulls_not_distinct:
|
||||
comment:
|
||||
valid: true
|
||||
taggings:
|
||||
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
|
||||
table: taggings
|
||||
@@ -2438,4 +2452,4 @@ indexes:
|
||||
comment:
|
||||
valid: true
|
||||
workflows: []
|
||||
version: 20250626000000
|
||||
version: 20250702211937
|
||||
|
||||
+4
-1
@@ -1,5 +1,8 @@
|
||||
raise "Seeding is just for development" unless Rails.env.development?
|
||||
|
||||
require "active_support/testing/time_helpers"
|
||||
include ActiveSupport::Testing::TimeHelpers
|
||||
|
||||
# Seed DSL
|
||||
def seed_account(name)
|
||||
print " #{name}…"
|
||||
@@ -9,7 +12,7 @@ end
|
||||
|
||||
def create_tenant(signal_account_name)
|
||||
signal_account = SignalId::Account.find_by_product_and_name!("fizzy", signal_account_name)
|
||||
tenant_name = signal_account.subdomain
|
||||
tenant_name = signal_account.queenbee_id
|
||||
|
||||
ApplicationRecord.destroy_tenant tenant_name
|
||||
ApplicationRecord.create_tenant(tenant_name) do
|
||||
|
||||
+15
-5
@@ -50,19 +50,29 @@ collections = [
|
||||
"Documentation"
|
||||
]
|
||||
|
||||
time_range = (60 .. 30.days.in_minutes)
|
||||
|
||||
collections.each_with_index do |collection_name, index|
|
||||
create_collection(collection_name, access_to: authors.sample(3)).tap do |collection|
|
||||
# Create 20 unique cards for each collection
|
||||
card_titles.each do |title|
|
||||
create_card(title,
|
||||
description: "#{title} for #{collection_name} phase #{index + 1}.",
|
||||
collection: collection
|
||||
).tap do |card|
|
||||
travel(-rand(time_range).minutes) do
|
||||
card = create_card title,
|
||||
description: "#{title} for #{collection_name} phase #{index + 1}.",
|
||||
collection: collection,
|
||||
creator: authors.sample
|
||||
|
||||
# Randomly assign to 1-2 authors
|
||||
travel rand(0..20).minutes
|
||||
card.toggle_assignment(authors.sample)
|
||||
card.toggle_assignment(authors.sample) if rand > 0.5
|
||||
|
||||
if rand > 0.5
|
||||
travel rand(0..20).minutes
|
||||
card.toggle_assignment(authors.sample)
|
||||
end
|
||||
|
||||
# Randomly set card state
|
||||
travel rand(0..20).minutes
|
||||
case rand(3)
|
||||
when 0
|
||||
card.engage
|
||||
|
||||
Reference in New Issue
Block a user