@lenne.tech/ng-base 13.15.0 → 13.16.0
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/base-components/components/model-form/model-form.component.d.ts +2 -1
- package/base-components/components/model-table/model-table.component.d.ts +2 -1
- package/esm2020/base-cms/pages/base-cms/base-cms.component.mjs +11 -5
- package/esm2020/base-components/components/model-form/model-form.component.mjs +15 -2
- package/esm2020/base-components/components/model-table/model-table.component.mjs +17 -3
- package/fesm2015/lenne.tech-ng-base-base-cms.mjs +12 -6
- package/fesm2015/lenne.tech-ng-base-base-cms.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-base-components.mjs +30 -3
- package/fesm2015/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-cms.mjs +10 -4
- package/fesm2020/lenne.tech-ng-base-base-cms.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-components.mjs +30 -3
- package/fesm2020/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import * as i4 from '@angular/common';
|
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
6
6
|
import * as i1 from '@lenne.tech/ng-base/shared';
|
|
7
|
+
import { BasicUser } from '@lenne.tech/ng-base/shared';
|
|
7
8
|
import * as i2 from '@angular/router';
|
|
8
9
|
import { RouterModule } from '@angular/router';
|
|
9
10
|
import * as i3 from '@lenne.tech/ng-base/base-components';
|
|
@@ -61,15 +62,20 @@ class BaseCmsComponent {
|
|
|
61
62
|
this.types = filteredTypes.filter((e) => {
|
|
62
63
|
const foundRestrict = this.moduleConfig.restrictedModels?.find((v) => v.model.toLowerCase() === e.name.toLowerCase());
|
|
63
64
|
if (foundRestrict) {
|
|
64
|
-
if (!this.authService
|
|
65
|
+
if (!this.authService?.currentUser) {
|
|
65
66
|
return false;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
const user = this.authService?.currentUser;
|
|
69
|
+
const mappedUser = BasicUser.map(user);
|
|
70
|
+
return mappedUser?.hasAllRoles(foundRestrict.roles);
|
|
68
71
|
}
|
|
69
72
|
else {
|
|
70
73
|
return true;
|
|
71
74
|
}
|
|
72
75
|
});
|
|
76
|
+
if (this.moduleConfig?.logging) {
|
|
77
|
+
console.log('BaseCmsComponent::init->types', this.types);
|
|
78
|
+
}
|
|
73
79
|
resolve(this.types);
|
|
74
80
|
if (!this.modelName && this.types) {
|
|
75
81
|
this.router.navigate(['./' + this.types[0].name.toLowerCase()], { relativeTo: this.route });
|
|
@@ -157,10 +163,10 @@ class BaseCmsComponent {
|
|
|
157
163
|
}
|
|
158
164
|
}
|
|
159
165
|
BaseCmsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BaseCmsComponent, deps: [{ token: BASE_CMS_MODULE_CONFIG }, { token: i1.GraphQLMetaService }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: i1.AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
160
|
-
BaseCmsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: BaseCmsComponent, selector: "app-base-cms", ngImport: i0, template: "<div class=\"main\">\n <div class=\"sidebar\">\n <div class=\"d-flex flex-column flex-shrink-0 p-3 h-100\">\n <ng-container *ngIf=\"moduleConfig.branding\">\n <a href=\"/\" class=\"d-flex flex-column align-items-start mb-3 mt-3 me-md-auto link-dark text-decoration-none\">\n <span class=\"d-block fs-4\"><b class=\"text-primary\">Base</b>CMS</span>\n <small class=\"fw-lighter\">The auto generated GraphQL CMS</small>\n </a>\n <hr />\n </ng-container>\n <ul class=\"nav nav-pills flex-column mb-auto\" *ngIf=\"types\">\n <li class=\"nav-item\" *ngFor=\"let type of types\">\n <a\n class=\"nav-link\"\n aria-current=\"page\"\n [routerLink]=\"(id ? '../../' : '../') + type?.name?.toLowerCase()\"\n [ngClass]=\"{ active: type?.name?.toLowerCase() === this.modelName?.toLowerCase() }\"\n >\n {{ type.name + 's' }}\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div class=\"p-5\">\n <base-model-table\n [tableFields]=\"moduleConfig?.tableFields ?? ['name']\"\n [modelName]=\"modelName\"\n [objectId]=\"id !== 'new' ? id : ''\"\n [createMode]=\"id === 'new'\"\n (createModeChanged)=\"onCreateModeChanged($event)\"\n (idSelected)=\"idSelected($event)\"\n [create]=\"isCreatePossible()\"\n [update]=\"isUpdatePossible()\"\n [delete]=\"isDeletePossible()\"\n ></base-model-table>\n </div>\n </div>\n</div>\n", styles: [".active{color:var(--bs-primary)!important;background-color:rgba(var(--bs-primary-rgb),.2)!important;font-weight:700}.nav-link{color:var(--bs-body-color)}.sidebar{box-shadow:#7090b014 14px 17px 40px 4px;transition:all .2s linear 0s;z-index:99}.main{display:flex;flex-direction:row;overflow:hidden;height:100%}.main .sidebar{flex:1 0 22%;max-width:300px}.main .sidebar-content{flex-grow:999;overflow-y:auto;background-color:#f5f7fe}.nav-flush .nav-link{border-radius:0}\n"], components: [{ type: i3.ModelTableComponent, selector: "base-model-table", inputs: ["modelName", "objectId", "createMode", "create", "update", "delete", "tableFields"], outputs: ["idSelected", "createModeChanged"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
166
|
+
BaseCmsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: BaseCmsComponent, selector: "app-base-cms", ngImport: i0, template: "<div class=\"main\">\n <div class=\"sidebar\">\n <div class=\"d-flex flex-column flex-shrink-0 p-3 h-100\">\n <ng-container *ngIf=\"moduleConfig.branding\">\n <a href=\"/\" class=\"d-flex flex-column align-items-start mb-3 mt-3 me-md-auto link-dark text-decoration-none\">\n <span class=\"d-block fs-4\"><b class=\"text-primary\">Base</b>CMS</span>\n <small class=\"fw-lighter\">The auto generated GraphQL CMS</small>\n </a>\n <hr />\n </ng-container>\n <ul class=\"nav nav-pills flex-column mb-auto\" *ngIf=\"types\">\n <li class=\"nav-item\" *ngFor=\"let type of types\">\n <a\n class=\"nav-link\"\n aria-current=\"page\"\n [routerLink]=\"(id ? '../../' : '../') + type?.name?.toLowerCase()\"\n [ngClass]=\"{ active: type?.name?.toLowerCase() === this.modelName?.toLowerCase() }\"\n >\n {{ type.name + 's' }}\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div class=\"p-5\">\n <base-model-table\n [tableFields]=\"moduleConfig?.tableFields ?? ['name']\"\n [modelName]=\"modelName\"\n [logging]=\"moduleConfig?.logging\"\n [objectId]=\"id !== 'new' ? id : ''\"\n [createMode]=\"id === 'new'\"\n (createModeChanged)=\"onCreateModeChanged($event)\"\n (idSelected)=\"idSelected($event)\"\n [create]=\"isCreatePossible()\"\n [update]=\"isUpdatePossible()\"\n [delete]=\"isDeletePossible()\"\n ></base-model-table>\n </div>\n </div>\n</div>\n", styles: [".active{color:var(--bs-primary)!important;background-color:rgba(var(--bs-primary-rgb),.2)!important;font-weight:700}.nav-link{color:var(--bs-body-color)}.sidebar{box-shadow:#7090b014 14px 17px 40px 4px;transition:all .2s linear 0s;z-index:99}.main{display:flex;flex-direction:row;overflow:hidden;height:100%}.main .sidebar{flex:1 0 22%;max-width:300px}.main .sidebar-content{flex-grow:999;overflow-y:auto;background-color:#f5f7fe}.nav-flush .nav-link{border-radius:0}\n"], components: [{ type: i3.ModelTableComponent, selector: "base-model-table", inputs: ["modelName", "objectId", "createMode", "create", "update", "delete", "logging", "tableFields"], outputs: ["idSelected", "createModeChanged"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
161
167
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BaseCmsComponent, decorators: [{
|
|
162
168
|
type: Component,
|
|
163
|
-
args: [{ selector: 'app-base-cms', template: "<div class=\"main\">\n <div class=\"sidebar\">\n <div class=\"d-flex flex-column flex-shrink-0 p-3 h-100\">\n <ng-container *ngIf=\"moduleConfig.branding\">\n <a href=\"/\" class=\"d-flex flex-column align-items-start mb-3 mt-3 me-md-auto link-dark text-decoration-none\">\n <span class=\"d-block fs-4\"><b class=\"text-primary\">Base</b>CMS</span>\n <small class=\"fw-lighter\">The auto generated GraphQL CMS</small>\n </a>\n <hr />\n </ng-container>\n <ul class=\"nav nav-pills flex-column mb-auto\" *ngIf=\"types\">\n <li class=\"nav-item\" *ngFor=\"let type of types\">\n <a\n class=\"nav-link\"\n aria-current=\"page\"\n [routerLink]=\"(id ? '../../' : '../') + type?.name?.toLowerCase()\"\n [ngClass]=\"{ active: type?.name?.toLowerCase() === this.modelName?.toLowerCase() }\"\n >\n {{ type.name + 's' }}\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div class=\"p-5\">\n <base-model-table\n [tableFields]=\"moduleConfig?.tableFields ?? ['name']\"\n [modelName]=\"modelName\"\n [objectId]=\"id !== 'new' ? id : ''\"\n [createMode]=\"id === 'new'\"\n (createModeChanged)=\"onCreateModeChanged($event)\"\n (idSelected)=\"idSelected($event)\"\n [create]=\"isCreatePossible()\"\n [update]=\"isUpdatePossible()\"\n [delete]=\"isDeletePossible()\"\n ></base-model-table>\n </div>\n </div>\n</div>\n", styles: [".active{color:var(--bs-primary)!important;background-color:rgba(var(--bs-primary-rgb),.2)!important;font-weight:700}.nav-link{color:var(--bs-body-color)}.sidebar{box-shadow:#7090b014 14px 17px 40px 4px;transition:all .2s linear 0s;z-index:99}.main{display:flex;flex-direction:row;overflow:hidden;height:100%}.main .sidebar{flex:1 0 22%;max-width:300px}.main .sidebar-content{flex-grow:999;overflow-y:auto;background-color:#f5f7fe}.nav-flush .nav-link{border-radius:0}\n"] }]
|
|
169
|
+
args: [{ selector: 'app-base-cms', template: "<div class=\"main\">\n <div class=\"sidebar\">\n <div class=\"d-flex flex-column flex-shrink-0 p-3 h-100\">\n <ng-container *ngIf=\"moduleConfig.branding\">\n <a href=\"/\" class=\"d-flex flex-column align-items-start mb-3 mt-3 me-md-auto link-dark text-decoration-none\">\n <span class=\"d-block fs-4\"><b class=\"text-primary\">Base</b>CMS</span>\n <small class=\"fw-lighter\">The auto generated GraphQL CMS</small>\n </a>\n <hr />\n </ng-container>\n <ul class=\"nav nav-pills flex-column mb-auto\" *ngIf=\"types\">\n <li class=\"nav-item\" *ngFor=\"let type of types\">\n <a\n class=\"nav-link\"\n aria-current=\"page\"\n [routerLink]=\"(id ? '../../' : '../') + type?.name?.toLowerCase()\"\n [ngClass]=\"{ active: type?.name?.toLowerCase() === this.modelName?.toLowerCase() }\"\n >\n {{ type.name + 's' }}\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div class=\"p-5\">\n <base-model-table\n [tableFields]=\"moduleConfig?.tableFields ?? ['name']\"\n [modelName]=\"modelName\"\n [logging]=\"moduleConfig?.logging\"\n [objectId]=\"id !== 'new' ? id : ''\"\n [createMode]=\"id === 'new'\"\n (createModeChanged)=\"onCreateModeChanged($event)\"\n (idSelected)=\"idSelected($event)\"\n [create]=\"isCreatePossible()\"\n [update]=\"isUpdatePossible()\"\n [delete]=\"isDeletePossible()\"\n ></base-model-table>\n </div>\n </div>\n</div>\n", styles: [".active{color:var(--bs-primary)!important;background-color:rgba(var(--bs-primary-rgb),.2)!important;font-weight:700}.nav-link{color:var(--bs-body-color)}.sidebar{box-shadow:#7090b014 14px 17px 40px 4px;transition:all .2s linear 0s;z-index:99}.main{display:flex;flex-direction:row;overflow:hidden;height:100%}.main .sidebar{flex:1 0 22%;max-width:300px}.main .sidebar-content{flex-grow:999;overflow-y:auto;background-color:#f5f7fe}.nav-flush .nav-link{border-radius:0}\n"] }]
|
|
164
170
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
165
171
|
type: Inject,
|
|
166
172
|
args: [BASE_CMS_MODULE_CONFIG]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lenne.tech-ng-base-base-cms.mjs","sources":["../../../projects/ng-base/base-cms/interfaces/base-cms-module-config.interface.ts","../../../projects/ng-base/base-cms/pages/base-cms/base-cms.component.ts","../../../projects/ng-base/base-cms/pages/base-cms/base-cms.component.html","../../../projects/ng-base/base-cms/base-cms-routing.module.ts","../../../projects/ng-base/base-cms/base-cms.module.ts","../../../projects/ng-base/base-cms/public-api.ts","../../../projects/ng-base/base-cms/lenne.tech-ng-base-base-cms.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface BaseCMSModuleConfig {\n tableFields?: string[];\n excludedModels?: string[];\n restrictedModels?: [{ model: string; roles: string[] }];\n logging?: boolean;\n branding?: boolean;\n}\n\nexport const BASE_CMS_MODULE_CONFIG = new InjectionToken('BASE_CMS_MODULE_CONFIG');\n","import { Component, Inject, OnInit } from '@angular/core';\nimport { AuthService, GraphqlCrudType, GraphQLMeta, GraphQLMetaService } from '@lenne.tech/ng-base/shared';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BASE_CMS_MODULE_CONFIG, BaseCMSModuleConfig } from '../../interfaces/base-cms-module-config.interface';\n\n@Component({\n selector: 'app-base-cms',\n templateUrl: './base-cms.component.html',\n styleUrls: ['./base-cms.component.scss'],\n})\nexport class BaseCmsComponent implements OnInit {\n meta: GraphQLMeta;\n modelName: string;\n id: string;\n types: GraphqlCrudType[] = [];\n\n constructor(\n @Inject(BASE_CMS_MODULE_CONFIG) public moduleConfig: BaseCMSModuleConfig,\n private graphQLMetaService: GraphQLMetaService,\n private route: ActivatedRoute,\n private router: Router,\n private authService: AuthService\n ) {\n this.route.params.subscribe((value) => {\n if (value['modelName']) {\n if (!this.checkModelIsExcludedOrRestrcited(value['modelName'])) {\n this.modelName = value['modelName'];\n } else {\n this.init().then((types: GraphqlCrudType[]) => {\n this.router.navigate(['../' + types[0].name.toLowerCase()], { relativeTo: this.route });\n });\n }\n }\n\n if (value['id']) {\n this.id = value['id'];\n }\n });\n }\n\n async ngOnInit() {\n await this.init();\n }\n\n /**\n * It returns a promise that resolves to an array of GraphqlCrudType objects\n *\n * @returns The types that are available to the user.\n */\n init(): Promise<GraphqlCrudType[]> {\n return new Promise((resolve, reject) => {\n this.graphQLMetaService.getMeta().subscribe((meta) => {\n this.meta = meta;\n\n if (this.route.snapshot?.params?.['modelName']) {\n this.modelName = this.route.snapshot?.params?.['modelName'];\n }\n\n if (this.route.snapshot?.params?.['id']) {\n this.id = this.route.snapshot?.params?.['id'];\n }\n\n const excludedModels = this.moduleConfig.excludedModels?.map((e) => e.toLowerCase());\n const types = meta.getTypes();\n\n // Check for excluded types\n const filteredTypes = types.filter((e) => !excludedModels?.includes(e.name.toLowerCase()));\n\n // Check for restricted types\n this.types = filteredTypes.filter((e) => {\n const foundRestrict = this.moduleConfig.restrictedModels?.find(\n (v) => v.model.toLowerCase() === e.name.toLowerCase()\n );\n\n if (foundRestrict) {\n if (!this.authService.currentUser) {\n return false;\n }\n\n return this.authService.currentUser.hasAllRoles(foundRestrict.roles);\n } else {\n return true;\n }\n });\n\n resolve(this.types);\n\n if (!this.modelName && this.types) {\n this.router.navigate(['./' + this.types[0].name.toLowerCase()], { relativeTo: this.route });\n }\n });\n });\n }\n\n /**\n * It checks if the model is excluded or restricted\n *\n * @param model - The name of the model you want to check.\n * @returns A boolean value.\n */\n checkModelIsExcludedOrRestrcited(model: string): boolean {\n if (!model) {\n return false;\n }\n const excludedModels = this.moduleConfig.excludedModels?.map((e) => e.toLowerCase());\n return !!(\n excludedModels?.includes(model?.toLowerCase()) ||\n this.moduleConfig.restrictedModels?.find((e) => e.model.toLowerCase() === model.toLowerCase())\n );\n }\n\n /**\n * If the model name is set and the types are set, then return the type that matches the model name\n *\n * @returns The type object that matches the model name.\n */\n getTypeByModelName() {\n if (this.modelName && this.types) {\n return this.types.find((e) => e.name.toLowerCase() === this.modelName.toLowerCase());\n } else {\n return null;\n }\n }\n\n /**\n * When the createModeChanged event is emitted, if the createMode is true, navigate to the new route\n *\n * @param createMode - boolean - This is a boolean value that indicates whether the user is in create mode or\n * not.\n */\n onCreateModeChanged(createMode: boolean) {\n if (createMode) {\n this.router.navigate(['./' + 'new'], { relativeTo: this.route });\n }\n }\n\n /**\n * If the type exists, return the create property of the type, otherwise return false.\n *\n * @returns A boolean value.\n */\n isCreatePossible(): boolean {\n const type = this.getTypeByModelName();\n return type ? type.create : false;\n }\n\n /**\n * If the model name is found in the type map, return the update property of the type object\n *\n * @returns A boolean value.\n */\n isUpdatePossible(): boolean {\n const type = this.getTypeByModelName();\n return type ? type.update : false;\n }\n\n /**\n * If the type is defined, return the delete property of the type, otherwise return false\n *\n * @returns A boolean value.\n */\n isDeletePossible(): boolean {\n const type = this.getTypeByModelName();\n return type ? type.delete : false;\n }\n\n /**\n * If the id is truthy, navigate to the id, otherwise navigate to the parent route\n *\n * @param id - The id of the selected item.\n */\n idSelected(id: string) {\n if (id) {\n this.router.navigate(['./' + id], { relativeTo: this.route });\n } else {\n this.router.navigate(['..'], { relativeTo: this.route });\n }\n }\n}\n","<div class=\"main\">\n <div class=\"sidebar\">\n <div class=\"d-flex flex-column flex-shrink-0 p-3 h-100\">\n <ng-container *ngIf=\"moduleConfig.branding\">\n <a href=\"/\" class=\"d-flex flex-column align-items-start mb-3 mt-3 me-md-auto link-dark text-decoration-none\">\n <span class=\"d-block fs-4\"><b class=\"text-primary\">Base</b>CMS</span>\n <small class=\"fw-lighter\">The auto generated GraphQL CMS</small>\n </a>\n <hr />\n </ng-container>\n <ul class=\"nav nav-pills flex-column mb-auto\" *ngIf=\"types\">\n <li class=\"nav-item\" *ngFor=\"let type of types\">\n <a\n class=\"nav-link\"\n aria-current=\"page\"\n [routerLink]=\"(id ? '../../' : '../') + type?.name?.toLowerCase()\"\n [ngClass]=\"{ active: type?.name?.toLowerCase() === this.modelName?.toLowerCase() }\"\n >\n {{ type.name + 's' }}\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div class=\"p-5\">\n <base-model-table\n [tableFields]=\"moduleConfig?.tableFields ?? ['name']\"\n [modelName]=\"modelName\"\n [objectId]=\"id !== 'new' ? id : ''\"\n [createMode]=\"id === 'new'\"\n (createModeChanged)=\"onCreateModeChanged($event)\"\n (idSelected)=\"idSelected($event)\"\n [create]=\"isCreatePossible()\"\n [update]=\"isUpdatePossible()\"\n [delete]=\"isDeletePossible()\"\n ></base-model-table>\n </div>\n </div>\n</div>\n","import { RouterModule, Routes } from '@angular/router';\nimport { NgModule } from '@angular/core';\nimport { BaseCmsComponent } from './pages/base-cms/base-cms.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: BaseCmsComponent,\n },\n {\n path: ':modelName',\n component: BaseCmsComponent,\n },\n {\n path: ':modelName/:id',\n component: BaseCmsComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BaseCMSRoutingModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { BaseCmsComponent } from './pages/base-cms/base-cms.component';\nimport { BaseCMSRoutingModule } from './base-cms-routing.module';\nimport { BaseComponentsModule } from '@lenne.tech/ng-base/base-components';\nimport { BASE_CMS_MODULE_CONFIG, BaseCMSModuleConfig } from './interfaces/base-cms-module-config.interface';\n\nexport function CMSConfigFactory() {\n return {\n tableFields: ['id', 'name', 'title', 'description', 'email', 'createdAt', 'updatedAt'],\n excludedModels: [],\n restrictedModels: [],\n branding: true,\n logging: false,\n ...BaseCMSModule.config,\n };\n}\n\n@NgModule({\n imports: [\n // Modules\n CommonModule,\n ReactiveFormsModule,\n BaseCMSRoutingModule,\n BaseComponentsModule,\n ],\n declarations: [BaseCmsComponent],\n exports: [],\n providers: [\n {\n provide: BASE_CMS_MODULE_CONFIG,\n useFactory: CMSConfigFactory,\n },\n ],\n})\nexport class BaseCMSModule {\n static config: BaseCMSModuleConfig;\n}\n","/**\n * Exports for public API\n */\n\n// Module\nexport * from './base-cms.module';\n\n// Pages\nexport * from './pages/base-cms/base-cms.component';\n\n// Interface\nexport * from './interfaces/base-cms-module-config.interface';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAUa,sBAAsB,GAAG,IAAI,cAAc,CAAC,wBAAwB;;MCApE,gBAAgB,CAAA;IAM3B,WACyC,CAAA,YAAiC,EAChE,kBAAsC,EACtC,KAAqB,EACrB,MAAc,EACd,WAAwB,EAAA;QAJO,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAqB;QAChE,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAoB;QACtC,IAAK,CAAA,KAAA,GAAL,KAAK,CAAgB;QACrB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAW,CAAA,WAAA,GAAX,WAAW,CAAa;QAPlC,IAAK,CAAA,KAAA,GAAsB,EAAE,CAAC;QAS5B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC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qBAAA;oBACD,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,sBAAsB;AAC/B,4BAAA,UAAU,EAAE,gBAAgB;AAC7B,yBAAA;AACF,qBAAA;AACF,iBAAA,CAAA;;;ACnCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lenne.tech-ng-base-base-cms.mjs","sources":["../../../projects/ng-base/base-cms/interfaces/base-cms-module-config.interface.ts","../../../projects/ng-base/base-cms/pages/base-cms/base-cms.component.ts","../../../projects/ng-base/base-cms/pages/base-cms/base-cms.component.html","../../../projects/ng-base/base-cms/base-cms-routing.module.ts","../../../projects/ng-base/base-cms/base-cms.module.ts","../../../projects/ng-base/base-cms/public-api.ts","../../../projects/ng-base/base-cms/lenne.tech-ng-base-base-cms.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface BaseCMSModuleConfig {\n tableFields?: string[];\n excludedModels?: string[];\n restrictedModels?: [{ model: string; roles: string[] }];\n logging?: boolean;\n branding?: boolean;\n}\n\nexport const BASE_CMS_MODULE_CONFIG = new InjectionToken('BASE_CMS_MODULE_CONFIG');\n","import { Component, Inject, OnInit } from '@angular/core';\nimport { AuthService, BasicUser, GraphqlCrudType, GraphQLMeta, GraphQLMetaService } from '@lenne.tech/ng-base/shared';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BASE_CMS_MODULE_CONFIG, BaseCMSModuleConfig } from '../../interfaces/base-cms-module-config.interface';\n\n@Component({\n selector: 'app-base-cms',\n templateUrl: './base-cms.component.html',\n styleUrls: ['./base-cms.component.scss'],\n})\nexport class BaseCmsComponent implements OnInit {\n meta: GraphQLMeta;\n modelName: string;\n id: string;\n types: GraphqlCrudType[] = [];\n\n constructor(\n @Inject(BASE_CMS_MODULE_CONFIG) public moduleConfig: BaseCMSModuleConfig,\n private graphQLMetaService: GraphQLMetaService,\n private route: ActivatedRoute,\n private router: Router,\n private authService: AuthService\n ) {\n this.route.params.subscribe((value) => {\n if (value['modelName']) {\n if (!this.checkModelIsExcludedOrRestrcited(value['modelName'])) {\n this.modelName = value['modelName'];\n } else {\n this.init().then((types: GraphqlCrudType[]) => {\n this.router.navigate(['../' + types[0].name.toLowerCase()], { relativeTo: this.route });\n });\n }\n }\n\n if (value['id']) {\n this.id = value['id'];\n }\n });\n }\n\n async ngOnInit() {\n await this.init();\n }\n\n /**\n * It returns a promise that resolves to an array of GraphqlCrudType objects\n *\n * @returns The types that are available to the user.\n */\n init(): Promise<GraphqlCrudType[]> {\n return new Promise((resolve, reject) => {\n this.graphQLMetaService.getMeta().subscribe((meta) => {\n this.meta = meta;\n\n if (this.route.snapshot?.params?.['modelName']) {\n this.modelName = this.route.snapshot?.params?.['modelName'];\n }\n\n if (this.route.snapshot?.params?.['id']) {\n this.id = this.route.snapshot?.params?.['id'];\n }\n\n const excludedModels = this.moduleConfig.excludedModels?.map((e) => e.toLowerCase());\n const types = meta.getTypes();\n\n // Check for excluded types\n const filteredTypes = types.filter((e) => !excludedModels?.includes(e.name.toLowerCase()));\n\n // Check for restricted types\n this.types = filteredTypes.filter((e) => {\n const foundRestrict = this.moduleConfig.restrictedModels?.find(\n (v) => v.model.toLowerCase() === e.name.toLowerCase()\n );\n\n if (foundRestrict) {\n if (!this.authService?.currentUser) {\n return false;\n }\n const user = this.authService?.currentUser;\n const mappedUser = BasicUser.map(user);\n\n return mappedUser?.hasAllRoles(foundRestrict.roles);\n } else {\n return true;\n }\n });\n\n if (this.moduleConfig?.logging) {\n console.log('BaseCmsComponent::init->types', this.types);\n }\n\n resolve(this.types);\n\n if (!this.modelName && this.types) {\n this.router.navigate(['./' + this.types[0].name.toLowerCase()], { relativeTo: this.route });\n }\n });\n });\n }\n\n /**\n * It checks if the model is excluded or restricted\n *\n * @param model - The name of the model you want to check.\n * @returns A boolean value.\n */\n checkModelIsExcludedOrRestrcited(model: string): boolean {\n if (!model) {\n return false;\n }\n const excludedModels = this.moduleConfig.excludedModels?.map((e) => e.toLowerCase());\n return !!(\n excludedModels?.includes(model?.toLowerCase()) ||\n this.moduleConfig.restrictedModels?.find((e) => e.model.toLowerCase() === model.toLowerCase())\n );\n }\n\n /**\n * If the model name is set and the types are set, then return the type that matches the model name\n *\n * @returns The type object that matches the model name.\n */\n getTypeByModelName() {\n if (this.modelName && this.types) {\n return this.types.find((e) => e.name.toLowerCase() === this.modelName.toLowerCase());\n } else {\n return null;\n }\n }\n\n /**\n * When the createModeChanged event is emitted, if the createMode is true, navigate to the new route\n *\n * @param createMode - boolean - This is a boolean value that indicates whether the user is in create mode or\n * not.\n */\n onCreateModeChanged(createMode: boolean) {\n if (createMode) {\n this.router.navigate(['./' + 'new'], { relativeTo: this.route });\n }\n }\n\n /**\n * If the type exists, return the create property of the type, otherwise return false.\n *\n * @returns A boolean value.\n */\n isCreatePossible(): boolean {\n const type = this.getTypeByModelName();\n return type ? type.create : false;\n }\n\n /**\n * If the model name is found in the type map, return the update property of the type object\n *\n * @returns A boolean value.\n */\n isUpdatePossible(): boolean {\n const type = this.getTypeByModelName();\n return type ? type.update : false;\n }\n\n /**\n * If the type is defined, return the delete property of the type, otherwise return false\n *\n * @returns A boolean value.\n */\n isDeletePossible(): boolean {\n const type = this.getTypeByModelName();\n return type ? type.delete : false;\n }\n\n /**\n * If the id is truthy, navigate to the id, otherwise navigate to the parent route\n *\n * @param id - The id of the selected item.\n */\n idSelected(id: string) {\n if (id) {\n this.router.navigate(['./' + id], { relativeTo: this.route });\n } else {\n this.router.navigate(['..'], { relativeTo: this.route });\n }\n }\n}\n","<div class=\"main\">\n <div class=\"sidebar\">\n <div class=\"d-flex flex-column flex-shrink-0 p-3 h-100\">\n <ng-container *ngIf=\"moduleConfig.branding\">\n <a href=\"/\" class=\"d-flex flex-column align-items-start mb-3 mt-3 me-md-auto link-dark text-decoration-none\">\n <span class=\"d-block fs-4\"><b class=\"text-primary\">Base</b>CMS</span>\n <small class=\"fw-lighter\">The auto generated GraphQL CMS</small>\n </a>\n <hr />\n </ng-container>\n <ul class=\"nav nav-pills flex-column mb-auto\" *ngIf=\"types\">\n <li class=\"nav-item\" *ngFor=\"let type of types\">\n <a\n class=\"nav-link\"\n aria-current=\"page\"\n [routerLink]=\"(id ? '../../' : '../') + type?.name?.toLowerCase()\"\n [ngClass]=\"{ active: type?.name?.toLowerCase() === this.modelName?.toLowerCase() }\"\n >\n {{ type.name + 's' }}\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div class=\"p-5\">\n <base-model-table\n [tableFields]=\"moduleConfig?.tableFields ?? ['name']\"\n [modelName]=\"modelName\"\n [logging]=\"moduleConfig?.logging\"\n [objectId]=\"id !== 'new' ? id : ''\"\n [createMode]=\"id === 'new'\"\n (createModeChanged)=\"onCreateModeChanged($event)\"\n (idSelected)=\"idSelected($event)\"\n [create]=\"isCreatePossible()\"\n [update]=\"isUpdatePossible()\"\n [delete]=\"isDeletePossible()\"\n ></base-model-table>\n </div>\n </div>\n</div>\n","import { RouterModule, Routes } from '@angular/router';\nimport { NgModule } from '@angular/core';\nimport { BaseCmsComponent } from './pages/base-cms/base-cms.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: BaseCmsComponent,\n },\n {\n path: ':modelName',\n component: BaseCmsComponent,\n },\n {\n path: ':modelName/:id',\n component: BaseCmsComponent,\n },\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class BaseCMSRoutingModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { BaseCmsComponent } from './pages/base-cms/base-cms.component';\nimport { BaseCMSRoutingModule } from './base-cms-routing.module';\nimport { BaseComponentsModule } from '@lenne.tech/ng-base/base-components';\nimport { BASE_CMS_MODULE_CONFIG, BaseCMSModuleConfig } from './interfaces/base-cms-module-config.interface';\n\nexport function CMSConfigFactory() {\n return {\n tableFields: ['id', 'name', 'title', 'description', 'email', 'createdAt', 'updatedAt'],\n excludedModels: [],\n restrictedModels: [],\n branding: true,\n logging: false,\n ...BaseCMSModule.config,\n };\n}\n\n@NgModule({\n imports: [\n // Modules\n CommonModule,\n ReactiveFormsModule,\n BaseCMSRoutingModule,\n BaseComponentsModule,\n ],\n declarations: [BaseCmsComponent],\n exports: [],\n providers: [\n {\n provide: BASE_CMS_MODULE_CONFIG,\n useFactory: CMSConfigFactory,\n },\n ],\n})\nexport class BaseCMSModule {\n static config: BaseCMSModuleConfig;\n}\n","/**\n * Exports for public API\n */\n\n// Module\nexport * from './base-cms.module';\n\n// Pages\nexport * from './pages/base-cms/base-cms.component';\n\n// Interface\nexport * from './interfaces/base-cms-module-config.interface';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAUa,sBAAsB,GAAG,IAAI,cAAc,CAAC,wBAAwB;;MCApE,gBAAgB,CAAA;IAM3B,WACyC,CAAA,YAAiC,EAChE,kBAAsC,EACtC,KAAqB,EACrB,MAAc,EACd,WAAwB,EAAA;QAJO,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAqB;QAChE,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAoB;QACtC,IAAK,CAAA,KAAA,GAAL,KAAK,CAAgB;QACrB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAW,CAAA,WAAA,GAAX,WAAW,CAAa;QAPlC,IAAK,CAAA,KAAA,GAAsB,EAAE,CAAC;QAS5B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,KAAI;AACpC,YAAA,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE;gBACtB,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE;AAC9D,oBAAA,IAAI,CAAC,SAAS,GAAG,KAAK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YAAY;wBACZ,mBAAmB;wBACnB,oBAAoB;wBACpB,oBAAoB;AACrB,qBAAA;oBACD,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,sBAAsB;AAC/B,4BAAA,UAAU,EAAE,gBAAgB;AAC7B,yBAAA;AACF,qBAAA;AACF,iBAAA,CAAA;;;ACnCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -375,6 +375,7 @@ class ModelFormComponent {
|
|
|
375
375
|
this.graphQLService = graphQLService;
|
|
376
376
|
this.formsService = formsService;
|
|
377
377
|
this.delete = true;
|
|
378
|
+
this.logging = false;
|
|
378
379
|
this.finished = new EventEmitter();
|
|
379
380
|
this.loading = false;
|
|
380
381
|
this.keys = [];
|
|
@@ -404,6 +405,10 @@ class ModelFormComponent {
|
|
|
404
405
|
});
|
|
405
406
|
this.fields = this.fields['input'];
|
|
406
407
|
this.keys = Object.keys(this.fields);
|
|
408
|
+
if (this.logging) {
|
|
409
|
+
console.log('ModelFormComponent::init->fields', this.fields);
|
|
410
|
+
console.log('ModelFormComponent::init->keys', this.keys);
|
|
411
|
+
}
|
|
407
412
|
this.createForm(this.fields);
|
|
408
413
|
if (this.id) {
|
|
409
414
|
this.getObjectById(this.id);
|
|
@@ -416,6 +421,9 @@ class ModelFormComponent {
|
|
|
416
421
|
* @param id - The id of the object to be loaded
|
|
417
422
|
*/
|
|
418
423
|
getObjectById(id) {
|
|
424
|
+
if (this.logging) {
|
|
425
|
+
console.log('ModelFormComponent::getObjectById->id', id);
|
|
426
|
+
}
|
|
419
427
|
this.graphQLService
|
|
420
428
|
.graphQl('get' + this.capitalizeFirstLetter(this.modelName), {
|
|
421
429
|
arguments: { id },
|
|
@@ -424,6 +432,9 @@ class ModelFormComponent {
|
|
|
424
432
|
})
|
|
425
433
|
.subscribe({
|
|
426
434
|
next: (value) => {
|
|
435
|
+
if (this.logging) {
|
|
436
|
+
console.log('ModelFormComponent::get->value', value);
|
|
437
|
+
}
|
|
427
438
|
this.form.patchValue({ ...{}, ...value });
|
|
428
439
|
},
|
|
429
440
|
error: (err) => {
|
|
@@ -521,7 +532,7 @@ class ModelFormComponent {
|
|
|
521
532
|
}
|
|
522
533
|
}
|
|
523
534
|
ModelFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelFormComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }, { token: i1$1.FormsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
524
|
-
ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelFormComponent, selector: "base-model-form", inputs: { modelName: "modelName", id: "id", delete: "delete" }, outputs: { finished: "finished" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-100\" *ngIf=\"form\">\n <h1>{{ capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}</h1>\n\n <form [formGroup]=\"form\">\n <div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container [ngSwitch]=\"fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"fields[key].isRequired\"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"fields[key].isRequired\"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"true\"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"true\"\n ></base-input>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"d-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit()\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n", styles: [""], components: [{ type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required"] }, { type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required"] }, { type: CheckboxComponent, selector: "base-checkbox", inputs: ["id", "name", "label", "value", "control", "required"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
535
|
+
ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelFormComponent, selector: "base-model-form", inputs: { modelName: "modelName", id: "id", delete: "delete", logging: "logging" }, outputs: { finished: "finished" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-100\" *ngIf=\"form\">\n <h1>{{ capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}</h1>\n\n <form [formGroup]=\"form\">\n <div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container [ngSwitch]=\"fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"fields[key].isRequired\"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"fields[key].isRequired\"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"true\"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"true\"\n ></base-input>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"d-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit()\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n", styles: [""], components: [{ type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required"] }, { type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required"] }, { type: CheckboxComponent, selector: "base-checkbox", inputs: ["id", "name", "label", "value", "control", "required"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
525
536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelFormComponent, decorators: [{
|
|
526
537
|
type: Component,
|
|
527
538
|
args: [{ selector: 'base-model-form', template: "<div class=\"w-100\" *ngIf=\"form\">\n <h1>{{ capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}</h1>\n\n <form [formGroup]=\"form\">\n <div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container [ngSwitch]=\"fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"fields[key].isRequired\"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"fields[key].isRequired\"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"true\"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"capitalizeFirstLetter(key)\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"true\"\n ></base-input>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"d-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit()\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n", styles: [""] }]
|
|
@@ -531,6 +542,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
531
542
|
type: Input
|
|
532
543
|
}], delete: [{
|
|
533
544
|
type: Input
|
|
545
|
+
}], logging: [{
|
|
546
|
+
type: Input
|
|
534
547
|
}], finished: [{
|
|
535
548
|
type: Output
|
|
536
549
|
}] } });
|
|
@@ -543,6 +556,7 @@ class ModelTableComponent {
|
|
|
543
556
|
this.create = true;
|
|
544
557
|
this.update = true;
|
|
545
558
|
this.delete = true;
|
|
559
|
+
this.logging = false;
|
|
546
560
|
this.tableFields = ['id', 'name', 'title', 'description', 'email', 'createdAt', 'updatedAt'];
|
|
547
561
|
this.idSelected = new EventEmitter();
|
|
548
562
|
this.createModeChanged = new EventEmitter();
|
|
@@ -567,6 +581,9 @@ class ModelTableComponent {
|
|
|
567
581
|
}
|
|
568
582
|
if (changes['objectId'] && this.meta) {
|
|
569
583
|
if (this.selectedId !== this.objectId) {
|
|
584
|
+
if (this.logging) {
|
|
585
|
+
console.log('ModelTableComponent::ngOnChanges->selectedId', this.selectedId);
|
|
586
|
+
}
|
|
570
587
|
this.selectedId = this.objectId;
|
|
571
588
|
}
|
|
572
589
|
}
|
|
@@ -584,6 +601,11 @@ class ModelTableComponent {
|
|
|
584
601
|
this.availableFields.push(field);
|
|
585
602
|
}
|
|
586
603
|
});
|
|
604
|
+
if (this.logging) {
|
|
605
|
+
console.log('ModelTableComponent::init->possibleFields', possibleFields);
|
|
606
|
+
console.log('ModelTableComponent::init->keys', keys);
|
|
607
|
+
console.log('ModelTableComponent::init->availableFields', this.availableFields);
|
|
608
|
+
}
|
|
587
609
|
this.loadObjects(this.availableFields);
|
|
588
610
|
}
|
|
589
611
|
/**
|
|
@@ -608,6 +630,9 @@ class ModelTableComponent {
|
|
|
608
630
|
})
|
|
609
631
|
.subscribe({
|
|
610
632
|
next: (value) => {
|
|
633
|
+
if (this.logging) {
|
|
634
|
+
console.log('ModelTableComponent::loadObjects->value', value);
|
|
635
|
+
}
|
|
611
636
|
this.objects = value;
|
|
612
637
|
},
|
|
613
638
|
error: (err) => {
|
|
@@ -642,10 +667,10 @@ class ModelTableComponent {
|
|
|
642
667
|
}
|
|
643
668
|
}
|
|
644
669
|
ModelTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelTableComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }], target: i0.ɵɵFactoryTarget.Component });
|
|
645
|
-
ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelTableComponent, selector: "base-model-table", inputs: { modelName: "modelName", objectId: "objectId", createMode: "createMode", create: "create", update: "update", delete: "delete", tableFields: "tableFields" }, outputs: { idSelected: "idSelected", createModeChanged: "createModeChanged" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h1 *ngIf=\"modelName\">{{ capitalizeFirstLetter(modelName) }}s</h1>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">{{ capitalizeFirstLetter(field) }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n {{ object[field] }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"], components: [{ type: ModelFormComponent, selector: "base-model-form", inputs: ["modelName", "id", "delete"], outputs: ["finished"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
670
|
+
ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelTableComponent, selector: "base-model-table", inputs: { modelName: "modelName", objectId: "objectId", createMode: "createMode", create: "create", update: "update", delete: "delete", logging: "logging", tableFields: "tableFields" }, outputs: { idSelected: "idSelected", createModeChanged: "createModeChanged" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h1 *ngIf=\"modelName\">{{ capitalizeFirstLetter(modelName) }}s</h1>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">{{ capitalizeFirstLetter(field) }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n {{ object[field] }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [logging]=\"logging\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"], components: [{ type: ModelFormComponent, selector: "base-model-form", inputs: ["modelName", "id", "delete", "logging"], outputs: ["finished"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
646
671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelTableComponent, decorators: [{
|
|
647
672
|
type: Component,
|
|
648
|
-
args: [{ selector: 'base-model-table', template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h1 *ngIf=\"modelName\">{{ capitalizeFirstLetter(modelName) }}s</h1>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">{{ capitalizeFirstLetter(field) }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n {{ object[field] }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"] }]
|
|
673
|
+
args: [{ selector: 'base-model-table', template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h1 *ngIf=\"modelName\">{{ capitalizeFirstLetter(modelName) }}s</h1>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">{{ capitalizeFirstLetter(field) }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n {{ object[field] }}\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [logging]=\"logging\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"] }]
|
|
649
674
|
}], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }]; }, propDecorators: { modelName: [{
|
|
650
675
|
type: Input
|
|
651
676
|
}], objectId: [{
|
|
@@ -658,6 +683,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
658
683
|
type: Input
|
|
659
684
|
}], delete: [{
|
|
660
685
|
type: Input
|
|
686
|
+
}], logging: [{
|
|
687
|
+
type: Input
|
|
661
688
|
}], tableFields: [{
|
|
662
689
|
type: Input
|
|
663
690
|
}], idSelected: [{
|