31894 and 32573 Updated par value validation and display#843
31894 and 32573 Updated par value validation and display#843severinbeauvais merged 5 commits intobcgov:mainfrom
Conversation
- used default header (same as edit UI) - updated share classes styling to match Edit UI - created function to format par values - updated par value rules - created function to count significant digits - added/updated unit tests
There was a problem hiding this comment.
Pull request overview
Updates share structure par value validation and display to align with the Edit UI, including introducing a significant-digits-based validation rule and formatting/par-value display changes.
Changes:
- Add
SignificantDigitsutility + unit tests and wire it into par value validation. - Update Share Structure validation messaging/tests for the new par value rules.
- Update List Share Class table header/styling and add par value formatting for display.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/SignificantDigits.spec.ts | Adds unit coverage for the new significant digits utility. |
| tests/unit/ShareStructure.spec.ts | Updates par value validation tests to match new significant-digit rule/message. |
| src/utils/index.ts | Re-exports SignificantDigits from the utils barrel. |
| src/utils/SignificantDigits.ts | Introduces significant digits counting helper. |
| src/components/common/ShareStructure.vue | Replaces decimal-place rules with significant-digits validation for par value. |
| src/components/common/ListShareClass.vue | Updates share class/series table header/styling and formats displayed par values. |
| package.json | Bumps app version to 5.16.32. |
| package-lock.json | Updates lockfile version metadata (and adds a license field entry). |
| .gitignore | Ignores Copilot instruction/agent files under .github. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <li> | ||
| <span class="ml-n1">{{ seriesItem.name }}</span> | ||
| </li> |
There was a problem hiding this comment.
The template renders an <li> directly inside a <td> without a surrounding <ul>/<ol>, which is invalid HTML and can cause inconsistent styling / screen-reader output. Replace the <li> with a non-list element (eg, <span>/<div>) or wrap the series rows in a proper list container if list semantics are intended.
| <li> | |
| <span class="ml-n1">{{ seriesItem.name }}</span> | |
| </li> | |
| <span class="ml-n1">{{ seriesItem.name }}</span> |
There was a problem hiding this comment.
I copied this from Edit UI. It displays just the bullet properly in all modern browsers.
There was a problem hiding this comment.
Yeah, I'll just fix in both UIs.
| </th> | ||
| </tr> | ||
| </thead> | ||
| </template> |
There was a problem hiding this comment.
I deleted this code in favour of using the default header -- same as in Edit UI.
| {{ row.item.name }} | ||
| </td> | ||
| <td class="share-series-value"> | ||
| <td class="share-series-value text-right"> |
| <span>{{ seriesItem.name }}</span> | ||
| <li> | ||
| <span class="ml-n1">{{ seriesItem.name }}</span> | ||
| </li> |
| } | ||
|
|
||
| td:not(:first-child){ | ||
| color: $gray6; |
|
|
||
| # Copilot custom instructions | ||
| /**/.github/copilot-instructions.md | ||
| /**/.github/agents/ |
There was a problem hiding this comment.
In case you configure some AI tools in your VS Code 😉
There was a problem hiding this comment.
Since you're both curious: https://code.visualstudio.com/docs/copilot/overview
| /** Returns a formatted par value. */ | ||
| formatParValue (item: any): string { | ||
| /** Returns a number formatted with a minimum of two decimal places. */ | ||
| function formatWithMinTwoDecimals (value: number): string { |
There was a problem hiding this comment.
Any need on toLocaleString for the par value formatted? The max shares above uses it in the template so I think would show 1,000,000 and then par value would show 1000000 if I'm understanding.
Not sure if realistic use case...
There was a problem hiding this comment.
Adding grouping (commas) wasn't a requirement but I didn't like some of my examples anyways so I'm rewriting this.
There was a problem hiding this comment.
I've completed my refactoring.
- moved FormatCurrency to own util file - refactored FormatCurrency - added unit tests for FormatCurrency
|
/gcbrun |
|
Temporary Url for review: https://business-create-dev--pr-843-x5xyygqw.web.app SB says, try this:
|
| vuetify, | ||
| propsData: { shareClasses } | ||
| }) | ||
| await flushPromises() |
There was a problem hiding this comment.
This was an attempt to fix the broken unit tests in this test suite.
The root cause was actually that our CI environment doesn't support maximumFractionDigits: 100.
The current change is always a good idea and is consistent with other unit tests so I'm leaving it.
loneil
left a comment
There was a problem hiding this comment.
Looks good, would want QA to put it through it's paces when deployed trying all sorts of options, and saving/completing the filing too, so that the DB field (not just he filing json field) for par value is verified for these conditions
I filed my test IA. The new business is: https://dev.business-dashboard.bcregistry.gov.bc.ca/BC0888490 Also, the tickets have the UX Assurance label on them already :) |




Issue #: bcgov/entity#31894 and bcgov/entity#32573
Description of changes:
Commit 1:
Commit 2:
Commit 3:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the bcrs-entities-create-ui license (Apache 2.0).