You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "Add Parts" button disappears when switching to Parametric View on the Parts page, even for admin users. This isn't a permissions issue: PartListTable (Table View) and ParametricPartTable (Parametric View) are separate components, and only PartListTable builds a toolbar with an "Add Parts" action. The generic ParametricDataTable that Parametric View wraps only supports per-row actions (like "Add Parameter"), so the button was never in that view in the first place.
Solution
Brought the "Add Parts" button from Table View into Parametric View so both views behave consistently. Added an optional customActions prop to ParametricDataTable, following the same pattern as the existing customColumns and customFilters props, and wired the same "Add Parts" dropdown (Create Part, Import from File, Import from Supplier) into Parametric View through that prop, gated by the same hasAddRole(UserRoles.part) permission check Table View already uses. However, since the dropdown was duplicated between the two tables, I extracted it into a shared PartCreationMenu component used by both.
Added Playwright tests confirming the button is visible for admins, hidden for read-only users, and that creating a part through the Parametric View works end to end.
1 paths audited Performance: 97 (no change from production) Accessibility: 81 (no change from production) Best Practices: 100 (no change from production) SEO: 78 (no change from production) PWA: - View the detailed breakdown and full score reports
The combination of "create new part" / "import parts" is a repeated pattern here - I think it would be worth offloading this to a common component e.g. PartCreationMenu which can be used in both locations
@SchrodingersGat I've implemented the PartCreationMenu component that both the Table View and Parametric View now use. Thanks for mentioning this, I noticed the SonarCloud code duplication check flagging it while I was working on the PR and I wasn't sure if I should've created separate component, but it makes sense since it's cleaner this way.
@SchrodingersGat I noticed some of the checks are failing, but some seem unrelated to this PR (aside from the prek one which I'll look into). I'm wondering if there are other remaining blockers or anything else needing to be addressed? Thanks!
The failing frontend tests seem to be flaky tests elsewhere - I'll look into that. But please address the prek tests
@SchrodingersGat Thanks for confirming! I’ve addressed the prek test failure and pushed the changes.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Add Parts" button disappears when switching to Parametric View on the Parts page, even for admin users. This isn't a permissions issue:
PartListTable(Table View) andParametricPartTable(Parametric View) are separate components, and onlyPartListTablebuilds a toolbar with an "Add Parts" action. The genericParametricDataTablethat Parametric View wraps only supports per-row actions (like "Add Parameter"), so the button was never in that view in the first place.Solution
Brought the "Add Parts" button from Table View into Parametric View so both views behave consistently. Added an optional
customActionsprop toParametricDataTable, following the same pattern as the existingcustomColumnsandcustomFiltersprops, and wired the same "Add Parts" dropdown (Create Part, Import from File, Import from Supplier) into Parametric View through that prop, gated by the samehasAddRole(UserRoles.part)permission check Table View already uses. However, since the dropdown was duplicated between the two tables, I extracted it into a sharedPartCreationMenucomponent used by both.Before:

After:

#11385: add part button disappear if grid style is changed to parametric view #11385Testing
Added Playwright tests confirming the button is visible for admins, hidden for read-only users, and that creating a part through the Parametric View works end to end.