Skip to content

Commit

Permalink
Simplify display of "locked" part status (#8297)
Browse files Browse the repository at this point in the history
* Simplify display of "locked" part status

- REmove big badge
- Show subtle icon

* Update playwright test
  • Loading branch information
SchrodingersGat authored Oct 16, 2024
1 parent 181e1dd commit 7c19e51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions src/frontend/src/pages/part/PartDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import {
IconLayersLinked,
IconList,
IconListTree,
IconNotes,
IconLock,
IconPackages,
IconPaperclip,
IconReportAnalytics,
IconShoppingCart,
IconStack2,
Expand Down Expand Up @@ -899,12 +898,6 @@ export default function PartDetail() {
visible={part.building > 0}
key="in_production"
/>,
<DetailsBadge
label={t`Locked`}
color="black"
visible={part.locked == true}
key="locked"
/>,
<DetailsBadge
label={t`Inactive`}
color="red"
Expand Down Expand Up @@ -1090,6 +1083,11 @@ export default function PartDetail() {
/>
<PageDetail
title={t`Part` + ': ' + part.full_name}
icon={
part?.locked ? (
<IconLock aria-label="part-lock-icon" />
) : undefined
}
subtitle={part.description}
imageUrl={part.image}
badges={badges}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/tests/pages/pui_part.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('Pages - Part - Locking', async ({ page }) => {
// Navigate to a known assembly which *is* locked
await page.goto(`${baseUrl}/part/100/bom`);
await page.getByRole('tab', { name: 'Bill of Materials' }).click();
await page.getByText('Locked', { exact: true }).waitFor();
await page.getByLabel('part-lock-icon').waitFor();
await page.getByText('Part is Locked', { exact: true }).waitFor();

// Check the "parameters" tab also
Expand Down

0 comments on commit 7c19e51

Please sign in to comment.