Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes the style of the reasons for waiting completed #18939

Draft
wants to merge 3 commits into
base: 10.0/bugfixes
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/PendingReason_Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ public static function isLastPendingForItem(
): bool {
$pending_item = self::getLastPendingTimelineItemDataForItem($item);

if (!$pending_item) {
return false;
}

return
$pending_item->fields['items_id'] == $timeline_item->fields['id']
&& $pending_item->fields['itemtype'] == $timeline_item::getType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,31 @@
{% set pending_item = pending_item ?? call(entry['type'] ~ "::getById", [entry_i['id']]) %}
{% set pending_reason_item = pending_item ? call("PendingReason_Item::getForItem", [pending_item]) : false %}
{% set pending_reason = pending_reason_item ? call("PendingReason::getById", [pending_reason_item.fields['pendingreasons_id']]) : false %}
{% set is_latest_pending = call("PendingReason_Item::isLastPendingForItem", [
MyvTsv marked this conversation as resolved.
Show resolved Hide resolved
item,
pending_item
]) %}
{% set active_pending_icon %}
<i class="fas fa-pause me-1"></i>
{% endset %}
{% set done_pending_icon %}
<i class="fas fa-solid fa-check"></i>
{% endset %}
{% set pending_reason_option = is_latest_pending and pending_reason_item_parent != false ? {
'className' : 'badge bg-blue-lt',
'icon' : active_pending_icon,
'text': 'Pending',
} : {
'className' : 'badge bg-transparent text-muted',
'icon' : done_pending_icon,
'text' : 'Done',
} %}
{% endif %}

{% if pending_reason %}
<span class="badge bg-blue-lt {{ display_for_parent ? "mt-1 w-100 text-truncate" : "" }}">
<i class="fas fa-pause me-1"></i>
{{ __("Pending: %s")|format(pending_reason.getLink())|raw }}
<span class="{{ pending_reason_option.className }} {{ display_for_parent ? "mt-1 w-100 text-truncate" : "" }}">
{{ pending_reason_option.icon }}
{{ __(pending_reason_option.text ~ ": %s")|format(pending_reason.getLink())|raw }}

{% if display_for_parent or call("PendingReason_Item::isLastPendingForItem", [
item,
Expand Down