Skip to content

Commit 108e915

Browse files
committed
handle arrray re-orders in multiply nested paths
1 parent 4e82100 commit 108e915

File tree

7 files changed

+328
-36
lines changed

7 files changed

+328
-36
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@gadget-client/app-with-no-user-model": "^1.10.0",
2828
"@gadget-client/bulk-actions-test": "^1.113.0",
2929
"@gadget-client/full-auth": "^1.9.0",
30-
"@gadget-client/js-clients-test": "1.499.0-development.2005",
30+
"@gadget-client/js-clients-test": "1.508.0-development.2265",
3131
"@gadget-client/kitchen-sink": "1.9.0-development.206",
3232
"@gadget-client/related-products-example": "^1.865.0",
3333
"@gadget-client/zxcv-deeply-nested": "^1.212.0",

packages/react/cypress/component/auto/form/PolarisAutoBelongsToInput.cy.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ describe("PolarisAutoBelongsToInput", () => {
4545
// This simulates the response when the related record is queried to get the related model record value
4646
id: "42",
4747
sectionId: "1",
48-
section: { id: "1", name: "Section 1" },
4948
__typename: "Widget",
5049
}
5150
: {
@@ -133,7 +132,7 @@ describe("PolarisAutoBelongsToInput", () => {
133132
cy.contains(`Section 3`).click();
134133
cy.get(`[id="3_Section 3"]`);
135134

136-
expectUpdateActionSubmissionVariables({ id: "42", widget: { section: { _link: "3" } } });
135+
expectUpdateActionSubmissionVariables({ id: "42", widget: { section: { update: { id: "3", name: "Section 1" } } } });
137136
cy.getSubmitButton().click();
138137
cy.contains("Saved Widget successfully");
139138
});

packages/react/spec/__recordings__/useActionFormNested_1974165259/with-polly_2612993081/can-update-multiple-HasMany-relationships-that-are-reordered_1591436327/recording.har

+12-12
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
}
165165
},
166166
{
167-
"_id": "92f0993ea7a9aba2b2055384d7e2c25b",
167+
"_id": "0523aa94388d3d9c8c46302084a73ecf",
168168
"_order": 0,
169169
"cache": {},
170170
"request": {
@@ -212,7 +212,7 @@
212212
"postData": {
213213
"mimeType": "application/json",
214214
"params": [],
215-
"text": "{\"operationName\":\"updateQuiz\",\"query\":\"mutation updateQuiz($id: GadgetID!, $quiz: UpdateQuizInput) {\\n updateQuiz(id: $id, quiz: $quiz) {\\n success\\n errors {\\n message\\n code\\n ... on InvalidRecordError {\\n model {\\n apiIdentifier\\n __typename\\n }\\n validationErrors {\\n message\\n apiIdentifier\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n quiz {\\n id\\n text\\n questions {\\n edges {\\n node {\\n id\\n text\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n gadgetMeta {\\n hydrations(modelName: \\n\\\"quiz\\\")\\n __typename\\n }\\n}\",\"variables\":{\"id\":\"168\",\"quiz\":{\"questions\":[{\"update\":{\"id\":\"1774\",\"text\":\"test question updated - 1\"}},{\"update\":{\"id\":\"1775\",\"text\":\"test question updated - 2\"}}],\"text\":\"test quiz updated\"}}}"
215+
"text": "{\"operationName\":\"updateQuiz\",\"query\":\"mutation updateQuiz($id: GadgetID!, $quiz: UpdateQuizInput) {\\n updateQuiz(id: $id, quiz: $quiz) {\\n success\\n errors {\\n message\\n code\\n ... on InvalidRecordError {\\n model {\\n apiIdentifier\\n __typename\\n }\\n validationErrors {\\n message\\n apiIdentifier\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n quiz {\\n id\\n text\\n questions {\\n edges {\\n node {\\n id\\n text\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n gadgetMeta {\\n hydrations(modelName: \\n\\\"quiz\\\")\\n __typename\\n }\\n}\",\"variables\":{\"id\":\"168\",\"quiz\":{\"questions\":[{\"update\":{\"id\":\"1775\",\"text\":\"test question updated - 2\"}},{\"update\":{\"id\":\"1774\",\"text\":\"test question updated - 1\"}}],\"text\":\"test quiz updated\"}}}"
216216
},
217217
"queryString": [
218218
{
@@ -228,13 +228,13 @@
228228
"encoding": "base64",
229229
"mimeType": "application/json; charset=utf-8",
230230
"size": 432,
231-
"text": "[\"H4sIAAAAAAAAA5yRy2rDMBBFf8XMWq3t4FiJdqEtpYsuUtpVKUGRJoqoI7vSGPLA/16UVyEmBLrUzJ1zR3N3oCVJEDtoGy0Jp63dxldolcIQQJBvkQF6X/sAwrVVxeDnKLIaBOTlCBgQrgkEEAZKYjs54DRENQaytQtxBLXBAOJzB67W+AfhvOhRDmMnUnKX5MBgNqNNg06uEARMjxrorjSetEHoWN9teNtt8E+3ryvdh9o5VFcAdtsrfpwDecPQVhQFRmqD9IqHyJYb7eX5tMpj3HwS//QoCd/tCoEdc70oX3o977mTpqms2hP3Fl3HANeELpw8qtoEELAkaoJIU2PovrLuO431NB9mZTZK52qecZ4PcIyLsZRFKTmOJceyyDTP1SJe3kuFLzGKm+Ku+wUAAP//AwCwUnbFowIAAA==\"]"
231+
"text": "[\"H4sIAAAAAAAAA5yRy07DMBBFfyWatSEJpXl4VwFCLFgUwQqhyrIH1yJ1gj2R+lD+Hblpi9QoqtSlZ+6cO567AyVIAN9B2yhBOG/NNrx8KyV6D5xciwzQudp54LatKga/B5FRwCHNCmBAuCbgQOgpCu2oxykIavRkauvDCCqNHvjnDmyt8B+S5/cDSj92JEU3UQoMFgvaNGjFCoHD/KCBbqTxpDRCx4Zu08tud1e6fY10H2prUY4AzHZQ/DgF8oa+rSgItFAa6RX7yJYb5cTptNJh2HwW/vQoCN/NCoEdcj0rn3s977mzpqmM3BP3Fl3HANeE1h89qlp74LAkajyPY63ptjL2Jw71OJ0mWVLEQpRqkucqK8qJKPNpkWYqS4qs/C4nhUQZLu+ExJcQxUVx1/0BAAD//wMAgXoqlqMCAAA=\"]"
232232
},
233233
"cookies": [],
234234
"headers": [
235235
{
236236
"name": "date",
237-
"value": "Wed, 28 Aug 2024 23:51:06 GMT"
237+
"value": "Fri, 06 Dec 2024 18:26:09 GMT"
238238
},
239239
{
240240
"name": "content-type",
@@ -246,7 +246,7 @@
246246
},
247247
{
248248
"name": "connection",
249-
"value": "close"
249+
"value": "keep-alive"
250250
},
251251
{
252252
"name": "vary",
@@ -266,11 +266,11 @@
266266
},
267267
{
268268
"name": "x-request-id",
269-
"value": "71e6f976bdf5819fc5352d25a97baf5e"
269+
"value": "dd9c1c42bb00562cc941b60f9875c713"
270270
},
271271
{
272272
"name": "x-trace-id",
273-
"value": "bcb07712e9ef9aa46a7e9a7e640d71cf"
273+
"value": "aa9d377d6893a975816d60869f938cec"
274274
},
275275
{
276276
"name": "strict-transport-security",
@@ -290,7 +290,7 @@
290290
},
291291
{
292292
"name": "cf-ray",
293-
"value": "8ba8351979ccac96-YYZ"
293+
"value": "8ede5285385d6a57-EWR"
294294
},
295295
{
296296
"name": "content-encoding",
@@ -301,22 +301,22 @@
301301
"value": "h3=\":443\"; ma=86400"
302302
}
303303
],
304-
"headersSize": 612,
304+
"headersSize": 617,
305305
"httpVersion": "HTTP/1.1",
306306
"redirectURL": "",
307307
"status": 200,
308308
"statusText": "OK"
309309
},
310-
"startedDateTime": "2024-08-28T23:51:06.347Z",
311-
"time": 328,
310+
"startedDateTime": "2024-12-06T18:26:06.129Z",
311+
"time": 3295,
312312
"timings": {
313313
"blocked": -1,
314314
"connect": -1,
315315
"dns": -1,
316316
"receive": 0,
317317
"send": 0,
318318
"ssl": -1,
319-
"wait": 328
319+
"wait": 3295
320320
}
321321
}
322322
],

packages/react/spec/auto/hooks/useTable.spec.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ describe("useTable hook", () => {
788788
name
789789
}
790790
secretKey
791+
sectionId
791792
startsAt
792793
updatedAt
793794
}

0 commit comments

Comments
 (0)