From b2b272680d301d387b93ab5d3587a3d45b1f9f32 Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Fri, 19 Jan 2024 15:05:37 -0300 Subject: [PATCH] rework non updatable entities --- .../_entityFolder_/_entityFile_.routes.ts.ejs | 2 ++ .../_entityFile_-detail.component.html.ejs | 2 +- .../list/_entityFile_.component.html.ejs | 4 +++- .../service/_entityFile_.service.spec.ts.ejs | 2 ++ .../service/_entityFile_.service.ts.ejs | 8 ++++++-- .../update/_entityFile_-form.service.ts.ejs | 4 ++-- .../_entityFile_-update.component.spec.ts.ejs | 4 ++++ .../_entityFile_-update.component.ts.ejs | 4 ++++ .../support/prepare-entity.ts | 3 ++- .../cypress/e2e/entity/_entity_.cy.ts.ejs | 10 +++++++--- .../update_template.ejs | 9 --------- .../update_template.ejs | 5 ----- .../_partials_entity_/patch_template.ejs | 2 +- .../impl/_entityClass_ServiceImpl.java.ejs | 20 ++++++++++--------- .../web/rest/_entityClass_Resource.java.ejs | 4 +++- .../web/rest/_entityClass_ResourceIT.java.ejs | 4 +++- .../jdl-entities/01-non-updatable-entity.jdl | 2 ++ 17 files changed, 53 insertions(+), 36 deletions(-) create mode 100644 test-integration/samples/jdl-entities/01-non-updatable-entity.jdl diff --git a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.routes.ts.ejs b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.routes.ts.ejs index 69819ae81f02..3611f1d5952c 100644 --- a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.routes.ts.ejs +++ b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.routes.ts.ejs @@ -53,6 +53,8 @@ const <%= entityInstance %>Route: Routes = [ }, canActivate: [UserRouteAccessService] }, +<%_ } _%> +<%_ if (!readOnly && updatableEntity) { _%> { path: ':<%= primaryKey.name %>/edit', component: <%= entityAngularName %>UpdateComponent, diff --git a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/detail/_entityFile_-detail.component.html.ejs b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/detail/_entityFile_-detail.component.html.ejs index d510c50c771b..f80f6a5e7b47 100644 --- a/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/detail/_entityFile_-detail.component.html.ejs +++ b/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/detail/_entityFile_-detail.component.html.ejs @@ -116,7 +116,7 @@ _%> data-cy="entityDetailsBackButton">  Translate="entity.action.back">__jhiTransformTranslate__('entity.action.back') -<%_ if (!readOnly) { _%> +<%_ if (!readOnly && updatableEntity) { _%>