cabloy 5.1.141 → 5.1.142
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/.cabloy-version +1 -1
- package/.github/workflows/playwright-e2e.yml +2 -2
- package/CHANGELOG.md +21 -0
- package/cabloy-docs/frontend/form-guide.md +47 -0
- package/cabloy-docs/frontend/markdown-guide.md +50 -17
- package/cabloy-docs/frontend/route-alias-guide.md +20 -0
- package/cabloy-docs/frontend/scripts.md +9 -11
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +25 -0
- package/cabloy-docs/fullstack/parallel-worktree-environment.md +1 -1
- package/cabloy-docs/fullstack/quickstart.md +5 -4
- package/cabloy-docs/reference/repo-scripts.md +29 -42
- package/e2e/config/playwright.config.ts +34 -0
- package/e2e/scripts/e2e.ts +2 -27
- package/e2e/scripts/runE2e.ts +62 -0
- package/e2e/scripts/runE2eArgs.test.ts +75 -0
- package/e2e/scripts/runE2eArgs.ts +158 -0
- package/e2e/specs/{a-commerce/commerce.spec.ts → a-commerce.spec.ts} +361 -30
- package/e2e/specs/{cabloy-basic/account.spec.ts → account.spec.ts} +1 -2
- package/oxlint.config.ts +3 -0
- package/package.json +3 -9
- package/scripts/upgrade.ts +63 -68
- package/vona/packages-utils/lint/package.json +1 -1
- package/vona/packages-utils/lint/src/oxc/lint.ts +1 -1
- package/vona/packages-utils/lint/src/oxc/lintVue.ts +1 -1
- package/vona/pnpm-lock.yaml +41 -41
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/refundRecoveryView.tsx +7 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/order.ts +31 -15
- package/vona/src/suite/a-home/modules/home-user/package.json +1 -0
- package/vona/src/suite/a-home/modules/home-user/src/service/account.ts +15 -2
- package/vona/src/suite/a-home/modules/home-user/test/accountActivation.test.ts +34 -4
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/package.json +2 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/.metadata/index.ts +26 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/bean/imageScene.markdown.ts +13 -0
- package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/providerOperation.ts +23 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/refundOperation.ts +7 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/package.json +5 -5
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +1 -1
- package/zova/packages-zova/zova-core/src/bean/resource/locale/type.ts +1 -0
- package/zova/pnpm-lock.yaml +63 -18
- package/zova/src/front/config/config/config.cabloyBasicWeb.ts +3 -1
- package/zova/src/front/config/config/config.cabloyCommerce.ts +4 -2
- package/zova/src/suite/a-commerce/modules/commerce-member/src/page/address/controller.tsx +64 -63
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/types.ts +6 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionRefund/controller.tsx +413 -134
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/en-us.ts +76 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/zh-cn.ts +67 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/model/order.ts +1 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/cart/controller.tsx +1 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/checkout/controller.tsx +7 -7
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/order/controller.tsx +46 -9
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx +50 -30
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/src/component/formFieldCaptcha/controller.tsx +6 -2
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/component/formFieldImage/controller.tsx +9 -15
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/package.json +10 -2
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/index.ts +11 -2
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/controller.tsx +723 -5
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/render.tsx +461 -2
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/config/locale/en-us.ts +59 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/config/locale/zh-cn.ts +59 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/lib/codeBlockLanguages.ts +42 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/lib/richTextContentStyle.ts +20 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/test/lib/codeBlockLanguages.test.ts +25 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/model/resource.ts +1 -0
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/component/paymentNextAction/controller.tsx +26 -12
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/cli/openapi.config.ts +1 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/api/payMockMockPayment.ts +26 -0
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/apiSchema/payMockMockPayment.ts +8 -1
- package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/model/payMockPayment.ts +13 -1
- package/zova/src/suite-vendor/a-pay/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/types/formField.ts +7 -6
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +3 -3
- package/e2e/config/playwright.basic.config.ts +0 -3
- package/e2e/config/playwright.commerce.config.ts +0 -3
- package/e2e/config/playwright.shared.config.ts +0 -38
- package/e2e/scripts/testE2eClean.ts +0 -56
- /package/e2e/specs/{cabloy-basic/basic.spec.ts → cabloy-basic.spec.ts} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { SchemaObject } from 'openapi3-ts/oas31';
|
|
1
2
|
import type { TableIdentity } from 'table-identity';
|
|
3
|
+
import type { TypeFormOnSubmitData } from 'zova-module-a-form';
|
|
2
4
|
|
|
3
5
|
import { z } from 'zod';
|
|
4
6
|
import { BeanControllerPageBase, Use } from 'zova';
|
|
5
7
|
import { Controller } from 'zova-module-a-bean';
|
|
8
|
+
import { ZForm } from 'zova-module-a-form';
|
|
6
9
|
import { $QueryEnsureLoaded } from 'zova-module-a-model';
|
|
7
10
|
import { ZPage } from 'zova-module-home-base';
|
|
8
11
|
|
|
@@ -37,9 +40,27 @@ export class ControllerPageAddress extends BeanControllerPageBase {
|
|
|
37
40
|
|
|
38
41
|
editingId?: TableIdentity;
|
|
39
42
|
draft: AddressDraft = emptyDraft();
|
|
43
|
+
schemaAddress?: SchemaObject;
|
|
44
|
+
|
|
45
|
+
get apiSchemasAddressCreate() {
|
|
46
|
+
return this.scope.apiSchema.commerceMemberAddress.createMine();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get apiSchemasAddressUpdate() {
|
|
50
|
+
return this.scope.apiSchema.commerceMemberAddress.updateMine();
|
|
51
|
+
}
|
|
40
52
|
|
|
41
53
|
protected async __init__() {
|
|
42
|
-
await
|
|
54
|
+
await Promise.all([
|
|
55
|
+
$QueryEnsureLoaded(() => this.queryAddresses),
|
|
56
|
+
$QueryEnsureLoaded(() => this.apiSchemasAddressCreate.sdk),
|
|
57
|
+
$QueryEnsureLoaded(() => this.apiSchemasAddressUpdate.sdk),
|
|
58
|
+
]);
|
|
59
|
+
this.schemaAddress = this.$computed(() => {
|
|
60
|
+
return this.editingId === undefined
|
|
61
|
+
? this.apiSchemasAddressCreate.requestBody
|
|
62
|
+
: this.apiSchemasAddressUpdate.requestBody;
|
|
63
|
+
});
|
|
43
64
|
}
|
|
44
65
|
|
|
45
66
|
get queryAddresses() {
|
|
@@ -65,13 +86,13 @@ export class ControllerPageAddress extends BeanControllerPageBase {
|
|
|
65
86
|
this.draft = emptyDraft();
|
|
66
87
|
}
|
|
67
88
|
|
|
68
|
-
async submit() {
|
|
89
|
+
async submit(data: TypeFormOnSubmitData<AddressDraft>) {
|
|
69
90
|
if (this.editingId === undefined) {
|
|
70
|
-
await this.$$modelAddressMine.createMine().mutateAsync(
|
|
91
|
+
await this.$$modelAddressMine.createMine().mutateAsync(data.value);
|
|
71
92
|
} else {
|
|
72
93
|
await this.$$modelAddressMine.updateMine().mutateAsync({
|
|
73
94
|
id: this.editingId,
|
|
74
|
-
body:
|
|
95
|
+
body: data.value,
|
|
75
96
|
});
|
|
76
97
|
}
|
|
77
98
|
this.resetDraft();
|
|
@@ -124,68 +145,48 @@ export class ControllerPageAddress extends BeanControllerPageBase {
|
|
|
124
145
|
</article>
|
|
125
146
|
))}
|
|
126
147
|
</div>
|
|
127
|
-
<
|
|
128
|
-
class="card bg-base-100 border border-base-300 shadow-sm"
|
|
129
|
-
onSubmit={event => event.preventDefault()}
|
|
130
|
-
>
|
|
148
|
+
<div class="card bg-base-100 border border-base-300 shadow-sm">
|
|
131
149
|
<div class="card-body gap-3">
|
|
132
|
-
<
|
|
133
|
-
{this.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
class="input input-bordered"
|
|
169
|
-
placeholder={this.scope.locale.AddressLine1()}
|
|
170
|
-
v-model={this.draft.addressLine1}
|
|
171
|
-
/>
|
|
172
|
-
<input
|
|
173
|
-
class="input input-bordered"
|
|
174
|
-
placeholder={this.scope.locale.AddressLine2()}
|
|
175
|
-
v-model={this.draft.addressLine2}
|
|
176
|
-
/>
|
|
177
|
-
<div class="flex gap-2">
|
|
178
|
-
<button class="btn btn-primary" type="submit" onClick={() => this.submit()}>
|
|
179
|
-
{this.scope.locale.SaveAddress()}
|
|
180
|
-
</button>
|
|
181
|
-
{this.editingId !== undefined && (
|
|
182
|
-
<button class="btn btn-outline" type="button" onClick={() => this.resetDraft()}>
|
|
183
|
-
{this.scope.locale.CancelAddressEdit()}
|
|
184
|
-
</button>
|
|
150
|
+
<ZForm
|
|
151
|
+
data={this.draft}
|
|
152
|
+
schema={this.schemaAddress}
|
|
153
|
+
onSubmitData={data => this.submit(data)}
|
|
154
|
+
onShowError={async ({ error }) => {
|
|
155
|
+
await this.$performCommand('basic-commands:alert', {
|
|
156
|
+
type: 'error',
|
|
157
|
+
text: error.message,
|
|
158
|
+
});
|
|
159
|
+
}}
|
|
160
|
+
slotHeader={() => (
|
|
161
|
+
<h2 class="card-title">
|
|
162
|
+
{this.editingId === undefined
|
|
163
|
+
? this.scope.locale.AddAddress()
|
|
164
|
+
: this.scope.locale.EditAddress()}
|
|
165
|
+
</h2>
|
|
166
|
+
)}
|
|
167
|
+
slotFooter={$$form => (
|
|
168
|
+
<div class="flex gap-2">
|
|
169
|
+
<button
|
|
170
|
+
class="btn btn-primary"
|
|
171
|
+
disabled={$$form.formState.isSubmitting}
|
|
172
|
+
type="submit"
|
|
173
|
+
>
|
|
174
|
+
{this.scope.locale.SaveAddress()}
|
|
175
|
+
</button>
|
|
176
|
+
{this.editingId !== undefined && (
|
|
177
|
+
<button
|
|
178
|
+
class="btn btn-outline"
|
|
179
|
+
type="button"
|
|
180
|
+
onClick={() => this.resetDraft()}
|
|
181
|
+
>
|
|
182
|
+
{this.scope.locale.CancelAddressEdit()}
|
|
183
|
+
</button>
|
|
184
|
+
)}
|
|
185
|
+
</div>
|
|
185
186
|
)}
|
|
186
|
-
|
|
187
|
+
></ZForm>
|
|
187
188
|
</div>
|
|
188
|
-
</
|
|
189
|
+
</div>
|
|
189
190
|
</div>
|
|
190
191
|
{query?.error && (
|
|
191
192
|
<div role="alert" class="alert alert-error mt-6">
|
|
@@ -3133,7 +3133,12 @@ export interface components {
|
|
|
3133
3133
|
/** Format: date-time */
|
|
3134
3134
|
finalizedAt?: Date;
|
|
3135
3135
|
/** @enum {string} */
|
|
3136
|
-
recoveryDisposition:
|
|
3136
|
+
recoveryDisposition:
|
|
3137
|
+
| 'none'
|
|
3138
|
+
| 'await_webhook'
|
|
3139
|
+
| 'reconcile_only'
|
|
3140
|
+
| 'query_only'
|
|
3141
|
+
| 'retry_same_key';
|
|
3137
3142
|
recoveryMessage: string;
|
|
3138
3143
|
};
|
|
3139
3144
|
'commerce-trade.dto.refundRecoveryAction': {
|