@dignite-ng/expand.cms 0.0.50 → 0.0.51
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/config/services/validators.service.d.ts +1 -1
- package/esm2022/config/components/domains/domains.component.mjs +3 -3
- package/esm2022/config/components/site-language/site-language.component.mjs +2 -2
- package/esm2022/config/enums/route-names.mjs +1 -2
- package/esm2022/config/services/validators.service.mjs +6 -5
- package/esm2022/lib/components/admin/entries/create.component.mjs +3 -3
- package/esm2022/lib/components/admin/entries/edit.component.mjs +3 -3
- package/esm2022/lib/components/admin/fields/create-field.component.mjs +3 -3
- package/esm2022/lib/components/admin/fields/edit-field.component.mjs +3 -3
- package/esm2022/lib/components/admin/fields/field-group.component.mjs +5 -5
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +4 -4
- package/esm2022/lib/components/admin/sections/sections.component.mjs +5 -5
- package/esm2022/lib/services/validators.service.mjs +7 -5
- package/fesm2022/dignite-ng-expand.cms-config.mjs +8 -8
- package/fesm2022/dignite-ng-expand.cms-config.mjs.map +1 -1
- package/fesm2022/dignite-ng-expand.cms.mjs +25 -23
- package/fesm2022/dignite-ng-expand.cms.mjs.map +1 -1
- package/lib/services/validators.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -460,21 +460,23 @@ class ValidatorsService {
|
|
|
460
460
|
this._LocalizationService = inject(LocalizationService);
|
|
461
461
|
}
|
|
462
462
|
/**检查表单- */
|
|
463
|
-
|
|
463
|
+
/**检查表单- */
|
|
464
|
+
isCheckForm(input, module = 'AbpValidation') {
|
|
464
465
|
let keys = Object.keys(input);
|
|
465
466
|
for (let i = 0; i < keys.length; i++) {
|
|
466
467
|
const element = keys[i];
|
|
467
468
|
if (input[element] == false) {
|
|
468
|
-
let info =
|
|
469
|
+
let info = `"${this._LocalizationService.instant(`${module}::${element}`)}" `;
|
|
469
470
|
if (element.includes('.') && !element.includes('].')) {
|
|
470
471
|
let arr = element.split('.');
|
|
471
|
-
info =
|
|
472
|
+
info = `"${this._LocalizationService.instant(`CmsKit::${arr[0]}`)}.${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
|
|
472
473
|
}
|
|
473
474
|
if (element.includes('].')) {
|
|
474
475
|
let arr = element.split('].');
|
|
475
476
|
let arrStart = arr[0].split('[');
|
|
476
|
-
info =
|
|
477
|
+
info = `"${this._LocalizationService.instant(`CmsKit::${arrStart[0]}`)}[${arrStart[1]}].${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
|
|
477
478
|
}
|
|
479
|
+
info += `${this._LocalizationService.instant(`AbpValidation::ThisFieldIsNotValid`)}`;
|
|
478
480
|
//使用abp多语言提示
|
|
479
481
|
this.toaster.warn(info);
|
|
480
482
|
return true;
|
|
@@ -1120,12 +1122,12 @@ class CreateComponent {
|
|
|
1120
1122
|
if (!this.isSubmit)
|
|
1121
1123
|
return;
|
|
1122
1124
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
|
|
1123
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1125
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1124
1126
|
return;
|
|
1125
1127
|
if (!this.newEntity.valid)
|
|
1126
1128
|
return;
|
|
1127
1129
|
this._EntryAdminService.create(input).subscribe(res => {
|
|
1128
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1130
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1129
1131
|
this._location.back();
|
|
1130
1132
|
this._updateListService.updateList();
|
|
1131
1133
|
});
|
|
@@ -1212,12 +1214,12 @@ class EditComponent {
|
|
|
1212
1214
|
if (!this.isSubmit)
|
|
1213
1215
|
return;
|
|
1214
1216
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
|
|
1215
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1217
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1216
1218
|
return;
|
|
1217
1219
|
if (!this.newEntity.valid)
|
|
1218
1220
|
return;
|
|
1219
1221
|
this._EntryAdminService.update(this.entrySelect.id, input).subscribe(res => {
|
|
1220
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1222
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1221
1223
|
this.backTo();
|
|
1222
1224
|
this._updateListService.updateList();
|
|
1223
1225
|
});
|
|
@@ -1359,14 +1361,14 @@ class FieldGroupComponent {
|
|
|
1359
1361
|
let input = this.createForm.value;
|
|
1360
1362
|
this.modalBusy = true;
|
|
1361
1363
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
|
|
1362
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1364
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1363
1365
|
return;
|
|
1364
1366
|
this._FieldGroupAdminService.create(input).pipe(finalize$1(() => {
|
|
1365
1367
|
this.modalBusy = false;
|
|
1366
1368
|
this.createGroupOpen = false;
|
|
1367
1369
|
this.formValidation = '';
|
|
1368
1370
|
})).subscribe(res => {
|
|
1369
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1371
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1370
1372
|
this._FieldAbstractsService.getfieldGroupList();
|
|
1371
1373
|
});
|
|
1372
1374
|
}
|
|
@@ -1375,14 +1377,14 @@ class FieldGroupComponent {
|
|
|
1375
1377
|
let input = this.editGroupForm.value;
|
|
1376
1378
|
this.modalBusy = true;
|
|
1377
1379
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
|
|
1378
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1380
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1379
1381
|
return;
|
|
1380
1382
|
this._FieldGroupAdminService.update(this.fieldGroupId, input).pipe(finalize$1(() => {
|
|
1381
1383
|
this.modalBusy = false;
|
|
1382
1384
|
this.editGroupOpen = false;
|
|
1383
1385
|
this.formValidation = '';
|
|
1384
1386
|
})).subscribe(res => {
|
|
1385
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1387
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1386
1388
|
this._FieldAbstractsService.getfieldGroupList();
|
|
1387
1389
|
});
|
|
1388
1390
|
}
|
|
@@ -1663,12 +1665,12 @@ class CreateFieldComponent {
|
|
|
1663
1665
|
let input = this.newEntity.value;
|
|
1664
1666
|
// if (!this.isSubmit) return;
|
|
1665
1667
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
|
|
1666
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1668
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1667
1669
|
return;
|
|
1668
1670
|
if (!this.newEntity.valid)
|
|
1669
1671
|
return;
|
|
1670
1672
|
this._FieldAdminService.create(input).subscribe(res => {
|
|
1671
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1673
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1672
1674
|
this._location.back();
|
|
1673
1675
|
this._UpdateListService.updateList();
|
|
1674
1676
|
});
|
|
@@ -1749,12 +1751,12 @@ class EditFieldComponent {
|
|
|
1749
1751
|
if (!this.isSubmit)
|
|
1750
1752
|
return;
|
|
1751
1753
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
|
|
1752
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1754
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1753
1755
|
return;
|
|
1754
1756
|
if (!this.newEntity.valid)
|
|
1755
1757
|
return;
|
|
1756
1758
|
this._FieldAdminService.update(this.fieldId, input).subscribe(res => {
|
|
1757
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1759
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1758
1760
|
this._location.back();
|
|
1759
1761
|
this._UpdateListService.updateList();
|
|
1760
1762
|
});
|
|
@@ -1900,7 +1902,7 @@ class SectionsComponent {
|
|
|
1900
1902
|
createSave() {
|
|
1901
1903
|
let input = this.createOrEditForm.value;
|
|
1902
1904
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
|
|
1903
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1905
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1904
1906
|
return;
|
|
1905
1907
|
if (!this.createOrEditForm.valid)
|
|
1906
1908
|
return;
|
|
@@ -1912,7 +1914,7 @@ class SectionsComponent {
|
|
|
1912
1914
|
this.visibleOpen = false;
|
|
1913
1915
|
}))
|
|
1914
1916
|
.subscribe(res => {
|
|
1915
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1917
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1916
1918
|
this.list.get();
|
|
1917
1919
|
});
|
|
1918
1920
|
}
|
|
@@ -1921,7 +1923,7 @@ class SectionsComponent {
|
|
|
1921
1923
|
let input = this.createOrEditForm.value;
|
|
1922
1924
|
input.concurrencyStamp = this.selected.concurrencyStamp;
|
|
1923
1925
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
|
|
1924
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
1926
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
1925
1927
|
return;
|
|
1926
1928
|
if (!this.createOrEditForm.valid)
|
|
1927
1929
|
return;
|
|
@@ -1933,7 +1935,7 @@ class SectionsComponent {
|
|
|
1933
1935
|
this.visibleOpen = false;
|
|
1934
1936
|
}))
|
|
1935
1937
|
.subscribe(res => {
|
|
1936
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
1938
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1937
1939
|
this.list.get();
|
|
1938
1940
|
});
|
|
1939
1941
|
}, 100);
|
|
@@ -2404,11 +2406,11 @@ class CreateOrEditComponent {
|
|
|
2404
2406
|
save() {
|
|
2405
2407
|
let input = this.newEntity.value;
|
|
2406
2408
|
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
|
|
2407
|
-
if (this._ValidatorsService.isCheckForm(this.formValidation))
|
|
2409
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
|
|
2408
2410
|
return;
|
|
2409
2411
|
if (this.entryTypesSelect) {
|
|
2410
2412
|
this._EntryTypeAdminService.update(this.entryTypesSelect.id, input).subscribe(res => {
|
|
2411
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
2413
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
2412
2414
|
this._location.back();
|
|
2413
2415
|
this._UpdateListService.updateList();
|
|
2414
2416
|
});
|
|
@@ -2416,7 +2418,7 @@ class CreateOrEditComponent {
|
|
|
2416
2418
|
}
|
|
2417
2419
|
input.sectionId = this.sectionId;
|
|
2418
2420
|
this._EntryTypeAdminService.create(input).subscribe(res => {
|
|
2419
|
-
this.toaster.success(this._LocalizationService.instant(`
|
|
2421
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
2420
2422
|
this._location.back();
|
|
2421
2423
|
this._UpdateListService.updateList();
|
|
2422
2424
|
});
|