|
3 | 3 | import Tooltip from '../../components/Tooltip.svelte'; |
4 | 4 | import Input from '../../components/Input.svelte'; |
5 | 5 | import ItemTypeIcon from '../../components/ItemTypeIcon.svelte'; |
| 6 | + import ItemDetailBreadcrumbLevel from './ItemDetailBreadcrumbLevel.svelte'; |
6 | 7 | import ItemKey from '../items/ItemKey.svelte'; |
7 | 8 | import { api } from '../../api.js'; |
8 | 9 | import { t } from '../../stores/i18n.svelte.js'; |
|
265 | 266 | <!-- Parent Hierarchy in breadcrumb --> |
266 | 267 | {#if parentHierarchy.length > 0} |
267 | 268 | {#each parentHierarchy as parent} |
268 | | - <div class="flex items-center gap-2 min-w-0"> |
269 | | - {#if parent.itemType} |
270 | | - <Tooltip content={parent.itemType.name}> |
271 | | - {#snippet children()} |
272 | | - <ItemTypeIcon itemType={parent.itemType} class="cursor-help" /> |
273 | | - {/snippet} |
274 | | - </Tooltip> |
275 | | - {/if} |
| 269 | + <ItemDetailBreadcrumbLevel |
| 270 | + itemType={parent.itemType} |
| 271 | + iconSlotTestId={`item-parent-type-icon-slot-${parent.id}`} |
| 272 | + iconTestId={`item-parent-type-icon-${parent.id}`} |
| 273 | + > |
276 | 274 | <a |
277 | 275 | data-testid={`item-parent-breadcrumb-${parent.id}`} |
278 | 276 | href={`/workspaces/${parent.workspace_id}/items/${parent.id}`} |
|
282 | 280 | > |
283 | 281 | {parent.title} |
284 | 282 | </a> |
285 | | - </div> |
| 283 | + </ItemDetailBreadcrumbLevel> |
286 | 284 | <span class="flex-shrink-0">/</span> |
287 | 285 | {/each} |
288 | 286 | {:else if !item.parent_id && !(workspace?.is_personal && item.related_work_item_id)} |
|
481 | 479 | {/if} |
482 | 480 | </div> |
483 | 481 | {/if} |
484 | | - <div class="flex items-center gap-2 min-w-0 flex-1" style="color: var(--ds-text);"> |
485 | | - {#if currentItemType} |
486 | | - <div class="relative flex-shrink-0"> |
487 | | - <Tooltip content="{currentItemType.name} ({currentHierarchyLevel?.name || 'Unknown level'}) — click to change"> |
488 | | - {#snippet children()} |
489 | | - <button |
490 | | - type="button" |
491 | | - data-testid="item-type-change-trigger" |
492 | | - data-item-type-id={currentItemType.id} |
493 | | - onclick={openItemTypeSelector} |
494 | | - class="inline-flex h-6 w-6 items-center justify-center rounded leading-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500" |
495 | | - title="Change item type" |
496 | | - > |
497 | | - <ItemTypeIcon itemType={currentItemType} testId="item-type-change-icon" /> |
498 | | - </button> |
499 | | - {/snippet} |
500 | | - </Tooltip> |
501 | | -
|
| 482 | + <ItemDetailBreadcrumbLevel |
| 483 | + itemType={currentItemType} |
| 484 | + iconTooltip={currentItemType ? `${currentItemType.name} (${currentHierarchyLevel?.name || 'Unknown level'}) — click to change` : undefined} |
| 485 | + iconTitle="Change item type" |
| 486 | + iconSlotTestId="item-type-icon-slot" |
| 487 | + iconTriggerTestId="item-type-change-trigger" |
| 488 | + iconTestId="item-type-change-icon" |
| 489 | + oniconclick={openItemTypeSelector} |
| 490 | + class="flex-1" |
| 491 | + style="color: var(--ds-text);" |
| 492 | + > |
| 493 | + {#snippet iconOverlay()} |
| 494 | + {#if currentItemType} |
502 | 495 | {#if showItemTypeSelector} |
503 | 496 | <div |
504 | 497 | data-testid="item-type-selector" |
|
569 | 562 | </div> |
570 | 563 | </div> |
571 | 564 | {/if} |
572 | | - </div> |
573 | | - {/if} |
| 565 | + {/if} |
| 566 | + {/snippet} |
574 | 567 | <Tooltip content={t('items.clickToCopyKey')}> |
575 | 568 | {#snippet children()} |
576 | 569 | <button |
|
584 | 577 | {/snippet} |
585 | 578 | </Tooltip> |
586 | 579 | <span class="truncate">{item.title}</span> |
587 | | - </div> |
| 580 | + </ItemDetailBreadcrumbLevel> |
588 | 581 | </div> |
589 | 582 |
|
590 | 583 | {#if hasHierarchyMismatch} |
|
0 commit comments