@dignite-ng/expand.cms 0.0.58 → 2.0.0-rc.10
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/ng-package.json +6 -0
- package/config/src/cms-config.module.ts +13 -0
- package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
- package/config/src/enums/route-names.ts +7 -0
- package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
- package/config/src/providers/route.provider.ts +68 -0
- package/config/{public-api.d.ts → src/public-api.ts} +3 -3
- package/ng-package.json +10 -0
- package/package.json +7 -22
- package/src/lib/cms-routing.module.ts +102 -0
- package/src/lib/cms.module.ts +113 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.html +137 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +0 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +216 -0
- package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +26 -0
- package/src/lib/components/admin/entries/create.component.html +16 -0
- package/src/lib/components/admin/entries/create.component.scss +0 -0
- package/src/lib/components/admin/entries/create.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create.component.ts +130 -0
- package/src/lib/components/admin/entries/edit.component.html +9 -0
- package/src/lib/components/admin/entries/edit.component.scss +0 -0
- package/src/lib/components/admin/entries/edit.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/edit.component.ts +134 -0
- package/src/lib/components/admin/entries/entries.component.html +225 -0
- package/src/lib/components/admin/entries/entries.component.scss +109 -0
- package/src/lib/components/admin/entries/entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/entries.component.ts +394 -0
- package/src/lib/components/admin/entries/index.ts +4 -0
- package/src/lib/components/admin/fields/create-field.component.html +12 -0
- package/src/lib/components/admin/fields/create-field.component.scss +1 -0
- package/src/lib/components/admin/fields/create-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/create-field.component.ts +85 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.html +39 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.ts +140 -0
- package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +33 -0
- package/src/lib/components/admin/fields/edit-field.component.html +14 -0
- package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/edit-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/edit-field.component.ts +112 -0
- package/src/lib/components/admin/fields/field-group.component.html +69 -0
- package/src/lib/components/admin/fields/field-group.component.scss +0 -0
- package/src/lib/components/admin/fields/field-group.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/field-group.component.ts +151 -0
- package/src/lib/components/admin/fields/fields.component.html +25 -0
- package/src/lib/components/admin/fields/fields.component.scss +1 -0
- package/src/lib/components/admin/fields/fields.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/fields.component.ts +109 -0
- package/src/lib/components/admin/fields/index.ts +6 -0
- package/src/lib/components/admin/index.ts +3 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.html +81 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.scss +0 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.spec.ts +23 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.ts +239 -0
- package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +23 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +52 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +195 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +1 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +21 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +442 -0
- package/src/lib/components/admin/sections/entry-types/index.ts +2 -0
- package/src/lib/components/admin/sections/index.ts +3 -0
- package/src/lib/components/admin/sections/sections.component.html +189 -0
- package/src/lib/components/admin/sections/sections.component.scss +1 -0
- package/src/lib/components/admin/sections/sections.component.spec.ts +21 -0
- package/src/lib/components/admin/sections/sections.component.ts +136 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.html +26 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.scss +27 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.ts +119 -0
- package/src/lib/components/dynamic-form/entry/entry-config.ts +22 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.html +25 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.scss +35 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.ts +111 -0
- package/src/lib/components/dynamic-form/entry/index.ts +3 -0
- package/src/lib/components/dynamic-form/form-control-group.ts +27 -0
- package/src/lib/components/dynamic-form/index.ts +4 -0
- package/src/lib/components/dynamic-form/matrix/index.ts +3 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +148 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +244 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.ts +63 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +42 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +118 -0
- package/src/lib/components/dynamic-form/table/index.ts +3 -0
- package/src/lib/components/dynamic-form/table/table-config.component.html +85 -0
- package/src/lib/components/dynamic-form/table/table-config.component.scss +10 -0
- package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/table/table-config.component.ts +177 -0
- package/src/lib/components/dynamic-form/table/table-config.ts +45 -0
- package/src/lib/components/dynamic-form/table/table-control.component.html +54 -0
- package/src/lib/components/dynamic-form/table/table-control.component.scss +1 -0
- package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/table/table-control.component.ts +127 -0
- package/src/lib/components/index.ts +2 -0
- package/src/lib/constants/index.ts +1 -0
- package/src/lib/constants/styles.ts +18 -0
- package/src/lib/enums/ecms-component.ts +11 -0
- package/src/lib/enums/index.ts +1 -0
- package/src/lib/proxy/README.md +17 -0
- package/src/lib/proxy/dignite/abp/data/index.ts +1 -0
- package/src/lib/proxy/dignite/abp/data/models.ts +4 -0
- package/src/lib/proxy/dignite/abp/index.ts +3 -0
- package/src/lib/proxy/dignite/abp/regionalization-management/index.ts +2 -0
- package/src/lib/proxy/dignite/abp/regionalization-management/models.ts +10 -0
- package/src/lib/proxy/dignite/abp/regionalization-management/regionalization.service.ts +29 -0
- package/src/lib/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.ts +20 -0
- package/src/lib/proxy/dignite/cms/admin/dynamic-forms/models.ts +6 -0
- package/src/lib/proxy/dignite/cms/admin/entries/entry-admin.service.ts +109 -0
- package/src/lib/proxy/dignite/cms/admin/entries/models.ts +69 -0
- package/src/lib/proxy/dignite/cms/admin/fields/field-admin.service.ts +64 -0
- package/src/lib/proxy/dignite/cms/admin/fields/field-group-admin.service.ts +56 -0
- package/src/lib/proxy/dignite/cms/admin/fields/models.ts +42 -0
- package/src/lib/proxy/dignite/cms/admin/index.ts +5 -0
- package/src/lib/proxy/dignite/cms/admin/sections/entry-type-admin.service.ts +55 -0
- package/{lib/proxy/admin/sections/models.d.ts → src/lib/proxy/dignite/cms/admin/sections/models.ts} +82 -67
- package/src/lib/proxy/dignite/cms/admin/sections/section-admin.service.ts +74 -0
- package/src/lib/proxy/dignite/cms/entries/entry-status.enum.ts +8 -0
- package/src/lib/proxy/dignite/cms/fields/index.ts +1 -0
- package/src/lib/proxy/dignite/cms/fields/models.ts +9 -0
- package/src/lib/proxy/dignite/cms/index.ts +5 -0
- package/src/lib/proxy/dignite/cms/sections/models.ts +15 -0
- package/src/lib/proxy/dignite/cms/sections/section-type.enum.ts +9 -0
- package/src/lib/proxy/dignite/index.ts +3 -0
- package/src/lib/proxy/generate-proxy.json +54593 -0
- package/src/lib/proxy/index.ts +3 -0
- package/src/lib/proxy/volo/cms-kit/index.ts +2 -0
- package/src/lib/proxy/volo/cms-kit/users/index.ts +1 -0
- package/{lib/proxy/volo/cms-kit/users/models.d.ts → src/lib/proxy/volo/cms-kit/users/models.ts} +8 -7
- package/src/lib/proxy/volo/index.ts +2 -0
- package/src/lib/resolvers/extensions-props-action-token.resolver.ts +182 -0
- package/src/lib/resolvers/page-default-toolbar-actions.ts +173 -0
- package/src/lib/resolvers/table-default-entity-actions.ts +29 -0
- package/src/lib/resolvers/table-default-entity-props.ts +62 -0
- package/src/lib/services/appent-content.ts +13 -0
- package/src/lib/services/cms-api.service.ts +90 -0
- package/src/lib/services/cms.service.ts +18 -0
- package/src/lib/services/field-abstracts.service.ts +39 -0
- package/src/lib/services/index.ts +3 -0
- package/src/lib/services/validator.ts +10 -0
- package/src/public-api.ts +7 -0
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +16 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/config/cms-config.module.d.ts +0 -8
- package/config/components/domains/domains.component.d.ts +0 -31
- package/config/components/site-language/site-language.component.d.ts +0 -30
- package/config/enums/route-names.d.ts +0 -8
- package/config/index.d.ts +0 -5
- package/config/providers/route.provider.d.ts +0 -9
- package/config/proxy/admin/domains/domain-admin.service.d.ts +0 -13
- package/config/proxy/admin/domains/index.d.ts +0 -2
- package/config/proxy/admin/domains/models.d.ts +0 -7
- package/config/proxy/dignite/cms/admin/sites/index.d.ts +0 -2
- package/config/proxy/dignite/cms/admin/sites/models.d.ts +0 -4
- package/config/proxy/dignite/cms/admin/sites/site-admin.service.d.ts +0 -13
- package/config/proxy/dignite/cms/sites/models.d.ts +0 -4
- package/esm2022/config/cms-config.module.mjs +0 -18
- package/esm2022/config/components/domains/domains.component.mjs +0 -118
- package/esm2022/config/components/site-language/site-language.component.mjs +0 -113
- package/esm2022/config/dignite-ng-expand.cms-config.mjs +0 -5
- package/esm2022/config/enums/index.mjs +0 -2
- package/esm2022/config/enums/route-names.mjs +0 -10
- package/esm2022/config/providers/index.mjs +0 -2
- package/esm2022/config/providers/route.provider.mjs +0 -74
- package/esm2022/config/proxy/admin/domains/domain-admin.service.mjs +0 -32
- package/esm2022/config/proxy/admin/domains/index.mjs +0 -3
- package/esm2022/config/proxy/admin/domains/models.mjs +0 -2
- package/esm2022/config/proxy/dignite/cms/admin/sites/index.mjs +0 -3
- package/esm2022/config/proxy/dignite/cms/admin/sites/models.mjs +0 -2
- package/esm2022/config/proxy/dignite/cms/admin/sites/site-admin.service.mjs +0 -27
- package/esm2022/config/proxy/dignite/cms/sites/models.mjs +0 -2
- package/esm2022/config/public-api.mjs +0 -4
- package/esm2022/dignite-ng-expand.cms.mjs +0 -5
- package/esm2022/lib/cms-routing.module.mjs +0 -94
- package/esm2022/lib/cms.module.mjs +0 -139
- package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +0 -226
- package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +0 -25
- package/esm2022/lib/components/admin/entries/create.component.mjs +0 -136
- package/esm2022/lib/components/admin/entries/edit.component.mjs +0 -138
- package/esm2022/lib/components/admin/entries/entries.component.mjs +0 -203
- package/esm2022/lib/components/admin/entries/index.mjs +0 -5
- package/esm2022/lib/components/admin/fields/create-field.component.mjs +0 -87
- package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +0 -120
- package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +0 -25
- package/esm2022/lib/components/admin/fields/edit-field.component.mjs +0 -109
- package/esm2022/lib/components/admin/fields/field-group.component.mjs +0 -131
- package/esm2022/lib/components/admin/fields/fields.component.mjs +0 -108
- package/esm2022/lib/components/admin/fields/index.mjs +0 -7
- package/esm2022/lib/components/admin/index.mjs +0 -4
- package/esm2022/lib/components/admin/sections/create-or-edit-sections-modal.component.mjs +0 -210
- package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +0 -22
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +0 -71
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +0 -404
- package/esm2022/lib/components/admin/sections/entry-types/index.mjs +0 -3
- package/esm2022/lib/components/admin/sections/index.mjs +0 -4
- package/esm2022/lib/components/admin/sections/sections.component.mjs +0 -138
- package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +0 -114
- package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +0 -18
- package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +0 -101
- package/esm2022/lib/components/dynamic-form/entry/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/form-control-group.mjs +0 -28
- package/esm2022/lib/components/dynamic-form/index.mjs +0 -5
- package/esm2022/lib/components/dynamic-form/matrix/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +0 -212
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +0 -50
- package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +0 -94
- package/esm2022/lib/components/dynamic-form/table/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +0 -151
- package/esm2022/lib/components/dynamic-form/table/table-config.mjs +0 -38
- package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +0 -105
- package/esm2022/lib/components/index.mjs +0 -3
- package/esm2022/lib/constants/styles.mjs +0 -19
- package/esm2022/lib/enums/ecms-component.mjs +0 -13
- package/esm2022/lib/enums/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +0 -22
- package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +0 -70
- package/esm2022/lib/proxy/admin/entries/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/entries/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +0 -45
- package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +0 -41
- package/esm2022/lib/proxy/admin/fields/index.mjs +0 -4
- package/esm2022/lib/proxy/admin/fields/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +0 -41
- package/esm2022/lib/proxy/admin/sections/index.mjs +0 -4
- package/esm2022/lib/proxy/admin/sections/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +0 -51
- package/esm2022/lib/proxy/admin/settings/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +0 -31
- package/esm2022/lib/proxy/dignite/abp/data/models.mjs +0 -2
- package/esm2022/lib/proxy/entries/entry-status.enum.mjs +0 -8
- package/esm2022/lib/proxy/entries/index.mjs +0 -2
- package/esm2022/lib/proxy/fields/models.mjs +0 -2
- package/esm2022/lib/proxy/sections/index.mjs +0 -3
- package/esm2022/lib/proxy/sections/models.mjs +0 -2
- package/esm2022/lib/proxy/sections/section-type.enum.mjs +0 -9
- package/esm2022/lib/proxy/settings/models.mjs +0 -2
- package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +0 -2
- package/esm2022/lib/resolvers/extensions-props-action-token.resolver.mjs +0 -136
- package/esm2022/lib/resolvers/page-default-toolbar-actions.mjs +0 -160
- package/esm2022/lib/resolvers/table-default-entity-actions.mjs +0 -49
- package/esm2022/lib/resolvers/table-default-entity-props.mjs +0 -53
- package/esm2022/lib/services/appent-content.mjs +0 -15
- package/esm2022/lib/services/cms-api.service.mjs +0 -70
- package/esm2022/lib/services/cms.service.mjs +0 -21
- package/esm2022/lib/services/field-abstracts.service.mjs +0 -42
- package/esm2022/lib/services/index.mjs +0 -4
- package/esm2022/public-api.mjs +0 -6
- package/fesm2022/dignite-ng-expand.cms-config.mjs +0 -371
- package/fesm2022/dignite-ng-expand.cms-config.mjs.map +0 -1
- package/fesm2022/dignite-ng-expand.cms.mjs +0 -3886
- package/fesm2022/dignite-ng-expand.cms.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/cms-routing.module.d.ts +0 -7
- package/lib/cms.module.d.ts +0 -37
- package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +0 -63
- package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +0 -23
- package/lib/components/admin/entries/create.component.d.ts +0 -50
- package/lib/components/admin/entries/edit.component.d.ts +0 -53
- package/lib/components/admin/entries/entries.component.d.ts +0 -67
- package/lib/components/admin/entries/index.d.ts +0 -4
- package/lib/components/admin/fields/create-field.component.d.ts +0 -37
- package/lib/components/admin/fields/create-or-edit-field.component.d.ts +0 -38
- package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +0 -16
- package/lib/components/admin/fields/edit-field.component.d.ts +0 -46
- package/lib/components/admin/fields/field-group.component.d.ts +0 -58
- package/lib/components/admin/fields/fields.component.d.ts +0 -35
- package/lib/components/admin/fields/index.d.ts +0 -6
- package/lib/components/admin/index.d.ts +0 -3
- package/lib/components/admin/sections/create-or-edit-sections-modal.component.d.ts +0 -49
- package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +0 -20
- package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +0 -38
- package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +0 -139
- package/lib/components/admin/sections/entry-types/index.d.ts +0 -2
- package/lib/components/admin/sections/index.d.ts +0 -3
- package/lib/components/admin/sections/sections.component.d.ts +0 -46
- package/lib/components/dynamic-form/entry/entry-config.component.d.ts +0 -39
- package/lib/components/dynamic-form/entry/entry-config.d.ts +0 -9
- package/lib/components/dynamic-form/entry/entry-control.component.d.ts +0 -35
- package/lib/components/dynamic-form/entry/index.d.ts +0 -3
- package/lib/components/dynamic-form/form-control-group.d.ts +0 -4
- package/lib/components/dynamic-form/index.d.ts +0 -4
- package/lib/components/dynamic-form/matrix/index.d.ts +0 -3
- package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +0 -73
- package/lib/components/dynamic-form/matrix/matrix-config.d.ts +0 -24
- package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +0 -39
- package/lib/components/dynamic-form/table/index.d.ts +0 -3
- package/lib/components/dynamic-form/table/table-config.component.d.ts +0 -58
- package/lib/components/dynamic-form/table/table-config.d.ts +0 -18
- package/lib/components/dynamic-form/table/table-control.component.d.ts +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/constants/styles.d.ts +0 -2
- package/lib/enums/ecms-component.d.ts +0 -11
- package/lib/enums/index.d.ts +0 -1
- package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +0 -12
- package/lib/proxy/admin/dynamic-forms/models.d.ts +0 -4
- package/lib/proxy/admin/entries/entry-admin.service.d.ts +0 -22
- package/lib/proxy/admin/entries/models.d.ts +0 -60
- package/lib/proxy/admin/fields/field-admin.service.d.ts +0 -17
- package/lib/proxy/admin/fields/field-group-admin.service.d.ts +0 -16
- package/lib/proxy/admin/fields/models.d.ts +0 -34
- package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +0 -15
- package/lib/proxy/admin/sections/section-admin.service.d.ts +0 -18
- package/lib/proxy/admin/settings/index.d.ts +0 -1
- package/lib/proxy/admin/settings/site-settings-admin.service.d.ts +0 -13
- package/lib/proxy/dignite/abp/data/models.d.ts +0 -3
- package/lib/proxy/entries/entry-status.enum.d.ts +0 -5
- package/lib/proxy/fields/models.d.ts +0 -8
- package/lib/proxy/sections/models.d.ts +0 -12
- package/lib/proxy/sections/section-type.enum.d.ts +0 -6
- package/lib/proxy/settings/models.d.ts +0 -5
- package/lib/resolvers/extensions-props-action-token.resolver.d.ts +0 -75
- package/lib/resolvers/page-default-toolbar-actions.d.ts +0 -18
- package/lib/resolvers/table-default-entity-actions.d.ts +0 -5
- package/lib/resolvers/table-default-entity-props.d.ts +0 -5
- package/lib/services/appent-content.d.ts +0 -1
- package/lib/services/cms-api.service.d.ts +0 -16
- package/lib/services/cms.service.d.ts +0 -10
- package/lib/services/field-abstracts.service.d.ts +0 -20
- package/lib/services/index.d.ts +0 -3
- package/public-api.d.ts +0 -2
- /package/{lib/proxy/admin/dynamic-forms/index.d.ts → src/lib/proxy/dignite/cms/admin/dynamic-forms/index.ts} +0 -0
- /package/{lib/proxy/admin/entries/index.d.ts → src/lib/proxy/dignite/cms/admin/entries/index.ts} +0 -0
- /package/{lib/proxy/admin/fields/index.d.ts → src/lib/proxy/dignite/cms/admin/fields/index.ts} +0 -0
- /package/{lib/proxy/admin/sections/index.d.ts → src/lib/proxy/dignite/cms/admin/sections/index.ts} +0 -0
- /package/{lib/proxy/entries/index.d.ts → src/lib/proxy/dignite/cms/entries/index.ts} +0 -0
- /package/{lib/proxy/sections/index.d.ts → src/lib/proxy/dignite/cms/sections/index.ts} +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { ConfigStateService, LocalizationService } from '@abp/ng.core';
|
|
2
|
+
import { ToasterService } from '@abp/ng.theme.shared';
|
|
3
|
+
import { Component, ElementRef, inject, Input, ViewChild } from '@angular/core';
|
|
4
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
5
|
+
import { Router } from '@angular/router';
|
|
6
|
+
import { DatePipe, Location } from '@angular/common';
|
|
7
|
+
import { CmsApiService } from '../../../services';
|
|
8
|
+
import { SectionAdminService } from '../../../proxy/dignite/cms/admin/sections';
|
|
9
|
+
import { EntryAdminService } from '../../../proxy/dignite/cms/admin/entries';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'cms-create-or-edit-entries',
|
|
13
|
+
templateUrl: './create-or-edit-entries.component.html',
|
|
14
|
+
styleUrls: ['./create-or-edit-entries.component.scss'],
|
|
15
|
+
})
|
|
16
|
+
export class CreateOrEditEntriesComponent {
|
|
17
|
+
private toaster = inject(ToasterService);
|
|
18
|
+
public _location = inject(Location);
|
|
19
|
+
private configState = inject(ConfigStateService);
|
|
20
|
+
private _SectionAdminService = inject(SectionAdminService);
|
|
21
|
+
private _EntryAdminService = inject(EntryAdminService);
|
|
22
|
+
private datePipe = inject(DatePipe);
|
|
23
|
+
private _LocalizationService = inject(LocalizationService);
|
|
24
|
+
private router = inject(Router);
|
|
25
|
+
private _CmsApiService = inject(CmsApiService);
|
|
26
|
+
|
|
27
|
+
/**语言列表 */
|
|
28
|
+
languagesList: any[] = [];
|
|
29
|
+
/**条目列表-选择上级条目 */
|
|
30
|
+
entryList: any[] = [];
|
|
31
|
+
/**条目信息 */
|
|
32
|
+
entryInfo: any = '';
|
|
33
|
+
/**版本信息 */
|
|
34
|
+
sectionInfo: any = '';
|
|
35
|
+
/**需要展示的b板块下条目类型 */
|
|
36
|
+
showEntryType: any = '';
|
|
37
|
+
/**版本条目id */
|
|
38
|
+
entryVersionId: any = '';
|
|
39
|
+
/**版本列表 */
|
|
40
|
+
AllVersionsList: any[] = [];
|
|
41
|
+
|
|
42
|
+
@Input() isEdit: boolean = false;
|
|
43
|
+
|
|
44
|
+
@Input() sectionId: string = '';
|
|
45
|
+
@Input() entryTypeId: string = '';
|
|
46
|
+
@Input() public set select(v: any) {
|
|
47
|
+
this.entryVersionId = v.id;
|
|
48
|
+
this.entryInfo = v;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
formEntity: FormGroup | undefined;
|
|
52
|
+
@Input() set entity(value: FormGroup | undefined) {
|
|
53
|
+
this.formEntity = value;
|
|
54
|
+
if (value) {
|
|
55
|
+
let languages = this.configState.getDeep('localization.languages');
|
|
56
|
+
this.languagesList = languages;
|
|
57
|
+
this.loadData();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**是否加载完成 */
|
|
61
|
+
isLoad: boolean = false;
|
|
62
|
+
|
|
63
|
+
/**语言控件 */
|
|
64
|
+
get cultureInput(): FormControl {
|
|
65
|
+
return this.formEntity?.get('culture') as FormControl;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
69
|
+
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
70
|
+
|
|
71
|
+
/**加载数据 */
|
|
72
|
+
async loadData() {
|
|
73
|
+
if (this.sectionId) {
|
|
74
|
+
await this.getSectionInfo();
|
|
75
|
+
await this.getEntryList();
|
|
76
|
+
}
|
|
77
|
+
this.cultureInput.disable();
|
|
78
|
+
let repetition = await this.cultureAsyncValidator();
|
|
79
|
+
if (repetition) this.cultureInput.setErrors(repetition);
|
|
80
|
+
if (this.entryInfo) {
|
|
81
|
+
await this.getAllVersionsList();
|
|
82
|
+
this.formEntity.patchValue({
|
|
83
|
+
entryTypeId: this.entryInfo.entryTypeId,
|
|
84
|
+
publishTime: this.datePipe.transform(this.entryInfo.publishTime, 'yyyy-MM-dd HH:mm:ss'),
|
|
85
|
+
title: this.entryInfo.title,
|
|
86
|
+
slug: this.entryInfo.slug,
|
|
87
|
+
parentId: this.entryInfo.parentId,
|
|
88
|
+
versionNotes: this.entryInfo.versionNotes,
|
|
89
|
+
initialVersionId: this.entryInfo.id,
|
|
90
|
+
});
|
|
91
|
+
} else {
|
|
92
|
+
this.formEntity.patchValue({
|
|
93
|
+
entryTypeId: this.entryTypeId,
|
|
94
|
+
publishTime: this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
this.isLoad = true;
|
|
98
|
+
setTimeout(() => {
|
|
99
|
+
this.submitclick?.nativeElement.click();
|
|
100
|
+
}, 0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**定义自定义异步验证 */
|
|
104
|
+
cultureAsyncValidator() {
|
|
105
|
+
return new Promise(resolve => {
|
|
106
|
+
let culture = this.cultureInput.value;
|
|
107
|
+
if (culture == this.entryInfo?.culture || this.sectionInfo.type !== 0) return resolve(null);
|
|
108
|
+
this._EntryAdminService
|
|
109
|
+
.cultureExistWithSingleSection({
|
|
110
|
+
culture: culture,
|
|
111
|
+
sectionId: this.sectionId,
|
|
112
|
+
entryTypeId: this.entryTypeId,
|
|
113
|
+
})
|
|
114
|
+
.subscribe(res => {
|
|
115
|
+
if (res) {
|
|
116
|
+
resolve({
|
|
117
|
+
repetition: this._LocalizationService.instant(
|
|
118
|
+
`Cms::EntriesAlreadyExistEntryType`,
|
|
119
|
+
'',
|
|
120
|
+
this.languagesList.find(el => el.cultureName == culture).displayName
|
|
121
|
+
),
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
resolve(null);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**获取板块信息 */
|
|
131
|
+
getSectionInfo() {
|
|
132
|
+
return new Promise((resolve, reject) => {
|
|
133
|
+
this._SectionAdminService.get(this.sectionId).subscribe(res => {
|
|
134
|
+
this.showEntryType = res.entryTypes.find(el => el.id == this.entryTypeId);
|
|
135
|
+
this.sectionInfo = res;
|
|
136
|
+
resolve(res);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**获取板块下所有条目 */
|
|
141
|
+
getEntryList() {
|
|
142
|
+
return new Promise((resolve, rejects) => {
|
|
143
|
+
this._EntryAdminService
|
|
144
|
+
.getList({
|
|
145
|
+
sectionId: this.sectionId,
|
|
146
|
+
maxResultCount: 1000,
|
|
147
|
+
culture: this.cultureInput.value,
|
|
148
|
+
})
|
|
149
|
+
.subscribe((res: any) => {
|
|
150
|
+
let entryList = res.items.filter(el => el.id !== this.entryInfo?.id);
|
|
151
|
+
let parentList = entryList.filter(el => !el.parentId);
|
|
152
|
+
parentList.forEach(el => {
|
|
153
|
+
let layer: number = 0;
|
|
154
|
+
el.layer = new Array(layer);
|
|
155
|
+
el.children = this.groupByParentId(entryList, el.id, layer + 1);
|
|
156
|
+
});
|
|
157
|
+
this.entryList = parentList;
|
|
158
|
+
resolve(res);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**对数组按照父子关系进行分组 */
|
|
163
|
+
groupByParentId(arr, id = '', layer) {
|
|
164
|
+
let result = [];
|
|
165
|
+
result = arr.filter(el => el.parentId == id);
|
|
166
|
+
result.forEach(el => {
|
|
167
|
+
el.layer = new Array(layer);
|
|
168
|
+
el.children = this.groupByParentId(arr, el.id, layer + 1);
|
|
169
|
+
});
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
/**标题转化别名 */
|
|
173
|
+
setTitleToSlugBlur(event) {
|
|
174
|
+
let val = event.target.value;
|
|
175
|
+
let slug = this.formEntity.get('slug');
|
|
176
|
+
let pinyinstr = '';
|
|
177
|
+
if (slug.value) return;
|
|
178
|
+
pinyinstr = this._CmsApiService.chineseToPinyin(val);
|
|
179
|
+
this.formEntity.patchValue({
|
|
180
|
+
slug: pinyinstr || val,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**获取条目版本列表 */
|
|
185
|
+
getAllVersionsList() {
|
|
186
|
+
return new Promise((resolve, rejects) => {
|
|
187
|
+
this._EntryAdminService.getAllVersions(this.entryInfo.id).subscribe(res => {
|
|
188
|
+
this.AllVersionsList = res.items;
|
|
189
|
+
resolve(res);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**激活 */
|
|
195
|
+
ActivatedVersion(VersionId) {
|
|
196
|
+
this._EntryAdminService.activate(VersionId).subscribe(res => {
|
|
197
|
+
this.AllVersionsList.forEach(el => {
|
|
198
|
+
el.isActivatedVersion = el.id === VersionId;
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**编辑版本 */
|
|
204
|
+
toEditUrl(id) {
|
|
205
|
+
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
206
|
+
this.router.navigate([`/cms/admin/entries/${id}/edit`]);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**删除版本 */
|
|
210
|
+
delectVersion(vid) {
|
|
211
|
+
this._EntryAdminService.delete(vid).subscribe(res => {
|
|
212
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::DeletedSuccessfully`));
|
|
213
|
+
this.getAllVersionsList();
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FormGroup, Validators } from "@angular/forms";
|
|
2
|
+
|
|
3
|
+
export class CreateOrUpdateEntryInputBase {
|
|
4
|
+
|
|
5
|
+
/**条目id */
|
|
6
|
+
entryTypeId: any = ['']
|
|
7
|
+
/**标题 */
|
|
8
|
+
title: any = ['', [Validators.required]]
|
|
9
|
+
/**别名 */
|
|
10
|
+
slug: any = ['', [Validators.required]]
|
|
11
|
+
/**语言 */
|
|
12
|
+
culture: any = ['']
|
|
13
|
+
/**是否是草稿 */
|
|
14
|
+
draft: any = ['', []]
|
|
15
|
+
/**发布时间 */
|
|
16
|
+
publishTime: any = ['', [Validators.required]]
|
|
17
|
+
/**上级目录 */
|
|
18
|
+
parentId: any = [null]
|
|
19
|
+
/**修订说明 */
|
|
20
|
+
versionNotes: any = [null]
|
|
21
|
+
/**版本 */
|
|
22
|
+
initialVersionId: any = [null]
|
|
23
|
+
extraProperties: FormGroup | undefined = new FormGroup({})
|
|
24
|
+
constructor() { }
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<abp-page [title]="'Cms::New'| abpLocalization" [toolbar]="true">
|
|
2
|
+
<form class="row g-3 needs-validation" [formGroup]="formEntity" (keydown.enter)="$event.preventDefault()"
|
|
3
|
+
[class]="{'was-validated':formValidation}" (submit)="save()">
|
|
4
|
+
<button type="submit" style="display: none;" #submitclick></button>
|
|
5
|
+
<ng-container *ngIf="formEntity">
|
|
6
|
+
<ng-container *ngIf="entryVersionId; else elseTemplate">
|
|
7
|
+
<cms-create-or-edit-entries [sectionId]="sectionId" [entryTypeId]="entryTypeId" [select]="entryInfo" [entity]="formEntity"></cms-create-or-edit-entries>
|
|
8
|
+
</ng-container>
|
|
9
|
+
<ng-template #elseTemplate>
|
|
10
|
+
<cms-create-or-edit-entries [sectionId]="sectionId" [entryTypeId]="entryTypeId" [entity]="formEntity"></cms-create-or-edit-entries>
|
|
11
|
+
</ng-template>
|
|
12
|
+
</ng-container>
|
|
13
|
+
|
|
14
|
+
</form>
|
|
15
|
+
|
|
16
|
+
</abp-page>
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CreateComponent } from './create.component';
|
|
4
|
+
|
|
5
|
+
describe('CreateComponent', () => {
|
|
6
|
+
let component: CreateComponent;
|
|
7
|
+
let fixture: ComponentFixture<CreateComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CreateComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(CreateComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { EXTENSIONS_IDENTIFIER } from '@abp/ng.components/extensible';
|
|
2
|
+
import { LocalizationService } from '@abp/ng.core';
|
|
3
|
+
import { ToasterService } from '@abp/ng.theme.shared';
|
|
4
|
+
import { DatePipe, Location } from '@angular/common';
|
|
5
|
+
import { Component, OnInit, inject, ViewChild, ElementRef } from '@angular/core';
|
|
6
|
+
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
7
|
+
import { ActivatedRoute } from '@angular/router';
|
|
8
|
+
// import { EntryAdminService } from '../../../proxy/admin/entries';
|
|
9
|
+
import { ECmsComponent } from '../../../enums';
|
|
10
|
+
import { CreateOrUpdateEntryInputBase } from './create-or-update-entry-input-base';
|
|
11
|
+
import { ValidatorsService, UpdateListService } from '@dignite-ng/expand.core';
|
|
12
|
+
import { finalize } from 'rxjs';
|
|
13
|
+
import { EntryAdminService } from '../../../proxy/dignite/cms/admin/entries';
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'cms-create',
|
|
17
|
+
templateUrl: './create.component.html',
|
|
18
|
+
styleUrls: ['./create.component.scss'],
|
|
19
|
+
providers: [
|
|
20
|
+
{
|
|
21
|
+
provide: EXTENSIONS_IDENTIFIER,
|
|
22
|
+
useValue: ECmsComponent.Entries_Create,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
})
|
|
26
|
+
export class CreateComponent implements OnInit {
|
|
27
|
+
private fb = inject(FormBuilder);
|
|
28
|
+
private _updateListService = inject(UpdateListService);
|
|
29
|
+
private toaster = inject(ToasterService);
|
|
30
|
+
public _location = inject(Location);
|
|
31
|
+
private route = inject(ActivatedRoute);
|
|
32
|
+
private _EntryAdminService = inject(EntryAdminService);
|
|
33
|
+
private _LocalizationService = inject(LocalizationService);
|
|
34
|
+
private _ValidatorsService = inject(ValidatorsService);
|
|
35
|
+
|
|
36
|
+
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
37
|
+
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
38
|
+
|
|
39
|
+
/**表单验证状态
|
|
40
|
+
* {
|
|
41
|
+
* title:true,
|
|
42
|
+
* }
|
|
43
|
+
*/
|
|
44
|
+
formValidation: any = '';
|
|
45
|
+
/**表单实体 */
|
|
46
|
+
formEntity: FormGroup | undefined;
|
|
47
|
+
/**语言 */
|
|
48
|
+
cultureName: string = '';
|
|
49
|
+
/**条目类型id */
|
|
50
|
+
entryTypeId: string = '';
|
|
51
|
+
/**版块id */
|
|
52
|
+
sectionId: string = '';
|
|
53
|
+
/**条目版本id */
|
|
54
|
+
entryVersionId: string = '';
|
|
55
|
+
/**条目信息 */
|
|
56
|
+
entryInfo: any = '';
|
|
57
|
+
|
|
58
|
+
/**是否草稿控件*/
|
|
59
|
+
get draftInput() {
|
|
60
|
+
return this.formEntity?.get('draft') as FormControl;
|
|
61
|
+
}
|
|
62
|
+
/**语言控件 */
|
|
63
|
+
get cultureInput(): FormControl {
|
|
64
|
+
return this.formEntity?.get('culture') as FormControl;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async ngOnInit(): Promise<void> {
|
|
68
|
+
let queryParams = this.route.snapshot.queryParams;
|
|
69
|
+
|
|
70
|
+
this.cultureName = queryParams.cultureName;
|
|
71
|
+
this.entryTypeId = queryParams.entryTypeId;
|
|
72
|
+
this.sectionId = queryParams.sectionId;
|
|
73
|
+
this.entryVersionId = queryParams.entryVersionId;
|
|
74
|
+
this.formEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
|
|
75
|
+
if (this.entryVersionId) await this.getEntryInfo();
|
|
76
|
+
this.cultureInput.patchValue(this.cultureName);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**获取条目信息 */
|
|
80
|
+
getEntryInfo() {
|
|
81
|
+
return new Promise((resolve, rejects) => {
|
|
82
|
+
this._EntryAdminService.get(this.entryVersionId).subscribe(res => {
|
|
83
|
+
this.cultureName = res.culture;
|
|
84
|
+
this.entryTypeId = res.entryTypeId;
|
|
85
|
+
this.sectionId = res.sectionId;
|
|
86
|
+
this.entryInfo = res;
|
|
87
|
+
resolve(res);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**提交 */
|
|
92
|
+
save() {
|
|
93
|
+
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.formEntity);
|
|
94
|
+
|
|
95
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms')){
|
|
96
|
+
this.isSubmit = false;
|
|
97
|
+
return this.cultureInput.disable();
|
|
98
|
+
}
|
|
99
|
+
let input = this.formEntity?.value;
|
|
100
|
+
input.culture = this.cultureName;
|
|
101
|
+
input.publishTime = new Date(
|
|
102
|
+
new Date(input.publishTime).getTime() + 8 * 60 * 60 * 1000
|
|
103
|
+
).toISOString();
|
|
104
|
+
if (!this.formEntity.valid) return;
|
|
105
|
+
this._EntryAdminService
|
|
106
|
+
.create(input)
|
|
107
|
+
.pipe(finalize(() => {
|
|
108
|
+
this.isSubmit = false;
|
|
109
|
+
}))
|
|
110
|
+
.subscribe(res => {
|
|
111
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SavedSuccessfully`));
|
|
112
|
+
this._location.back();
|
|
113
|
+
this._updateListService.updateList();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
isSubmit: boolean = false;
|
|
117
|
+
/**点击提交 */
|
|
118
|
+
clickSubmit(type) {
|
|
119
|
+
if (this.isSubmit) return;
|
|
120
|
+
this.isSubmit = true;
|
|
121
|
+
this.draftInput.patchValue(type);
|
|
122
|
+
this.cultureInput.enable();
|
|
123
|
+
this.submitclick?.nativeElement?.click();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**返回上一页 */
|
|
127
|
+
backTo() {
|
|
128
|
+
this._location.back();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<abp-page [title]="'Cms::Edit'| abpLocalization" [toolbar]="true">
|
|
2
|
+
<form class="row g-3 needs-validation" [formGroup]="formEntity" (keydown.enter)="$event.preventDefault()"
|
|
3
|
+
[class]="{'was-validated':formValidation}" (submit)="save()">
|
|
4
|
+
<button type="submit" style="display: none;" #submitclick></button>
|
|
5
|
+
<ng-container *ngIf="formEntity&&entryInfo">
|
|
6
|
+
<cms-create-or-edit-entries [sectionId]="sectionId" [entryTypeId]="entryTypeId" [isEdit]="true" [select]="entryInfo" [entity]="formEntity"></cms-create-or-edit-entries>
|
|
7
|
+
</ng-container>
|
|
8
|
+
</form>
|
|
9
|
+
</abp-page>
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { EditComponent } from './edit.component';
|
|
4
|
+
|
|
5
|
+
describe('EditComponent', () => {
|
|
6
|
+
let component: EditComponent;
|
|
7
|
+
let fixture: ComponentFixture<EditComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [EditComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(EditComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* eslint-disable @angular-eslint/use-lifecycle-interface */
|
|
2
|
+
|
|
3
|
+
import { EXTENSIONS_IDENTIFIER } from '@abp/ng.components/extensible';
|
|
4
|
+
import { LocalizationService } from '@abp/ng.core';
|
|
5
|
+
import { ToasterService } from '@abp/ng.theme.shared';
|
|
6
|
+
import { DatePipe, Location } from '@angular/common';
|
|
7
|
+
import { Component, OnInit, inject, ViewChild, ElementRef } from '@angular/core';
|
|
8
|
+
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
9
|
+
import { ActivatedRoute } from '@angular/router';
|
|
10
|
+
// import { EntryAdminService } from '../../../proxy/admin/entries';
|
|
11
|
+
import { ECmsComponent } from '../../../enums';
|
|
12
|
+
import { UpdateListService } from '@dignite-ng/expand.core';
|
|
13
|
+
import { CreateOrUpdateEntryInputBase } from './create-or-update-entry-input-base';
|
|
14
|
+
import { ValidatorsService } from '@dignite-ng/expand.core';
|
|
15
|
+
import { finalize } from 'rxjs';
|
|
16
|
+
import { EntryAdminService } from '../../../proxy/dignite/cms/admin/entries';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'cms-edit',
|
|
20
|
+
templateUrl: './edit.component.html',
|
|
21
|
+
styleUrls: ['./edit.component.scss'],
|
|
22
|
+
providers: [
|
|
23
|
+
{
|
|
24
|
+
provide: EXTENSIONS_IDENTIFIER,
|
|
25
|
+
useValue: ECmsComponent.Entries_Edit,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
})
|
|
29
|
+
export class EditComponent implements OnInit {
|
|
30
|
+
private fb = inject(FormBuilder);
|
|
31
|
+
private _updateListService = inject(UpdateListService);
|
|
32
|
+
private toaster = inject(ToasterService);
|
|
33
|
+
public _location = inject(Location);
|
|
34
|
+
private route = inject(ActivatedRoute);
|
|
35
|
+
private _EntryAdminService = inject(EntryAdminService);
|
|
36
|
+
private _LocalizationService = inject(LocalizationService);
|
|
37
|
+
private _ValidatorsService = inject(ValidatorsService);
|
|
38
|
+
private datePipe = inject(DatePipe);
|
|
39
|
+
|
|
40
|
+
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
41
|
+
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
42
|
+
|
|
43
|
+
/**表单验证状态
|
|
44
|
+
* {
|
|
45
|
+
* title:true,
|
|
46
|
+
* }
|
|
47
|
+
*/
|
|
48
|
+
formValidation: any = '';
|
|
49
|
+
/**表单实体 */
|
|
50
|
+
formEntity: FormGroup | undefined;
|
|
51
|
+
/**语言 */
|
|
52
|
+
cultureName: string = '';
|
|
53
|
+
/**条目类型id */
|
|
54
|
+
entryTypeId: string = '';
|
|
55
|
+
/**版块id */
|
|
56
|
+
sectionId: string = '';
|
|
57
|
+
/**条目版本id */
|
|
58
|
+
entryVersionId: string = '';
|
|
59
|
+
/**条目id */
|
|
60
|
+
entrieId: string = '';
|
|
61
|
+
/**条目信息 */
|
|
62
|
+
entryInfo: any = '';
|
|
63
|
+
|
|
64
|
+
/**是否草稿控件*/
|
|
65
|
+
get draftInput() {
|
|
66
|
+
return this.formEntity?.get('draft') as FormControl;
|
|
67
|
+
}
|
|
68
|
+
/**语言控件 */
|
|
69
|
+
get cultureInput(): FormControl {
|
|
70
|
+
return this.formEntity?.get('culture') as FormControl;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async ngOnInit(): Promise<void> {
|
|
74
|
+
let params = this.route.snapshot.params;
|
|
75
|
+
this.entrieId = params.entrieId;
|
|
76
|
+
this.formEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
|
|
77
|
+
await this.getEntryInfo();
|
|
78
|
+
this.cultureInput.patchValue(this.cultureName);
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
/**获取条目信息 */
|
|
82
|
+
getEntryInfo() {
|
|
83
|
+
return new Promise((resolve, rejects) => {
|
|
84
|
+
this._EntryAdminService.get(this.entrieId).subscribe(res => {
|
|
85
|
+
this.cultureName = res.culture;
|
|
86
|
+
this.entryTypeId = res.entryTypeId;
|
|
87
|
+
this.sectionId = res.sectionId;
|
|
88
|
+
this.entryInfo = res;
|
|
89
|
+
resolve(res);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**提交 */
|
|
95
|
+
save() {
|
|
96
|
+
let input = this.formEntity?.value;
|
|
97
|
+
input.culture = this.cultureName;
|
|
98
|
+
input.publishTime = new Date(
|
|
99
|
+
new Date(input.publishTime).getTime() + 8 * 60 * 60 * 1000
|
|
100
|
+
).toISOString();
|
|
101
|
+
input.concurrencyStamp = this.entryInfo.concurrencyStamp;
|
|
102
|
+
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.formEntity);
|
|
103
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms')){
|
|
104
|
+
this.isSubmit = false;
|
|
105
|
+
return this.cultureInput.disable();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!this.formEntity.valid) return;
|
|
109
|
+
this._EntryAdminService
|
|
110
|
+
.update(this.entryInfo.id, input)
|
|
111
|
+
.pipe(finalize(() => {
|
|
112
|
+
this.isSubmit = false;
|
|
113
|
+
}))
|
|
114
|
+
.subscribe(res => {
|
|
115
|
+
this.toaster.success(this._LocalizationService.instant(`AbpUi::SavedSuccessfully`));
|
|
116
|
+
this.backTo();
|
|
117
|
+
this._updateListService.updateList();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
isSubmit: boolean = false;
|
|
121
|
+
/**点击提交 */
|
|
122
|
+
clickSubmit(type) {
|
|
123
|
+
if (this.isSubmit) return;
|
|
124
|
+
this.isSubmit = true;
|
|
125
|
+
this.draftInput.patchValue(type);
|
|
126
|
+
this.cultureInput.enable();
|
|
127
|
+
this.submitclick?.nativeElement?.click();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**返回上一页 */
|
|
131
|
+
backTo() {
|
|
132
|
+
this._location.back();
|
|
133
|
+
}
|
|
134
|
+
}
|