fam-archetype-app 0.0.1

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.
Files changed (147) hide show
  1. package/README.md +38 -0
  2. package/package.json +25 -0
  3. package/src/collection.json +10 -0
  4. package/src/fam-archetype-app/files/.editorconfig +16 -0
  5. package/src/fam-archetype-app/files/.prettierignore +15 -0
  6. package/src/fam-archetype-app/files/.prettierrc.json +29 -0
  7. package/src/fam-archetype-app/files/LICENSE.md +21 -0
  8. package/src/fam-archetype-app/files/README.md +59 -0
  9. package/src/fam-archetype-app/files/angular.json.template +178 -0
  10. package/src/fam-archetype-app/files/cli +361 -0
  11. package/src/fam-archetype-app/files/eslint.config.js +89 -0
  12. package/src/fam-archetype-app/files/package-lock.json.template +18812 -0
  13. package/src/fam-archetype-app/files/package.json.template +62 -0
  14. package/src/fam-archetype-app/files/src/assets/fonts/DiBaScreen-Regular.woff2 +0 -0
  15. package/src/fam-archetype-app/files/src/assets/translations/translations-ca.json +284 -0
  16. package/src/fam-archetype-app/files/src/assets/translations/translations-en.json +28 -0
  17. package/src/fam-archetype-app/files/src/assets/translations/translations-es.json +28 -0
  18. package/src/fam-archetype-app/files/src/core/layout/component/footer/footer.component.html.template +3 -0
  19. package/src/fam-archetype-app/files/src/core/layout/component/footer/footer.component.scss +8 -0
  20. package/src/fam-archetype-app/files/src/core/layout/component/layout/layout.component.html +19 -0
  21. package/src/fam-archetype-app/files/src/core/layout/component/layout/layout.component.scss +28 -0
  22. package/src/fam-archetype-app/files/src/core/layout/component/main-info-popup/main-info-popup.component.html +33 -0
  23. package/src/fam-archetype-app/files/src/core/layout/component/main-info-popup/main-info-popup.component.scss +3 -0
  24. package/src/fam-archetype-app/files/src/core/layout/component/menu/menu.component.html +3 -0
  25. package/src/fam-archetype-app/files/src/core/layout/component/menu/menu.component.scss +163 -0
  26. package/src/fam-archetype-app/files/src/core/layout/component/menuitem/menuitem.component.html +39 -0
  27. package/src/fam-archetype-app/files/src/core/layout/component/menuitem/menuitem.component.scss +44 -0
  28. package/src/fam-archetype-app/files/src/core/layout/component/not-found/not-found.component.html +12 -0
  29. package/src/fam-archetype-app/files/src/core/layout/component/not-found/not-found.component.scss +17 -0
  30. package/src/fam-archetype-app/files/src/core/layout/component/sidebar/sidebar.component.html +13 -0
  31. package/src/fam-archetype-app/files/src/core/layout/component/sidebar/sidebar.component.scss +33 -0
  32. package/src/fam-archetype-app/files/src/core/layout/component/top-menu/top-menu.component.html +12 -0
  33. package/src/fam-archetype-app/files/src/core/layout/component/top-menu/top-menu.component.scss +9 -0
  34. package/src/fam-archetype-app/files/src/core/layout/component/topbar/_mixins.scss +8 -0
  35. package/src/fam-archetype-app/files/src/core/layout/component/topbar/topbar.component.html.template +45 -0
  36. package/src/fam-archetype-app/files/src/core/layout/component/topbar/topbar.component.scss +77 -0
  37. package/src/fam-archetype-app/files/src/environments/environment.dev.ts.template +12 -0
  38. package/src/fam-archetype-app/files/src/environments/environment.int.ts.template +12 -0
  39. package/src/fam-archetype-app/files/src/environments/environment.pre.ts.template +12 -0
  40. package/src/fam-archetype-app/files/src/environments/environment.ts.template +12 -0
  41. package/src/fam-archetype-app/files/src/index.html.template +18 -0
  42. package/src/fam-archetype-app/files/src/shared/filters/diba-filters/diba-filters.component.html +69 -0
  43. package/src/fam-archetype-app/files/src/shared/filters/diba-filters/diba-filters.component.scss +0 -0
  44. package/src/fam-archetype-app/files/src/shared/styles/_movements.scss +19 -0
  45. package/src/fam-archetype-app/files/src/shared/styles/global/_core.scss +20 -0
  46. package/src/fam-archetype-app/files/src/shared/styles/global/_icons.scss +37 -0
  47. package/src/fam-archetype-app/files/src/shared/styles/global/_tooltips.scss +14 -0
  48. package/src/fam-archetype-app/files/src/shared/styles/global/_typography.scss +68 -0
  49. package/src/fam-archetype-app/files/src/shared/styles/global/_utils.scss +24 -0
  50. package/src/fam-archetype-app/files/src/shared/styles/global/layout.scss +5 -0
  51. package/src/fam-archetype-app/files/src/shared/table/column-visibility-selector/column-visibility-selector.component.html +10 -0
  52. package/src/fam-archetype-app/files/src/shared/table/column-visibility-selector/column-visibility-selector.component.scss +0 -0
  53. package/src/fam-archetype-app/files/src/shared/table/diba-table/diba-table.component.html +136 -0
  54. package/src/fam-archetype-app/files/src/shared/table/diba-table/diba-table.component.scss +0 -0
  55. package/src/fam-archetype-app/files/src/styles.scss +109 -0
  56. package/src/fam-archetype-app/files/src/tailwind.css +3 -0
  57. package/src/fam-archetype-app/files/tailwind.config.js +36 -0
  58. package/src/fam-archetype-app/files/tools/cli/TelosysTools/commands/commands.txt +1 -0
  59. package/src/fam-archetype-app/files/tools/cli/TelosysTools/commands/db_to_entities.txt +1 -0
  60. package/src/fam-archetype-app/files/tools/cli/TelosysTools/commands/test_db_connection.txt +1 -0
  61. package/src/fam-archetype-app/files/tools/cli/TelosysTools/databases.yaml +188 -0
  62. package/src/fam-archetype-app/files/tools/cli/TelosysTools/downloads/.keep +0 -0
  63. package/src/fam-archetype-app/files/tools/cli/TelosysTools/lib/.keep +0 -0
  64. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamActivitat.entity +26 -0
  65. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamActivitatsUbicacio.entity +40 -0
  66. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamAlumne.entity +76 -0
  67. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamArea.entity +33 -0
  68. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamComanda.entity +37 -0
  69. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamCurs.entity +50 -0
  70. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamDocument.entity +53 -0
  71. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamDocumentTipus.entity +26 -0
  72. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamEntitatBase.entity +84 -0
  73. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedient.entity +71 -0
  74. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedientDocument.entity +51 -0
  75. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedientEstat.entity +26 -0
  76. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedientTipus.entity +26 -0
  77. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamJerarquia.entity +33 -0
  78. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamLinia.entity +56 -0
  79. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamMatricula.entity +63 -0
  80. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamTipusArticle.entity +26 -0
  81. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamUbicacio.entity +35 -0
  82. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamZona.entity +27 -0
  83. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/Funcionalitat.entity +65 -0
  84. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FuncionalitatGrupFunc.entity +58 -0
  85. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/GrupFuncionalitat.entity +54 -0
  86. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/PerfilGrupFuncionalitat.entity +50 -0
  87. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/VusPerfil.entity +31 -0
  88. package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/model.yaml +4 -0
  89. package/src/fam-archetype-app/files/tools/cli/TelosysTools/telosys-tools.cfg +31 -0
  90. package/src/fam-archetype-app/files/tools/cli/TelosysTools/telosys.env +5 -0
  91. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/README.md +12 -0
  92. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/database.properties +23 -0
  93. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/include/init_var_entity.vm +169 -0
  94. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/include/macros.vm +218 -0
  95. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/app_config_ts.vm +56 -0
  96. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/app_routes_ts.vm +21 -0
  97. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/core/layout/component/menu/menu_component_ts.vm +30 -0
  98. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/core/layout/component/top-menu/top-menu_component_ts.vm +36 -0
  99. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/core/layout/service/menu_model_service_ts.vm +49 -0
  100. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/create-Xxx_use-case_ts.vm +18 -0
  101. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/create-file-Xxx_use-case_ts.vm +17 -0
  102. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/delete-Xxx_use-case_ts.vm +17 -0
  103. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/download-Xxx-file_use-case_ts.vm +24 -0
  104. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/find-Xxx_use-case_ts.vm +18 -0
  105. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/search-Xxx_use-case_ts.vm +25 -0
  106. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/update-Xxx_use-case_ts.vm +18 -0
  107. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/domain/Xxx_entity_ts.vm +36 -0
  108. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/domain/Xxx_repository_interface_ts.vm +27 -0
  109. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/mappers/Xxx_jsona_mapper_ts.vm +52 -0
  110. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/mappers/Xxx_mapper_ts.vm +36 -0
  111. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/Xxx_routes_ts.vm +15 -0
  112. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_html.vm +178 -0
  113. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_scss.vm +0 -0
  114. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_spec_ts.vm +29 -0
  115. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_ts.vm +382 -0
  116. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_html.vm +37 -0
  117. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_scss.vm +10 -0
  118. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_spec_ts.vm +29 -0
  119. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_ts.vm +430 -0
  120. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/resources/Xxx_resource_ts.vm +43 -0
  121. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/outbound/Xxx_repository_impl_ts.vm +162 -0
  122. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/test_code.vm +3 -0
  123. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/templates.cfg +52 -0
  124. package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/tools-test/test-api_Xxx_rest.vm +181 -0
  125. package/src/fam-archetype-app/files/tools/cli/telosys +5 -0
  126. package/src/fam-archetype-app/files/tools/cli/telosys-cli-4.2.0-001.jar +0 -0
  127. package/src/fam-archetype-app/files/tools/cli/telosys-cli.cfg +55 -0
  128. package/src/fam-archetype-app/files/tools/cli/telosys-term.sh +30 -0
  129. package/src/fam-archetype-app/files/tools/cli/telosys.bat +4 -0
  130. package/src/fam-archetype-app/files/tools/cli/telosys.ico +0 -0
  131. package/src/fam-archetype-app/files/tools/db/develop/data/.keep +0 -0
  132. package/src/fam-archetype-app/files/tools/db/production/data/.keep +0 -0
  133. package/src/fam-archetype-app/files/tools/db/production/migrations/.keep +0 -0
  134. package/src/fam-archetype-app/files/tools/docs/.keep +0 -0
  135. package/src/fam-archetype-app/files/tools/test/test-api.rest +80 -0
  136. package/src/fam-archetype-app/files/tsconfig.app.json +15 -0
  137. package/src/fam-archetype-app/files/tsconfig.json +42 -0
  138. package/src/fam-archetype-app/files/tsconfig.spec.json +15 -0
  139. package/src/fam-archetype-app/files/vercel.json +9 -0
  140. package/src/fam-archetype-app/index.d.ts +2 -0
  141. package/src/fam-archetype-app/index.js +18 -0
  142. package/src/fam-archetype-app/index.js.map +1 -0
  143. package/src/fam-archetype-app/index_spec.d.ts +1 -0
  144. package/src/fam-archetype-app/index_spec.js +23 -0
  145. package/src/fam-archetype-app/index_spec.js.map +1 -0
  146. package/src/fam-archetype-app/schema.json +21 -0
  147. package/tsconfig.json +24 -0
