@abgov/nx-adsp 13.31.1 → 13.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/nx-adsp",
3
- "version": "13.31.1",
3
+ "version": "13.31.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "src/index.js",
6
6
  "description": "Government of Alberta - Nx plugin for ADSP apps.",
@@ -205,11 +205,11 @@ onUnmounted(() => {
205
205
  <% if (field.type === 'checkbox') { -%>
206
206
  <!-- The checkbox carries its own label via `text`; goa-form-item must not
207
207
  repeat it, or it renders twice. -->
208
- <goa-form-item>
208
+ <goa-form-item mb="l">
209
209
  <GoabCheckbox v-model="form.<%= field.key %>" name="<%= field.key %>" text="<%= field.label %>" />
210
210
  </goa-form-item>
211
211
  <% } else { -%>
212
- <goa-form-item label="<%= field.label %>"<% if (field.required !== false) { %> requirement="required"<% } %> :error="errors.<%= field.key %>">
212
+ <goa-form-item mb="l" label="<%= field.label %>"<% if (field.required !== false) { %> requirement="required"<% } %> :error="errors.<%= field.key %>">
213
213
  <% if (field.type === 'textarea') { -%>
214
214
  <GoabTextarea v-model="form.<%= field.key %>" name="<%= field.key %>" />
215
215
  <% } else if (field.type === 'number') { -%>
@@ -365,4 +365,26 @@ describe('Vue Admin CRUD Generator', () => {
365
365
  );
366
366
  expect(list).toContain('Cattle (mature)');
367
367
  }, 30000);
368
+
369
+ // Regression: goa-form-item's `mb` defaults to none, so stacked items rendered
370
+ // flush against each other -- a field's label sat directly on the previous
371
+ // field's input. `l` is the design system's own convention for vertical forms
372
+ // (110 uses against 11 of `xl` in GoA's reference app).
373
+ it('spaces stacked form items so fields do not sit flush', async () => {
374
+ await generator(host, baseOptions);
375
+ const edit = host
376
+ .read('apps/test/src/views/RegionsEditView.vue')
377
+ .toString();
378
+ // Counted per tag rather than as a contiguous string: formatFiles reflows a
379
+ // multi-attribute tag across lines, so `<goa-form-item mb="l"` is not a
380
+ // reliable substring.
381
+ const tags = edit
382
+ .split('<goa-form-item')
383
+ .slice(1)
384
+ .map((fragment) => fragment.slice(0, fragment.indexOf('>')));
385
+ expect(tags.length).toBeGreaterThan(0);
386
+ for (const tag of tags) {
387
+ expect(tag).toContain('mb="l"');
388
+ }
389
+ }, 30000);
368
390
  });
@@ -60,7 +60,7 @@ inline styles.
60
60
  | A styled status pill | `<goa-badge type="…">` | |
61
61
  | A hand-built alert/notice box | `<goa-callout type="…" heading="…">` | |
62
62
  | A loading `<div>` or spinner markup | `<goa-skeleton type="…">` or `<goa-spinner>` | Skeletons match the shape they replace (`card`, `text`, `table`) |
63
- | A `<label>` + error `<span>` around an input | `<goa-form-item label="…" error="…">` | Wrap the `Goab*` input in this, don't restyle it |
63
+ | A `<label>` + error `<span>` around an input | `<goa-form-item label="…" error="…" mb="l">` | Wrap the `Goab*` input in this, don't restyle it. `mb` defaults to none, so stacked items sit flush against each other — pass `mb="l"` (the design system's own convention for vertical forms). Omit it when the items are inside a `goa-block`, which supplies its own gap |
64
64
  | A row of buttons with flex styling | `<goa-button-group alignment="…">` | |
65
65
  | A hand-built multi-select (checkbox list, chips) | `<goa-dropdown-multiselect>` | Added in web-components 2.4.0 |
