From 723e6d94f52056fd67223c3f8884ba5b6fa3ba80 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 9 Apr 2025 14:50:49 +0200 Subject: [PATCH 1/7] Rename bubbles => cards --- .../images/{bubble-add.svg => card-add.svg} | 0 app/assets/images/{bubbles.svg => cards.svg} | 0 app/assets/images/{pop.svg => closure.svg} | 0 app/assets/stylesheets/animation.css | 4 +- app/assets/stylesheets/bubbles.css | 48 +- app/assets/stylesheets/cards.css | 64 +- .../stylesheets/{popup.css => closureup.css} | 0 .../{buckets.css => collections.css} | 10 +- app/assets/stylesheets/color-picker.css | 2 +- app/assets/stylesheets/events.css | 4 +- app/assets/stylesheets/icons.css | 6 +- app/assets/stylesheets/pins.css | 6 +- app/assets/stylesheets/workflows.css | 12 +- .../bubbles/assignments_controller.rb | 10 - app/controllers/bubbles/boosts_controller.rb | 12 - .../bubbles/engagements_controller.rb | 13 - app/controllers/bubbles/images_controller.rb | 8 - app/controllers/bubbles/pops_controller.rb | 13 - .../bubbles/publishes_controller.rb | 8 - .../bubbles/readings_controller.rb | 13 - .../bubbles/recovers_controller.rb | 7 - .../bubbles/stagings_controller.rb | 11 - app/controllers/bubbles/watches_controller.rb | 13 - app/controllers/bubbles_controller.rb | 71 -- .../buckets/involvements_controller.rb | 7 - .../buckets/workflows_controller.rb | 16 - app/controllers/buckets_controller.rb | 50 -- .../cards/assignments_controller.rb | 10 + app/controllers/cards/boosts_controller.rb | 12 + app/controllers/cards/closures_controller.rb | 13 + .../cards/engagements_controller.rb | 13 + app/controllers/cards/images_controller.rb | 8 + .../{bubbles => cards}/pins_controller.rb | 12 +- app/controllers/cards/publishes_controller.rb | 8 + app/controllers/cards/readings_controller.rb | 13 + app/controllers/cards/recovers_controller.rb | 7 + app/controllers/cards/stagings_controller.rb | 11 + .../{bubbles => cards}/taggings_controller.rb | 6 +- app/controllers/cards/watches_controller.rb | 13 + app/controllers/cards_controller.rb | 71 ++ .../collections/involvements_controller.rb | 7 + .../collections/workflows_controller.rb | 16 + app/controllers/collections_controller.rb | 50 ++ .../comments/reactions_controller.rb | 2 +- app/controllers/comments_controller.rb | 8 +- app/controllers/concerns/bubble_scoped.rb | 16 - app/controllers/concerns/bucket_filterable.rb | 24 - app/controllers/concerns/bucket_scoped.rb | 12 - app/controllers/concerns/card_scoped.rb | 16 + .../concerns/collection_filterable.rb | 24 + app/controllers/concerns/collection_scoped.rb | 12 + app/controllers/concerns/events_timeline.rb | 12 +- app/controllers/events_controller.rb | 4 +- app/controllers/filters_controller.rb | 4 +- app/controllers/my/pins_controller.rb | 2 +- .../notifications/settings_controller.rb | 2 +- app/controllers/terminals_controller.rb | 6 +- app/helpers/accesses_helper.rb | 28 +- app/helpers/bubbles_helper.rb | 24 - app/helpers/cards_helper.rb | 24 + app/helpers/comments_helper.rb | 4 +- app/helpers/events_helper.rb | 38 +- app/helpers/filters_helper.rb | 10 +- app/helpers/messages_helper.rb | 6 +- app/helpers/notifications_helper.rb | 6 +- app/helpers/translations_helper.rb | 2 +- app/helpers/workflows_helper.rb | 6 +- ..._controller.js => card_size_controller.js} | 12 +- ...ontroller.js => closureover_controller.js} | 0 .../controllers/local_save_controller.js | 2 +- .../controllers/paste_controller.js | 2 +- .../auto_closure_all_due_job.rb} | 4 +- .../auto_reconsider_all_stagnated_job.rb | 4 +- app/jobs/remove_abandoned_creations_job.rb | 2 +- app/models/access.rb | 2 +- app/models/account.rb | 6 +- .../{pop_reasons.rb => closure_reasons.rb} | 10 +- app/models/assignment.rb | 2 +- app/models/bubble/engagement.rb | 3 - app/models/bubble/poppable.rb | 56 -- app/models/bucket.rb | 21 - app/models/bucket/broadcastable.rb | 8 - app/models/{bubble.rb => card.rb} | 14 +- app/models/{bubble => card}/assignable.rb | 2 +- app/models/{bubble => card}/boostable.rb | 2 +- app/models/card/closeable.rb | 56 ++ app/models/{bubble => card}/colored.rb | 2 +- app/models/{bubble => card}/commentable.rb | 2 +- app/models/{bubble => card}/engageable.rb | 8 +- app/models/card/engagement.rb | 3 + app/models/{bubble => card}/eventable.rb | 4 +- app/models/{bubble => card}/messages.rb | 2 +- app/models/{bubble => card}/pinnable.rb | 2 +- app/models/{bubble => card}/scorable.rb | 6 +- app/models/{bubble => card}/searchable.rb | 8 +- app/models/{bubble => card}/staged.rb | 2 +- app/models/{bubble => card}/statuses.rb | 10 +- app/models/{bubble => card}/taggable.rb | 4 +- app/models/{bubble => card}/watchable.rb | 4 +- app/models/closure.rb | 4 + app/models/closure/reason.rb | 3 + app/models/collection.rb | 21 + .../{bucket => collection}/accessible.rb | 4 +- app/models/collection/broadcastable.rb | 8 + app/models/comment.rb | 14 +- app/models/concerns/filter/params.rb | 4 +- app/models/concerns/messageable.rb | 2 +- app/models/event.rb | 4 +- app/models/event_summary.rb | 4 +- app/models/filter.rb | 20 +- app/models/filter/params.rb | 4 +- app/models/filter/resources.rb | 6 +- app/models/filter/summarized.rb | 8 +- app/models/message.rb | 6 +- app/models/notification.rb | 2 +- app/models/notifier.rb | 10 +- app/models/notifier/assigned.rb | 2 +- app/models/notifier/closed.rb | 2 + app/models/notifier/popped.rb | 2 - app/models/notifier/published.rb | 2 +- app/models/pin.rb | 2 +- app/models/pop.rb | 4 - app/models/pop/reason.rb | 3 - app/models/tag.rb | 2 +- app/models/tagging.rb | 2 +- app/models/user.rb | 4 +- app/models/user/accessor.rb | 10 +- app/models/user/assignee.rb | 2 +- app/models/watch.rb | 2 +- app/presenters/bucket_filter_presenter.rb | 29 - app/presenters/collection_filter_presenter.rb | 29 + app/views/bubbles/_comments.html.erb | 6 - app/views/bubbles/_date.html.erb | 9 - app/views/bubbles/_publish.html.erb | 3 - .../assignments/create.turbo_stream.erb | 1 - app/views/bubbles/boosts/_boosts.html.erb | 10 - .../bubbles/boosts/create.turbo_stream.erb | 7 - app/views/bubbles/cards/_mini.html.erb | 22 - app/views/bubbles/cards/_perma.html.erb | 44 -- app/views/bubbles/cards/_preview.html.erb | 31 - .../bubbles/cards/common/_background.html.erb | 11 - app/views/bubbles/cards/mini/_tags.html.erb | 1 - .../bubbles/cards/perma/_assignees.html.erb | 3 - .../bubbles/cards/perma/_boosts.html.erb | 3 - app/views/bubbles/cards/perma/_meta.html.erb | 3 - .../bubbles/cards/perma/_people.html.erb | 3 - .../bubbles/cards/preview/_assignees.html.erb | 1 - .../bubbles/cards/preview/_boosts.html.erb | 8 - .../bubbles/cards/preview/_meta.html.erb | 3 - .../bubbles/cards/preview/_people.html.erb | 3 - .../bubbles/cards/preview/_tags.html.erb | 12 - app/views/bubbles/index.html.erb | 14 - .../bubbles/index/_buckets_filter.html.erb | 23 - app/views/bubbles/stagings/_stages.html.erb | 9 - .../bubbles/stagings/create.turbo_stream.erb | 3 - .../bubbles/taggings/create.turbo_stream.erb | 1 - app/views/bubbles/watches/show.html.erb | 13 - app/views/buckets/_bucket.html.erb | 27 - .../buckets/involvements/update.html.erb | 1 - .../_closure_toggle.html.erb} | 20 +- app/views/{bubbles => cards}/_color.html.erb | 4 +- app/views/cards/_comments.html.erb | 6 + app/views/cards/_date.html.erb | 9 + .../_display_count_selector.html.erb | 0 .../{bubbles => cards}/_filters.html.erb | 0 app/views/{bubbles => cards}/_image.html.erb | 6 +- .../{bubbles => cards}/_messages.html.erb | 10 +- app/views/cards/_publish.html.erb | 3 + .../cards/assignments/create.turbo_stream.erb | 1 + .../assignments/new.html.erb | 8 +- app/views/cards/boosts/_boosts.html.erb | 10 + .../cards/boosts/create.turbo_stream.erb | 7 + app/views/cards/cards/_mini.html.erb | 22 + app/views/cards/cards/_perma.html.erb | 44 ++ app/views/cards/cards/_preview.html.erb | 31 + .../cards/common/_assignees.html.erb | 6 +- .../cards/cards/common/_background.html.erb | 11 + .../cards/common/_meta.html.erb | 12 +- .../cards/common/_people.html.erb | 2 +- .../cards/mini/_assignees.html.erb | 6 +- app/views/cards/cards/mini/_tags.html.erb | 1 + .../cards/cards/perma/_assignees.html.erb | 3 + app/views/cards/cards/perma/_boosts.html.erb | 3 + app/views/cards/cards/perma/_meta.html.erb | 3 + app/views/cards/cards/perma/_people.html.erb | 3 + .../cards/perma/_tags.html.erb | 14 +- .../cards/cards/preview/_assignees.html.erb | 1 + .../cards/cards/preview/_boosts.html.erb | 8 + app/views/cards/cards/preview/_meta.html.erb | 3 + .../cards/cards/preview/_people.html.erb | 3 + .../cards/preview/_stages.html.erb | 4 +- app/views/cards/cards/preview/_tags.html.erb | 12 + app/views/{bubbles => cards}/edit.html.erb | 6 +- app/views/cards/index.html.erb | 14 + .../cards/index/_collections_filter.html.erb | 23 + .../{bubbles => cards}/index/_header.html.erb | 18 +- .../index/_sorting_options.html.erb | 2 +- .../index/_workflow_filter.html.erb | 4 +- .../index/cards/_closed.html.erb} | 4 +- .../index/cards}/_considering.html.erb | 4 +- .../index/cards}/_doing.html.erb | 8 +- .../{bubbles => cards}/pins/show.html.erb | 8 +- .../readings/create.turbo_stream.erb | 0 app/views/{bubbles => cards}/show.html.erb | 62 +- app/views/cards/stagings/_stages.html.erb | 9 + .../cards/stagings/create.turbo_stream.erb | 3 + .../cards/taggings/create.turbo_stream.erb | 1 + .../{bubbles => cards}/taggings/new.html.erb | 8 +- .../tags/_listbox_option.html.erb | 2 +- app/views/cards/watches/show.html.erb | 13 + .../_access_toggle.erb | 0 app/views/collections/_collection.html.erb | 27 + .../{buckets => collections}/edit.html.erb | 24 +- .../collections/involvements/update.html.erb | 1 + .../{buckets => collections}/new.html.erb | 6 +- app/views/comments/_body.html.erb | 4 +- app/views/comments/_new.html.erb | 6 +- app/views/comments/create.html.erb | 2 +- app/views/comments/edit.html.erb | 8 +- .../comments/reactions/_reaction.html.erb | 2 +- .../comments/reactions/_reactions.html.erb | 2 +- app/views/comments/reactions/new.html.erb | 4 +- app/views/events/_event.html.erb | 14 +- app/views/events/_filter.html.erb | 12 +- app/views/events/index.html.erb | 8 +- app/views/filters/_assignees.html.erb | 4 +- app/views/filters/_broadcasts.html.erb | 8 +- ...buckets.html.erb => _collections.html.erb} | 18 +- app/views/filters/_creators.html.erb | 4 +- app/views/filters/_dialog.html.erb | 16 +- app/views/filters/_filter.html.erb | 24 +- app/views/filters/_indexed_by.html.erb | 2 +- app/views/filters/_settings.html.erb | 4 +- app/views/filters/_stages.html.erb | 2 +- app/views/filters/_tags.html.erb | 4 +- app/views/my/pins/_pin.html.erb | 22 +- .../notifications/_notification.html.erb | 2 +- ...{_bucket.html.erb => _collection.html.erb} | 6 +- .../notifications/settings/show.html.erb | 2 +- app/views/pwa/manifest.json.erb | 2 +- app/views/tags/index.html.erb | 2 +- app/views/terminals/_event.html.erb | 2 +- app/views/terminals/edit.html.erb | 2 +- app/views/users/show.html.erb | 4 +- config/recurring.yml | 6 +- config/routes.rb | 18 +- config/storage.yml | 4 +- .../20250409043626_rename_bubbles_to_cards.rb | 53 ++ db/schema.rb | 134 ++-- db/schema_cache.yml | 634 +++++++++--------- script/closureulate/collections_and_cards.rb | 17 + ...ons.rb => fill_account_closure_reasons.rb} | 2 +- script/populate/buckets_and_bubbles.rb | 17 - script/remove_duplicated_tags.rb | 4 +- script/renaming/content.rb | 64 ++ script/renaming/files.rb | 75 +++ .../bubbles/assignments_controller_test.rb | 24 - .../bubbles/boosts_controller_test.rb | 27 - .../bubbles/engagements_controller_test.rb | 27 - .../bubbles/pins_controller_test.rb | 31 - .../bubbles/pops_controller_test.rb | 29 - .../bubbles/publishes_controller_test.rb | 18 - .../bubbles/taggings_controller_test.rb | 26 - .../bubbles/watches_controller_test.rb | 27 - test/controllers/bubbles_controller_test.rb | 65 -- .../buckets/involvements_controller_test.rb | 18 - .../buckets/workflows_controller_test.rb | 16 - test/controllers/buckets_controller_test.rb | 63 -- .../cards/assignments_controller_test.rb | 24 + .../cards/boosts_controller_test.rb | 27 + .../cards/closures_controller_test.rb | 29 + .../cards/engagements_controller_test.rb | 27 + .../controllers/cards/pins_controller_test.rb | 31 + .../cards/publishes_controller_test.rb | 18 + .../readings_controller_test.rb | 4 +- .../cards/taggings_controller_test.rb | 26 + .../cards/watches_controller_test.rb | 27 + test/controllers/cards_controller_test.rb | 65 ++ .../involvements_controller_test.rb | 18 + .../collections/workflows_controller_test.rb | 16 + .../collections_controller_test.rb | 63 ++ test/controllers/comments_controller_test.rb | 8 +- test/controllers/events_controller_test.rb | 6 +- test/controllers/filters_controller_test.rb | 12 +- test/controllers/my/pins_controller_test.rb | 2 +- test/controllers/reactions_controller_test.rb | 6 +- test/controllers/recovers_controller_test.rb | 14 +- test/fixtures/accesses.yml | 6 +- test/fixtures/assignments.yml | 6 +- .../fixtures/{bubble => card}/engagements.yml | 2 +- test/fixtures/{bubbles.yml => cards.yml} | 8 +- test/fixtures/{pops.yml => closures.yml} | 2 +- .../fixtures/{buckets.yml => collections.yml} | 0 test/fixtures/events.yml | 32 +- test/fixtures/messages.yml | 18 +- test/fixtures/notifications.yml | 6 +- test/fixtures/pins.yml | 4 +- test/fixtures/taggings.yml | 8 +- test/fixtures/watches.yml | 18 +- test/integration/bubble_messages.rb | 50 -- test/integration/card_messages.rb | 50 ++ test/models/account/closure_reasons_test.rb | 8 + test/models/account/pop_reasons_test.rb | 8 - test/models/bubble/assignable_test.rb | 15 - test/models/bubble/commentable_test.rb | 14 - test/models/bubble/engageable_test.rb | 63 -- test/models/bubble/eventable_test.rb | 21 - test/models/bubble/messages_test.rb | 46 -- test/models/bubble/poppable_test.rb | 31 - test/models/bubble/scorable_test.rb | 90 --- test/models/bubble/searchable_test.rb | 24 - test/models/bubble/statuses_test.rb | 61 -- test/models/bubble/taggable_test.rb | 19 - test/models/bubble/watchable_test.rb | 43 -- test/models/bubble_test.rb | 147 ---- test/models/bucket_test.rb | 33 - test/models/card/assignable_test.rb | 15 + test/models/card/closeable_test.rb | 31 + test/models/card/commentable_test.rb | 14 + test/models/card/engageable_test.rb | 63 ++ test/models/card/eventable_test.rb | 21 + test/models/card/messages_test.rb | 46 ++ test/models/card/scorable_test.rb | 90 +++ test/models/card/searchable_test.rb | 24 + test/models/card/statuses_test.rb | 61 ++ test/models/card/taggable_test.rb | 19 + test/models/card/watchable_test.rb | 43 ++ test/models/card_test.rb | 147 ++++ test/models/collection_test.rb | 33 + test/models/comment_test.rb | 40 +- test/models/filter_test.rb | 66 +- test/models/notifier_test.rb | 14 +- test/models/user_test.rb | 4 +- 333 files changed, 3012 insertions(+), 2820 deletions(-) rename app/assets/images/{bubble-add.svg => card-add.svg} (100%) rename app/assets/images/{bubbles.svg => cards.svg} (100%) rename app/assets/images/{pop.svg => closure.svg} (100%) rename app/assets/stylesheets/{popup.css => closureup.css} (100%) rename app/assets/stylesheets/{buckets.css => collections.css} (85%) delete mode 100644 app/controllers/bubbles/assignments_controller.rb delete mode 100644 app/controllers/bubbles/boosts_controller.rb delete mode 100644 app/controllers/bubbles/engagements_controller.rb delete mode 100644 app/controllers/bubbles/images_controller.rb delete mode 100644 app/controllers/bubbles/pops_controller.rb delete mode 100644 app/controllers/bubbles/publishes_controller.rb delete mode 100644 app/controllers/bubbles/readings_controller.rb delete mode 100644 app/controllers/bubbles/recovers_controller.rb delete mode 100644 app/controllers/bubbles/stagings_controller.rb delete mode 100644 app/controllers/bubbles/watches_controller.rb delete mode 100644 app/controllers/bubbles_controller.rb delete mode 100644 app/controllers/buckets/involvements_controller.rb delete mode 100644 app/controllers/buckets/workflows_controller.rb delete mode 100644 app/controllers/buckets_controller.rb create mode 100644 app/controllers/cards/assignments_controller.rb create mode 100644 app/controllers/cards/boosts_controller.rb create mode 100644 app/controllers/cards/closures_controller.rb create mode 100644 app/controllers/cards/engagements_controller.rb create mode 100644 app/controllers/cards/images_controller.rb rename app/controllers/{bubbles => cards}/pins_controller.rb (60%) create mode 100644 app/controllers/cards/publishes_controller.rb create mode 100644 app/controllers/cards/readings_controller.rb create mode 100644 app/controllers/cards/recovers_controller.rb create mode 100644 app/controllers/cards/stagings_controller.rb rename app/controllers/{bubbles => cards}/taggings_controller.rb (59%) create mode 100644 app/controllers/cards/watches_controller.rb create mode 100644 app/controllers/cards_controller.rb create mode 100644 app/controllers/collections/involvements_controller.rb create mode 100644 app/controllers/collections/workflows_controller.rb create mode 100644 app/controllers/collections_controller.rb delete mode 100644 app/controllers/concerns/bubble_scoped.rb delete mode 100644 app/controllers/concerns/bucket_filterable.rb delete mode 100644 app/controllers/concerns/bucket_scoped.rb create mode 100644 app/controllers/concerns/card_scoped.rb create mode 100644 app/controllers/concerns/collection_filterable.rb create mode 100644 app/controllers/concerns/collection_scoped.rb delete mode 100644 app/helpers/bubbles_helper.rb create mode 100644 app/helpers/cards_helper.rb rename app/javascript/controllers/{bubble_size_controller.js => card_size_controller.js} (69%) rename app/javascript/controllers/{popover_controller.js => closureover_controller.js} (100%) rename app/jobs/{bubble/auto_pop_all_due_job.rb => card/auto_closure_all_due_job.rb} (57%) rename app/jobs/{bubble => card}/auto_reconsider_all_stagnated_job.rb (50%) rename app/models/account/{pop_reasons.rb => closure_reasons.rb} (58%) delete mode 100644 app/models/bubble/engagement.rb delete mode 100644 app/models/bubble/poppable.rb delete mode 100644 app/models/bucket.rb delete mode 100644 app/models/bucket/broadcastable.rb rename app/models/{bubble.rb => card.rb} (81%) rename app/models/{bubble => card}/assignable.rb (97%) rename app/models/{bubble => card}/boostable.rb (92%) create mode 100644 app/models/card/closeable.rb rename app/models/{bubble => card}/colored.rb (87%) rename app/models/{bubble => card}/commentable.rb (93%) rename app/models/{bubble => card}/engageable.rb (82%) create mode 100644 app/models/card/engagement.rb rename app/models/{bubble => card}/eventable.rb (86%) rename app/models/{bubble => card}/messages.rb (97%) rename app/models/{bubble => card}/pinnable.rb (92%) rename app/models/{bubble => card}/scorable.rb (92%) rename app/models/{bubble => card}/searchable.rb (75%) rename app/models/{bubble => card}/staged.rb (95%) rename app/models/{bubble => card}/statuses.rb (66%) rename app/models/{bubble => card}/taggable.rb (83%) rename app/models/{bubble => card}/watchable.rb (88%) create mode 100644 app/models/closure.rb create mode 100644 app/models/closure/reason.rb create mode 100644 app/models/collection.rb rename app/models/{bucket => collection}/accessible.rb (85%) create mode 100644 app/models/collection/broadcastable.rb create mode 100644 app/models/notifier/closed.rb delete mode 100644 app/models/notifier/popped.rb delete mode 100644 app/models/pop.rb delete mode 100644 app/models/pop/reason.rb delete mode 100644 app/presenters/bucket_filter_presenter.rb create mode 100644 app/presenters/collection_filter_presenter.rb delete mode 100644 app/views/bubbles/_comments.html.erb delete mode 100644 app/views/bubbles/_date.html.erb delete mode 100644 app/views/bubbles/_publish.html.erb delete mode 100644 app/views/bubbles/assignments/create.turbo_stream.erb delete mode 100644 app/views/bubbles/boosts/_boosts.html.erb delete mode 100644 app/views/bubbles/boosts/create.turbo_stream.erb delete mode 100644 app/views/bubbles/cards/_mini.html.erb delete mode 100644 app/views/bubbles/cards/_perma.html.erb delete mode 100644 app/views/bubbles/cards/_preview.html.erb delete mode 100644 app/views/bubbles/cards/common/_background.html.erb delete mode 100644 app/views/bubbles/cards/mini/_tags.html.erb delete mode 100644 app/views/bubbles/cards/perma/_assignees.html.erb delete mode 100644 app/views/bubbles/cards/perma/_boosts.html.erb delete mode 100644 app/views/bubbles/cards/perma/_meta.html.erb delete mode 100644 app/views/bubbles/cards/perma/_people.html.erb delete mode 100644 app/views/bubbles/cards/preview/_assignees.html.erb delete mode 100644 app/views/bubbles/cards/preview/_boosts.html.erb delete mode 100644 app/views/bubbles/cards/preview/_meta.html.erb delete mode 100644 app/views/bubbles/cards/preview/_people.html.erb delete mode 100644 app/views/bubbles/cards/preview/_tags.html.erb delete mode 100644 app/views/bubbles/index.html.erb delete mode 100644 app/views/bubbles/index/_buckets_filter.html.erb delete mode 100644 app/views/bubbles/stagings/_stages.html.erb delete mode 100644 app/views/bubbles/stagings/create.turbo_stream.erb delete mode 100644 app/views/bubbles/taggings/create.turbo_stream.erb delete mode 100644 app/views/bubbles/watches/show.html.erb delete mode 100644 app/views/buckets/_bucket.html.erb delete mode 100644 app/views/buckets/involvements/update.html.erb rename app/views/{bubbles/_pop_toggle.html.erb => cards/_closure_toggle.html.erb} (58%) rename app/views/{bubbles => cards}/_color.html.erb (86%) create mode 100644 app/views/cards/_comments.html.erb create mode 100644 app/views/cards/_date.html.erb rename app/views/{bubbles => cards}/_display_count_selector.html.erb (100%) rename app/views/{bubbles => cards}/_filters.html.erb (100%) rename app/views/{bubbles => cards}/_image.html.erb (69%) rename app/views/{bubbles => cards}/_messages.html.erb (50%) create mode 100644 app/views/cards/_publish.html.erb create mode 100644 app/views/cards/assignments/create.turbo_stream.erb rename app/views/{bubbles => cards}/assignments/new.html.erb (59%) create mode 100644 app/views/cards/boosts/_boosts.html.erb create mode 100644 app/views/cards/boosts/create.turbo_stream.erb create mode 100644 app/views/cards/cards/_mini.html.erb create mode 100644 app/views/cards/cards/_perma.html.erb create mode 100644 app/views/cards/cards/_preview.html.erb rename app/views/{bubbles => cards}/cards/common/_assignees.html.erb (55%) create mode 100644 app/views/cards/cards/common/_background.html.erb rename app/views/{bubbles => cards}/cards/common/_meta.html.erb (59%) rename app/views/{bubbles => cards}/cards/common/_people.html.erb (84%) rename app/views/{bubbles => cards}/cards/mini/_assignees.html.erb (58%) create mode 100644 app/views/cards/cards/mini/_tags.html.erb create mode 100644 app/views/cards/cards/perma/_assignees.html.erb create mode 100644 app/views/cards/cards/perma/_boosts.html.erb create mode 100644 app/views/cards/cards/perma/_meta.html.erb create mode 100644 app/views/cards/cards/perma/_people.html.erb rename app/views/{bubbles => cards}/cards/perma/_tags.html.erb (50%) create mode 100644 app/views/cards/cards/preview/_assignees.html.erb create mode 100644 app/views/cards/cards/preview/_boosts.html.erb create mode 100644 app/views/cards/cards/preview/_meta.html.erb create mode 100644 app/views/cards/cards/preview/_people.html.erb rename app/views/{bubbles => cards}/cards/preview/_stages.html.erb (77%) create mode 100644 app/views/cards/cards/preview/_tags.html.erb rename app/views/{bubbles => cards}/edit.html.erb (68%) create mode 100644 app/views/cards/index.html.erb create mode 100644 app/views/cards/index/_collections_filter.html.erb rename app/views/{bubbles => cards}/index/_header.html.erb (59%) rename app/views/{bubbles => cards}/index/_sorting_options.html.erb (90%) rename app/views/{bubbles => cards}/index/_workflow_filter.html.erb (89%) rename app/views/{bubbles/index/bubbles/_popped.html.erb => cards/index/cards/_closed.html.erb} (68%) rename app/views/{bubbles/index/bubbles => cards/index/cards}/_considering.html.erb (73%) rename app/views/{bubbles/index/bubbles => cards/index/cards}/_doing.html.erb (60%) rename app/views/{bubbles => cards}/pins/show.html.erb (50%) rename app/views/{bubbles => cards}/readings/create.turbo_stream.erb (100%) rename app/views/{bubbles => cards}/show.html.erb (58%) create mode 100644 app/views/cards/stagings/_stages.html.erb create mode 100644 app/views/cards/stagings/create.turbo_stream.erb create mode 100644 app/views/cards/taggings/create.turbo_stream.erb rename app/views/{bubbles => cards}/taggings/new.html.erb (67%) rename app/views/{bubbles => cards}/tags/_listbox_option.html.erb (69%) create mode 100644 app/views/cards/watches/show.html.erb rename app/views/{buckets => collections}/_access_toggle.erb (100%) create mode 100644 app/views/collections/_collection.html.erb rename app/views/{buckets => collections}/edit.html.erb (73%) create mode 100644 app/views/collections/involvements/update.html.erb rename app/views/{buckets => collections}/new.html.erb (80%) rename app/views/filters/{_buckets.html.erb => _collections.html.erb} (62%) rename app/views/notifications/settings/{_bucket.html.erb => _collection.html.erb} (68%) create mode 100644 db/migrate/20250409043626_rename_bubbles_to_cards.rb create mode 100644 script/closureulate/collections_and_cards.rb rename script/{fill_account_pop_reasons.rb => fill_account_closure_reasons.rb} (75%) delete mode 100644 script/populate/buckets_and_bubbles.rb create mode 100644 script/renaming/content.rb create mode 100644 script/renaming/files.rb delete mode 100644 test/controllers/bubbles/assignments_controller_test.rb delete mode 100644 test/controllers/bubbles/boosts_controller_test.rb delete mode 100644 test/controllers/bubbles/engagements_controller_test.rb delete mode 100644 test/controllers/bubbles/pins_controller_test.rb delete mode 100644 test/controllers/bubbles/pops_controller_test.rb delete mode 100644 test/controllers/bubbles/publishes_controller_test.rb delete mode 100644 test/controllers/bubbles/taggings_controller_test.rb delete mode 100644 test/controllers/bubbles/watches_controller_test.rb delete mode 100644 test/controllers/bubbles_controller_test.rb delete mode 100644 test/controllers/buckets/involvements_controller_test.rb delete mode 100644 test/controllers/buckets/workflows_controller_test.rb delete mode 100644 test/controllers/buckets_controller_test.rb create mode 100644 test/controllers/cards/assignments_controller_test.rb create mode 100644 test/controllers/cards/boosts_controller_test.rb create mode 100644 test/controllers/cards/closures_controller_test.rb create mode 100644 test/controllers/cards/engagements_controller_test.rb create mode 100644 test/controllers/cards/pins_controller_test.rb create mode 100644 test/controllers/cards/publishes_controller_test.rb rename test/controllers/{bubbles => cards}/readings_controller_test.rb (62%) create mode 100644 test/controllers/cards/taggings_controller_test.rb create mode 100644 test/controllers/cards/watches_controller_test.rb create mode 100644 test/controllers/cards_controller_test.rb create mode 100644 test/controllers/collections/involvements_controller_test.rb create mode 100644 test/controllers/collections/workflows_controller_test.rb create mode 100644 test/controllers/collections_controller_test.rb rename test/fixtures/{bubble => card}/engagements.yml (53%) rename test/fixtures/{bubbles.yml => cards.yml} (89%) rename test/fixtures/{pops.yml => closures.yml} (68%) rename test/fixtures/{buckets.yml => collections.yml} (100%) delete mode 100644 test/integration/bubble_messages.rb create mode 100644 test/integration/card_messages.rb create mode 100644 test/models/account/closure_reasons_test.rb delete mode 100644 test/models/account/pop_reasons_test.rb delete mode 100644 test/models/bubble/assignable_test.rb delete mode 100644 test/models/bubble/commentable_test.rb delete mode 100644 test/models/bubble/engageable_test.rb delete mode 100644 test/models/bubble/eventable_test.rb delete mode 100644 test/models/bubble/messages_test.rb delete mode 100644 test/models/bubble/poppable_test.rb delete mode 100644 test/models/bubble/scorable_test.rb delete mode 100644 test/models/bubble/searchable_test.rb delete mode 100644 test/models/bubble/statuses_test.rb delete mode 100644 test/models/bubble/taggable_test.rb delete mode 100644 test/models/bubble/watchable_test.rb delete mode 100644 test/models/bubble_test.rb delete mode 100644 test/models/bucket_test.rb create mode 100644 test/models/card/assignable_test.rb create mode 100644 test/models/card/closeable_test.rb create mode 100644 test/models/card/commentable_test.rb create mode 100644 test/models/card/engageable_test.rb create mode 100644 test/models/card/eventable_test.rb create mode 100644 test/models/card/messages_test.rb create mode 100644 test/models/card/scorable_test.rb create mode 100644 test/models/card/searchable_test.rb create mode 100644 test/models/card/statuses_test.rb create mode 100644 test/models/card/taggable_test.rb create mode 100644 test/models/card/watchable_test.rb create mode 100644 test/models/card_test.rb create mode 100644 test/models/collection_test.rb diff --git a/app/assets/images/bubble-add.svg b/app/assets/images/card-add.svg similarity index 100% rename from app/assets/images/bubble-add.svg rename to app/assets/images/card-add.svg diff --git a/app/assets/images/bubbles.svg b/app/assets/images/cards.svg similarity index 100% rename from app/assets/images/bubbles.svg rename to app/assets/images/cards.svg diff --git a/app/assets/images/pop.svg b/app/assets/images/closure.svg similarity index 100% rename from app/assets/images/pop.svg rename to app/assets/images/closure.svg diff --git a/app/assets/stylesheets/animation.css b/app/assets/stylesheets/animation.css index a0d250fe0..c2a510c18 100644 --- a/app/assets/stylesheets/animation.css +++ b/app/assets/stylesheets/animation.css @@ -38,7 +38,7 @@ } @keyframes wobble { - 0% { transform: rotate(calc(var(--bubble-rotate) + 90deg)); } + 0% { transform: rotate(calc(var(--card-rotate) + 90deg)); } 15% { border-radius: 66% 34% 72% 28% / 39% 63% 37% 61%; } 25% { border-radius: 55% 47% 62% 40% / 58% 50% 52% 44%; } 33% { border-radius: 46% 54% 61% 39% / 50% 51% 49% 50%; } @@ -47,7 +47,7 @@ } @keyframes wobble-alt { - 0% { transform: rotate(calc(var(--bubble-rotate) + -90deg)); } + 0% { transform: rotate(calc(var(--card-rotate) + -90deg)); } 12% { border-radius: 66% 34% 72% 28% / 39% 63% 37% 61%; } 25% { border-radius: 53% 45% 60% 38% / 56% 48% 50% 42%; } 33% { border-radius: 55% 47% 62% 40% / 58% 50% 52% 44%; } diff --git a/app/assets/stylesheets/bubbles.css b/app/assets/stylesheets/bubbles.css index 669a99f80..509cb62d0 100644 --- a/app/assets/stylesheets/bubbles.css +++ b/app/assets/stylesheets/bubbles.css @@ -20,7 +20,7 @@ } } - .bubble { + .something-to-rename { --bubble-background: radial-gradient(circle at center, color(from var(--bubble-color) srgb r g b / 0.25), color(from var(--bubble-color) srgb r g b / 0.05)); --bubble-border-width: 0.2rem; --hover-size: 0; @@ -110,15 +110,15 @@ } @media (hover: hover) { - .bubbles .bubble:not(.popped):hover & { + .bubbles .something-to-rename:not(.popped):hover & { transform: translate(0, -1rem); } - .bubbles .bubble:not(.popped):hover & + & { + .bubbles .something-to-rename:not(.popped):hover & + & { transform: translate(1rem, -1rem); } - .bubbles .bubble:not(.popped):hover & + & + & { + .bubbles .something-to-rename:not(.popped):hover & + & + & { transform: translate(1.5rem, -0.5rem);; } } @@ -176,7 +176,7 @@ } @media (hover: hover) { - .bubbles .bubble:not(.popped):hover & { + .bubbles .something-to-rename:not(.popped):hover & { transform: translate(-0.5rem, -2rem); } } @@ -195,22 +195,22 @@ } @media (hover: hover) { - .bubbles .bubble:not(.popped):hover & { + .bubbles .something-to-rename:not(.popped):hover & { transform: rotate(calc(var(--rotation) + var(--bubble-shift) * 1)) translate(0rem, 0.5rem); } } } @media (hover: hover) { - .bubbles .bubble:not(.popped):hover & { + .bubbles .something-to-rename:not(.popped):hover & { transform: translate(1rem, 1rem); } - .bubbles .bubble:not(.popped):hover & + & { + .bubbles .something-to-rename:not(.popped):hover & + & { transform: translate(0, -1rem); } - .bubbles .bubble:not(.popped):hover & + & + & { + .bubbles .something-to-rename:not(.popped):hover & + & + & { transform: translate(-1rem, -1rem); } } @@ -227,7 +227,7 @@ transition: 0.2s ease; @media (hover: hover) { - .bubbles .bubble:not(.popped):hover & { + .bubbles .something-to-rename:not(.popped):hover & { transform: rotate(calc(var(--bubble-rotate) + var(--bubble-shift))) scale(0.9); } } @@ -273,7 +273,7 @@ margin-inline: var(--tray-size); } - .bubble { + .something-to-rename { order: 0; } @@ -379,22 +379,22 @@ } } - textarea { - --input-color: var(--bubble-color); - --input-border-radius: 0; + /*textarea {*/ + /* --input-color: var(--bubble-color);*/ + /* --input-border-radius: 0;*/ - font-size: 9cqi; - font-weight: 800; - line-height: 1.2; + /* font-size: 9cqi;*/ + /* font-weight: 800;*/ + /* line-height: 1.2;*/ - &::selection { - background-color: var(--bubble-color); - color: var(--color-ink-reversed); - } - } + /* &::selection {*/ + /* background-color: var(--bubble-color);*/ + /* color: var(--color-ink-reversed);*/ + /* }*/ + /*}*/ @media (hover: hover) { - .bubble:has(.bubble__image img:not([src=""])):hover & { + .something-to-rename:has(.bubble__image img:not([src=""])):hover & { color: var(--color-ink-reversed); text-shadow: 0 0 0.2em var(--bubble-color), 0 0 0.2em var(--bubble-color), 0 0 0.2em var(--bubble-color); position: relative; @@ -422,7 +422,7 @@ --bubble-border-color: color-mix(in srgb, var(--bubble-color) 30%, var(--color-bg)); } - .bubble & { + .something-to-rename & { --bubble-size: 100%; } diff --git a/app/assets/stylesheets/cards.css b/app/assets/stylesheets/cards.css index a91eafae7..294f6cd0b 100644 --- a/app/assets/stylesheets/cards.css +++ b/app/assets/stylesheets/cards.css @@ -29,7 +29,7 @@ padding: calc(var(--block-space) * 1.5) var(--block-space); margin: var(--block-space) auto calc(var(--block-space) * 1.5); - .card__title { + .something-to-rename__title { margin-block-start: 0.1em; min-block-size: 0; } @@ -52,7 +52,7 @@ margin-block-start: -0.2em; } - .card__tags { + .something-to-rename__tags { font-size: var(--text-small); } } @@ -78,8 +78,8 @@ --border-size: 0; aspect-ratio: 2/0.95; - background-color: color-mix(in srgb, var(--bubble-color) 4%, var(--color-bg)); - color: color-mix(in srgb, var(--bubble-color) 40%, var(--color-ink)); + background-color: color-mix(in srgb, var(--card-color) 4%, var(--color-bg)); + color: color-mix(in srgb, var(--card-color) 40%, var(--color-ink)); max-inline-size: 75ch; z-index: 1; @@ -111,11 +111,11 @@ inset: var(--actions-block-inset) calc(var(--actions-inline-inset) * -1) auto auto; } - .card__actions-container { + .something-to-rename__actions-container { --border-radius: 1em; - + background-color: var(--color-bg); - color: color-mix(in srgb, var(--bubble-color) 40%, var(--color-ink)); + color: color-mix(in srgb, var(--card-color) 40%, var(--color-ink)); margin-block: calc(var(--block-space) * -1.66) calc(var(--block-space) * 1.66); padding: calc(var(--block-space) * 0.66) calc(var(--inline-space) * 1.5); position: relative; @@ -126,18 +126,18 @@ } .btn:not(.popup__item, .btn--plain) { - --btn-background: var(--bubble-color); + --btn-background: var(--card-color); --btn-color: var(--color-ink-reversed); } .btn--plain { - --btn-color: var(--bubble-color); + --btn-color: var(--card-color); text-decoration: underline; } - .bubble__pop-message { - color: var(--bubble-color); + .something-to-rename__closure-message { + color: var(--card-color); } } @@ -152,7 +152,7 @@ } .switch__input:checked + .switch__btn { - background-color: var(--bubble-color) !important; + background-color: var(--card-color) !important; } strong { @@ -203,14 +203,14 @@ padding-block: var(--block-space); } - .card__bucket { - background-color: var(--bubble-color); + .card__collection { + background-color: var(--card-color); font-weight: 800; letter-spacing: 0.5ch; padding: var(--block-space-half) var(--inline-space-double); } - .card-bucket__filter { + .card-collection__filter { > button { --hover-size: 0; } @@ -244,7 +244,7 @@ --padding-inline: calc(var(--block-space-double) + var(--block-space)); --padding-block: var(--block-space-double) calc(var(--block-space-double) + var(--block-space-half)); - background-color: color-mix(in srgb, var(--bubble-color) 33%, var(--color-bg)); + background-color: color-mix(in srgb, var(--card-color) 33%, var(--color-bg)); border-radius: 0.2em; display: inline-flex; margin-block: calc(var(--block-space) * -1) calc(var(--block-space) * -0.33); @@ -374,7 +374,7 @@ } } - .card__link { + .something-to-rename__link { --hover-size: 0; content: ""; @@ -389,7 +389,7 @@ } .card__meta { - --border-color: var(--bubble-color); + --border-color: var(--card-color); --border-size: 1px; --row-gap: 0.25em; @@ -405,7 +405,7 @@ } .card__move-button { - --btn-background: color-mix(in srgb, var(--bubble-color) 40%, var(--color-ink)); + --btn-background: color-mix(in srgb, var(--card-color) 40%, var(--color-ink)); margin-block-start: calc(var(--block-space) * 1.2); margin-inline-end: calc(var(--inline-space) * -4); @@ -416,16 +416,16 @@ flex: 1 1 25%; } - .card__tag { - color: var(--bubble-color); + .something-to-rename__tag { + color: var(--card-color); font-weight: 700; } - .card__tags { - color: var(--bubble-color); + .something-to-rename__tags { + color: var(--card-color); } - .card__title { + .something-to-rename__title { --hover-size: 0; --input-border-radius: 0; @@ -498,10 +498,10 @@ } } - .card__popped { + .card__closed { align-items: center; aspect-ratio: 7/4; - border: var(--block-space-half) solid var(--bubble-color); + border: var(--block-space-half) solid var(--card-color); position: absolute; inset: auto var(--block-space) var(--block-space-double) auto; justify-content: space-between; @@ -510,18 +510,18 @@ z-index: -1; } - .card__popped-by { + .card__closed-by { border-block-end: 1px dashed currentcolor; } - .card__popped-title { + .card__closed-title { color: var(--color-ink-reversed); font-size: var(--text-rel-large); font-weight: 900; text-shadow: - -2px -2px 0 var(--bubble-color), - 2px -2px 0 var(--bubble-color), - -2px 2px 0 var(--bubble-color), - 2px 2px 0 var(--bubble-color); + -2px -2px 0 var(--card-color), + 2px -2px 0 var(--card-color), + -2px 2px 0 var(--card-color), + 2px 2px 0 var(--card-color); } } diff --git a/app/assets/stylesheets/popup.css b/app/assets/stylesheets/closureup.css similarity index 100% rename from app/assets/stylesheets/popup.css rename to app/assets/stylesheets/closureup.css diff --git a/app/assets/stylesheets/buckets.css b/app/assets/stylesheets/collections.css similarity index 85% rename from app/assets/stylesheets/buckets.css rename to app/assets/stylesheets/collections.css index dc7eee01e..4d0ad7245 100644 --- a/app/assets/stylesheets/buckets.css +++ b/app/assets/stylesheets/collections.css @@ -1,5 +1,5 @@ @layer components { - .bucket { + .collection { inline-size: min(35ch, 40%); line-height: 1.2; @@ -10,7 +10,7 @@ } } - .buckets { + .collections { --gap: 2cqi; --hover-size: 0; --column-gap: var(--gap); @@ -20,12 +20,12 @@ padding: var(--gap); } - .bucket__button { + .collection__button { position: absolute; inset: calc((var(--btn-size) * -1) - 2cqi) 1cqi auto auto; } - .bucket__bubbles { + .collection__cards { --border-radius: 1.5em; margin-block: 0; @@ -33,7 +33,7 @@ padding: 1cqi; } - .bubbles__container { + .cards__container { aspect-ratio: 18 / 9; container-type: inline-size; } diff --git a/app/assets/stylesheets/color-picker.css b/app/assets/stylesheets/color-picker.css index 15d835477..7b6ff640f 100644 --- a/app/assets/stylesheets/color-picker.css +++ b/app/assets/stylesheets/color-picker.css @@ -1,5 +1,5 @@ .color-picker { - --panel-border-color: var(--bubble-color); + --panel-border-color: var(--card-color); --panel-border-radius: 2em; --panel-border-size: 2px; --panel-padding: 0.5em 0.7em; diff --git a/app/assets/stylesheets/events.css b/app/assets/stylesheets/events.css index f7f5ce3bb..9a04d5ee2 100644 --- a/app/assets/stylesheets/events.css +++ b/app/assets/stylesheets/events.css @@ -86,7 +86,7 @@ } .event--related { - --hover-color: var(--bubble-color); + --hover-color: var(--card-color); --hover-size: 0.15rem; box-shadow: 0 0 0 var(--hover-size) var(--hover-color); @@ -138,7 +138,7 @@ .event__icon { aspect-ratio: 1; - background-color: var(--bubble-color); + background-color: var(--card-color); block-size: 1.7em; border-radius: 1.7em; inline-size: 1.7em; diff --git a/app/assets/stylesheets/icons.css b/app/assets/stylesheets/icons.css index 7937952f3..10e273bb5 100644 --- a/app/assets/stylesheets/icons.css +++ b/app/assets/stylesheets/icons.css @@ -30,8 +30,8 @@ .icon--bolt { --svg: url("bolt.svg "); } .icon--bookmark-outline { --svg: url("bookmark-outline.svg "); } .icon--bookmark { --svg: url("bookmark.svg "); } - .icon--bubble-add { --svg: url("bubble-add.svg "); } - .icon--bubbles { --svg: url("bubbles.svg "); } + .icon--card-add { --svg: url("card-add.svg "); } + .icon--cards { --svg: url("cards.svg "); } .icon--calendar-add { --svg: url("calendar-add.svg "); } .icon--calendar { --svg: url("calendar.svg "); } .icon--camera { --svg: url("camera.svg "); } @@ -65,7 +65,7 @@ .icon--picture-double { --svg: url("picture-double.svg "); } .icon--picture-remove { --svg: url("picture-remove.svg "); } .icon--pinned { --svg: url("pinned.svg "); } - .icon--pop { --svg: url("pop.svg "); } + .icon--closure { --svg: url("closure.svg "); } .icon--qr-code { --svg: url("qr-code.svg "); } .icon--reaction { --svg: url("reaction.svg "); } .icon--refresh { --svg: url("refresh.svg "); } diff --git a/app/assets/stylesheets/pins.css b/app/assets/stylesheets/pins.css index d5563d5dd..292f7c691 100644 --- a/app/assets/stylesheets/pins.css +++ b/app/assets/stylesheets/pins.css @@ -14,8 +14,8 @@ } } - .pin__bucket { - background-color: var(--bubble-color); + .pin__collection { + background-color: var(--card-color); font-weight: 800; letter-spacing: 0.3ch; padding: 0.3em 0.6em 0.3em 1.5em; @@ -45,7 +45,7 @@ } .pin__tags { - color: var(--bubble-color); + color: var(--card-color); } .pin__title { diff --git a/app/assets/stylesheets/workflows.css b/app/assets/stylesheets/workflows.css index b6591a2a7..4f93ce4b8 100644 --- a/app/assets/stylesheets/workflows.css +++ b/app/assets/stylesheets/workflows.css @@ -11,35 +11,35 @@ @media (hover: hover) { &:hover { - background-color: color(from var(--bubble-color) srgb r g b / 0.15); + background-color: color(from var(--card-color) srgb r g b / 0.15); } } - .bubbles-list & { + .cards-list & { display: none; } } .workflow-stage--current { - --btn-background: var(--bubble-color); + --btn-background: var(--card-color); color: var(--color-ink-reversed); @media (hover: hover) { &:hover { - background-color: color(from var(--bubble-color) srgb r g b / 0.65); + background-color: color(from var(--card-color) srgb r g b / 0.65); } } .ticket & { --btn-background: var(--color-ink); - background: var(--bubble-color); + background: var(--card-color); border-radius: 0.2em; color: var(--color-ink-reversed); } - .bubbles-list & { + .cards-list & { display: flex; background: transparent; border-radius: 0.2em; diff --git a/app/controllers/bubbles/assignments_controller.rb b/app/controllers/bubbles/assignments_controller.rb deleted file mode 100644 index 7fd9186aa..000000000 --- a/app/controllers/bubbles/assignments_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class Bubbles::AssignmentsController < ApplicationController - include BubbleScoped - - def new - end - - def create - @bubble.toggle_assignment @bucket.users.active.find(params[:assignee_id]) - end -end diff --git a/app/controllers/bubbles/boosts_controller.rb b/app/controllers/bubbles/boosts_controller.rb deleted file mode 100644 index 38970c40f..000000000 --- a/app/controllers/bubbles/boosts_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Bubbles::BoostsController < ApplicationController - include BubbleScoped - - def create - count = if params[:boost_count].to_i == @bubble.boosts_count - @bubble.boosts_count + 1 - else - params[:boost_count].to_i - end - @bubble.boost!(count) - end -end diff --git a/app/controllers/bubbles/engagements_controller.rb b/app/controllers/bubbles/engagements_controller.rb deleted file mode 100644 index 5599b7381..000000000 --- a/app/controllers/bubbles/engagements_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Bubbles::EngagementsController < ApplicationController - include BubbleScoped - - def create - @bubble.engage - redirect_to @bubble - end - - def destroy - @bubble.reconsider - redirect_to @bubble - end -end diff --git a/app/controllers/bubbles/images_controller.rb b/app/controllers/bubbles/images_controller.rb deleted file mode 100644 index b7dc7da97..000000000 --- a/app/controllers/bubbles/images_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Bubbles::ImagesController < ApplicationController - include BubbleScoped - - def destroy - @bubble.image.purge_later - redirect_to @bubble - end -end diff --git a/app/controllers/bubbles/pops_controller.rb b/app/controllers/bubbles/pops_controller.rb deleted file mode 100644 index 5421428ca..000000000 --- a/app/controllers/bubbles/pops_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Bubbles::PopsController < ApplicationController - include BubbleScoped - - def create - @bubble.pop!(user: Current.user, reason: params[:reason]) - redirect_to @bubble - end - - def destroy - @bubble.unpop - redirect_to @bubble - end -end diff --git a/app/controllers/bubbles/publishes_controller.rb b/app/controllers/bubbles/publishes_controller.rb deleted file mode 100644 index bcc75eb27..000000000 --- a/app/controllers/bubbles/publishes_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Bubbles::PublishesController < ApplicationController - include BubbleScoped - - def create - @bubble.publish - redirect_to @bubble - end -end diff --git a/app/controllers/bubbles/readings_controller.rb b/app/controllers/bubbles/readings_controller.rb deleted file mode 100644 index 9f99c456d..000000000 --- a/app/controllers/bubbles/readings_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Bubbles::ReadingsController < ApplicationController - include BubbleScoped - - def create - mark_bubble_notifications_read - @notifications = Current.user.notifications.unread.ordered.limit(20) - end - - private - def mark_bubble_notifications_read - Current.user.notifications.unread.where(bubble: @bubble).read_all - end -end diff --git a/app/controllers/bubbles/recovers_controller.rb b/app/controllers/bubbles/recovers_controller.rb deleted file mode 100644 index c94fd6ccf..000000000 --- a/app/controllers/bubbles/recovers_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Bubbles::RecoversController < ApplicationController - include BubbleScoped - - def create - redirect_to @bubble.recover_abandoned_creation - end -end diff --git a/app/controllers/bubbles/stagings_controller.rb b/app/controllers/bubbles/stagings_controller.rb deleted file mode 100644 index 28f7af26e..000000000 --- a/app/controllers/bubbles/stagings_controller.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Bubbles::StagingsController < ApplicationController - include BubbleScoped - - def create - if params[:stage_id].present? - @bubble.toggle_stage Current.account.stages.find(params[:stage_id]) - else - @bubble.update!(stage: nil) - end - end -end diff --git a/app/controllers/bubbles/watches_controller.rb b/app/controllers/bubbles/watches_controller.rb deleted file mode 100644 index 3b21acfa4..000000000 --- a/app/controllers/bubbles/watches_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Bubbles::WatchesController < ApplicationController - include BubbleScoped - - def create - @bubble.watch_by Current.user - redirect_to bubble_watch_path(@bubble) - end - - def destroy - @bubble.unwatch_by Current.user - redirect_to bubble_watch_path(@bubble) - end -end diff --git a/app/controllers/bubbles_controller.rb b/app/controllers/bubbles_controller.rb deleted file mode 100644 index 3033ca473..000000000 --- a/app/controllers/bubbles_controller.rb +++ /dev/null @@ -1,71 +0,0 @@ -class BubblesController < ApplicationController - include BucketScoped - - skip_before_action :set_bucket, only: :index - - before_action :set_filter, only: :index - before_action :set_bubble, only: %i[ show edit update destroy ] - before_action :handle_display_count, only: :index - - DISPLAY_COUNT_OPTIONS = [ 6, 12, 18, 24 ].freeze - DEFAULT_DISPLAY_COUNT = 6 - RECENTLY_POPPED_LIMIT = 100 - - def index - @considering_bubbles = @filter.bubbles.considering.load_async - @doing_bubbles = @filter.bubbles.doing.load_async - @popped_bubbles = @filter.with(indexed_by: "popped").bubbles.recently_popped_first.limit(RECENTLY_POPPED_LIMIT).load_async - end - - def create - redirect_to @bucket.bubbles.create! - end - - def show - end - - def edit - end - - def destroy - @bubble.destroy! - redirect_to bubbles_path(bucket_ids: [ @bubble.bucket ]), notice: deleted_notice - end - - def update - @bubble.update! bubble_params - redirect_to @bubble - end - - private - DEFAULT_PARAMS = { indexed_by: "newest" } - - def set_filter - @filter = Current.user.filters.from_params params.reverse_merge(**DEFAULT_PARAMS).permit(*Filter::PERMITTED_PARAMS) - end - - def set_bubble - @bubble = @bucket.bubbles.find params[:id] - end - - def bubble_params - params.expect(bubble: [ :status, :title, :color, :due_on, :image, :draft_comment, tag_ids: [] ]) - end - - def deleted_notice - "Bubble deleted" unless @bubble.creating? - end - - def handle_display_count - if params[:set_display_count].present? - cookies[:display_count] = params[:set_display_count] - redirect_to bubbles_path( - params.permit(*Filter::PERMITTED_PARAMS, :bucket_ids).except(:set_display_count) - ) - end - end - - def display_count - (cookies[:display_count] || DEFAULT_DISPLAY_COUNT).to_i - end -end diff --git a/app/controllers/buckets/involvements_controller.rb b/app/controllers/buckets/involvements_controller.rb deleted file mode 100644 index dbfcbb6d7..000000000 --- a/app/controllers/buckets/involvements_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Buckets::InvolvementsController < ApplicationController - include BucketScoped - - def update - @bucket.access_for(Current.user).update!(involvement: params[:involvement]) - end -end diff --git a/app/controllers/buckets/workflows_controller.rb b/app/controllers/buckets/workflows_controller.rb deleted file mode 100644 index fb31b08d0..000000000 --- a/app/controllers/buckets/workflows_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Buckets::WorkflowsController < ApplicationController - include BucketScoped - - before_action :set_workflow - - def update - @bucket.update! workflow: @workflow - - redirect_to bubbles_path(bucket_ids: [ @bucket ]) - end - - private - def set_workflow - @workflow = Current.account.workflows.find(params.expect(bucket: [ :workflow_id ]).require(:workflow_id)) - end -end diff --git a/app/controllers/buckets_controller.rb b/app/controllers/buckets_controller.rb deleted file mode 100644 index f4f5a2ff4..000000000 --- a/app/controllers/buckets_controller.rb +++ /dev/null @@ -1,50 +0,0 @@ -class BucketsController < ApplicationController - before_action :set_bucket, except: %i[ new create ] - - def new - @bucket = Current.account.buckets.build - end - - def create - @bucket = Current.account.buckets.create! bucket_params - redirect_to bubbles_path(bucket_ids: [ @bucket ]) - end - - def edit - selected_user_ids = @bucket.users.pluck :id - @selected_users, @unselected_users = User.active.alphabetically.partition { |user| selected_user_ids.include? user.id } - end - - def update - @bucket.update! bucket_params - @bucket.accesses.revise granted: grantees, revoked: revokees - - redirect_to bubbles_path(bucket_ids: [ @bucket ]) - end - - def destroy - @bucket.destroy - redirect_to root_path - end - - private - def set_bucket - @bucket = Current.user.buckets.find params[:id] - end - - def bucket_params - params.expect(bucket: [ :name, :all_access ]).with_defaults(all_access: true) - end - - def grantees - Current.account.users.active.where id: grantee_ids - end - - def revokees - @bucket.users.where.not id: grantee_ids - end - - def grantee_ids - params.fetch :user_ids, [] - end -end diff --git a/app/controllers/cards/assignments_controller.rb b/app/controllers/cards/assignments_controller.rb new file mode 100644 index 000000000..63dce613c --- /dev/null +++ b/app/controllers/cards/assignments_controller.rb @@ -0,0 +1,10 @@ +class Cards::AssignmentsController < ApplicationController + include CardScoped + + def new + end + + def create + @card.toggle_assignment @collection.users.active.find(params[:assignee_id]) + end +end diff --git a/app/controllers/cards/boosts_controller.rb b/app/controllers/cards/boosts_controller.rb new file mode 100644 index 000000000..bebe888fc --- /dev/null +++ b/app/controllers/cards/boosts_controller.rb @@ -0,0 +1,12 @@ +class Cards::BoostsController < ApplicationController + include CardScoped + + def create + count = if params[:boost_count].to_i == @card.boosts_count + @card.boosts_count + 1 + else + params[:boost_count].to_i + end + @card.boost!(count) + end +end diff --git a/app/controllers/cards/closures_controller.rb b/app/controllers/cards/closures_controller.rb new file mode 100644 index 000000000..a62955228 --- /dev/null +++ b/app/controllers/cards/closures_controller.rb @@ -0,0 +1,13 @@ +class Cards::ClosuresController < ApplicationController + include CardScoped + + def create + @card.closure!(user: Current.user, reason: params[:reason]) + redirect_to @card + end + + def destroy + @card.unpop + redirect_to @card + end +end diff --git a/app/controllers/cards/engagements_controller.rb b/app/controllers/cards/engagements_controller.rb new file mode 100644 index 000000000..72025d16a --- /dev/null +++ b/app/controllers/cards/engagements_controller.rb @@ -0,0 +1,13 @@ +class Cards::EngagementsController < ApplicationController + include CardScoped + + def create + @card.engage + redirect_to @card + end + + def destroy + @card.reconsider + redirect_to @card + end +end diff --git a/app/controllers/cards/images_controller.rb b/app/controllers/cards/images_controller.rb new file mode 100644 index 000000000..fad419c52 --- /dev/null +++ b/app/controllers/cards/images_controller.rb @@ -0,0 +1,8 @@ +class Cards::ImagesController < ApplicationController + include CardScoped + + def destroy + @card.image.purge_later + redirect_to @card + end +end diff --git a/app/controllers/bubbles/pins_controller.rb b/app/controllers/cards/pins_controller.rb similarity index 60% rename from app/controllers/bubbles/pins_controller.rb rename to app/controllers/cards/pins_controller.rb index d75d2b10d..1f6c1aaa8 100644 --- a/app/controllers/bubbles/pins_controller.rb +++ b/app/controllers/cards/pins_controller.rb @@ -1,21 +1,21 @@ -class Bubbles::PinsController < ApplicationController - include BubbleScoped +class Cards::PinsController < ApplicationController + include CardScoped def show end def create - pin = @bubble.pin_by Current.user + pin = @card.pin_by Current.user broadcast_my_new pin - redirect_to bubble_pin_path(@bubble) + redirect_to card_pin_path(@card) end def destroy - pin = @bubble.unpin_by Current.user + pin = @card.unpin_by Current.user broadcast_my_removed pin - redirect_to bubble_pin_path(@bubble) + redirect_to card_pin_path(@card) end private diff --git a/app/controllers/cards/publishes_controller.rb b/app/controllers/cards/publishes_controller.rb new file mode 100644 index 000000000..f7ac6590c --- /dev/null +++ b/app/controllers/cards/publishes_controller.rb @@ -0,0 +1,8 @@ +class Cards::PublishesController < ApplicationController + include CardScoped + + def create + @card.publish + redirect_to @card + end +end diff --git a/app/controllers/cards/readings_controller.rb b/app/controllers/cards/readings_controller.rb new file mode 100644 index 000000000..669d959d8 --- /dev/null +++ b/app/controllers/cards/readings_controller.rb @@ -0,0 +1,13 @@ +class Cards::ReadingsController < ApplicationController + include CardScoped + + def create + mark_card_notifications_read + @notifications = Current.user.notifications.unread.ordered.limit(20) + end + + private + def mark_card_notifications_read + Current.user.notifications.unread.where(card: @card).read_all + end +end diff --git a/app/controllers/cards/recovers_controller.rb b/app/controllers/cards/recovers_controller.rb new file mode 100644 index 000000000..b4614bc2a --- /dev/null +++ b/app/controllers/cards/recovers_controller.rb @@ -0,0 +1,7 @@ +class Cards::RecoversController < ApplicationController + include CardScoped + + def create + redirect_to @card.recover_abandoned_creation + end +end diff --git a/app/controllers/cards/stagings_controller.rb b/app/controllers/cards/stagings_controller.rb new file mode 100644 index 000000000..af524fa52 --- /dev/null +++ b/app/controllers/cards/stagings_controller.rb @@ -0,0 +1,11 @@ +class Cards::StagingsController < ApplicationController + include CardScoped + + def create + if params[:stage_id].present? + @card.toggle_stage Current.account.stages.find(params[:stage_id]) + else + @card.update!(stage: nil) + end + end +end diff --git a/app/controllers/bubbles/taggings_controller.rb b/app/controllers/cards/taggings_controller.rb similarity index 59% rename from app/controllers/bubbles/taggings_controller.rb rename to app/controllers/cards/taggings_controller.rb index 156705a98..f75681c9d 100644 --- a/app/controllers/bubbles/taggings_controller.rb +++ b/app/controllers/cards/taggings_controller.rb @@ -1,12 +1,12 @@ -class Bubbles::TaggingsController < ApplicationController - include BubbleScoped +class Cards::TaggingsController < ApplicationController + include CardScoped def new @tags = Current.account.tags.alphabetically end def create - @bubble.toggle_tag_with sanitized_tag_title_param + @card.toggle_tag_with sanitized_tag_title_param end private diff --git a/app/controllers/cards/watches_controller.rb b/app/controllers/cards/watches_controller.rb new file mode 100644 index 000000000..bd956a2d5 --- /dev/null +++ b/app/controllers/cards/watches_controller.rb @@ -0,0 +1,13 @@ +class Cards::WatchesController < ApplicationController + include CardScoped + + def create + @card.watch_by Current.user + redirect_to card_watch_path(@card) + end + + def destroy + @card.unwatch_by Current.user + redirect_to card_watch_path(@card) + end +end diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb new file mode 100644 index 000000000..1485ad33f --- /dev/null +++ b/app/controllers/cards_controller.rb @@ -0,0 +1,71 @@ +class CardsController < ApplicationController + include CollectionScoped + + skip_before_action :set_collection, only: :index + + before_action :set_filter, only: :index + before_action :set_card, only: %i[ show edit update destroy ] + before_action :handle_display_count, only: :index + + DISPLAY_COUNT_OPTIONS = [ 6, 12, 18, 24 ].freeze + DEFAULT_DISPLAY_COUNT = 6 + RECENTLY_CLOSED_LIMIT = 100 + + def index + @considering_cards = @filter.cards.considering.load_async + @doing_cards = @filter.cards.doing.load_async + @closed_cards = @filter.with(indexed_by: "closed").cards.recently_closed_first.limit(RECENTLY_CLOSED_LIMIT).load_async + end + + def create + redirect_to @collection.cards.create! + end + + def show + end + + def edit + end + + def destroy + @card.destroy! + redirect_to cards_path(collection_ids: [ @card.collection ]), notice: deleted_notice + end + + def update + @card.update! card_params + redirect_to @card + end + + private + DEFAULT_PARAMS = { indexed_by: "newest" } + + def set_filter + @filter = Current.user.filters.from_params params.reverse_merge(**DEFAULT_PARAMS).permit(*Filter::PERMITTED_PARAMS) + end + + def set_card + @card = @collection.cards.find params[:id] + end + + def card_params + params.expect(card: [ :status, :title, :color, :due_on, :image, :draft_comment, tag_ids: [] ]) + end + + def deleted_notice + "Card deleted" unless @card.creating? + end + + def handle_display_count + if params[:set_display_count].present? + cookies[:display_count] = params[:set_display_count] + redirect_to cards_path( + params.permit(*Filter::PERMITTED_PARAMS, :collection_ids).except(:set_display_count) + ) + end + end + + def display_count + (cookies[:display_count] || DEFAULT_DISPLAY_COUNT).to_i + end +end diff --git a/app/controllers/collections/involvements_controller.rb b/app/controllers/collections/involvements_controller.rb new file mode 100644 index 000000000..69f7f2fbc --- /dev/null +++ b/app/controllers/collections/involvements_controller.rb @@ -0,0 +1,7 @@ +class Collections::InvolvementsController < ApplicationController + include CollectionScoped + + def update + @collection.access_for(Current.user).update!(involvement: params[:involvement]) + end +end diff --git a/app/controllers/collections/workflows_controller.rb b/app/controllers/collections/workflows_controller.rb new file mode 100644 index 000000000..963feb595 --- /dev/null +++ b/app/controllers/collections/workflows_controller.rb @@ -0,0 +1,16 @@ +class Collections::WorkflowsController < ApplicationController + include CollectionScoped + + before_action :set_workflow + + def update + @collection.update! workflow: @workflow + + redirect_to cards_path(collection_ids: [ @collection ]) + end + + private + def set_workflow + @workflow = Current.account.workflows.find(params.expect(collection: [ :workflow_id ]).require(:workflow_id)) + end +end diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb new file mode 100644 index 000000000..3eb8cb507 --- /dev/null +++ b/app/controllers/collections_controller.rb @@ -0,0 +1,50 @@ +class CollectionsController < ApplicationController + before_action :set_collection, except: %i[ new create ] + + def new + @collection = Current.account.collections.build + end + + def create + @collection = Current.account.collections.create! collection_params + redirect_to cards_path(collection_ids: [ @collection ]) + end + + def edit + selected_user_ids = @collection.users.pluck :id + @selected_users, @unselected_users = User.active.alphabetically.partition { |user| selected_user_ids.include? user.id } + end + + def update + @collection.update! collection_params + @collection.accesses.revise granted: grantees, revoked: revokees + + redirect_to cards_path(collection_ids: [ @collection ]) + end + + def destroy + @collection.destroy + redirect_to root_path + end + + private + def set_collection + @collection = Current.user.collections.find params[:id] + end + + def collection_params + params.expect(collection: [ :name, :all_access ]).with_defaults(all_access: true) + end + + def grantees + Current.account.users.active.where id: grantee_ids + end + + def revokees + @collection.users.where.not id: grantee_ids + end + + def grantee_ids + params.fetch :user_ids, [] + end +end diff --git a/app/controllers/comments/reactions_controller.rb b/app/controllers/comments/reactions_controller.rb index 36f51f6f6..17da85753 100644 --- a/app/controllers/comments/reactions_controller.rb +++ b/app/controllers/comments/reactions_controller.rb @@ -12,7 +12,7 @@ class Comments::ReactionsController < ApplicationController @reaction = @comment.reactions.create!(reaction_params) broadcast_create - redirect_to bucket_bubble_comment_reactions_url(@comment.bubble.bucket, @comment.bubble, @comment) + redirect_to collection_card_comment_reactions_url(@comment.card.collection, @comment.card, @comment) end def destroy diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 4708af0e1..6d9540662 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,10 +1,10 @@ class CommentsController < ApplicationController - include BubbleScoped + include CardScoped before_action :set_comment, only: [ :show, :edit, :update, :destroy ] before_action :require_own_comment, only: [ :edit, :update, :destroy ] def create - @bubble.capture new_comment + @card.capture new_comment end def show @@ -19,7 +19,7 @@ class CommentsController < ApplicationController def destroy @comment.destroy - redirect_to @bubble + redirect_to @card end private @@ -33,7 +33,7 @@ class CommentsController < ApplicationController def set_comment @comment = Comment.joins(:message) - .where(messages: { bubble_id: @bubble.id }) + .where(messages: { card_id: @card.id }) .find(params[:id]) end diff --git a/app/controllers/concerns/bubble_scoped.rb b/app/controllers/concerns/bubble_scoped.rb deleted file mode 100644 index a3783d9c5..000000000 --- a/app/controllers/concerns/bubble_scoped.rb +++ /dev/null @@ -1,16 +0,0 @@ -module BubbleScoped - extend ActiveSupport::Concern - - included do - before_action :set_bubble, :set_bucket - end - - private - def set_bubble - @bubble = Current.user.accessible_bubbles.find(params[:bubble_id]) - end - - def set_bucket - @bucket = Current.user.buckets.find(@bubble.bucket_id) - end -end diff --git a/app/controllers/concerns/bucket_filterable.rb b/app/controllers/concerns/bucket_filterable.rb deleted file mode 100644 index 0205a456b..000000000 --- a/app/controllers/concerns/bucket_filterable.rb +++ /dev/null @@ -1,24 +0,0 @@ -module BucketFilterable - extend ActiveSupport::Concern - - included do - before_action :set_bucket_filter - end - - private - def set_bucket_filter - params[:bucket_ids] ||= cookies[:bucket_filter]&.split(",") unless params[:clear_filter] - end - - def bucket_filter - params[:bucket_ids].presence || Current.user.bucket_ids - end - - def update_bucket_filter - if params[:clear_filter] - cookies.delete(:bucket_filter) - elsif params[:bucket_ids].present? - cookies[:bucket_filter] = params[:bucket_ids].join(",") - end - end -end diff --git a/app/controllers/concerns/bucket_scoped.rb b/app/controllers/concerns/bucket_scoped.rb deleted file mode 100644 index c0dd1176f..000000000 --- a/app/controllers/concerns/bucket_scoped.rb +++ /dev/null @@ -1,12 +0,0 @@ -module BucketScoped - extend ActiveSupport::Concern - - included do - before_action :set_bucket - end - - private - def set_bucket - @bucket = Current.user.buckets.find(params[:bucket_id]) - end -end diff --git a/app/controllers/concerns/card_scoped.rb b/app/controllers/concerns/card_scoped.rb new file mode 100644 index 000000000..e85291b57 --- /dev/null +++ b/app/controllers/concerns/card_scoped.rb @@ -0,0 +1,16 @@ +module CardScoped + extend ActiveSupport::Concern + + included do + before_action :set_card, :set_collection + end + + private + def set_card + @card = Current.user.accessible_cards.find(params[:card_id]) + end + + def set_collection + @collection = Current.user.collections.find(@card.collection_id) + end +end diff --git a/app/controllers/concerns/collection_filterable.rb b/app/controllers/concerns/collection_filterable.rb new file mode 100644 index 000000000..4bd5ff9f1 --- /dev/null +++ b/app/controllers/concerns/collection_filterable.rb @@ -0,0 +1,24 @@ +module CollectionFilterable + extend ActiveSupport::Concern + + included do + before_action :set_collection_filter + end + + private + def set_collection_filter + params[:collection_ids] ||= cookies[:collection_filter]&.split(",") unless params[:clear_filter] + end + + def collection_filter + params[:collection_ids].presence || Current.user.collection_ids + end + + def update_collection_filter + if params[:clear_filter] + cookies.delete(:collection_filter) + elsif params[:collection_ids].present? + cookies[:collection_filter] = params[:collection_ids].join(",") + end + end +end diff --git a/app/controllers/concerns/collection_scoped.rb b/app/controllers/concerns/collection_scoped.rb new file mode 100644 index 000000000..2ddde9531 --- /dev/null +++ b/app/controllers/concerns/collection_scoped.rb @@ -0,0 +1,12 @@ +module CollectionScoped + extend ActiveSupport::Concern + + included do + before_action :set_collection + end + + private + def set_collection + @collection = Current.user.collections.find(params[:collection_id]) + end +end diff --git a/app/controllers/concerns/events_timeline.rb b/app/controllers/concerns/events_timeline.rb index 7b4e98e2e..d71928b4d 100644 --- a/app/controllers/concerns/events_timeline.rb +++ b/app/controllers/concerns/events_timeline.rb @@ -1,7 +1,7 @@ module EventsTimeline extend ActiveSupport::Concern - include BucketFilterable + include CollectionFilterable included do before_action :set_activity_day @@ -23,7 +23,7 @@ module EventsTimeline group_by { |event| [ event.created_at.hour, helpers.event_column(event) ] }. map { |hour_col, events| [ hour_col, - events.uniq { |e| e.action == "boosted" ? [ e.creator_id, e.bubble_id ] : e.id } + events.uniq { |e| e.action == "boosted" ? [ e.creator_id, e.card_id ] : e.id } ] } end @@ -33,12 +33,12 @@ module EventsTimeline end def user_events - Event.where(bubble: user_bubbles, creator: Current.account.users) + Event.where(card: user_cards, creator: Current.account.users) end - def user_bubbles - Current.user.accessible_bubbles + def user_cards + Current.user.accessible_cards .published_or_drafted_by(Current.user) - .where(bucket_id: bucket_filter) + .where(collection_id: collection_filter) end end diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index ba6df4e27..a3c8a9157 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -2,9 +2,9 @@ class EventsController < ApplicationController include EventsTimeline def index - update_bucket_filter + update_collection_filter - @buckets = Current.user.buckets.alphabetically + @collections = Current.user.collections.alphabetically @filters = Current.user.filters.all @events = events_for_activity_day diff --git a/app/controllers/filters_controller.rb b/app/controllers/filters_controller.rb index c0523fa0d..6c840952a 100644 --- a/app/controllers/filters_controller.rb +++ b/app/controllers/filters_controller.rb @@ -3,7 +3,7 @@ class FiltersController < ApplicationController def create @filter = Current.user.filters.remember filter_params - redirect_to bubbles_path(@filter.as_params) + redirect_to cards_path(@filter.as_params) end def destroy @@ -24,7 +24,7 @@ class FiltersController < ApplicationController if request.referer == root_url redirect_to root_path else - redirect_to bubbles_path(@filter.as_params) + redirect_to cards_path(@filter.as_params) end end end diff --git a/app/controllers/my/pins_controller.rb b/app/controllers/my/pins_controller.rb index c7f222d33..f361b6af7 100644 --- a/app/controllers/my/pins_controller.rb +++ b/app/controllers/my/pins_controller.rb @@ -1,5 +1,5 @@ class My::PinsController < ApplicationController def index - @pins = Current.user.pins.includes(:bubble).ordered.limit(20) + @pins = Current.user.pins.includes(:card).ordered.limit(20) end end diff --git a/app/controllers/notifications/settings_controller.rb b/app/controllers/notifications/settings_controller.rb index ebffcbf58..a94345746 100644 --- a/app/controllers/notifications/settings_controller.rb +++ b/app/controllers/notifications/settings_controller.rb @@ -1,7 +1,7 @@ module Notifications class SettingsController < ApplicationController def show - @buckets = Current.user.buckets.alphabetically + @collections = Current.user.collections.alphabetically end end end diff --git a/app/controllers/terminals_controller.rb b/app/controllers/terminals_controller.rb index b4fe28411..d05a339bc 100644 --- a/app/controllers/terminals_controller.rb +++ b/app/controllers/terminals_controller.rb @@ -1,6 +1,6 @@ class TerminalsController < ApplicationController def show - @events = Event.where(bubble: user_bubbles, creator: Current.user).chronologically.reverse_order.limit(20) + @events = Event.where(card: user_cards, creator: Current.user).chronologically.reverse_order.limit(20) end def edit @@ -8,7 +8,7 @@ class TerminalsController < ApplicationController end private - def user_bubbles - Current.user.accessible_bubbles + def user_cards + Current.user.accessible_cards end end diff --git a/app/helpers/accesses_helper.rb b/app/helpers/accesses_helper.rb index 58c23e72a..a139ac3d4 100644 --- a/app/helpers/accesses_helper.rb +++ b/app/helpers/accesses_helper.rb @@ -1,29 +1,29 @@ module AccessesHelper - def access_menu_tag(bucket, &) - tag.menu class: [ "flex flex-column gap margin-none pad txt-medium", { "toggler--toggled": bucket.all_access? } ], data: { + def access_menu_tag(collection, &) + tag.menu class: [ "flex flex-column gap margin-none pad txt-medium", { "toggler--toggled": collection.all_access? } ], data: { controller: "filter toggle-class", filter_active_class: "filter--active", filter_selected_class: "selected", toggle_class_toggle_class: "toggler--toggled" }, & end def access_toggles_for(users, selected:) - render partial: "buckets/access_toggle", + render partial: "collections/access_toggle", collection: users, as: :user, locals: { selected: selected }, cached: ->(user) { [ user, selected ] } end - def access_involvement_advance_button(bucket, user) - access = bucket.access_for(user) + def access_involvement_advance_button(collection, user) + access = collection.access_for(user) - turbo_frame_tag dom_id(bucket, :involvement_button) do - button_to bucket_involvement_path(bucket), method: :put, - aria: { labelledby: dom_id(bucket, :involvement_label) }, + turbo_frame_tag dom_id(collection, :involvement_button) do + button_to collection_involvement_path(collection), method: :put, + aria: { labelledby: dom_id(collection, :involvement_label) }, class: [ "btn", { "btn--reversed": access.involvement == "watching" || access.involvement == "everything" } ], params: { involvement: next_involvement(access.involvement) }, - title: involvement_access_label(bucket, access.involvement) do + title: involvement_access_label(collection, access.involvement) do icon_tag("notification-bell-#{access.involvement.dasherize}") + - tag.span(involvement_access_label(bucket, access.involvement), class: "for-screen-reader", id: dom_id(bucket, :involvement_label)) + tag.span(involvement_access_label(collection, access.involvement), class: "for-screen-reader", id: dom_id(collection, :involvement_label)) end end end @@ -34,14 +34,14 @@ module AccessesHelper order[(order.index(involvement.to_s) + 1) % order.size] end - def involvement_access_label(bucket, involvement) + def involvement_access_label(collection, involvement) case involvement when "access_only" - "Notifications are off for #{bucket.name}" + "Notifications are off for #{collection.name}" when "everything" - "Notifying me about everything in #{bucket.name}" + "Notifying me about everything in #{collection.name}" when "watching" - "Notifying me only about @mentions and new items in #{bucket.name}" + "Notifying me only about @mentions and new items in #{collection.name}" end end end diff --git a/app/helpers/bubbles_helper.rb b/app/helpers/bubbles_helper.rb deleted file mode 100644 index 22f319362..000000000 --- a/app/helpers/bubbles_helper.rb +++ /dev/null @@ -1,24 +0,0 @@ -module BubblesHelper - BUBBLE_ROTATION = %w[ 75 60 45 35 25 5 ] - - def bubble_title(bubble) - bubble.title.presence || "Untitled" - end - - def bubble_rotation(bubble) - value = BUBBLE_ROTATION[Zlib.crc32(bubble.to_param) % BUBBLE_ROTATION.size] - - "--bubble-rotate: #{value}deg;" - end - - def display_count_options - BubblesController::DISPLAY_COUNT_OPTIONS.map do |count| - { - value: count, - label: count, - selected: @display_count == count, - id: "display-count-#{count}" - } - end - end -end diff --git a/app/helpers/cards_helper.rb b/app/helpers/cards_helper.rb new file mode 100644 index 000000000..c340f2827 --- /dev/null +++ b/app/helpers/cards_helper.rb @@ -0,0 +1,24 @@ +module CardsHelper + CARD_ROTATION = %w[ 75 60 45 35 25 5 ] + + def card_title(card) + card.title.presence || "Untitled" + end + + def card_rotation(card) + value = CARD_ROTATION[Zlib.crc32(card.to_param) % CARD_ROTATION.size] + + "--card-rotate: #{value}deg;" + end + + def display_count_options + CardsController::DISPLAY_COUNT_OPTIONS.map do |count| + { + value: count, + label: count, + selected: @display_count == count, + id: "display-count-#{count}" + } + end + end +end diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 4bb8be39f..77847b53b 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -4,8 +4,8 @@ module CommentsHelper data: { creator_id: comment.creator_id, created_by_current_user_target: "creation" }, & end - def new_comment_placeholder(bubble) - if bubble.creator == Current.user && bubble.messages.comments.empty? + def new_comment_placeholder(card) + if card.creator == Current.user && card.messages.comments.empty? "Next, add some notes, context, pictures, or video about this…" else "Type your comment…" diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 613c7fe36..e8afb6f4e 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -12,7 +12,7 @@ module EventsHelper def event_column(event) case event.action - when "popped" + when "closed" 3 when "published" 1 @@ -45,15 +45,15 @@ module EventsHelper start_time = day.beginning_of_day end_time = day.end_of_day - accessible_events = Event.joins(bubble: :bucket) - .merge(Current.user.buckets) + accessible_events = Event.joins(card: :collection) + .merge(Current.user.collections) .where(created_at: start_time..end_time) - .where(bubbles: { bucket_id: params[:bucket_ids].presence || Current.user.bucket_ids }) + .where(cards: { collection_id: params[:collection_ids].presence || Current.user.collection_ids }) headers = { "Added" => accessible_events.where(action: "published").count, "Updated" => nil, - "Closed" => accessible_events.where(action: "popped").count + "Closed" => accessible_events.where(action: "closed").count } headers.map do |header, count| @@ -66,32 +66,32 @@ module EventsHelper case event.action when "assigned" if event.assignees.include?(Current.user) - "#{ event.creator == Current.user ? "You" : event.creator.name } will handle #{ bubble_title(event.bubble) }".html_safe + "#{ event.creator == Current.user ? "You" : event.creator.name } will handle #{ card_title(event.card) }".html_safe else - "#{ event.creator == Current.user ? "You" : event.creator.name } assigned #{ event.assignees.pluck(:name).to_sentence } to #{ bubble_title(event.bubble) }".html_safe + "#{ event.creator == Current.user ? "You" : event.creator.name } assigned #{ event.assignees.pluck(:name).to_sentence } to #{ card_title(event.card) }".html_safe end when "unassigned" - "#{ event.creator == Current.user ? "You" : event.creator.name } unassigned #{ event.assignees.pluck(:name).to_sentence } from #{ bubble_title(event.bubble) }".html_safe + "#{ event.creator == Current.user ? "You" : event.creator.name } unassigned #{ event.assignees.pluck(:name).to_sentence } from #{ card_title(event.card) }".html_safe when "boosted" - "#{ event.creator == Current.user ? "You" : event.creator.name } boosted #{ bubble_title(event.bubble) }".html_safe + "#{ event.creator == Current.user ? "You" : event.creator.name } boosted #{ card_title(event.card) }".html_safe when "commented" - "#{ event.creator == Current.user ? "You" : event.creator.name } commented on #{ bubble_title(event.bubble) }".html_safe + "#{ event.creator == Current.user ? "You" : event.creator.name } commented on #{ card_title(event.card) }".html_safe when "published" - "#{ event.creator == Current.user ? "You" : event.creator.name } added #{ bubble_title(event.bubble) }".html_safe - when "popped" - "#{ event.creator == Current.user ? "You" : event.creator.name } closed #{ bubble_title(event.bubble) }".html_safe + "#{ event.creator == Current.user ? "You" : event.creator.name } added #{ card_title(event.card) }".html_safe + when "closed" + "#{ event.creator == Current.user ? "You" : event.creator.name } closed #{ card_title(event.card) }".html_safe when "staged" - "#{event.creator == Current.user ? "You" : event.creator.name} changed the stage to #{event.stage_name} on #{ bubble_title(event.bubble) }".html_safe + "#{event.creator == Current.user ? "You" : event.creator.name} changed the stage to #{event.stage_name} on #{ card_title(event.card) }".html_safe when "unstaged" - "#{event.creator == Current.user ? "You" : event.creator.name} removed #{ bubble_title(event.bubble) } from the #{event.stage_name} stage".html_safe + "#{event.creator == Current.user ? "You" : event.creator.name} removed #{ card_title(event.card) } from the #{event.stage_name} stage".html_safe when "due_date_added" - "#{event.creator == Current.user ? "You" : event.creator.name} set the date to #{event.particulars.dig('particulars', 'due_date').to_date.strftime('%B %-d')} on #{ bubble_title(event.bubble) }".html_safe + "#{event.creator == Current.user ? "You" : event.creator.name} set the date to #{event.particulars.dig('particulars', 'due_date').to_date.strftime('%B %-d')} on #{ card_title(event.card) }".html_safe when "due_date_changed" - "#{event.creator == Current.user ? "You" : event.creator.name} changed the date to #{event.particulars.dig('particulars', 'due_date').to_date.strftime('%B %-d')} on #{ bubble_title(event.bubble) }".html_safe + "#{event.creator == Current.user ? "You" : event.creator.name} changed the date to #{event.particulars.dig('particulars', 'due_date').to_date.strftime('%B %-d')} on #{ card_title(event.card) }".html_safe when "due_date_removed" - "#{event.creator == Current.user ? "You" : event.creator.name} removed the date on #{ bubble_title(event.bubble) }" + "#{event.creator == Current.user ? "You" : event.creator.name} removed the date on #{ card_title(event.card) }" when "title_changed" - "#{event.creator == Current.user ? "You" : event.creator.name} renamed on #{ bubble_title(event.bubble) } (was: '#{event.particulars.dig('particulars', 'old_title')})'".html_safe + "#{event.creator == Current.user ? "You" : event.creator.name} renamed on #{ card_title(event.card) } (was: '#{event.particulars.dig('particulars', 'old_title')})'".html_safe end end diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 1693e77a1..c2c1d0dc5 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -1,16 +1,16 @@ module FiltersHelper def filter_title(filter) - if filter.buckets.none? + if filter.collections.none? "All collections" - elsif filter.buckets.one? - filter.buckets.first.name + elsif filter.collections.one? + filter.collections.first.name else - filter.buckets.map(&:name).to_sentence + filter.collections.map(&:name).to_sentence end end def filter_chip_tag(text, params) - link_to bubbles_path(params), class: "btn txt-small btn--remove fill-selected" do + link_to cards_path(params), class: "btn txt-small btn--remove fill-selected" do concat tag.span(text) concat icon_tag("close") end diff --git a/app/helpers/messages_helper.rb b/app/helpers/messages_helper.rb index d76a46867..a8a7544ac 100644 --- a/app/helpers/messages_helper.rb +++ b/app/helpers/messages_helper.rb @@ -1,8 +1,8 @@ module MessagesHelper - def messages_tag(bubble, &) - turbo_frame_tag dom_id(bubble, :messages), + def messages_tag(card, &) + turbo_frame_tag dom_id(card, :messages), class: "comments gap center", - style: "--bubble-color: <%= bubble.color %>", + style: "--card-color: <%= card.color %>", role: "group", aria: { label: "Messages" }, data: { controller: "created-by-current-user", diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index fd2b101db..3c5e0d680 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -1,6 +1,6 @@ module NotificationsHelper def notification_title(notification) - title = bubble_title(notification.bubble) + title = card_title(notification.card) if notification.resource.is_a? Comment "RE: " + title @@ -15,7 +15,7 @@ module NotificationsHelper name = notification.creator.name case notification_event_action(notification) - when "popped" then "Popped by #{name}" + when "closed" then "Closed by #{name}" when "published" then "Added by #{name}" else name end @@ -59,6 +59,6 @@ module NotificationsHelper end def notification_is_for_initial_assignement?(notification) - notification.event.action == "published" && notification.bubble.assigned_to?(notification.user) + notification.event.action == "published" && notification.card.assigned_to?(notification.user) end end diff --git a/app/helpers/translations_helper.rb b/app/helpers/translations_helper.rb index 5f6ae4223..f50a397e2 100644 --- a/app/helpers/translations_helper.rb +++ b/app/helpers/translations_helper.rb @@ -3,7 +3,7 @@ module TranslationsHelper user_name: { "🇺🇸": "Enter your name", "🇪🇸": "Introduce tu nombre", "🇫🇷": "Entrez votre nom", "🇮🇳": "अपना नाम दर्ज करें", "🇩🇪": "Geben Sie Ihren Namen ein", "🇧🇷": "Insira seu nome" }, email_address: { "🇺🇸": "Enter your email address", "🇪🇸": "Introduce tu correo electrónico", "🇫🇷": "Entrez votre adresse courriel", "🇮🇳": "अपना ईमेल पता दर्ज करें", "🇩🇪": "Geben Sie Ihre E-Mail-Adresse ein", "🇧🇷": "Insira seu endereço de email" }, password: { "🇺🇸": "Enter your password", "🇪🇸": "Introduce tu contraseña", "🇫🇷": "Saisissez votre mot de passe", "🇮🇳": "अपना पासवर्ड दर्ज करें", "🇩🇪": "Geben Sie Ihr Passwort ein", "🇧🇷": "Insira sua senha" }, - bucket_name: { "🇺🇸": "Give it a name", "🇪🇸": "Dale un nombre", "🇫🇷": "Donnez lui un nom", "🇮🇳": "इसे एक नाम दें", "🇩🇪": "Gib ihm einen Namen", "🇧🇷": "Dê-lhe um nome" } + collection_name: { "🇺🇸": "Give it a name", "🇪🇸": "Dale un nombre", "🇫🇷": "Donnez lui un nom", "🇮🇳": "इसे एक नाम दें", "🇩🇪": "Gib ihm einen Namen", "🇧🇷": "Dê-lhe um nome" } } def translations_for(translation_key) diff --git a/app/helpers/workflows_helper.rb b/app/helpers/workflows_helper.rb index f78241aa9..32fd5e68a 100644 --- a/app/helpers/workflows_helper.rb +++ b/app/helpers/workflows_helper.rb @@ -1,7 +1,7 @@ module WorkflowsHelper - def button_to_set_stage(bubble, stage) - button_to bubble_stagings_path(bubble, stage_id: stage), - method: :post, class: [ "btn full-width justify-start workflow-stage txt-uppercase", { "workflow-stage--current": stage == bubble.stage } ], + def button_to_set_stage(card, stage) + button_to card_stagings_path(card, stage_id: stage), + method: :post, class: [ "btn full-width justify-start workflow-stage txt-uppercase", { "workflow-stage--current": stage == card.stage } ], form_class: "flex align-center gap-half", data: { turbo_frame: "_top" } do tag.span class: "overflow-ellipsis" do diff --git a/app/javascript/controllers/bubble_size_controller.js b/app/javascript/controllers/card_size_controller.js similarity index 69% rename from app/javascript/controllers/bubble_size_controller.js rename to app/javascript/controllers/card_size_controller.js index 912e19d66..b673e910d 100644 --- a/app/javascript/controllers/bubble_size_controller.js +++ b/app/javascript/controllers/card_size_controller.js @@ -3,7 +3,7 @@ import { Controller } from "@hotwired/stimulus" const SIZES = [ "one", "two", "three", "four", "five" ] export default class extends Controller { - static targets = [ "bubble" ] + static targets = [ "card" ] connect() { this.resize() @@ -12,19 +12,19 @@ export default class extends Controller { resize() { const [ min, max ] = this.#getScoreRange() - this.bubbleTargets.forEach(bubble => { - const score = this.#currentBubbleScore(bubble) + this.cardTargets.forEach(card => { + const score = this.#currentBubbleScore(card) const idx = Math.round((score - min) / (max - min) * (SIZES.length - 1)) - bubble.style.setProperty("--bubble-size", `var(--bubble-size-${SIZES[idx]})`) + card.style.setProperty("--card-size", `var(--card-size-${SIZES[idx]})`) }) } #getScoreRange() { var min = 0, max = 1; - this.bubbleTargets.forEach(bubble => { - const score = this.#currentBubbleScore(bubble) + this.cardTargets.forEach(card => { + const score = this.#currentBubbleScore(card) min = Math.min(min, score) max = Math.max(max, score) diff --git a/app/javascript/controllers/popover_controller.js b/app/javascript/controllers/closureover_controller.js similarity index 100% rename from app/javascript/controllers/popover_controller.js rename to app/javascript/controllers/closureover_controller.js diff --git a/app/javascript/controllers/local_save_controller.js b/app/javascript/controllers/local_save_controller.js index 5d9b89a72..c0c5892aa 100644 --- a/app/javascript/controllers/local_save_controller.js +++ b/app/javascript/controllers/local_save_controller.js @@ -47,7 +47,7 @@ export default class extends Controller { #triggerChangeEvent(newValue) { if (this.inputTarget.tagName === "HOUSE-MD") { this.inputTarget.dispatchEvent(new CustomEvent('house-md:change', { - bubbles: true, + cards: true, detail: { previousContent: '', newContent: newValue diff --git a/app/javascript/controllers/paste_controller.js b/app/javascript/controllers/paste_controller.js index 79db7d7db..41fc77d2c 100644 --- a/app/javascript/controllers/paste_controller.js +++ b/app/javascript/controllers/paste_controller.js @@ -12,7 +12,7 @@ export default class extends Controller { for (const file of files) { const uploadEvent = new CustomEvent("house-md:before-upload", { - bubbles: true, + cards: true, detail: { file }, cancelable: true }) diff --git a/app/jobs/bubble/auto_pop_all_due_job.rb b/app/jobs/card/auto_closure_all_due_job.rb similarity index 57% rename from app/jobs/bubble/auto_pop_all_due_job.rb rename to app/jobs/card/auto_closure_all_due_job.rb index 845c0889e..0bf063c2b 100644 --- a/app/jobs/bubble/auto_pop_all_due_job.rb +++ b/app/jobs/card/auto_closure_all_due_job.rb @@ -1,9 +1,9 @@ -class Bubble::AutoPopAllDueJob < ApplicationJob +class Card::AutoPopAllDueJob < ApplicationJob queue_as :default def perform ApplicationRecord.with_each_tenant do |tenant| - Bubble.auto_pop_all_due + Card.auto_closure_all_due end end end diff --git a/app/jobs/bubble/auto_reconsider_all_stagnated_job.rb b/app/jobs/card/auto_reconsider_all_stagnated_job.rb similarity index 50% rename from app/jobs/bubble/auto_reconsider_all_stagnated_job.rb rename to app/jobs/card/auto_reconsider_all_stagnated_job.rb index 1b08f4371..83f87a648 100644 --- a/app/jobs/bubble/auto_reconsider_all_stagnated_job.rb +++ b/app/jobs/card/auto_reconsider_all_stagnated_job.rb @@ -1,9 +1,9 @@ -class Bubble::AutoReconsiderAllStagnatedJob < ApplicationJob +class Card::AutoReconsiderAllStagnatedJob < ApplicationJob queue_as :default def perform ApplicationRecord.with_each_tenant do |tenant| - Bubble.auto_reconsider_all_stagnated + Card.auto_reconsider_all_stagnated end end end diff --git a/app/jobs/remove_abandoned_creations_job.rb b/app/jobs/remove_abandoned_creations_job.rb index 9381927aa..1444313a2 100644 --- a/app/jobs/remove_abandoned_creations_job.rb +++ b/app/jobs/remove_abandoned_creations_job.rb @@ -3,7 +3,7 @@ class RemoveAbandonedCreationsJob < ApplicationJob def perform ApplicationRecord.with_each_tenant do |tenant| - Bubble.remove_abandoned_creations + Card.remove_abandoned_creations end end end diff --git a/app/models/access.rb b/app/models/access.rb index 1ca40d9e2..509067f0c 100644 --- a/app/models/access.rb +++ b/app/models/access.rb @@ -1,5 +1,5 @@ class Access < ApplicationRecord - belongs_to :bucket + belongs_to :collection belongs_to :user enum :involvement, %i[ access_only watching everything ].index_by(&:itself) diff --git a/app/models/account.rb b/app/models/account.rb index a2b3c7e34..10ba9f773 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,8 +1,8 @@ class Account < ApplicationRecord - include PopReasons, Joinable + include ClosureReasons, Joinable - has_many :buckets, dependent: :destroy - has_many :bubbles, through: :buckets + has_many :collections, dependent: :destroy + has_many :cards, through: :collections has_many :users, dependent: :destroy do def system diff --git a/app/models/account/pop_reasons.rb b/app/models/account/closure_reasons.rb similarity index 58% rename from app/models/account/pop_reasons.rb rename to app/models/account/closure_reasons.rb index 63ce1584e..e5bdf25a1 100644 --- a/app/models/account/pop_reasons.rb +++ b/app/models/account/closure_reasons.rb @@ -1,4 +1,4 @@ -module Account::PopReasons +module Account::ClosureReasons extend ActiveSupport::Concern DEFAULT_LABELS = [ @@ -11,19 +11,19 @@ module Account::PopReasons FALLBACK_LABEL = "Done" included do - has_many :pop_reasons, dependent: :destroy, class_name: "Pop::Reason" do + has_many :closure_reasons, dependent: :destroy, class_name: "Closure::Reason" do def labels pluck(:label).presence || [ FALLBACK_LABEL ] end end - after_create :create_default_pop_reasons + after_create :create_default_closure_reasons end private - def create_default_pop_reasons + def create_default_closure_reasons DEFAULT_LABELS.each do |label| - pop_reasons.create! label: label + closure_reasons.create! label: label end end end diff --git a/app/models/assignment.rb b/app/models/assignment.rb index 7233030b3..312bc3bf7 100644 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -1,5 +1,5 @@ class Assignment < ApplicationRecord - belongs_to :bubble, touch: true + belongs_to :card, touch: true belongs_to :assignee, class_name: "User" belongs_to :assigner, class_name: "User" diff --git a/app/models/bubble/engagement.rb b/app/models/bubble/engagement.rb deleted file mode 100644 index 0458f9ec2..000000000 --- a/app/models/bubble/engagement.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Bubble::Engagement < ApplicationRecord - belongs_to :bubble, class_name: "::Bubble", touch: true -end diff --git a/app/models/bubble/poppable.rb b/app/models/bubble/poppable.rb deleted file mode 100644 index 098bda924..000000000 --- a/app/models/bubble/poppable.rb +++ /dev/null @@ -1,56 +0,0 @@ -module Bubble::Poppable - extend ActiveSupport::Concern - - AUTO_POP_AFTER = 30.days - - included do - has_one :pop, dependent: :destroy - - scope :popped, -> { joins(:pop) } - scope :active, -> { where.missing(:pop) } - - scope :recently_popped_first, -> { popped.order("pops.created_at": :desc) } - scope :due_to_be_popped, -> { considering.where(last_active_at: ..AUTO_POP_AFTER.ago) } - end - - class_methods do - def auto_pop_all_due - due_to_be_popped.find_each do |bubble| - bubble.pop!(user: bubble.bucket.account.users.system, reason: "Closed") - end - end - end - - def auto_pop_at - last_active_at + AUTO_POP_AFTER if last_active_at - end - - def popped? - pop.present? - end - - def active? - !popped? - end - - def popped_by - pop&.user - end - - def popped_at - pop&.created_at - end - - def pop!(user: Current.user, reason: Account::PopReasons::FALLBACK_LABEL) - unless popped? - transaction do - create_pop! user: user, reason: reason - track_event :popped, creator: user - end - end - end - - def unpop - pop&.destroy - end -end diff --git a/app/models/bucket.rb b/app/models/bucket.rb deleted file mode 100644 index ce6ec4154..000000000 --- a/app/models/bucket.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Bucket < ApplicationRecord - include Accessible, Broadcastable, Filterable - - belongs_to :account - belongs_to :creator, class_name: "User", default: -> { Current.user } - belongs_to :workflow, optional: true - - has_many :bubbles, dependent: :destroy - has_many :tags, -> { distinct }, through: :bubbles - - validates_presence_of :name - - after_save :update_bubbles_workflow, if: :saved_change_to_workflow_id? - - scope :alphabetically, -> { order("lower(name)") } - - private - def update_bubbles_workflow - bubbles.update_all(stage_id: workflow&.stages&.first&.id) - end -end diff --git a/app/models/bucket/broadcastable.rb b/app/models/bucket/broadcastable.rb deleted file mode 100644 index 5406c23ef..000000000 --- a/app/models/bucket/broadcastable.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Bucket::Broadcastable - extend ActiveSupport::Concern - - included do - broadcasts_refreshes - broadcasts_refreshes_to ->(bucket) { [ bucket.account, :buckets ] } - end -end diff --git a/app/models/bubble.rb b/app/models/card.rb similarity index 81% rename from app/models/bubble.rb rename to app/models/card.rb index cda9f2cc0..50f2f541b 100644 --- a/app/models/bubble.rb +++ b/app/models/card.rb @@ -1,8 +1,8 @@ -class Bubble < ApplicationRecord +class Card < ApplicationRecord include Assignable, Boostable, Colored, Commentable, Engageable, Eventable, - Messages, Notifiable, Pinnable, Poppable, Scorable, Searchable, Staged, Statuses, Taggable, Watchable + Messages, Notifiable, Pinnable, Closeable, Scorable, Searchable, Staged, Statuses, Taggable, Watchable - belongs_to :bucket, touch: true + belongs_to :collection, touch: true belongs_to :creator, class_name: "User", default: -> { Current.user } has_many :notifications, dependent: :destroy @@ -15,7 +15,7 @@ class Bubble < ApplicationRecord scope :reverse_chronologically, -> { order created_at: :desc, id: :desc } scope :chronologically, -> { order created_at: :asc, id: :asc } - scope :in_bucket, ->(bucket) { where bucket: bucket } + scope :in_collection, ->(collection) { where collection: collection } scope :indexed_by, ->(index) do case index @@ -25,12 +25,12 @@ class Bubble < ApplicationRecord when "newest" then reverse_chronologically when "oldest" then chronologically when "stalled" then ordered_by_staleness - when "popped" then popped + when "closed" then closed end end def cache_key - [ super, bucket&.name ].compact.join("/") + [ super, collection&.name ].compact.join("/") end private @@ -56,7 +56,7 @@ class Bubble < ApplicationRecord end def assign_initial_stage - if workflow_stage = bucket.workflow&.stages&.first + if workflow_stage = collection.workflow&.stages&.first self.stage = workflow_stage save! touch: false track_event :staged, stage_id: workflow_stage.id, stage_name: workflow_stage.name diff --git a/app/models/bubble/assignable.rb b/app/models/card/assignable.rb similarity index 97% rename from app/models/bubble/assignable.rb rename to app/models/card/assignable.rb index c0dd36ff4..7ef0eb134 100644 --- a/app/models/bubble/assignable.rb +++ b/app/models/card/assignable.rb @@ -1,4 +1,4 @@ -module Bubble::Assignable +module Card::Assignable extend ActiveSupport::Concern included do diff --git a/app/models/bubble/boostable.rb b/app/models/card/boostable.rb similarity index 92% rename from app/models/bubble/boostable.rb rename to app/models/card/boostable.rb index 94a530e8e..9e7c404c8 100644 --- a/app/models/bubble/boostable.rb +++ b/app/models/card/boostable.rb @@ -1,4 +1,4 @@ -module Bubble::Boostable +module Card::Boostable extend ActiveSupport::Concern included do diff --git a/app/models/card/closeable.rb b/app/models/card/closeable.rb new file mode 100644 index 000000000..e82df5a60 --- /dev/null +++ b/app/models/card/closeable.rb @@ -0,0 +1,56 @@ +module Card::Closeable + extend ActiveSupport::Concern + + AUTO_CLOSURE_AFTER = 30.days + + included do + has_one :closure, dependent: :destroy + + scope :closed, -> { joins(:closure) } + scope :active, -> { where.missing(:closure) } + + scope :recently_closed_first, -> { closed.order("closures.created_at": :desc) } + scope :due_to_be_closed, -> { considering.where(last_active_at: ..AUTO_CLOSURE_AFTER.ago) } + end + + class_methods do + def auto_closure_all_due + due_to_be_closed.find_each do |card| + card.closure!(user: card.collection.account.users.system, reason: "Closed") + end + end + end + + def auto_closure_at + last_active_at + AUTO_CLOSURE_AFTER if last_active_at + end + + def closed? + closure.present? + end + + def active? + !closed? + end + + def closed_by + closure&.user + end + + def closed_at + closure&.created_at + end + + def closure!(user: Current.user, reason: Account::ClosureReasons::FALLBACK_LABEL) + unless closed? + transaction do + create_closure! user: user, reason: reason + track_event :closed, creator: user + end + end + end + + def unpop + closure&.destroy + end +end diff --git a/app/models/bubble/colored.rb b/app/models/card/colored.rb similarity index 87% rename from app/models/bubble/colored.rb rename to app/models/card/colored.rb index 33939840b..7d4ae9c54 100644 --- a/app/models/bubble/colored.rb +++ b/app/models/card/colored.rb @@ -1,4 +1,4 @@ -module Bubble::Colored +module Card::Colored extend ActiveSupport::Concern COLORS = %w[ #b7462b #ff63a8 #eb7a32 #6ac967 #2c6da8 #663251 ] diff --git a/app/models/bubble/commentable.rb b/app/models/card/commentable.rb similarity index 93% rename from app/models/bubble/commentable.rb rename to app/models/card/commentable.rb index ab1c72a74..d0308069f 100644 --- a/app/models/bubble/commentable.rb +++ b/app/models/card/commentable.rb @@ -1,4 +1,4 @@ -module Bubble::Commentable +module Card::Commentable extend ActiveSupport::Concern included do diff --git a/app/models/bubble/engageable.rb b/app/models/card/engageable.rb similarity index 82% rename from app/models/bubble/engageable.rb rename to app/models/card/engageable.rb index 5a11a5b06..c16cd986a 100644 --- a/app/models/bubble/engageable.rb +++ b/app/models/card/engageable.rb @@ -1,10 +1,10 @@ -module Bubble::Engageable +module Card::Engageable extend ActiveSupport::Concern STAGNATED_AFTER = 30.days included do - has_one :engagement, dependent: :destroy, class_name: "Bubble::Engagement" + has_one :engagement, dependent: :destroy, class_name: "Card::Engagement" scope :doing, -> { published.active.joins(:engagement) } scope :considering, -> { published.active.where.missing(:engagement) } @@ -14,8 +14,8 @@ module Bubble::Engageable class_methods do def auto_reconsider_all_stagnated - stagnated.find_each do |bubble| - bubble.reconsider + stagnated.find_each do |card| + card.reconsider end end end diff --git a/app/models/card/engagement.rb b/app/models/card/engagement.rb new file mode 100644 index 000000000..6cdcdf45e --- /dev/null +++ b/app/models/card/engagement.rb @@ -0,0 +1,3 @@ +class Card::Engagement < ApplicationRecord + belongs_to :card, class_name: "::Card", touch: true +end diff --git a/app/models/bubble/eventable.rb b/app/models/card/eventable.rb similarity index 86% rename from app/models/bubble/eventable.rb rename to app/models/card/eventable.rb index c1297cc4f..038a6d51a 100644 --- a/app/models/bubble/eventable.rb +++ b/app/models/card/eventable.rb @@ -1,4 +1,4 @@ -module Bubble::Eventable +module Card::Eventable extend ActiveSupport::Concern included do @@ -13,7 +13,7 @@ module Bubble::Eventable private def track_event(action, creator: Current.user, **particulars) if published? - event = find_or_capture_event_summary.events.create! action: action, creator: creator, bubble: self, particulars: particulars + event = find_or_capture_event_summary.events.create! action: action, creator: creator, card: self, particulars: particulars event.generate_notifications_later end end diff --git a/app/models/bubble/messages.rb b/app/models/card/messages.rb similarity index 97% rename from app/models/bubble/messages.rb rename to app/models/card/messages.rb index 9f89466dc..01446905c 100644 --- a/app/models/bubble/messages.rb +++ b/app/models/card/messages.rb @@ -1,4 +1,4 @@ -module Bubble::Messages +module Card::Messages extend ActiveSupport::Concern included do diff --git a/app/models/bubble/pinnable.rb b/app/models/card/pinnable.rb similarity index 92% rename from app/models/bubble/pinnable.rb rename to app/models/card/pinnable.rb index 044125eae..0cdaf4000 100644 --- a/app/models/bubble/pinnable.rb +++ b/app/models/card/pinnable.rb @@ -1,4 +1,4 @@ -module Bubble::Pinnable +module Card::Pinnable extend ActiveSupport::Concern included do diff --git a/app/models/bubble/scorable.rb b/app/models/card/scorable.rb similarity index 92% rename from app/models/bubble/scorable.rb rename to app/models/card/scorable.rb index fd188eb98..3bad86a74 100644 --- a/app/models/bubble/scorable.rb +++ b/app/models/card/scorable.rb @@ -1,4 +1,4 @@ -module Bubble::Scorable +module Card::Scorable extend ActiveSupport::Concern REFERENCE_DATE = Time.utc(2025, 1, 1) @@ -37,7 +37,7 @@ module Bubble::Scorable def event_weight(event) case when event.boosted? then 1 - when event.comment&.first_by_author_on_bubble? then 20 + when event.comment&.first_by_author_on_card? then 20 when event.comment&.follows_comment_by_another_author? then 15 when event.commented? then 10 else 0 @@ -46,7 +46,7 @@ module Bubble::Scorable def event_score_reference(score, activity_at) # The reference score is used to make the activity score comparable - # across different bubbles, since it represents the bubble's activity + # across different cards, since it represents the card's activity # level at a consistent point in time. # # We store this as log2 to tame the huge/tiny numbers we'd otherwise get diff --git a/app/models/bubble/searchable.rb b/app/models/card/searchable.rb similarity index 75% rename from app/models/bubble/searchable.rb rename to app/models/card/searchable.rb index 150890efe..3627a555b 100644 --- a/app/models/bubble/searchable.rb +++ b/app/models/card/searchable.rb @@ -1,17 +1,17 @@ -module Bubble::Searchable +module Card::Searchable extend ActiveSupport::Concern included do include ::Searchable - searchable_by :title, using: :bubbles_search_index + searchable_by :title, using: :cards_search_index scope :mentioning, ->(query) do if query = sanitize_query_syntax(query) - bubbles = Bubble.search(query).select(:id).to_sql + cards = Card.search(query).select(:id).to_sql comments = Comment.search(query).select(:id).to_sql - left_joins(:messages).where("bubbles.id in (#{bubbles}) or messages.messageable_id in (#{comments})").distinct + left_joins(:messages).where("cards.id in (#{cards}) or messages.messageable_id in (#{comments})").distinct else none end diff --git a/app/models/bubble/staged.rb b/app/models/card/staged.rb similarity index 95% rename from app/models/bubble/staged.rb rename to app/models/card/staged.rb index 2b16734b9..b669aeddd 100644 --- a/app/models/bubble/staged.rb +++ b/app/models/card/staged.rb @@ -1,4 +1,4 @@ -module Bubble::Staged +module Card::Staged extend ActiveSupport::Concern included do diff --git a/app/models/bubble/statuses.rb b/app/models/card/statuses.rb similarity index 66% rename from app/models/bubble/statuses.rb rename to app/models/card/statuses.rb index f34dab13b..636d9127d 100644 --- a/app/models/bubble/statuses.rb +++ b/app/models/card/statuses.rb @@ -1,4 +1,4 @@ -module Bubble::Statuses +module Card::Statuses extend ActiveSupport::Concern included do @@ -9,7 +9,7 @@ module Bubble::Statuses class_methods do def remove_abandoned_creations - Bubble.creating.where(updated_at: ..1.day.ago).destroy_all + Card.creating.where(updated_at: ..1.day.ago).destroy_all end end @@ -18,8 +18,8 @@ module Bubble::Statuses end def recover_abandoned_creation - abandoned_creations.last.tap do |bubble| - Bubble.creating.where(creator: creator).excluding(bubble).destroy_all + abandoned_creations.last.tap do |card| + Card.creating.where(creator: creator).excluding(card).destroy_all end end @@ -32,6 +32,6 @@ module Bubble::Statuses private def abandoned_creations - Bubble.creating.where(creator: creator).where("created_at != updated_at").excluding(self) + Card.creating.where(creator: creator).where("created_at != updated_at").excluding(self) end end diff --git a/app/models/bubble/taggable.rb b/app/models/card/taggable.rb similarity index 83% rename from app/models/bubble/taggable.rb rename to app/models/card/taggable.rb index 7fa4dee07..a419a4cae 100644 --- a/app/models/bubble/taggable.rb +++ b/app/models/card/taggable.rb @@ -1,4 +1,4 @@ -module Bubble::Taggable +module Card::Taggable extend ActiveSupport::Concern included do @@ -9,7 +9,7 @@ module Bubble::Taggable end def toggle_tag_with(title) - tag = bucket.account.tags.find_or_create_by!(title: title) + tag = collection.account.tags.find_or_create_by!(title: title) transaction do if tagged_with?(tag) diff --git a/app/models/bubble/watchable.rb b/app/models/card/watchable.rb similarity index 88% rename from app/models/bubble/watchable.rb rename to app/models/card/watchable.rb index bc4a82ccf..f511ddc7e 100644 --- a/app/models/bubble/watchable.rb +++ b/app/models/card/watchable.rb @@ -1,4 +1,4 @@ -module Bubble::Watchable +module Card::Watchable extend ActiveSupport::Concern included do @@ -22,7 +22,7 @@ module Bubble::Watchable def watchers_and_subscribers(include_only_watching: false) involvements = include_only_watching ? [ :watching, :everything ] : :everything - subscribers = bucket.users.where(accesses: { involvement: involvements }) + subscribers = collection.users.where(accesses: { involvement: involvements }) User.where(id: subscribers.pluck(:id) + watches.watching.pluck(:user_id) - watches.not_watching.pluck(:user_id)) diff --git a/app/models/closure.rb b/app/models/closure.rb new file mode 100644 index 000000000..ec0a812fc --- /dev/null +++ b/app/models/closure.rb @@ -0,0 +1,4 @@ +class Closure < ApplicationRecord + belongs_to :card, touch: true + belongs_to :user, optional: true +end diff --git a/app/models/closure/reason.rb b/app/models/closure/reason.rb new file mode 100644 index 000000000..aa1f0161b --- /dev/null +++ b/app/models/closure/reason.rb @@ -0,0 +1,3 @@ +class Closure::Reason < ApplicationRecord + belongs_to :account +end diff --git a/app/models/collection.rb b/app/models/collection.rb new file mode 100644 index 000000000..3820af5a1 --- /dev/null +++ b/app/models/collection.rb @@ -0,0 +1,21 @@ +class Collection < ApplicationRecord + include Accessible, Broadcastable, Filterable + + belongs_to :account + belongs_to :creator, class_name: "User", default: -> { Current.user } + belongs_to :workflow, optional: true + + has_many :cards, dependent: :destroy + has_many :tags, -> { distinct }, through: :cards + + validates_presence_of :name + + after_save :update_cards_workflow, if: :saved_change_to_workflow_id? + + scope :alphabetically, -> { order("lower(name)") } + + private + def update_cards_workflow + cards.update_all(stage_id: workflow&.stages&.first&.id) + end +end diff --git a/app/models/bucket/accessible.rb b/app/models/collection/accessible.rb similarity index 85% rename from app/models/bucket/accessible.rb rename to app/models/collection/accessible.rb index 3c72e9983..81ed9b5b1 100644 --- a/app/models/bucket/accessible.rb +++ b/app/models/collection/accessible.rb @@ -1,4 +1,4 @@ -module Bucket::Accessible +module Collection::Accessible extend ActiveSupport::Concern included do @@ -11,7 +11,7 @@ module Bucket::Accessible end def grant_to(users) - Access.insert_all Array(users).collect { |user| { bucket_id: proxy_association.owner.id, user_id: user.id } } + Access.insert_all Array(users).collect { |user| { collection_id: proxy_association.owner.id, user_id: user.id } } end def revoke_from(users) diff --git a/app/models/collection/broadcastable.rb b/app/models/collection/broadcastable.rb new file mode 100644 index 000000000..5e36898d6 --- /dev/null +++ b/app/models/collection/broadcastable.rb @@ -0,0 +1,8 @@ +module Collection::Broadcastable + extend ActiveSupport::Concern + + included do + broadcasts_refreshes + broadcasts_refreshes_to ->(collection) { [ collection.account, :collections ] } + end +end diff --git a/app/models/comment.rb b/app/models/comment.rb index 03b45c6c3..8eb60d0f4 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -10,12 +10,12 @@ class Comment < ApplicationRecord before_destroy :cleanup_events - def first_by_author_on_bubble? - bubble_comments.many? && bubble_comments_prior.where(creator_id: creator_id).none? + def first_by_author_on_card? + card_comments.many? && card_comments_prior.where(creator_id: creator_id).none? end def follows_comment_by_another_author? - bubble_comments.many? && bubble_comments_prior.last&.creator != creator + card_comments.many? && card_comments_prior.last&.creator != creator end private @@ -30,11 +30,11 @@ class Comment < ApplicationRecord Event.where(particulars: { comment_id: id }).destroy_all end - def bubble_comments_prior - bubble_comments.where(created_at: ...created_at) + def card_comments_prior + card_comments.where(created_at: ...created_at) end - def bubble_comments - Comment.joins(:message).where(messages: { bubble: bubble }) + def card_comments + Comment.joins(:message).where(messages: { card: card }) end end diff --git a/app/models/concerns/filter/params.rb b/app/models/concerns/filter/params.rb index 6c1ff2a8e..7c500942a 100644 --- a/app/models/concerns/filter/params.rb +++ b/app/models/concerns/filter/params.rb @@ -2,7 +2,7 @@ module Filter::Params extend ActiveSupport::Concern PERMITTED_PARAMS = %i[ - indexed_by assignment_status bucket_ids creator_ids + indexed_by assignment_status collection_ids creator_ids assignee_ids stage_ids tag_ids terms display_count ].freeze @@ -10,7 +10,7 @@ module Filter::Params self.class.normalize_params( indexed_by: indexed_by, assignment_status: assignment_status, - bucket_ids: buckets.ids, + collection_ids: collections.ids, creator_ids: creators.ids, assignee_ids: assignees.ids, stage_ids: stages.ids, diff --git a/app/models/concerns/messageable.rb b/app/models/concerns/messageable.rb index 723be91d2..219ee1197 100644 --- a/app/models/concerns/messageable.rb +++ b/app/models/concerns/messageable.rb @@ -5,6 +5,6 @@ module Messageable included do has_one :message, as: :messageable, touch: true, dependent: :destroy - has_one :bubble, through: :message + has_one :card, through: :message end end diff --git a/app/models/event.rb b/app/models/event.rb index 9df46a2fb..e64a8f896 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -3,7 +3,7 @@ class Event < ApplicationRecord belongs_to :creator, class_name: "User" belongs_to :summary, touch: true, class_name: "EventSummary" - belongs_to :bubble + belongs_to :card has_one :account, through: :creator has_one :message, through: :summary @@ -14,7 +14,7 @@ class Event < ApplicationRecord scope :boosts, -> { where action: :boosted } scope :comments, -> { where action: :commented } - after_create -> { bubble.touch_last_active_at } + after_create -> { card.touch_last_active_at } def boosted? action == "boosted" diff --git a/app/models/event_summary.rb b/app/models/event_summary.rb index 221e78d2e..b74a5a10c 100644 --- a/app/models/event_summary.rb +++ b/app/models/event_summary.rb @@ -25,8 +25,8 @@ class EventSummary < ApplicationRecord "Unassigned from #{event.assignees.pluck(:name).to_sentence}." when "staged" "#{event.creator.name} moved this to '#{event.stage_name}'." - when "popped" - "Popped by #{ event.creator.name }" + when "closed" + "Closed by #{ event.creator.name }" when "unstaged" "#{event.creator.name} removed this from '#{event.stage_name}'." when "due_date_added" diff --git a/app/models/filter.rb b/app/models/filter.rb index aa9d0a794..62f89015c 100644 --- a/app/models/filter.rb +++ b/app/models/filter.rb @@ -16,14 +16,14 @@ class Filter < ApplicationRecord end end - def bubbles - @bubbles ||= begin - result = creator.accessible_bubbles.indexed_by(indexed_by) - result = result.active unless indexed_by.popped? + def cards + @cards ||= begin + result = creator.accessible_cards.indexed_by(indexed_by) + result = result.active unless indexed_by.closed? result = result.unassigned if assignment_status.unassigned? result = result.assigned_to(assignees.ids) if assignees.present? result = result.where(creator_id: creators.ids) if creators.present? - result = result.in_bucket(buckets.ids) if buckets.present? + result = result.in_collection(collections.ids) if collections.present? result = result.in_stage(stages.ids) if stages.present? result = result.tagged_with(tags.ids) if tags.present? result = terms.reduce(result) do |result, term| @@ -38,19 +38,19 @@ class Filter < ApplicationRecord self.class.normalize_params(as_params).blank? end - def single_bucket - buckets.first if buckets.one? + def single_collection + collections.first if collections.one? end def single_workflow - buckets.first.workflow if buckets.pluck(:workflow_id).uniq.one? + collections.first.workflow if collections.pluck(:workflow_id).uniq.one? end def cacheable? - buckets.exists? + collections.exists? end def cache_key - ActiveSupport::Cache.expand_cache_key buckets.cache_key_with_version, super + ActiveSupport::Cache.expand_cache_key collections.cache_key_with_version, super end end diff --git a/app/models/filter/params.rb b/app/models/filter/params.rb index c09edb074..dd519ec84 100644 --- a/app/models/filter/params.rb +++ b/app/models/filter/params.rb @@ -6,7 +6,7 @@ module Filter::Params :indexed_by, assignee_ids: [], creator_ids: [], - bucket_ids: [], + collection_ids: [], stage_ids: [], tag_ids: [], terms: [] @@ -38,7 +38,7 @@ module Filter::Params params[:assignment_status] = assignment_status params[:terms] = terms params[:tag_ids] = tags.ids - params[:bucket_ids] = buckets.ids + params[:collection_ids] = collections.ids params[:stage_ids] = stages.ids params[:assignee_ids] = assignees.ids params[:creator_ids] = creators.ids diff --git a/app/models/filter/resources.rb b/app/models/filter/resources.rb index a7df5ab69..2a695e43d 100644 --- a/app/models/filter/resources.rb +++ b/app/models/filter/resources.rb @@ -3,7 +3,7 @@ module Filter::Resources included do has_and_belongs_to_many :tags - has_and_belongs_to_many :buckets + has_and_belongs_to_many :collections has_and_belongs_to_many :stages, class_name: "Workflow::Stage", join_table: "filters_stages" has_and_belongs_to_many :assignees, class_name: "User", join_table: "assignees_filters", association_foreign_key: "assignee_id" has_and_belongs_to_many :creators, class_name: "User", join_table: "creators_filters", association_foreign_key: "creator_id" @@ -17,7 +17,7 @@ module Filter::Resources destroy! end - def buckets - creator.buckets.where id: super.ids + def collections + creator.collections.where id: super.ids end end diff --git a/app/models/filter/summarized.rb b/app/models/filter/summarized.rb index 559b3bc6b..c08607f32 100644 --- a/app/models/filter/summarized.rb +++ b/app/models/filter/summarized.rb @@ -1,6 +1,6 @@ module Filter::Summarized def summary - [ index_summary, tag_summary, assignee_summary, creator_summary, stage_summary, terms_summary ].compact.to_sentence + " #{bucket_summary}" + [ index_summary, tag_summary, assignee_summary, creator_summary, stage_summary, terms_summary ].compact.to_sentence + " #{collection_summary}" end private @@ -28,9 +28,9 @@ module Filter::Summarized end end - def bucket_summary - if buckets.any? - "in #{buckets.pluck(:name).to_choice_sentence}" + def collection_summary + if collections.any? + "in #{collections.pluck(:name).to_choice_sentence}" end end diff --git a/app/models/message.rb b/app/models/message.rb index 24e658ed3..bb5dea5a9 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -1,5 +1,5 @@ class Message < ApplicationRecord - belongs_to :bubble, touch: true + belongs_to :card, touch: true delegated_type :messageable, types: Messageable::TYPES, inverse_of: :message, dependent: :destroy @@ -10,10 +10,10 @@ class Message < ApplicationRecord private def created - bubble.comment_created(comment) if comment? + card.comment_created(comment) if comment? end def destroyed - bubble.comment_destroyed if comment? + card.comment_destroyed if comment? end end diff --git a/app/models/notification.rb b/app/models/notification.rb index 05d38c940..3980c3d8d 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,7 +1,7 @@ class Notification < ApplicationRecord belongs_to :user belongs_to :event - belongs_to :bubble + belongs_to :card belongs_to :resource, polymorphic: true scope :unread, -> { where(read_at: nil) } diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 9c89d6bdf..19626be5f 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -12,7 +12,7 @@ class Notifier def generate if should_notify? recipients.map do |recipient| - Notification.create! user: recipient, event: event, bubble: bubble, resource: resource + Notification.create! user: recipient, event: event, card: card, resource: resource end end end @@ -27,14 +27,14 @@ class Notifier end def recipients - bubble.watchers_and_subscribers.without(creator) + card.watchers_and_subscribers.without(creator) end def resource - bubble + card end - def bubble - event.summary.message.bubble + def card + event.summary.message.card end end diff --git a/app/models/notifier/assigned.rb b/app/models/notifier/assigned.rb index 3027ab56c..843376435 100644 --- a/app/models/notifier/assigned.rb +++ b/app/models/notifier/assigned.rb @@ -1,6 +1,6 @@ class Notifier::Assigned < Notifier private def recipients - event.assignees.excluding(bubble.bucket.access_only_users) + event.assignees.excluding(card.collection.access_only_users) end end diff --git a/app/models/notifier/closed.rb b/app/models/notifier/closed.rb new file mode 100644 index 000000000..f090b0308 --- /dev/null +++ b/app/models/notifier/closed.rb @@ -0,0 +1,2 @@ +class Notifier::Closed < Notifier +end diff --git a/app/models/notifier/popped.rb b/app/models/notifier/popped.rb deleted file mode 100644 index f83e721ce..000000000 --- a/app/models/notifier/popped.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Notifier::Popped < Notifier -end diff --git a/app/models/notifier/published.rb b/app/models/notifier/published.rb index 3aadc3c93..ce3917e8f 100644 --- a/app/models/notifier/published.rb +++ b/app/models/notifier/published.rb @@ -1,6 +1,6 @@ class Notifier::Published < Notifier private def recipients - bubble.watchers_and_subscribers(include_only_watching: true).without(creator) + card.watchers_and_subscribers(include_only_watching: true).without(creator) end end diff --git a/app/models/pin.rb b/app/models/pin.rb index 86913023c..425a504bf 100644 --- a/app/models/pin.rb +++ b/app/models/pin.rb @@ -1,5 +1,5 @@ class Pin < ApplicationRecord - belongs_to :bubble + belongs_to :card belongs_to :user scope :ordered, -> { order(created_at: :desc) } diff --git a/app/models/pop.rb b/app/models/pop.rb deleted file mode 100644 index 45ccb2411..000000000 --- a/app/models/pop.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Pop < ApplicationRecord - belongs_to :bubble, touch: true - belongs_to :user, optional: true -end diff --git a/app/models/pop/reason.rb b/app/models/pop/reason.rb deleted file mode 100644 index 753862a95..000000000 --- a/app/models/pop/reason.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Pop::Reason < ApplicationRecord - belongs_to :account -end diff --git a/app/models/tag.rb b/app/models/tag.rb index 376e21bc0..128a9aaac 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -4,7 +4,7 @@ class Tag < ApplicationRecord belongs_to :account, default: -> { Current.account }, touch: true has_many :taggings, dependent: :destroy - has_many :bubbles, through: :taggings + has_many :cards, through: :taggings validates :title, format: { without: /\A#/ } normalizes :title, with: -> { it.downcase } diff --git a/app/models/tagging.rb b/app/models/tagging.rb index 242dd4825..73daa0879 100644 --- a/app/models/tagging.rb +++ b/app/models/tagging.rb @@ -1,4 +1,4 @@ class Tagging < ApplicationRecord belongs_to :tag - belongs_to :bubble, touch: true + belongs_to :card, touch: true end diff --git a/app/models/user.rb b/app/models/user.rb index 623111447..f1b6a0d1f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,9 +11,9 @@ class User < ApplicationRecord has_many :notifications, dependent: :destroy has_many :filters, foreign_key: :creator_id, inverse_of: :creator, dependent: :destroy - has_many :pops, dependent: :nullify + has_many :closures, dependent: :nullify has_many :pins, dependent: :destroy - has_many :pinned_bubbles, through: :pins, source: :bubble + has_many :pinned_cards, through: :pins, source: :card normalizes :email_address, with: ->(value) { value.strip.downcase } diff --git a/app/models/user/accessor.rb b/app/models/user/accessor.rb index 5615f9976..f6c902c50 100644 --- a/app/models/user/accessor.rb +++ b/app/models/user/accessor.rb @@ -3,14 +3,14 @@ module User::Accessor included do has_many :accesses, dependent: :destroy - has_many :buckets, through: :accesses - has_many :accessible_bubbles, through: :buckets, source: :bubbles + has_many :collections, through: :accesses + has_many :accessible_cards, through: :collections, source: :cards - after_create_commit :grant_access_to_buckets + after_create_commit :grant_access_to_collections end private - def grant_access_to_buckets - Access.insert_all account.buckets.all_access.pluck(:id).collect { |bucket_id| { bucket_id: bucket_id, user_id: id } } + def grant_access_to_collections + Access.insert_all account.collections.all_access.pluck(:id).collect { |collection_id| { collection_id: collection_id, user_id: id } } end end diff --git a/app/models/user/assignee.rb b/app/models/user/assignee.rb index 730158164..a30394d2c 100644 --- a/app/models/user/assignee.rb +++ b/app/models/user/assignee.rb @@ -4,6 +4,6 @@ module User::Assignee included do has_many :assignments, foreign_key: :assignee_id, dependent: :destroy has_many :assignings, foreign_key: :assigner_id, class_name: "Assignment" - has_many :assigned_bubbles, through: :assignments, source: :bubble + has_many :assigned_cards, through: :assignments, source: :card end end diff --git a/app/models/watch.rb b/app/models/watch.rb index b10de9ef4..a49302c8f 100644 --- a/app/models/watch.rb +++ b/app/models/watch.rb @@ -1,6 +1,6 @@ class Watch < ApplicationRecord belongs_to :user - belongs_to :bubble + belongs_to :card scope :watching, -> { where(watching: true) } scope :not_watching, -> { where(watching: false) } diff --git a/app/presenters/bucket_filter_presenter.rb b/app/presenters/bucket_filter_presenter.rb deleted file mode 100644 index 8b4938903..000000000 --- a/app/presenters/bucket_filter_presenter.rb +++ /dev/null @@ -1,29 +0,0 @@ -class BucketFilterPresenter - def initialize(buckets, params, cookies) - @buckets = buckets - @params = params - @cookies = cookies - end - - def filter_text - if selected_bucket_ids.present? - "Showing activity for #{selected_bucket_names_bold}".html_safe - else - "Showing everything" - end - end - - private - def selected_bucket_ids - @params[:bucket_ids].presence || @cookies[:bucket_filter]&.split(",") - end - - def selected_bucket_names - @buckets.where(id: selected_bucket_ids).pluck(:name).to_sentence - end - - def selected_bucket_names_bold - names = @buckets.where(id: selected_bucket_ids).pluck(:name) - names.map { |name| "#{name}" }.to_sentence - end -end diff --git a/app/presenters/collection_filter_presenter.rb b/app/presenters/collection_filter_presenter.rb new file mode 100644 index 000000000..730e38e83 --- /dev/null +++ b/app/presenters/collection_filter_presenter.rb @@ -0,0 +1,29 @@ +class CollectionFilterPresenter + def initialize(collections, params, cookies) + @collections = collections + @params = params + @cookies = cookies + end + + def filter_text + if selected_collection_ids.present? + "Showing activity for #{selected_collection_names_bold}".html_safe + else + "Showing everything" + end + end + + private + def selected_collection_ids + @params[:collection_ids].presence || @cookies[:collection_filter]&.split(",") + end + + def selected_collection_names + @collections.where(id: selected_collection_ids).pluck(:name).to_sentence + end + + def selected_collection_names_bold + names = @collections.where(id: selected_collection_ids).pluck(:name) + names.map { |name| "#{name}" }.to_sentence + end +end diff --git a/app/views/bubbles/_comments.html.erb b/app/views/bubbles/_comments.html.erb deleted file mode 100644 index 6a60cdaeb..000000000 --- a/app/views/bubbles/_comments.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% if bubble.messages.comments.any? %> -
- - <%= pluralize(bubble.messages.comments.count, "comment") %> -
-<% end %> diff --git a/app/views/bubbles/_date.html.erb b/app/views/bubbles/_date.html.erb deleted file mode 100644 index bbcc9d4c1..000000000 --- a/app/views/bubbles/_date.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% if bubble.due_on.present? %> - <%= form_with model: bubble, url: bucket_bubble_path(bubble.bucket, bubble), data: { controller: "form" } do |form| %> - - <% end %> -<% end %> diff --git a/app/views/bubbles/_publish.html.erb b/app/views/bubbles/_publish.html.erb deleted file mode 100644 index 044142556..000000000 --- a/app/views/bubbles/_publish.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= button_to bubble_publish_path(bubble), class: "btn txt-small btn--link", style: "--btn-background: #{bubble.color}" do %> - Post to project -<% end %> diff --git a/app/views/bubbles/assignments/create.turbo_stream.erb b/app/views/bubbles/assignments/create.turbo_stream.erb deleted file mode 100644 index 67f41c898..000000000 --- a/app/views/bubbles/assignments/create.turbo_stream.erb +++ /dev/null @@ -1 +0,0 @@ -<%= turbo_stream.replace([ @bubble, :assignees ], partial: "bubbles/cards/perma/assignees", locals: { bubble: @bubble }) %> diff --git a/app/views/bubbles/boosts/_boosts.html.erb b/app/views/bubbles/boosts/_boosts.html.erb deleted file mode 100644 index ca12a1ed5..000000000 --- a/app/views/bubbles/boosts/_boosts.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<%= form_with url: bubble_boosts_path(bubble), class: "pad-inline flex align-center gap" do %> - - <%= number_field_tag :boost_count, bubble.boosts_count, min: 1, class: "boost__input input", autocomplete: "off" %> - <%= bubble.boosts_count == 1 ? "boost" : "boosts" %> - - <%= tag.button class: "btn", type: :submit, style: "font-size: 0.4em" do %> - <%= icon_tag "add" %> - Boost - <% end %> -<% end %> \ No newline at end of file diff --git a/app/views/bubbles/boosts/create.turbo_stream.erb b/app/views/bubbles/boosts/create.turbo_stream.erb deleted file mode 100644 index 63d73d4a9..000000000 --- a/app/views/bubbles/boosts/create.turbo_stream.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= turbo_stream.update dom_id(@bubble, :boosts) do %> - <%= render "bubbles/boosts/boosts", bubble: @bubble %> -<% end %> - -<%= turbo_stream.replace dom_id(@bubble, :messages) do %> - <%= render "bubbles/messages", bubble: @bubble %> -<% end %> diff --git a/app/views/bubbles/cards/_mini.html.erb b/app/views/bubbles/cards/_mini.html.erb deleted file mode 100644 index 161154023..000000000 --- a/app/views/bubbles/cards/_mini.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -
- <%= avatar_image_tag bubble.creator, class: "avatar" %> - -
-

- <%= bubble_title(bubble) %> -

- -
<%= "Added to #{bubble.bucket.name} by #{bubble.creator.name}" %> - <%= local_datetime_tag(bubble.created_at, style: :daysago) %> -
- -
- <%= render "bubbles/cards/mini/assignees", bubble: bubble %> -
<%= render "bubbles/cards/mini/tags", bubble: bubble %>
-
-
- - <%= link_to bucket_bubble_path(bubble.bucket, bubble), class: "card__link" do %> - <%= bubble_title(bubble) %> - <% end %> -
diff --git a/app/views/bubbles/cards/_perma.html.erb b/app/views/bubbles/cards/_perma.html.erb deleted file mode 100644 index 281ce1ff8..000000000 --- a/app/views/bubbles/cards/_perma.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<% cache bubble do %> -
-
- <%= link_to bubble.bucket.name, bubbles_path(bucket_ids: [bubble.bucket]), - class: "card__bucket txt-uppercase overflow-ellipsis txt-reversed" %> - - <%= render "bubbles/cards/perma/tags", bubble: bubble %> -
- -
-
-

- <% if bubble.published? %> - <%= turbo_frame_tag bubble, :edit do %> - <%= link_to bubble_title(bubble), edit_bucket_bubble_path(bubble.bucket, bubble), class: "card__title-link overflow-line-clamp" %> - <% end %> - <% else %> - <%= form_with model: bubble, url: bucket_bubble_path(bubble.bucket, bubble), id: "bubble_form", data: { controller: "auto-save" } do |form| %> - <%= form.text_area :title, placeholder: "Name it…", - class: "input input--textarea full-width borderless txt-align-start #{ "fill-highlight" if bubble.creating? }", - autofocus: bubble.title.blank?, - data: { action: "auto-save#change blur->auto-save#submit keydown.enter->auto-save#submit:prevent keydown.ctrl+enter->auto-save#submit:prevent" } %> - <% end %> - <% end %> -

-
- - <% if bubble.doing? %> - <%= turbo_frame_tag dom_id(@bubble, :stages) do %> - <%= render "bubbles/stagings/stages", bubble: bubble %> - <% end %> - <% end %> -
- -
- <%= render "bubbles/cards/perma/people", bubble: bubble %> - <%= render "bubbles/cards/perma/meta", bubble: bubble %> -
- - <%= render "bubbles/cards/common/background", bubble: bubble %> -
-<% end %> diff --git a/app/views/bubbles/cards/_preview.html.erb b/app/views/bubbles/cards/_preview.html.erb deleted file mode 100644 index b524c948c..000000000 --- a/app/views/bubbles/cards/_preview.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<% cache [ bubble ] do %> -
-
- <%= bubble.bucket.name %> - <%= render "bubbles/cards/preview/tags", bubble: bubble %> -
- -
-
-

- <%= bubble_title(bubble) %> -

-
- - <%= link_to bucket_bubble_path(bubble.bucket, bubble), class: "card__link" do %> - <%= bubble_title(bubble) %> - <% end %> - - <%= render "bubbles/stagings/stages", bubble: bubble if bubble.doing? %> -
- -
- <%= render "bubbles/cards/preview/people", bubble: bubble %> - <%= render "bubbles/cards/preview/meta", bubble: bubble %> -
- - <%= render "bubbles/cards/common/background", bubble: bubble %> -
-<% end %> diff --git a/app/views/bubbles/cards/common/_background.html.erb b/app/views/bubbles/cards/common/_background.html.erb deleted file mode 100644 index 26286cd86..000000000 --- a/app/views/bubbles/cards/common/_background.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -
- <%= image_tag bubble.image.presence || "", size: 120, data: { upload_preview_target: "image" } %> -
- -<% if bubble.popped? %> -
- <%= bubble.pop.reason %> - <%= bubble.popped_at.strftime("%b %d, %Y") %> - by <%= bubble.popped_by.name %> -
-<% end %> diff --git a/app/views/bubbles/cards/mini/_tags.html.erb b/app/views/bubbles/cards/mini/_tags.html.erb deleted file mode 100644 index b68e98529..000000000 --- a/app/views/bubbles/cards/mini/_tags.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render "bubbles/cards/preview/tags", bubble: bubble %> diff --git a/app/views/bubbles/cards/perma/_assignees.html.erb b/app/views/bubbles/cards/perma/_assignees.html.erb deleted file mode 100644 index 8733e969e..000000000 --- a/app/views/bubbles/cards/perma/_assignees.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= render "bubbles/cards/common/assignees", bubble: bubble do %> - <%= turbo_frame_tag bubble, :assignment, src: new_bubble_assignment_path(bubble) %> -<% end %> diff --git a/app/views/bubbles/cards/perma/_boosts.html.erb b/app/views/bubbles/cards/perma/_boosts.html.erb deleted file mode 100644 index 10c18c79e..000000000 --- a/app/views/bubbles/cards/perma/_boosts.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= turbo_frame_tag dom_id(bubble, :boosts) do %> - <%= render "bubbles/boosts/boosts", bubble: bubble %> -<% end %> diff --git a/app/views/bubbles/cards/perma/_meta.html.erb b/app/views/bubbles/cards/perma/_meta.html.erb deleted file mode 100644 index 7f6fa5da7..000000000 --- a/app/views/bubbles/cards/perma/_meta.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= render "bubbles/cards/common/meta", bubble: bubble do %> - <%= render "bubbles/cards/perma/boosts", bubble: bubble %> -<% end %> diff --git a/app/views/bubbles/cards/perma/_people.html.erb b/app/views/bubbles/cards/perma/_people.html.erb deleted file mode 100644 index 3943414a2..000000000 --- a/app/views/bubbles/cards/perma/_people.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= render "bubbles/cards/common/people", bubble: bubble do%> - <%= render "bubbles/cards/perma/assignees", bubble: bubble %> -<% end %> diff --git a/app/views/bubbles/cards/preview/_assignees.html.erb b/app/views/bubbles/cards/preview/_assignees.html.erb deleted file mode 100644 index ae3301ea1..000000000 --- a/app/views/bubbles/cards/preview/_assignees.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render "bubbles/cards/common/assignees", bubble: bubble %> diff --git a/app/views/bubbles/cards/preview/_boosts.html.erb b/app/views/bubbles/cards/preview/_boosts.html.erb deleted file mode 100644 index f3acb27e5..000000000 --- a/app/views/bubbles/cards/preview/_boosts.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= turbo_frame_tag dom_id(bubble, :boosts) do %> - <%= tag.div class: "pad-inline flex align-center gap" do %> - - <%= bubble.boosts_count %> - <%= bubble.boosts_count == 1 ? "boost" : "boosts" %> - - <% end %> -<% end %> diff --git a/app/views/bubbles/cards/preview/_meta.html.erb b/app/views/bubbles/cards/preview/_meta.html.erb deleted file mode 100644 index 4ffd12ccb..000000000 --- a/app/views/bubbles/cards/preview/_meta.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= render "bubbles/cards/common/meta", bubble: bubble do %> - <%= render "bubbles/cards/preview/boosts", bubble: bubble %> -<% end %> diff --git a/app/views/bubbles/cards/preview/_people.html.erb b/app/views/bubbles/cards/preview/_people.html.erb deleted file mode 100644 index b2affe593..000000000 --- a/app/views/bubbles/cards/preview/_people.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= render "bubbles/cards/common/people", bubble: bubble do%> - <%= render "bubbles/cards/preview/assignees", bubble: bubble %> -<% end %> diff --git a/app/views/bubbles/cards/preview/_tags.html.erb b/app/views/bubbles/cards/preview/_tags.html.erb deleted file mode 100644 index 66de991bc..000000000 --- a/app/views/bubbles/cards/preview/_tags.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -
-
- <% if bubble.tags.any? %> - # - <% bubble.tags.each_with_index do |tag, index| %> - - <%= tag.title %> - - <% end %> - <% end %> -
-
diff --git a/app/views/bubbles/index.html.erb b/app/views/bubbles/index.html.erb deleted file mode 100644 index 026f80100..000000000 --- a/app/views/bubbles/index.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% @page_title = @filter.summary %> - -<%= render "filters/broadcasts", filter: @filter %> - -<% content_for :header do %> - <%= render "bubbles/index/header", filter: @filter %> -<% end %> - -
- <%= render "bubbles/index/bubbles/considering", bubbles: @considering_bubbles %> - <%= render "bubbles/index/bubbles/doing", bubbles: @doing_bubbles, filter: @filter %> -
- -<%= render "bubbles/index/bubbles/popped", bubbles: @popped_bubbles, filter: @filter %> diff --git a/app/views/bubbles/index/_buckets_filter.html.erb b/app/views/bubbles/index/_buckets_filter.html.erb deleted file mode 100644 index 33792b4eb..000000000 --- a/app/views/bubbles/index/_buckets_filter.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", - data: { controller: "form" } do |form| %> - <% filter.as_params.except(:bucket_ids).each do |key, value| %> - <%= filter_hidden_field_tag key, value %> - <% end %> - - <%= link_to bubbles_path(filter.as_params.except(:bucket_ids)), class: "btn popup__item" do %> - All collections - <% end %> - - <% Current.user.buckets.order(:name).each do |bucket| %> - - <% end %> -<% end %> diff --git a/app/views/bubbles/stagings/_stages.html.erb b/app/views/bubbles/stagings/_stages.html.erb deleted file mode 100644 index 49a0c1dc3..000000000 --- a/app/views/bubbles/stagings/_stages.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% workflow = bubble.bucket.workflow %> - -<% if workflow %> -
" class="card__stages flex flex-column max-width min-width pad-block"> - <% workflow.stages.each do |stage| %> - <%= button_to_set_stage bubble, stage %> - <% end %> -
-<% end %> diff --git a/app/views/bubbles/stagings/create.turbo_stream.erb b/app/views/bubbles/stagings/create.turbo_stream.erb deleted file mode 100644 index 62e755146..000000000 --- a/app/views/bubbles/stagings/create.turbo_stream.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= turbo_stream.replace dom_id(@bubble, "stages") do %> - <%= render partial: "bubbles/stagings/stages", locals: { bubble: @bubble } %> -<% end %> diff --git a/app/views/bubbles/taggings/create.turbo_stream.erb b/app/views/bubbles/taggings/create.turbo_stream.erb deleted file mode 100644 index b261c7f0b..000000000 --- a/app/views/bubbles/taggings/create.turbo_stream.erb +++ /dev/null @@ -1 +0,0 @@ -<%= turbo_stream.replace([ @bubble, :tags ], partial: "bubbles/cards/perma/tags", locals: { bubble: @bubble }) %> diff --git a/app/views/bubbles/watches/show.html.erb b/app/views/bubbles/watches/show.html.erb deleted file mode 100644 index bd68ab801..000000000 --- a/app/views/bubbles/watches/show.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<%= turbo_frame_tag dom_id(@bubble, :watch) do %> - <% if @bubble.watched_by? Current.user %> - <%= button_to bubble_watch_path(@bubble), method: :delete, class: "btn btn--reversed" do %> - <%= icon_tag "bell" %> - Stop watching - <% end %> - <% else %> - <%= button_to bubble_watch_path(@bubble), class: "btn" do %> - <%= icon_tag "bell-off" %> - Watch this - <% end %> - <% end %> -<% end %> diff --git a/app/views/buckets/_bucket.html.erb b/app/views/buckets/_bucket.html.erb deleted file mode 100644 index 82149d71e..000000000 --- a/app/views/buckets/_bucket.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -
  • - <%= link_to bubbles_path(bucket_ids: [ bucket ]), - class: "border border-radius margin-block-end-half bubbles__container flex justify-center align-center position-relative", - aria: { hidden: true }, tabindex: -1 do %> -
    - <% bucket.bubbles.active.published_or_drafted_by(Current.user).ordered_by_activity.limit(10).each do |bubble| %> -
    " style="--bubble-color: <%= bubble.color %>; <%= bubble_rotation(bubble) %>" - data-bubble-size-target="bubble" - data-activity-score="<%= bubble.activity_score %>" - data-activity-score-at="<%= bubble.activity_score_at.to_i %>"> - -
    - <% end %> -
    - <% end %> - -
    - <%= link_to bubbles_path(bucket_ids: [ bucket ]), class: "txt-ink flex flex-column" do %> - <%= bucket.name %> - <% end %> - - <%= link_to edit_bucket_path(bucket), class: "btn txt-small bucket__button" do %> - <%= icon_tag "settings" %> - Settings for <%= bucket.name %> - <% end %> -
    -
  • diff --git a/app/views/buckets/involvements/update.html.erb b/app/views/buckets/involvements/update.html.erb deleted file mode 100644 index 76bd04031..000000000 --- a/app/views/buckets/involvements/update.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= access_involvement_advance_button(@bucket, Current.user) %> diff --git a/app/views/bubbles/_pop_toggle.html.erb b/app/views/cards/_closure_toggle.html.erb similarity index 58% rename from app/views/bubbles/_pop_toggle.html.erb rename to app/views/cards/_closure_toggle.html.erb index 3335efdac..4f08560eb 100644 --- a/app/views/bubbles/_pop_toggle.html.erb +++ b/app/views/cards/_closure_toggle.html.erb @@ -1,7 +1,7 @@ -
    - <% if bubble.popped? %> - Completed by <%= bubble.popped_by.name %> on <%= local_datetime_tag(bubble.popped_at, style: :shortdate) %>. - <%= button_to bubble_pop_path(bubble), method: :delete, class: "btn btn--plain borderless fill-transparent" do %> +
    + <% if card.closed? %> + Completed by <%= card.closed_by.name %> on <%= local_datetime_tag(card.closed_at, style: :shortdate) %>. + <%= button_to card_closure_path(card), method: :delete, class: "btn btn--plain borderless fill-transparent" do %> Un-do <% end %> <% else %> @@ -15,19 +15,19 @@ data-dialog-target="dialog" data-action="turbo:before-cache@document->dialog#close"> Close as… - <% Current.account.pop_reasons.labels.each do |label| %> - <%= button_to bubble_pop_path(bubble, reason: label), class: "btn popup__item full-width", form_class: "full-width" do %> + <% Current.account.closure_reasons.labels.each do |label| %> + <%= button_to card_closure_path(card, reason: label), class: "btn popup__item full-width", form_class: "full-width" do %> <%= label %> <% end %> <% end %>
    - - <% if bubble.doing? %> - Returns to Considering if no activity <%= local_datetime_tag(bubble.auto_reconsider_at, style: :indays) -%>. + + <% if card.doing? %> + Returns to Considering if no activity <%= local_datetime_tag(card.auto_reconsider_at, style: :indays) -%>. <% else %> - Auto-closes if no activity <%= local_datetime_tag(bubble.auto_pop_at, style: :indays) -%>. + Auto-closes if no activity <%= local_datetime_tag(card.auto_closure_at, style: :indays) -%>. <% end %> <% end %> diff --git a/app/views/bubbles/_color.html.erb b/app/views/cards/_color.html.erb similarity index 86% rename from app/views/bubbles/_color.html.erb rename to app/views/cards/_color.html.erb index cf022790f..339d30e53 100644 --- a/app/views/bubbles/_color.html.erb +++ b/app/views/cards/_color.html.erb @@ -5,8 +5,8 @@ - <%= form_with model: bubble, url: bucket_bubble_path(bubble.bucket, bubble), class: "flex gap-half", data: { controller: "form", action: "change->form#submit" } do |form| %> - <% Bubble::COLORS.each do |color| %> + <%= form_with model: card, url: collection_card_path(card.collection, card), class: "flex gap-half", data: { controller: "form", action: "change->form#submit" } do |form| %> + <% Card::COLORS.each do |color| %>