-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New design for WorkPackage HoverCard
- Loading branch information
Showing
8 changed files
with
67 additions
and
39 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
app/components/work_packages/highlighted_date_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<%= | ||
if @start_date == @due_date | ||
render(Primer::Beta::Text.new(**text_arguments, classes: date_classes(@start_date))) { parsed_date(@start_date) } | ||
render(Primer::Beta::Text.new(**@text_arguments, classes: date_classes(@start_date))) { parsed_date(@start_date) } | ||
else | ||
component_wrapper do | ||
concat(render(Primer::Beta::Text.new(**text_arguments)) { parsed_date(@start_date) }) | ||
concat(render(Primer::Beta::Text.new(**text_arguments)) { " - " }) if @due_date.present? | ||
concat(render(Primer::Beta::Text.new(**text_arguments, classes: date_classes(@due_date))) { parsed_date(@due_date) }) | ||
component_collection do |collection| | ||
collection.with_component(Primer::Beta::Text.new(**@text_arguments)) { parsed_date(@start_date) } | ||
collection.with_component(Primer::Beta::Text.new(**@text_arguments)) { " - " } if @due_date.present? | ||
collection.with_component(Primer::Beta::Text.new(**@text_arguments, classes: date_classes(@due_date))) { parsed_date(@due_date) } | ||
end | ||
end | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 17 additions & 16 deletions
33
app/components/work_packages/hover_card_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
.op-wp-hover-card | ||
display: grid | ||
align-items: center | ||
grid-template-columns: max-content max-content max-content auto 1fr | ||
grid-template-columns: auto auto auto auto 1fr | ||
grid-template-rows: max-content 1fr auto | ||
grid-row-gap: 5px | ||
grid-column-gap: 5px | ||
grid-template-areas: "status status id project project" "middleRow middleRow middleRow middleRow middleRow" "assignee assignee dates dates dates" | ||
grid-row-gap: calc(var(--stack-gap-condensed) / 2) | ||
grid-column-gap: var(--stack-gap-condensed) | ||
grid-template-areas: "type id status project project project" "subject subject subject subject subject subject" "assignee assignee assignee assignee dates dates" | ||
overflow: hidden | ||
|
||
&--middleRow | ||
align-self: flex-start | ||
&--project | ||
@include text-shortener() | ||
|
||
&--dates | ||
justify-self: flex-end | ||
|
||
&--principal | ||
max-width: 300px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= | ||
render(Primer::Beta::Label.new(size: :medium, inline: true, **@system_arguments)) { @status.name } | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class WorkPackages::StatusBadgeComponent < ApplicationComponent | ||
include OpPrimer::ComponentHelpers | ||
|
||
def initialize(work_package:, **system_arguments) | ||
super | ||
|
||
@work_package = work_package | ||
@status = work_package.status | ||
@system_arguments = system_arguments.merge({ classes: "__hl_background_status_#{@status.id}" }) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
lookbook/previews/open_project/work_packages/status_badge_component_preview.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenProject::WorkPackages | ||
# @logical_path OpenProject/WorkPackages | ||
class StatusBadgeComponentPreview < ViewComponent::Preview | ||
# @label Playground | ||
# @param size [Symbol] select [ medium, large] | ||
# @param inline [Boolean] | ||
def playground(size: :medium, inline: false) | ||
render(WorkPackages::StatusBadgeComponent.new(work_package: WorkPackage.visible.first, size:, inline:)) | ||
end | ||
end | ||
end |