2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-06 15:28:49 +00:00

Simplify display of "locked" part status (#8297)

* Simplify display of "locked" part status

- REmove big badge
- Show subtle icon

* Update playwright test
This commit is contained in:
Oliver 2024-10-16 19:43:10 +11:00 committed by GitHub
parent 181e1dd9cc
commit 7c19e51d80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 9 deletions

View File

@ -21,9 +21,8 @@ import {
IconLayersLinked, IconLayersLinked,
IconList, IconList,
IconListTree, IconListTree,
IconNotes, IconLock,
IconPackages, IconPackages,
IconPaperclip,
IconReportAnalytics, IconReportAnalytics,
IconShoppingCart, IconShoppingCart,
IconStack2, IconStack2,
@ -899,12 +898,6 @@ export default function PartDetail() {
visible={part.building > 0} visible={part.building > 0}
key="in_production" key="in_production"
/>, />,
<DetailsBadge
label={t`Locked`}
color="black"
visible={part.locked == true}
key="locked"
/>,
<DetailsBadge <DetailsBadge
label={t`Inactive`} label={t`Inactive`}
color="red" color="red"
@ -1090,6 +1083,11 @@ export default function PartDetail() {
/> />
<PageDetail <PageDetail
title={t`Part` + ': ' + part.full_name} title={t`Part` + ': ' + part.full_name}
icon={
part?.locked ? (
<IconLock aria-label="part-lock-icon" />
) : undefined
}
subtitle={part.description} subtitle={part.description}
imageUrl={part.image} imageUrl={part.image}
badges={badges} badges={badges}

View File

@ -15,7 +15,7 @@ test('Pages - Part - Locking', async ({ page }) => {
// Navigate to a known assembly which *is* locked // Navigate to a known assembly which *is* locked
await page.goto(`${baseUrl}/part/100/bom`); await page.goto(`${baseUrl}/part/100/bom`);
await page.getByRole('tab', { name: 'Bill of Materials' }).click(); 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(); await page.getByText('Part is Locked', { exact: true }).waitFor();
// Check the "parameters" tab also // Check the "parameters" tab also