@@ -0,0 +1,52 @@
1
+ ## --------------------------------------------------
2
+ #checkId($entity)
3
+ #parse("include/init_var_entity.vm")
4
+ #parse("include/macros.vm")
5
+ ##---------------------------------------------------
6
+ import { ModelPropertiesMapper } from 'jsona';
7
+
8
+ export class ${entityName}JsonaMapper extends ModelPropertiesMapper {
9
+ override getRelationships(model: any): any {
10
+ const relationships: any = {};
11
+
12
+ #foreach( $link in $toOneLinks )
13
+ #set($fieldShowFront = $link.tagValue("fieldShowFront", ""))
14
+ if (model.#snakeLowerCase("${link.fieldName}")?.id) {
15
+ relationships['#snakeLowerCase("${link.fieldName}")'] = {
16
+ #set($type = $link.tagValue("type", ""))
17
+ #if($type != "")
18
+ type: '$type',
19
+ #end
20
+ id: model.#snakeLowerCase("${link.fieldName}")?.id
21
+ #if($fieldShowFront != ""),
22
+ #snakeLowerCase("${fieldShowFront}"):model.#snakeLowerCase("${link.fieldName}")?.#snakeLowerCase("${fieldShowFront}")
23
+ #end
24
+ };
25
+ }
26
+ #end
27
+
28
+ #foreach( $link in $toManyLinks )
29
+ if (Array.isArray(model.#snakeLowerCase("${link.fieldName}"))) {
30
+ relationships['#snakeLowerCase("${link.fieldName}")'] = model.#snakeLowerCase("${link.fieldName}").map((item: any) => ({
31
+ type: '#snakeLowerCase("${link.fieldName}")',
32
+ id: item.id
33
+ }));
34
+ }
35
+ #end
36
+ return relationships;
37
+ }
38
+
39
+ override getAttributes(model: any): any {
40
+ // Excluir relaciones del bloque de attributes
41
+ const { id,
42
+ type,
43
+ #foreach( $link in $toOneLinks )
44
+ #snakeLowerCase("${link.fieldName}"),
45
+ #end
46
+ #foreach( $link in $toManyLinks )
47
+ #snakeLowerCase("${link.fieldName}"),
48
+ #end
49
+ ...attributes } = model;
50
+ return attributes;
51
+ }
52
+ }
@@ -0,0 +1,36 @@
1
+ #parse("include/macros.vm")
2
+ ## --------------------------------------------------
3
+ #checkId($entity)
4
+ #parse("include/init_var_entity.vm")
5
+ #parse("include/macros.vm")
6
+ ##---------------------------------------------------
7
+ import { ${entityName} } from '../../../domain/#kebabCase("${entityName}").entity';
8
+ import { ${entityName}Resource } from '../resources/#kebabCase("${entityName}").resource';
9
+
10
+ export class ${entityName}Mapper {
11
+ static toResource(#camelCase("${entityName}"): ${entityName}): ${entityName}Resource {
12
+ return new ${entityName}Resource({ ...#camelCase("${entityName}") });
13
+ }
14
+
15
+ static toDomain(resource: ${entityName}Resource): ${entityName} {
16
+ return { id: resource.id,
17
+ #foreach( $attribute in $entity.nonKeyAttributes )
18
+ #snakeLowerCase("$attribute.name"): resource.#snakeLowerCase("$attribute.name")#comma( $foreach.hasNext )
19
+
20
+ #end
21
+ #foreach( $link in $toOneLinks )
22
+ #if( $velocityCount == 1 )
23
+ ,
24
+ #end
25
+ #snakeLowerCase("${link.fieldName}"): resource.#snakeLowerCase("${link.fieldName}") #comma( $foreach.hasNext )
26
+ #end
27
+ #foreach( $link in $toManyLinks )
28
+ #if( $velocityCount == 1 )
29
+ ,
30
+ #end
31
+ #snakeLowerCase("${link.fieldName}"): resource.#snakeLowerCase("${link.fieldName}") #comma( $foreach.hasNext )
32
+ #end
33
+
34
+ };
35
+ }
36
+ }
@@ -0,0 +1,15 @@
1
+ #parse("include/macros.vm")
2
+ ## --------------------------------------------------
3
+ #checkId($entity)
4
+ #parse("include/init_var_entity.vm")
5
+ #parse("include/macros.vm")
6
+ ##---------------------------------------------------
7
+ import { Routes } from '@angular/router';
8
+ import { ${entityName}ListComponent } from './#kebabCase("${entityName}")-list/#kebabCase("${entityName}")-list.component';
9
+ import { ${entityName}DetailComponent } from './#kebabCase("${entityName}")-detail/#kebabCase("${entityName}")-detail.component';
10
+
11
+ export default [
12
+ { path: '', data: { breadcrumb: '${entityName}' }, component: ${entityName}ListComponent },
13
+ { path: 'new', data: { breadcrumb: 'Nova ${entityName}' }, component: ${entityName}DetailComponent },
14
+ { path: ':id', data: { breadcrumb: '${entityName} Detall' }, component: ${entityName}DetailComponent }
15
+ ] as Routes;
@@ -0,0 +1,178 @@
1
+ #parse("include/macros.vm")
2
+ ## --------------------------------------------------
3
+ #checkId($entity)
4
+ #parse("include/init_var_entity.vm")
5
+ #parse("include/macros.vm")
6
+ ##---------------------------------------------------
7
+ <h3>{{ '${entityName}_EDIT' | primengTranslation }}</h3>
8
+ <form [formGroup]="form" (ngSubmit)="save()" class="w-full">
9
+ <div [ngClass]="{
10
+ 'diba-form': !stackingForm,
11
+ 'diba-form-stacking': stackingForm,
12
+ 'diba-form-two-column-flow': twoColumnForm
13
+ }">
14
+ #foreach( $attribute in $sortedAttributes )
15
+ <!-- #snakeLowerCase("$attribute.name") - $attribute.type -->
16
+ <div class="diba-form-field" *ngIf="!isDisabled('#snakeLowerCase("$attribute.name")')">
17
+ <label for="#snakeLowerCase("$attribute.name")">{{ '#snakeLowerCase("$attribute.name")' | primengTranslation }}</label>
18
+ #if( $attribute.type == "String" || $attribute.type == "string" )
19
+ #if( $attribute.tagValue("isTextArea", "") == "true")
20
+ <textarea
21
+ id="#snakeLowerCase("$attribute.name")"
22
+ rows="5"
23
+ cols="30"
24
+ pTextarea
25
+ formControlName="#snakeLowerCase("$attribute.name")"
26
+ ></textarea>
27
+ #else
28
+ <input
29
+ pInputText
30
+ id="#snakeLowerCase("$attribute.name")"
31
+ formControlName="#snakeLowerCase("$attribute.name")"
32
+ class="w-full"
33
+ />
34
+ #end
35
+ #elseif( $attribute.type == "long" || $attribute.type == "Long" || $attribute.type == "int" || $attribute.type == "integer" || $attribute.type == "Integer")
36
+ <p-inputgroup>
37
+ <p-inputnumber
38
+ id="#snakeLowerCase("$attribute.name")"
39
+ formControlName="#snakeLowerCase("$attribute.name")"
40
+ #set($pipe = $attribute.tagValue("pipe"))
41
+ #if($pipe == 'money')
42
+ mode="decimal"
43
+ locale="es-ES"
44
+ [minFractionDigits]="2"
45
+ #end
46
+ />
47
+ #if($pipe == 'money')
48
+ <p-inputgroup-addon>€</p-inputgroup-addon>
49
+ #end
50
+ </p-inputgroup>
51
+ #elseif( $attribute.type == "LocalDate" || $attribute.type == "localdate" || $attribute.type == "Date" || $attribute.type == "date")
52
+ <p-datepicker
53
+ id="#snakeLowerCase("$attribute.name")"
54
+ formControlName="#snakeLowerCase("$attribute.name")"
55
+ [showIcon]="true"
56
+ dateFormat="dd/mm/yy"
57
+ />
58
+ #elseif( $attribute.type == "Boolean" || $attribute.type == "boolean")
59
+ <p-checkbox
60
+ id="#snakeLowerCase("$attribute.name")"
61
+ formControlName="#snakeLowerCase("$attribute.name")"
62
+ [binary]="true" />
63
+ #elseif( $attribute.type == "binary[]" || $attribute.type == "byte[]")
64
+ <p-fileUpload ##snakeLowerCase("$attribute.name")_fileUploader
65
+ name="#snakeLowerCase("$attribute.name")"
66
+ customUpload="true"
67
+ [auto]="false"
68
+ (onSelect)="onFileSelected(#[[$event]]#, '#snakeLowerCase("$attribute.name")')"
69
+ [showUploadButton]="false"
70
+ [showCancelButton]="false"
71
+ [maxFileSize]="5000000"
72
+ accept=".pdf,.jpg,.png"
73
+ chooseLabel="Tria un fitxer"
74
+ [mode]="'advanced'"
75
+ >
76
+ <ng-template pTemplate="content">
77
+ <ul *ngIf="form.get('#snakeLowerCase("$attribute.name")_nom')?.value"
78
+ class="list-none p-0 m-0">
79
+ <li class="inline-flex justify-between w-full items-center">
80
+ <div class="inline-flex w-[80%]">
81
+ <i class="pi pi-file"></i>
82
+ <p class="ml-2">{{ form.get('#snakeLowerCase("$attribute.name")_nom')?.value }} -
83
+ {{ form.get('#snakeLowerCase("$attribute.name")_content_type')?.value }}
84
+ ({{ form.get('#snakeLowerCase("$attribute.name")_pes')?.value }} bytes)</p>
85
+ </div>
86
+ <div>
87
+ <button
88
+ type="button"
89
+ *ngIf="uploadedFile#camelCaseCapitalize("${attribute.name}")"
90
+ (click)="downloadFile('#snakeLowerCase("$attribute.name")')"
91
+ class="ml-2 mr-2"
92
+ >
93
+ <i class="fa-solid fa-download text-primary-600 text-base"></i>
94
+ </button>
95
+ <button
96
+ type="button"
97
+ (click)="removeFile('#snakeLowerCase("$attribute.name")')"
98
+ >
99
+ <i class="fa-solid fa-trash text-primary-600"></i>
100
+ </button>
101
+ </div>
102
+ </li>
103
+ </ul>
104
+ </ng-template>
105
+ <ng-template #file></ng-template>
106
+ <ng-template #empty>
107
+ <div
108
+ *ngIf="!form.get('#snakeLowerCase("$attribute.name")_nom')?.value"
109
+ class="flex items-center">
110
+ <i class="fa-solid fa-upload ml-1 mr-2 text-primary-600 text-lg"></i>
111
+ <p class="mb-0 text-primary-600 ">{{ 'Arrossega un fitxer' | primengTranslation }}</p>
112
+ </div>
113
+ </ng-template>
114
+ </p-fileUpload>
115
+ #end
116
+ <div *ngIf="form.get('#snakeLowerCase("$attribute.name")')?.invalid && form.get('#snakeLowerCase("$attribute.name")')?.touched" class="text-red-500 text-sm">
117
+ {{ 'Aquest camp és obligatori' | primengTranslation }}
118
+ </div>
119
+ </div>
120
+ #end
121
+ #foreach( $link in $toOneLinks )
122
+ #set($fieldShowFront = $link.tagValue("fieldShowFront", ""))
123
+ #if($fieldShowFront != "")
124
+ <!-- #snakeLowerCase("${link.fieldName}") -->
125
+ <div class="diba-form-field" [ngClass]="{ '!hidden': isEmbedded && parentControlName === '#snakeLowerCase("${link.fieldName}")' }">
126
+ <label for="#snakeLowerCase("${link.fieldName}")">{{ '#snakeLowerCase("${link.fieldName}").#snakeLowerCase("${fieldShowFront}")' | primengTranslation }}</label>
127
+ <p-select
128
+ id="#snakeLowerCase("${link.fieldName}")"
129
+ [options]="${link.fieldName}Select"
130
+ formControlName="#snakeLowerCase("${link.fieldName}")"
131
+ class="w-full" />
132
+ <div *ngIf="form.get('#snakeLowerCase("${link.fieldName}")')?.invalid && form.get('#snakeLowerCase("${link.fieldName}")')?.touched" class="text-red-500 text-sm">
133
+ {{ 'Aquest camp és obligatori' | primengTranslation }}
134
+ </div>
135
+ </div>
136
+ #end
137
+ #end
138
+ </div>
139
+ <div class="buttons flex mt-8">
140
+ <p-button
141
+ type="submit"
142
+ class="btn-primary-diba mr-2"
143
+ label="{{ isNew ? ('Desa' | primengTranslation) : ('Desa' | primengTranslation) }}"
144
+ severity="success"
145
+ ><i class="fa-solid fa-pencil"></i></p-button>
146
+
147
+ <p-button
148
+ class="btn-secondary-diba"
149
+ label="{{ 'Cancel·la' | primengTranslation }}"
150
+ severity="success"
151
+ (click)="goBack()"
152
+ ><i class="fa-solid fa-xmark-large"></i></p-button>
153
+ </div>
154
+ </form>
155
+ #if($existsDetailTabs)
156
+ <hr class="my-6" *ngIf="!isNew">
157
+ <p-tabs value="0">
158
+ <p-tablist>
159
+ #foreach($tab in $listDetailTabs)
160
+ <p-tab value="0" *ngIf="!isNew && #camelCase("${entityName}")?.id">{{ '${tab}_EMBEDDED' | primengTranslation }}</p-tab>
161
+ #end
162
+ </p-tablist>
163
+ <p-tabpanels>
164
+ #foreach($tab in $listDetailTabs)
165
+ <p-tabpanel value="0" *ngIf="!isNew && #camelCase("${entityName}")?.id">
166
+ <app-#kebabCase("${tab}")-list
167
+ *ngIf="!isNew && #camelCase("${entityName}")?.id"
168
+ [embedded]="true"
169
+ [parentId]="#camelCase("${entityName}").id"
170
+ [showFilters]="false"
171
+ [pageSizeEmbedded]="5"
172
+ [parent]="'${entityName}'">
173
+ </app-#kebabCase("${tab}")-list>
174
+ </p-tabpanel>
175
+ #end
176
+ </p-tabpanels>
177
+ </p-tabs>
178
+ #end
@@ -0,0 +1,29 @@
1
+ #parse("include/macros.vm")
2
+ ## --------------------------------------------------
3
+ #checkId($entity)
4
+ #parse("include/init_var_entity.vm")
5
+ #parse("include/macros.vm")
6
+ ##---------------------------------------------------
7
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
8
+
9
+ import { ${entityName}DetailComponent } from './#kebabCase("${entityName}")-detail.component';
10
+
11
+ describe('${entityName}DetailComponent', () => {
12
+ let component: ${entityName}DetailComponent;
13
+ let fixture: ComponentFixture<${entityName}DetailComponent>;
14
+
15
+ beforeEach(async () => {
16
+ await TestBed.configureTestingModule({
17
+ imports: [${entityName}DetailComponent]
18
+ })
19
+ .compileComponents();
20
+
21
+ fixture = TestBed.createComponent(${entityName}DetailComponent);
22
+ component = fixture.componentInstance;
23
+ fixture.detectChanges();
24
+ });
25
+
26
+ it('should create', () => {
27
+ expect(component).toBeTruthy();
28
+ });
29
+ });