66
66
  | A hand-built filter row above a table | `<FilterBar>` (this library) | Controls, collapse, active-filter chips and clear-all. It emits a query-ready values object; the *view* owns resetting the page, debouncing, and URL sync |
@@ -98,7 +98,7 @@ async function onSubmit() {
98
98
  Edit
99
99
  </goa-button>
100
100
  </div>
101
- <dl>
101
+ <dl class="review-fields">
102
102
  <% step.fields.forEach(function (field) { -%>
103
103
  <dt><%- field.label %></dt>
104
104
  <% if (field.type === 'date') { -%>
@@ -146,4 +146,19 @@ async function onSubmit() {
146
146
  align-items: center;
147
147
  gap: var(--goa-space-m);
148
148
  }
149
+
150
+ /* A bare <dl> stacks its terms and values flush, so every answer ran into the
151
+ next one on the page whose whole job is being read back. Two columns, label
152
+ distinguished by weight -- matching vue-detail-view's .detail-fields, since
153
+ both render a record as label/value pairs and should not look different. */
154
+ .review-fields {
155
+ display: grid;
156
+ grid-template-columns: auto 1fr;
157
+ gap: var(--goa-space-xs) var(--goa-space-l);
158
+ margin: 0;
159
+ }
160
+
161
+ .review-fields dt {
162
+ font-weight: 600;
163
+ }
149
164
  </style>
@@ -213,7 +213,7 @@ function goBack() {
213
213
  <StepErrorSummary :errors="errors" />
214
214
 
215
215
  <% stepFields.forEach(function (field) { -%>
216
- <goa-form-item id="field-<%- field.key %>" label="<%- field.label %>"<% if (field.required !== false) { %> requirement="required"<% } %>>
216
+ <goa-form-item mb="l" id="field-<%- field.key %>" label="<%- field.label %>"<% if (field.required !== false) { %> requirement="required"<% } %>>
217
217
  <% if (field.type === 'textarea') { -%>
218
218
  <GoabTextarea v-model="form.<%- field.key %>" name="<%- field.key %>" />
219
219
  <% } else if (field.type === 'number') { -%>
@@ -343,4 +343,36 @@ describe('Vue Intake View Generator', () => {
343
343
  );
344
344
  expect(review).toContain('Cattle (mature)');
345
345
  }, 30000);
346
+
347
+ it('spaces stacked form items in each step', async () => {
348
+ await generator(host, baseOptions);
349
+ const step = host
350
+ .read('apps/test/src/views/PersonalInfoStepView.vue')
351
+ .toString();
352
+ // Counted per tag rather than as a contiguous string: formatFiles reflows a
353
+ // multi-attribute tag across lines, so `<goa-form-item mb="l"` is not a
354
+ // reliable substring.
355
+ const tags = step
356
+ .split('<goa-form-item')
357
+ .slice(1)
358
+ .map((fragment) => fragment.slice(0, fragment.indexOf('>')));
359
+ expect(tags.length).toBeGreaterThan(0);
360
+ for (const tag of tags) {
361
+ expect(tag).toContain('mb="l"');
362
+ }
363
+ }, 30000);
364
+
365
+ // Regression: the review page's <dl> was unstyled, so terms and values stacked
366
+ // flush -- every answer ran into the next on the page whose entire purpose is
367
+ // being read back before submitting. vue-detail-view already styled its
368
+ // equivalent list; this is the same fix, not a new idea.
369
+ it('gives the review page label/value list real spacing', async () => {
370
+ await generator(host, baseOptions);
371
+ const review = host
372
+ .read('apps/test/src/views/ApplicationReviewView.vue')
373
+ .toString();
374
+ expect(review).toContain('<dl class="review-fields">');
375
+ expect(review).toContain('grid-template-columns: auto 1fr');
376
+ expect(review).toContain('gap: var(--goa-space-xs) var(--goa-space-l)');
377
+ }, 30000);
346
378
  });