@dignite-ng/expand.cms 2.0.0-rc.10 → 2.0.0-rc.11
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/cms-config.module.d.ts +8 -0
- package/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
- package/config/enums/route-names.d.ts +7 -0
- package/config/index.d.ts +5 -0
- package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
- package/config/providers/route.provider.d.ts +9 -0
- package/config/{src/public-api.ts → public-api.d.ts} +3 -3
- package/esm2022/config/cms-config.module.mjs +19 -0
- package/esm2022/config/dignite-ng-expand.cms-config.mjs +5 -0
- package/esm2022/config/enums/index.mjs +2 -0
- package/esm2022/config/enums/route-names.mjs +9 -0
- package/esm2022/config/providers/index.mjs +2 -0
- package/esm2022/config/providers/route.provider.mjs +60 -0
- package/esm2022/config/public-api.mjs +4 -0
- package/esm2022/dignite-ng-expand.cms.mjs +5 -0
- package/esm2022/lib/cms-routing.module.mjs +94 -0
- package/esm2022/lib/cms.module.mjs +137 -0
- package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +226 -0
- package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +25 -0
- package/esm2022/lib/components/admin/entries/create.component.mjs +136 -0
- package/esm2022/lib/components/admin/entries/edit.component.mjs +138 -0
- package/esm2022/lib/components/admin/entries/entries.component.mjs +367 -0
- package/esm2022/lib/components/admin/entries/index.mjs +5 -0
- package/esm2022/lib/components/admin/fields/create-field.component.mjs +87 -0
- package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +116 -0
- package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +25 -0
- package/esm2022/lib/components/admin/fields/edit-field.component.mjs +109 -0
- package/esm2022/lib/components/admin/fields/field-group.component.mjs +131 -0
- package/esm2022/lib/components/admin/fields/fields.component.mjs +107 -0
- package/esm2022/lib/components/admin/fields/index.mjs +7 -0
- package/esm2022/lib/components/admin/index.mjs +4 -0
- package/esm2022/lib/components/admin/sections/create-or-edit-sections-modal.component.mjs +210 -0
- package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +22 -0
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +47 -0
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +408 -0
- package/esm2022/lib/components/admin/sections/entry-types/index.mjs +3 -0
- package/esm2022/lib/components/admin/sections/index.mjs +4 -0
- package/esm2022/lib/components/admin/sections/sections.component.mjs +138 -0
- package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +117 -0
- package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +18 -0
- package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +105 -0
- package/esm2022/lib/components/dynamic-form/entry/index.mjs +4 -0
- package/esm2022/lib/components/dynamic-form/form-control-group.mjs +28 -0
- package/esm2022/lib/components/dynamic-form/index.mjs +5 -0
- package/esm2022/lib/components/dynamic-form/matrix/index.mjs +4 -0
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +219 -0
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +50 -0
- package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +108 -0
- package/esm2022/lib/components/dynamic-form/table/index.mjs +4 -0
- package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +158 -0
- package/esm2022/lib/components/dynamic-form/table/table-config.mjs +38 -0
- package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +118 -0
- package/esm2022/lib/components/index.mjs +3 -0
- package/esm2022/lib/constants/styles.mjs +19 -0
- package/esm2022/lib/enums/ecms-component.mjs +13 -0
- package/esm2022/lib/enums/index.mjs +2 -0
- package/esm2022/lib/proxy/dignite/abp/data/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/abp/regionalization-management/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/abp/regionalization-management/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/abp/regionalization-management/regionalization.service.mjs +27 -0
- package/esm2022/lib/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.mjs +22 -0
- package/esm2022/lib/proxy/dignite/cms/admin/dynamic-forms/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/cms/admin/dynamic-forms/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/admin/entries/entry-admin.service.mjs +70 -0
- package/esm2022/lib/proxy/dignite/cms/admin/entries/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/cms/admin/entries/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/admin/fields/field-admin.service.mjs +45 -0
- package/esm2022/lib/proxy/dignite/cms/admin/fields/field-group-admin.service.mjs +41 -0
- package/esm2022/lib/proxy/dignite/cms/admin/fields/index.mjs +4 -0
- package/esm2022/lib/proxy/dignite/cms/admin/fields/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/admin/sections/entry-type-admin.service.mjs +41 -0
- package/esm2022/lib/proxy/dignite/cms/admin/sections/index.mjs +4 -0
- package/esm2022/lib/proxy/dignite/cms/admin/sections/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/admin/sections/section-admin.service.mjs +51 -0
- package/esm2022/lib/proxy/dignite/cms/entries/entry-status.enum.mjs +8 -0
- package/esm2022/lib/proxy/dignite/cms/entries/index.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/fields/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/sections/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/cms/sections/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/cms/sections/section-type.enum.mjs +9 -0
- package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +2 -0
- package/esm2022/lib/resolvers/extensions-props-action-token.resolver.mjs +136 -0
- package/esm2022/lib/resolvers/page-default-toolbar-actions.mjs +160 -0
- package/esm2022/lib/resolvers/table-default-entity-actions.mjs +28 -0
- package/esm2022/lib/resolvers/table-default-entity-props.mjs +53 -0
- package/esm2022/lib/services/appent-content.mjs +15 -0
- package/esm2022/lib/services/cms-api.service.mjs +93 -0
- package/esm2022/lib/services/cms.service.mjs +21 -0
- package/esm2022/lib/services/field-abstracts.service.mjs +42 -0
- package/esm2022/lib/services/index.mjs +4 -0
- package/esm2022/public-api.mjs +7 -0
- package/fesm2022/dignite-ng-expand.cms-config.mjs +92 -0
- package/fesm2022/dignite-ng-expand.cms-config.mjs.map +1 -0
- package/fesm2022/dignite-ng-expand.cms.mjs +4063 -0
- package/fesm2022/dignite-ng-expand.cms.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/cms-routing.module.d.ts +7 -0
- package/lib/cms.module.d.ts +37 -0
- package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +63 -0
- package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +23 -0
- package/lib/components/admin/entries/create.component.d.ts +50 -0
- package/lib/components/admin/entries/edit.component.d.ts +53 -0
- package/lib/components/admin/entries/entries.component.d.ts +100 -0
- package/lib/components/admin/entries/index.d.ts +4 -0
- package/lib/components/admin/fields/create-field.component.d.ts +37 -0
- package/lib/components/admin/fields/create-or-edit-field.component.d.ts +37 -0
- package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +16 -0
- package/lib/components/admin/fields/edit-field.component.d.ts +46 -0
- package/lib/components/admin/fields/field-group.component.d.ts +58 -0
- package/lib/components/admin/fields/fields.component.d.ts +35 -0
- package/lib/components/admin/fields/index.d.ts +6 -0
- package/lib/components/admin/index.d.ts +3 -0
- package/lib/components/admin/sections/create-or-edit-sections-modal.component.d.ts +49 -0
- package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +20 -0
- package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +28 -0
- package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +139 -0
- package/lib/components/admin/sections/entry-types/index.d.ts +2 -0
- package/lib/components/admin/sections/index.d.ts +3 -0
- package/lib/components/admin/sections/sections.component.d.ts +46 -0
- package/lib/components/dynamic-form/entry/entry-config.component.d.ts +40 -0
- package/lib/components/dynamic-form/entry/entry-config.d.ts +9 -0
- package/lib/components/dynamic-form/entry/entry-control.component.d.ts +36 -0
- package/lib/components/dynamic-form/entry/index.d.ts +3 -0
- package/lib/components/dynamic-form/form-control-group.d.ts +4 -0
- package/lib/components/dynamic-form/index.d.ts +4 -0
- package/lib/components/dynamic-form/matrix/index.d.ts +3 -0
- package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +74 -0
- package/lib/components/dynamic-form/matrix/matrix-config.d.ts +24 -0
- package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +42 -0
- package/lib/components/dynamic-form/table/index.d.ts +3 -0
- package/lib/components/dynamic-form/table/table-config.component.d.ts +59 -0
- package/lib/components/dynamic-form/table/table-config.d.ts +18 -0
- package/lib/components/dynamic-form/table/table-control.component.d.ts +42 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/constants/styles.d.ts +2 -0
- package/lib/enums/ecms-component.d.ts +11 -0
- package/lib/enums/index.d.ts +1 -0
- package/lib/proxy/dignite/abp/data/models.d.ts +3 -0
- package/lib/proxy/dignite/abp/regionalization-management/models.d.ts +8 -0
- package/lib/proxy/dignite/abp/regionalization-management/regionalization.service.d.ts +12 -0
- package/lib/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.d.ts +12 -0
- package/lib/proxy/dignite/cms/admin/dynamic-forms/models.d.ts +5 -0
- package/lib/proxy/dignite/cms/admin/entries/entry-admin.service.d.ts +22 -0
- package/lib/proxy/dignite/cms/admin/entries/models.d.ts +61 -0
- package/lib/proxy/dignite/cms/admin/fields/field-admin.service.d.ts +17 -0
- package/lib/proxy/dignite/cms/admin/fields/field-group-admin.service.d.ts +16 -0
- package/{src/lib/proxy/dignite/cms/admin/fields/models.ts → lib/proxy/dignite/cms/admin/fields/models.d.ts} +34 -42
- package/lib/proxy/dignite/cms/admin/sections/entry-type-admin.service.d.ts +15 -0
- package/{src/lib/proxy/dignite/cms/admin/sections/models.ts → lib/proxy/dignite/cms/admin/sections/models.d.ts} +68 -82
- package/lib/proxy/dignite/cms/admin/sections/section-admin.service.d.ts +18 -0
- package/lib/proxy/dignite/cms/entries/entry-status.enum.d.ts +5 -0
- package/lib/proxy/dignite/cms/fields/models.d.ts +8 -0
- package/lib/proxy/dignite/cms/sections/models.d.ts +13 -0
- package/lib/proxy/dignite/cms/sections/section-type.enum.d.ts +6 -0
- package/{src/lib/proxy/volo/cms-kit/users/models.ts → lib/proxy/volo/cms-kit/users/models.d.ts} +7 -8
- package/lib/resolvers/extensions-props-action-token.resolver.d.ts +75 -0
- package/lib/resolvers/page-default-toolbar-actions.d.ts +18 -0
- package/lib/resolvers/table-default-entity-actions.d.ts +5 -0
- package/lib/resolvers/table-default-entity-props.d.ts +5 -0
- package/lib/services/appent-content.d.ts +1 -0
- package/lib/services/cms-api.service.d.ts +23 -0
- package/lib/services/cms.service.d.ts +10 -0
- package/lib/services/field-abstracts.service.d.ts +19 -0
- package/lib/services/index.d.ts +3 -0
- package/package.json +22 -7
- package/{src/public-api.ts → public-api.d.ts} +3 -7
- package/config/ng-package.json +0 -6
- package/config/src/cms-config.module.ts +0 -13
- package/config/src/enums/route-names.ts +0 -7
- package/config/src/providers/route.provider.ts +0 -68
- package/ng-package.json +0 -10
- package/src/lib/cms-routing.module.ts +0 -102
- package/src/lib/cms.module.ts +0 -113
- package/src/lib/components/admin/entries/create-or-edit-entries.component.html +0 -137
- 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 +0 -21
- package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +0 -216
- package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +0 -26
- package/src/lib/components/admin/entries/create.component.html +0 -16
- package/src/lib/components/admin/entries/create.component.scss +0 -0
- package/src/lib/components/admin/entries/create.component.spec.ts +0 -21
- package/src/lib/components/admin/entries/create.component.ts +0 -130
- package/src/lib/components/admin/entries/edit.component.html +0 -9
- package/src/lib/components/admin/entries/edit.component.scss +0 -0
- package/src/lib/components/admin/entries/edit.component.spec.ts +0 -21
- package/src/lib/components/admin/entries/edit.component.ts +0 -134
- package/src/lib/components/admin/entries/entries.component.html +0 -225
- package/src/lib/components/admin/entries/entries.component.scss +0 -109
- package/src/lib/components/admin/entries/entries.component.spec.ts +0 -21
- package/src/lib/components/admin/entries/entries.component.ts +0 -394
- package/src/lib/components/admin/entries/index.ts +0 -4
- package/src/lib/components/admin/fields/create-field.component.html +0 -12
- package/src/lib/components/admin/fields/create-field.component.scss +0 -1
- package/src/lib/components/admin/fields/create-field.component.spec.ts +0 -21
- package/src/lib/components/admin/fields/create-field.component.ts +0 -85
- package/src/lib/components/admin/fields/create-or-edit-field.component.html +0 -39
- 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 +0 -21
- package/src/lib/components/admin/fields/create-or-edit-field.component.ts +0 -140
- package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +0 -33
- package/src/lib/components/admin/fields/edit-field.component.html +0 -14
- package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/edit-field.component.spec.ts +0 -21
- package/src/lib/components/admin/fields/edit-field.component.ts +0 -112
- package/src/lib/components/admin/fields/field-group.component.html +0 -69
- package/src/lib/components/admin/fields/field-group.component.scss +0 -0
- package/src/lib/components/admin/fields/field-group.component.spec.ts +0 -21
- package/src/lib/components/admin/fields/field-group.component.ts +0 -151
- package/src/lib/components/admin/fields/fields.component.html +0 -25
- package/src/lib/components/admin/fields/fields.component.scss +0 -1
- package/src/lib/components/admin/fields/fields.component.spec.ts +0 -21
- package/src/lib/components/admin/fields/fields.component.ts +0 -109
- package/src/lib/components/admin/fields/index.ts +0 -6
- package/src/lib/components/admin/index.ts +0 -3
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.html +0 -81
- 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 +0 -23
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.ts +0 -239
- package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +0 -23
- package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +0 -52
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +0 -195
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +0 -1
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +0 -21
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +0 -442
- package/src/lib/components/admin/sections/entry-types/index.ts +0 -2
- package/src/lib/components/admin/sections/index.ts +0 -3
- package/src/lib/components/admin/sections/sections.component.html +0 -189
- package/src/lib/components/admin/sections/sections.component.scss +0 -1
- package/src/lib/components/admin/sections/sections.component.spec.ts +0 -21
- package/src/lib/components/admin/sections/sections.component.ts +0 -136
- package/src/lib/components/dynamic-form/entry/entry-config.component.html +0 -26
- package/src/lib/components/dynamic-form/entry/entry-config.component.scss +0 -27
- package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +0 -21
- package/src/lib/components/dynamic-form/entry/entry-config.component.ts +0 -119
- package/src/lib/components/dynamic-form/entry/entry-config.ts +0 -22
- package/src/lib/components/dynamic-form/entry/entry-control.component.html +0 -25
- package/src/lib/components/dynamic-form/entry/entry-control.component.scss +0 -35
- package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +0 -21
- package/src/lib/components/dynamic-form/entry/entry-control.component.ts +0 -111
- package/src/lib/components/dynamic-form/entry/index.ts +0 -3
- package/src/lib/components/dynamic-form/form-control-group.ts +0 -27
- package/src/lib/components/dynamic-form/index.ts +0 -4
- package/src/lib/components/dynamic-form/matrix/index.ts +0 -3
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +0 -148
- 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 +0 -21
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +0 -244
- package/src/lib/components/dynamic-form/matrix/matrix-config.ts +0 -63
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +0 -42
- 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 +0 -21
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +0 -118
- package/src/lib/components/dynamic-form/table/index.ts +0 -3
- package/src/lib/components/dynamic-form/table/table-config.component.html +0 -85
- package/src/lib/components/dynamic-form/table/table-config.component.scss +0 -10
- package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +0 -21
- package/src/lib/components/dynamic-form/table/table-config.component.ts +0 -177
- package/src/lib/components/dynamic-form/table/table-config.ts +0 -45
- package/src/lib/components/dynamic-form/table/table-control.component.html +0 -54
- package/src/lib/components/dynamic-form/table/table-control.component.scss +0 -1
- package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +0 -21
- package/src/lib/components/dynamic-form/table/table-control.component.ts +0 -127
- package/src/lib/components/index.ts +0 -2
- package/src/lib/constants/index.ts +0 -1
- package/src/lib/constants/styles.ts +0 -18
- package/src/lib/enums/ecms-component.ts +0 -11
- package/src/lib/enums/index.ts +0 -1
- package/src/lib/proxy/README.md +0 -17
- package/src/lib/proxy/dignite/abp/data/index.ts +0 -1
- package/src/lib/proxy/dignite/abp/data/models.ts +0 -4
- package/src/lib/proxy/dignite/abp/index.ts +0 -3
- package/src/lib/proxy/dignite/abp/regionalization-management/models.ts +0 -10
- package/src/lib/proxy/dignite/abp/regionalization-management/regionalization.service.ts +0 -29
- package/src/lib/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.ts +0 -20
- package/src/lib/proxy/dignite/cms/admin/dynamic-forms/models.ts +0 -6
- package/src/lib/proxy/dignite/cms/admin/entries/entry-admin.service.ts +0 -109
- package/src/lib/proxy/dignite/cms/admin/entries/models.ts +0 -69
- package/src/lib/proxy/dignite/cms/admin/fields/field-admin.service.ts +0 -64
- package/src/lib/proxy/dignite/cms/admin/fields/field-group-admin.service.ts +0 -56
- package/src/lib/proxy/dignite/cms/admin/index.ts +0 -5
- package/src/lib/proxy/dignite/cms/admin/sections/entry-type-admin.service.ts +0 -55
- package/src/lib/proxy/dignite/cms/admin/sections/section-admin.service.ts +0 -74
- package/src/lib/proxy/dignite/cms/entries/entry-status.enum.ts +0 -8
- package/src/lib/proxy/dignite/cms/fields/index.ts +0 -1
- package/src/lib/proxy/dignite/cms/fields/models.ts +0 -9
- package/src/lib/proxy/dignite/cms/index.ts +0 -5
- package/src/lib/proxy/dignite/cms/sections/models.ts +0 -15
- package/src/lib/proxy/dignite/cms/sections/section-type.enum.ts +0 -9
- package/src/lib/proxy/dignite/index.ts +0 -3
- package/src/lib/proxy/generate-proxy.json +0 -54593
- package/src/lib/proxy/index.ts +0 -3
- package/src/lib/proxy/volo/cms-kit/index.ts +0 -2
- package/src/lib/proxy/volo/cms-kit/users/index.ts +0 -1
- package/src/lib/proxy/volo/index.ts +0 -2
- package/src/lib/resolvers/extensions-props-action-token.resolver.ts +0 -182
- package/src/lib/resolvers/page-default-toolbar-actions.ts +0 -173
- package/src/lib/resolvers/table-default-entity-actions.ts +0 -29
- package/src/lib/resolvers/table-default-entity-props.ts +0 -62
- package/src/lib/services/appent-content.ts +0 -13
- package/src/lib/services/cms-api.service.ts +0 -90
- package/src/lib/services/cms.service.ts +0 -18
- package/src/lib/services/field-abstracts.service.ts +0 -39
- package/src/lib/services/index.ts +0 -3
- package/src/lib/services/validator.ts +0 -10
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -16
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
- /package/{src/lib/proxy/dignite/abp/regionalization-management/index.ts → lib/proxy/dignite/abp/regionalization-management/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/cms/admin/dynamic-forms/index.ts → lib/proxy/dignite/cms/admin/dynamic-forms/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/cms/admin/entries/index.ts → lib/proxy/dignite/cms/admin/entries/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/cms/admin/fields/index.ts → lib/proxy/dignite/cms/admin/fields/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/cms/admin/sections/index.ts → lib/proxy/dignite/cms/admin/sections/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/cms/entries/index.ts → lib/proxy/dignite/cms/entries/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/cms/sections/index.ts → lib/proxy/dignite/cms/sections/index.d.ts} +0 -0
|
@@ -1,216 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,134 +0,0 @@
|
|
|
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
|
-
}
|