Merge branch 'main' into closing-soon-badge

This commit is contained in:
Andy Smith
2025-05-06 15:25:01 -05:00
committed by GitHub
34 changed files with 273 additions and 135 deletions
+34 -33
View File
@@ -44,31 +44,31 @@
--lch-ink-darkest: 26% 0.05 264;
--lch-ink-darker: 40% 0.026 262;
--lch-ink-dark: 57% 0.014 260;
--lch-ink-medium: 70% 0.008 258;
--lch-ink-medium: 66% 0.008 258;
--lch-ink-light: 84% 0.005 256;
--lch-ink-lighter: 92% 0.003 254;
--lch-ink-lightest: 96% 0.002 252;
--lch-uncolor-darkest: 26% 0.018 40;
--lch-uncolor-darker: 40% 0.03 50;
--lch-uncolor-dark: 57% 0.04 60;
--lch-uncolor-medium: 70% 0.044 70;
--lch-uncolor-light: 84% 0.028 80;
--lch-uncolor-darker: 40.04% 0.0376 50.06;
--lch-uncolor-dark: 57.09% 0.0676 60.5;
--lch-uncolor-medium: 66% 0.0944 71.46;
--lch-uncolor-light: 83.97% 0.0457 80.84;
--lch-uncolor-lighter: 92% 0.014 90;
--lch-uncolor-lightest: 96% 0.012 100;
--lch-red-darkest: 26% 0.105 34;
--lch-red-darker: 40% 0.154 36;
--lch-red-dark: 59% 0.19 38;
--lch-red-medium: 70.4% 0.19 40;
--lch-red-light: 84% 0.07 42;
--lch-red-medium: 66% 0.204 40;
--lch-red-light: 84.08% 0.0837 41.96;
--lch-red-lighter: 92% 0.03 44;
--lch-red-lightest: 96% 0.013 46;
--lch-yellow-darkest: 26% 0.0729 40;
--lch-yellow-darker: 40% 0.12 50;
--lch-yellow-dark: 58% 0.156 60;
--lch-yellow-medium: 76% 0.17 70;
--lch-yellow-medium: 74% 0.184 70;
--lch-yellow-light: 84% 0.12 80;
--lch-yellow-lighter: 92% 0.076 90;
--lch-yellow-lightest: 96% 0.034 100;
@@ -76,56 +76,56 @@
--lch-lime-darkest: 26% 0.064 109;
--lch-lime-darker: 40% 0.101 110;
--lch-lime-dark: 56.5% 0.142 111;
--lch-lime-medium: 71% 0.158 112;
--lch-lime-light: 84% 0.08 113;
--lch-lime-medium: 68% 0.176 113.11;
--lch-lime-light: 83.92% 0.0927 113.6;
--lch-lime-lighter: 92% 0.046 114;
--lch-lime-lightest: 96% 0.034 115;
--lch-green-darkest: 26% 0.071 149;
--lch-green-darker: 40% 0.12 148;
--lch-green-dark: 55% 0.162 147;
--lch-green-medium: 70% 0.19 146;
--lch-green-light: 84% 0.07 145;
--lch-green-medium: 66% 0.208 146;
--lch-green-light: 83.92% 0.0772 145.06;
--lch-green-lighter: 92% 0.044 144;
--lch-green-lightest: 96% 0.022 143;
--lch-aqua-darkest: 26% 0.059 214;
--lch-aqua-darker: 40% 0.093 212;
--lch-aqua-dark: 55.5% 0.122 210;
--lch-aqua-medium: 70% 0.13 208;
--lch-aqua-light: 84% 0.04 206;
--lch-aqua-medium: 66% 0.152 208;
--lch-aqua-light: 83.88% 0.0555 206.02;
--lch-aqua-lighter: 92% 0.02 204;
--lch-aqua-lightest: 96% 0.012 202;
--lch-blue-darkest: 26% 0.126 264;
--lch-blue-darker: 40% 0.166 262;
--lch-blue-dark: 57% 0.19 260;
--lch-blue-medium: 70% 0.169 258;
--lch-blue-light: 84% 0.06 256;
--lch-blue-dark: 57.02% 0.1895 260.46;
--lch-blue-medium: 66% 0.196 257.82;
--lch-blue-light: 84.04% 0.0719 255.29;
--lch-blue-lighter: 92% 0.026 254;
--lch-blue-lightest: 96% 0.016 252;
--lch-violet-darkest: 26% 0.148 292;
--lch-violet-darker: 40% 0.2 290;
--lch-violet-dark: 58% 0.216 288;
--lch-violet-medium: 70% 0.178 286;
--lch-violet-light: 84% 0.07 284;
--lch-violet-dark: 58% 0.216 287.6;
--lch-violet-medium: 66% 0.206 285.52;
--lch-violet-light: 84.08% 0.0791 283.47;
--lch-violet-lighter: 92% 0.03 282;
--lch-violet-lightest: 96% 0.015 280;
--lch-purple-darkest: 26% 0.131 314;
--lch-purple-darker: 40% 0.178 312;
--lch-purple-dark: 58% 0.21 310;
--lch-purple-medium: 70% 0.22 308;
--lch-purple-light: 84% 0.07 306;
--lch-purple-medium: 66% 0.258 308;
--lch-purple-light: 84.09% 0.0778 305.77;
--lch-purple-lighter: 92% 0.03 304;
--lch-purple-lightest: 96% 0.019 302;
--lch-pink-darkest: 26% 0.12 348;
--lch-pink-darker: 40% 0.16 346;
--lch-pink-dark: 59% 0.188 344;
--lch-pink-medium: 70% 0.198 342;
--lch-pink-light: 84% 0.07 340;
--lch-pink-medium: 71.8% 0.2008 342;
--lch-pink-light: 84.04% 0.0737 340;
--lch-pink-lighter: 92% 0.03 338;
--lch-pink-lightest: 96% 0.02 336;
@@ -158,15 +158,16 @@
--color-terminal-text: oklch(var(--lch-green-medium));
/* Colors: Cards */
--color-card-1: oklch(var(--lch-ink-dark));
--color-card-2: oklch(var(--lch-uncolor-dark));
--color-card-3: oklch(var(--lch-yellow-dark));
--color-card-4: oklch(var(--lch-lime-dark));
--color-card-5: oklch(var(--lch-aqua-dark));
--color-card-6: oklch(var(--lch-blue-dark));
--color-card-7: oklch(var(--lch-violet-dark));
--color-card-8: oklch(var(--lch-purple-dark));
--color-card-9: oklch(var(--lch-pink-dark));
--color-card-default: oklch(var(--lch-blue-dark));
--color-card-complete: var(--color-ink);
--color-card-1: oklch(var(--lch-ink-medium));
--color-card-2: oklch(var(--lch-uncolor-medium));
--color-card-3: oklch(var(--lch-yellow-medium));
--color-card-4: oklch(var(--lch-lime-medium));
--color-card-5: oklch(var(--lch-aqua-medium));
--color-card-6: oklch(var(--lch-violet-medium));
--color-card-7: oklch(var(--lch-purple-medium));
--color-card-8: oklch(var(--lch-pink-medium));
@media (prefers-color-scheme: dark) {
--lch-canvas: 20% 0.0195 232.58;
+6 -4
View File
@@ -192,6 +192,8 @@
.btn__group {
.btn {
--btn-border-radius: 0;
--radius: 0.3em;
inline-size: 100%;
justify-content: center;
}
@@ -201,17 +203,17 @@
}
:first-of-type .btn {
border-end-start-radius: 2em;
border-end-start-radius: var(--radius);
border-inline-end: 0;
border-start-start-radius: 2em;
border-start-start-radius: var(--radius);
flex: 1 0 50%;
padding-inline-end: 0.8em;
}
:last-of-type .btn {
border-end-end-radius: 2em;
border-end-end-radius: var(--radius);
border-inline-start: 0;
border-start-end-radius: 2em;
border-start-end-radius: var(--radius);
flex: 1 0 50%;
padding-inline-start: 0.8em;
}
+34 -4
View File
@@ -10,15 +10,35 @@
}
.card-columns {
border-block-start: 1px solid var(--color-ink-lighter);
display: grid;
grid-template-columns: repeat(2, 50%);
margin: auto;
max-inline-size: 1080px;
position: relative;
&:before {
background: linear-gradient(to right,var(--color-canvas), var(--color-ink-lighter) 3%, var(--color-ink-lighter) 97%, var(--color-canvas));
block-size: 1px;
content: "";
display: block;
inline-size: calc(100% + 1.2em);
inset: 0 -0.6em 100% -0.6em;
position: absolute;
}
.cards:first-child {
border-inline-end: var(--border);
padding-inline-end: var(--cards-gap);
position: relative;
&:after {
background: linear-gradient(var(--color-canvas), var(--color-ink-lighter) 1%, var(--color-ink-lighter) 99%, var(--color-canvas));
block-size: calc(100% + 1.2em);
content: "";
display: block;
inline-size: 1px;
inset: -0.6em 0 -0.6em 100%;
position: absolute;
}
}
.cards:last-child {
@@ -37,7 +57,7 @@
flex-direction: column;
gap: var(--cards-gap);
justify-content: start;
padding-block: var(--cards-gap);
padding-block: calc(var(--cards-gap) * 0.75);
.card {
--block-space: 1em;
@@ -121,12 +141,22 @@
/* -------------------------------------------------------------------------- */
.cards--closed {
border-block-start: 1px solid var(--color-ink-lighter);
justify-content: center;
flex-direction: row;
flex-wrap: wrap;
inline-size: 100%;
margin: 0 auto;
position: relative;
&:before {
background: linear-gradient(to right,var(--color-canvas), var(--color-ink-lighter) 3%, var(--color-ink-lighter) 97%, var(--color-canvas));
block-size: 1px;
content: "";
display: block;
inline-size: calc(100% + 1.2em);
inset: 0 -0.6em 100% -0.6em;
position: absolute;
}
.card {
inline-size: calc((100% - var(--cards-gap) * 2) / 3);
+4
View File
@@ -2,6 +2,10 @@
.card-filter--collection {
> button {
--hover-size: 0;
--input-padding: 0.25em 1em 0.25em 0.8em;
inline-size: auto;
background-position: center right 0.3em;
}
}
+23 -4
View File
@@ -68,6 +68,16 @@
}
}
.card__id {
display: inline-flex;
margin-inline-start: calc(var(--inline-space) * -1);
.card-perma &:before {
content: "No.";
opacity: 0.5;
}
}
.card__link {
--hover-size: 0;
@@ -86,8 +96,14 @@
background-color: var(--card-color);
border-radius: var(--border-radius) 0 var(--border-radius) 0;
font-weight: 800;
letter-spacing: 0.4ch;
padding: var(--block-space-half) var(--inline-space-double);
padding: var(--block-space-half) var(--inline-space) var(--block-space-half) var(--inline-space-double);
}
.card__collection-name {
border-inline-start: 1px solid color-mix(in srgb, var(--color-ink-inverted) 33%, var(--card-color));
display: inline-flex;
margin-inline-start: var(--inline-space-half);
padding-inline-start: calc(var(--inline-space) * 0.75);
}
.card__tags {
@@ -174,7 +190,6 @@
box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-link) 20%, var(--color-canvas));
color: var(--btn-color);
font-weight: 700;
}
.card__move-button {
@@ -231,7 +246,6 @@
.card__closed {
align-items: center;
aspect-ratio: 8/5;
background-color: var(--color-canvas);
border: var(--block-space-half) solid var(--card-color);
border-radius: 0.2em;
color: var(--card-color);
@@ -249,6 +263,11 @@
@media (prefers-color-scheme: dark) {
mix-blend-mode: screen;
}
.card:has(&),
.card-perma:has(&) {
--card-color: var(--color-card-complete) !important;
}
}
.card__closed-by {
+28 -11
View File
@@ -61,30 +61,47 @@
}
.notification__unread_indicator {
--btn-background: var(--color-marker);
--btn-background: var(--color-canvas);
--btn-border-color: var(--color-canvas);
--btn-icon-size: 0.7em;
--btn-padding: 0;
--btn-size: 1.2em;
--btn-size: 1.75em;
--hover-size: 0;
inset: var(--block-space) var(--inline-space) auto auto;
inset: 0 0 auto auto;
position: absolute;
scale: 0.7;
img {
visibility: hidden;
&:before,
.icon {
transition: opacity 150ms ease;
}
/* The red dot */
&:before {
aspect-ratio: 1;
background-color: var(--color-marker);
border-radius: 50%;
content: "";
inline-size: 0.55em;
inset: 50% auto auto 50%;
position: absolute;
translate: -50% -50%;
}
.icon {
opacity: 0;
}
@media (hover: hover) {
&:hover {
--btn-background: var(--color-ink-medium);
--btn-border-color: var(--color-ink-medium);
--btn-background: transparent;
scale: 1;
&:before {
opacity: 0;
}
img {
visibility: unset;
.icon {
opacity: 1;
}
}
}
+4 -4
View File
@@ -8,7 +8,6 @@
color: inherit;
inline-size: 100%;
text-transform: uppercase;
@media (hover: hover) {
&:hover {
@@ -30,11 +29,11 @@
}
.workflow-preview {
--border-size: 3px;
--border-size: 0.2em;
aspect-ratio: 1;
flex: 1 1 30%;
max-inline-size: 33%;
max-inline-size: 30%;
button {
--hover-size: 0;
@@ -52,7 +51,8 @@
margin: 0;
max-inline-size: 100%;
outline: 0;
padding: 1em;
overflow: hidden;
padding: var(--inline-space);
text-align: start;
}
}
+12 -3
View File
@@ -1,11 +1,20 @@
module CollectionsHelper
def collection_auto_close_options
[
[ "7 days", 7.days ],
[ "30 days", 30.days ],
[ "60 days", 60.days ],
[ "90 days", 90.days ],
[ "6 months", 180.days ],
[ "1 year", 365.days ],
[ "Never", nil ]
]
end
def collection_stalled_options
[
[ "1 day", 1.days ],
[ "2 days", 2.days ],
[ "3 days", 3.days ],
[ "7 days", 7.days ],
[ "30 days", 30.days ],
[ "Never", nil ]
]
end
+1 -1
View File
@@ -1,7 +1,7 @@
module FiltersHelper
def filter_title(filter)
if filter.collections.none?
"All collections"
Current.user.collections.one? ? Current.user.collections.first.name : "All collections"
elsif filter.collections.one?
filter.collections.first.name
else
+2 -2
View File
@@ -32,10 +32,10 @@ module NotificationsHelper
def notification_mark_read_button(notification)
button_to read_notification_path(notification),
class: "notification__unread_indicator btn borderless",
class: "notification__unread_indicator btn btn--circle borderless",
title: "Mark as read",
data: { turbo_frame: "_top" } do
concat(image_tag("remove-med.svg", class: "unread_icon", size: 12, aria: { hidden: true }))
concat(icon_tag("remove-med"))
concat(tag.span("Mark as read", class: "for-screen-reader"))
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ module WorkflowsHelper
tag.span(stage.name, class: "overflow-ellipsis"),
card_staging_path(card, stage_id: stage),
method: :put,
class: [ "btn justify-start workflow-stage txt-uppercase workflow-stage", { "workflow-stage--current": stage == card.stage } ],
class: [ "btn justify-start workflow-stage txt-uppercase", { "workflow-stage--current": stage == card.stage } ],
form_class: "flex align-center gap-half",
data: { turbo_frame: "_top" }
end
+7 -4
View File
@@ -11,6 +11,8 @@ class Card < ApplicationRecord
has_markdown :description
before_save :set_default_title, if: :published?
scope :reverse_chronologically, -> { order created_at: :desc, id: :desc }
scope :chronologically, -> { order created_at: :asc, id: :asc }
scope :latest, -> { order updated_at: :desc, id: :desc }
@@ -25,11 +27,12 @@ class Card < ApplicationRecord
end
end
def title=(new_title)
self[:title] = new_title.presence || "Untitled"
end
def cache_key
[ super, collection.name ].compact.join("/")
end
private
def set_default_title
self.title = "Untitled" if title.blank?
end
end
+11 -2
View File
@@ -1,8 +1,17 @@
module Card::Colored
extend ActiveSupport::Concern
COLORS = %w[ #3b3633 #67695e #eb7a32 #bf7c2b #c09c6f #746b1e #2c6da8 #5d618f #663251 #ff63a8 ]
DEFAULT_COLOR = "#2c6da8"
COLORS = %w[
var(--color-card-1)
var(--color-card-2)
var(--color-card-3)
var(--color-card-4)
var(--color-card-5)
var(--color-card-6)
var(--color-card-7)
var(--color-card-8)
]
DEFAULT_COLOR = "var(--color-card-default)"
def color
color_from_stage || DEFAULT_COLOR
+1 -1
View File
@@ -6,7 +6,7 @@ class Notifier::CardEventNotifier < Notifier
def recipients
case source.action
when "card_assigned"
source.assignees.excluding(source.collection.access_only_users)
source.assignees.excluding(creator, *source.collection.access_only_users)
when "card_published"
watchers_and_subscribers(include_only_watching: true).without(creator, *card.mentionees)
when "comment_created"
+5 -2
View File
@@ -10,8 +10,11 @@
<div class="card-perma__bg">
<%= card_article_tag card, class: "card" do %>
<header class="card__header flex align-center gap-half min-width">
<%= link_to card.collection.name, cards_path(collection_ids: [ card.collection ]),
class: "card__collection txt-uppercase overflow-ellipsis txt-reversed" %>
<span class="card__collection">
<span class="card__id txt-reversed"><%= card.id %></span>
<%= link_to card.collection.name, cards_path(collection_ids: [ card.collection ]),
class: "card__collection-name txt-uppercase overflow-ellipsis txt-reversed" %>
</span>
<%= render "cards/display/perma/tags", card: card %>
</header>
+2 -2
View File
@@ -6,11 +6,11 @@
<strong class="txt-uppercase">Subscribers</strong>
<p class="margin-none-block-start margin-block-end-half">
<%= pluralize(@card.watchers.count, "person") %> will be notified when someone comments on this.
<%= pluralize(@card.watchers.without(User.system).count, "person") %> will be notified when someone comments on this.
</p>
<div class="flex align-center flex-wrap gap-half max-width txt-normal">
<% prepend_current_user_to(@card.watchers.alphabetically).each do |watcher| %>
<% prepend_current_user_to(@card.watchers.without(User.system).alphabetically).each do |watcher| %>
<%= avatar_tag watcher %>
<% end %>
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="card-perma__notch card-perma__notch--bottom flex-column" id="<%= dom_id(card, :card_closure_toggle) %>" style="--card-color: <%= card.color %>">
<div class="card-perma__notch card-perma__notch--bottom flex-column" id="<%= dom_id(card, :card_closure_toggle) %>">
<% if card.closed? %>
<div class="flex gap-half margin-block-start-double margin-block-end">
<span class="card-perma__closure-message">Completed by <%= card.closed_by.name %> on <%= local_datetime_tag(card.closed_at, style: :shortdate) %>.</span>
+5 -1
View File
@@ -1,7 +1,11 @@
<% cache card do %>
<%= card_article_tag card, class: "card" do %>
<header class="card__header flex align-center gap min-width">
<span class="card__collection txt-uppercase overflow-ellipsis txt-reversed"><%= card.collection.name %></span>
<span class="card__collection">
<span class="card__id txt-reversed"><%= card.id %></span>
<%= link_to card.collection.name, cards_path(collection_ids: [ card.collection ]),
class: "card__collection-name txt-uppercase overflow-ellipsis txt-reversed" %>
</span>
<%= render "cards/display/preview/tags", card: card %>
</header>
@@ -17,7 +17,7 @@
<% end %>
</span>
<span class="card__meta-item card__meta-item--reported overflow-ellipsis">
Added by <strong><%= card.creator.familiar_name %></strong>
By <strong><%= card.creator.familiar_name %></strong>
</span>
<span class="card__meta-item card__meta-item--assigned overflow-ellipsis">
<%= card.assignees.any? ? "Assigned to" : "Not assigned" %>
@@ -3,7 +3,7 @@
<% if workflow %>
<div class="card__stages">
<% workflow.stages.each do |stage| %>
<%= tag.span stage.name, class: ["overflow-ellipsis btn justify-start workflow-stage txt-uppercase workflow-stage", { "workflow-stage--current": stage == card.stage }] %>
<%= tag.span stage.name, class: ["overflow-ellipsis btn justify-start workflow-stage txt-uppercase", { "workflow-stage--current": stage == card.stage }] %>
<% end %>
</div>
<% end %>
@@ -4,40 +4,49 @@
<%= filter_hidden_field_tag key, value %>
<% end %>
<%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "popup__group flex align-center", style: "--hover-size: 0" do %>
<div class="btn txt-xx-small flex-item-no-shrink">
<input type="checkbox" <%= "checked" if filter.collection_ids.empty? %>>
<span class="for-screen-reader">
See everything in all collections
</span>
<%= icon_tag "check", size: 18, class: "checked" %>
</div>
<%= tag.div class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis">All collections</span>
<span class="txt-ink translucent flex-item-no-shrink flex-item-justify-end"><span class="txt-x-small txt-uppercase">GO TO</span> </span>
<% if Current.user.collections.one? %>
<%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "popup__group flex align-center", style: "--hover-size: 0" do %>
<%= tag.div class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis"><%= Current.user.collections.first.name %></span>
<span class="txt-ink translucent flex-item-no-shrink flex-item-justify-end"><span class="txt-x-small txt-uppercase">GO TO</span> </span>
<% end %>
<% end %>
<% end %>
<% Current.user.collections.order(:name).each do |collection| %>
<li class="popup__group flex align-center" data-value="<%= collection.name.downcase %>">
<% elsif Current.user.collections.many? %>
<%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "popup__group flex align-center", style: "--hover-size: 0" do %>
<div class="btn txt-xx-small flex-item-no-shrink">
<%= form.check_box "collection_ids[]", {
checked: filter.collections.include?(collection),
data: { action: "change->form#submit" },
include_hidden: false,
}, collection.id %>
<input type="checkbox" <%= "checked" if filter.collection_ids.empty? %>>
<span class="for-screen-reader">
Toggle filter for <%= collection.name %>
See everything in all collections
</span>
<%= icon_tag "check", size: 18, class: "checked" %>
</div>
<%= link_to cards_path(collection_ids: [ collection ]), class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis"><%= collection.name %></span>
<span class="translucent flex-item-no-shrink flex-item-justify-end"> </span>
<%= tag.div class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis">All collections</span>
<span class="txt-ink translucent flex-item-no-shrink flex-item-justify-end"><span class="txt-x-small txt-uppercase">GO TO</span> </span>
<% end %>
</li>
<% end %>
<% Current.user.collections.order(:name).each do |collection| %>
<li class="popup__group flex align-center" data-value="<%= collection.name.downcase %>">
<div class="btn txt-xx-small flex-item-no-shrink">
<%= form.check_box "collection_ids[]", {
checked: filter.collections.include?(collection),
data: { action: "change->form#submit" },
include_hidden: false,
}, collection.id %>
<span class="for-screen-reader">
Toggle filter for <%= collection.name %>
</span>
<%= icon_tag "check", size: 18, class: "checked" %>
</div>
<%= link_to cards_path(collection_ids: [ collection ]), class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis"><%= collection.name %></span>
<span class="translucent flex-item-no-shrink flex-item-justify-end"> </span>
<% end %>
</li>
<% end %>
<% end %>
<% end %>
+1 -3
View File
@@ -24,15 +24,13 @@
filter_active_class: "filter--active",
filter_selected_class: "selected" } do %>
<div class="flex align-center full-width gap-half">
<span class="btn borderless" style="pointer-events: none; --icon-size: 1.3em; --btn-padding: 0 0.4em 0 0.6em;">
<%= icon_tag "filter" %>
</span>
<strong class="popup__title txt-medium">Collections</strong>
<button class="btn borderless txt-x-small flex-item-justify-end" data-action="click->dialog#close" >
<%= icon_tag "remove-med" %>
<span class="for-screen-reader">Close</span>
</button>
</div>
<%= render "events/filter/new_collection_option" %>
<% if Current.user.collections.count > 15 %>
<input placeholder="Find a collection…" class="input input--transparent txt-small" type="search" autocorrect="off" autocomplete="off" data-1p-ignore="true" data-action="input->filter#filter" autofocus=>
<% end %>
@@ -3,7 +3,7 @@
Considering
</h2>
<% if collection = filter.single_collection %>
<% if collection = filter.single_collection || (Current.user.collections.first if Current.user.collections.one?) %>
<%= button_to collection_cards_path(collection), method: :post, class: "card card--new-card-button btn", form_class: "full-width" do %>
<div class="card__body flex align-center gap-half txt-xx-large margin-block-half">
<%= icon_tag "add" %>
+4 -4
View File
@@ -31,12 +31,12 @@
</div>
<div class="panel shadow center flex flex-column">
<%= render "collections/edit/auto_close", collection: @collection %>
<hr class="separator--horizontal full-width margin-block" style="--border-color: var(--color-ink-medium);" aria-hidden="true" />
<%= render "collections/edit/workflows", collection: @collection %>
<hr class="separator--horizontal full-width" style="--border-color: var(--color-ink-medium); margin-block-start: auto;" aria-hidden="true" />
<%= render "collections/edit/auto_close", collection: @collection %>
<%= render "collections/edit/stalled", collection: @collection %>
<hr class="separator--horizontal full-width margin-block" style="--border-color: var(--color-ink-medium);" aria-hidden="true" />
<%= form_with model: @collection, class: "txt-align-center", method: :delete do |form| %>
<%= form.button class: "btn txt-negative borderless txt-small", data: { turbo_confirm: "Are you sure you want to permanently delete this Collection?" } do %>
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="flex align-center gap">
<label class="flex-item-grow">
<strong><%= form.text_field :name, name: "collection[name]", class: "input full-width",
<strong><%= form.text_field :name, name: "collection[name]", class: "input full-width txt-medium",
required: true, autofocus: true, placeholder: "Give it a name…",
data: { action: "keydown.enter->form#submit:prevent, keydown.esc->form#cancel" } %></strong>
</label>
@@ -0,0 +1,6 @@
<strong class="txt-large">Stalled</strong>
<label for="closure" class="margin-block-end">Mark cards stalled when there is no activity for…</label>
<%= form_with model: collection, data: { controller: "form" } do |form| %>
<%= form.select :stalled_period, collection_stalled_options, {}, { class: "input input--select full-width margin-block-end", data: { action: "change->form#submit" } } %>
<% end %>
@@ -29,11 +29,6 @@
<div data-filter-target="list" class="users-list pad-inline">
<%= access_toggles_for selected_users, selected: true %>
<% if selected_users.any? && unselected_users.any? %>
<hr class="separator full-width" style="--border-style: solid">
<% end %>
<%= access_toggles_for unselected_users, selected: false %>
</div>
<% end %>
@@ -1,11 +1,11 @@
<strong class="txt-large">Workflows</strong>
<div class="flex justify-center margin-block-end">Use a Workflow to track progress in this Collection.</div>
<div class="flex flex-wrap gap">
<div class="flex flex-wrap gap justify-center">
<% Workflow.all.each do |workflow| %>
<div class="workflow-preview txt-align-start border border-radius <%= 'workflow-preview--selected' if workflow == collection.workflow %>">
<%= button_to collection_workflow_path(collection), method: :patch do %>
<%= hidden_field_tag "collection[workflow_id]", workflow.id %>
<strong class="txt-small overflow-ellipsis"><%= workflow.name %></strong>
<strong class="txt-small overflow-ellipsis flex-item-no-shrink"><%= workflow.name %></strong>
<ul class="list-style-none txt-xx-small margin-none flex flex-column gap-half">
<% workflow.stages.each do |stage| %>
<li class="overflow-ellipsis flex align-center gap-half min-width">
+6 -3
View File
@@ -26,9 +26,12 @@
<%= form_with url: events_path, method: :get, class: "flex flex-column max-width popup__list full-width",
data: { controller: "form" } do |form| %>
<%= render "events/filter/all_collections_option", form: form, filter: filter %>
<menu data-filter-target="list" contents>
<%= render partial: "events/filter/collection_option", collection: Current.user.collections.alphabetically, as: :collection, locals: { form: form, filter: filter } %>
</menu>
<% if Current.user.collections.many? %>
<menu data-filter-target="list" contents>
<%= render partial: "events/filter/collection_option", collection: Current.user.collections.alphabetically, as: :collection, locals: { form: form, filter: filter } %>
</menu>
<% end %>
<% end %>
<p class="txt-small txt-nowrap txt-align-center margin-block-half full-width">
@@ -1,17 +1,26 @@
<div class="popup__group flex align-center" style="--hover-size: 0">
<% if Current.user.collections.one? %>
<%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "popup__group flex align-center", style: "--hover-size: 0" do %>
<%= tag.div class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis"><%= Current.user.collections.first.name %></span>
<span class="txt-ink translucent flex-item-no-shrink flex-item-justify-end"><span class="txt-x-small txt-uppercase">GO TO</span> </span>
<% end %>
<% end %>
<% elsif Current.user.collections.many? %>
<div class="popup__group flex align-center" style="--hover-size: 0">
<div class="btn txt-xx-small flex-item-no-shrink">
<%= link_to events_path(clear_filter: true), style: "--hover-size: 0" do %>
<%= check_box_tag "filter_collections", nil, filter.collections.blank?, class: "form-checkbox" %>
<% end %>
<span class="for-screen-reader">
See everything in all collections
</span>
See everything in all collections
</span>
<%= icon_tag "check", size: 18, class: "checked" %>
</div>
<%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "btn popup__item min-width flex-item-grow" do %>
<%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "btn popup__item min-width flex-item-grow" do %>
<span class="overflow-ellipsis">All collections</span>
<span class="txt-ink translucent flex-item-no-shrink flex-item-justify-end"><span class="txt-x-small txt-uppercase">GO TO</span> </span>
<% end %>
</div>
</div>
<% end %>
@@ -2,6 +2,6 @@
<%= link_to new_collection_path, class: "btn popup__new popup__item", style: "view-transition-name: new-collection" do %>
<%= icon_tag "add" %>
<span>Add a new collection</span>
<hr class="full-width separator--horizontal margin-none" style="--border-color: transparent;">
<% end %>
<hr class="full-width separator--horizontal margin-none" style="--border-color: transparent;">
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="filters flex align-center gap-half margin-block-end-half margin-none-block-start justify-center center">
<div class="filters flex align-center gap-half margin-none-block justify-center center">
<div class="flex-inline center align-center gap-half">
<%= render "filters/tags", filter: filter %>
<%= render "filters/assignees", filter: filter %>
+8
View File
@@ -120,4 +120,12 @@ class CardTest < ActiveSupport::TestCase
assert_includes card.cache_key, ApplicationRecord.current_tenant, "cache key must always include the tenant"
end
test "for published cards, it should set the default title 'Untitiled' when not provided" do
card = collections(:writebook).cards.create!
assert_nil card.title
card.publish
assert_equal "Untitled", card.reload.title
end
end
@@ -56,6 +56,15 @@ class Notifier::EventNotifierTest < ActiveSupport::TestCase
end
test "assignment events do not notify users who are access-only for the collection" do
collections(:writebook).access_for(users(:jz)).watching!
events(:logo_assignment_jz).update! creator: users(:jz)
notifications = Notifier.for(events(:logo_assignment_jz)).notify
assert_empty notifications
end
test "assignment events do not notify you if you assigned yourself" do
collections(:writebook).access_for(users(:jz)).access_only!
notifications = Notifier.for(events(:logo_assignment_jz)).notify