jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.5k stars 4.02k forks source link

vue client Properties with the same name. `label` & `placeholder` #23179

Closed oopsaleem closed 1 year ago

oopsaleem commented 1 year ago
Overview of the issue

Properties with the same name. label & placeholder

Motivation for or Use Case

generated by jhipster and causing errors.

Reproduce the error

Create a monolithic app using vue client.

Related issues

N/A

Suggest a Fix

Modify the template where it is used to generate the login-form.vue file:

  1. Remove the duplicatelabel property from lines: 11 and 24
  2. Remove the duplicate lines that contain placeholder property from lines: 18 and 30
JHipster Version(s)

8.0.0-beta.2

JHipster configuration

.yo-rc.json file contents:

{ "generator-jhipster": { "applicationType": "monolith", "authenticationType": "jwt", "baseName": "jhdemo", "buildTool": "maven", "cacheProvider": "ehcache", "clientFramework": "vue", "databaseType": "mongodb", "devDatabaseType": "mongodb", "devServerPort": 9060, "dtoSuffix": "DTO", "jhiPrefix": "jhi", "jhipsterVersion": "8.0.0-beta.2", "messageBroker": false, "microfrontend": false, "nativeLanguage": "en", "packageFolder": "com/mycompany/myapp", "packageName": "com.mycompany.myapp", "prodDatabaseType": "mongodb", "reactive": false, "searchEngine": false, "testFrameworks": [], "websocket": false, "withAdminUi": true } }

Entity configuration(s) entityName.json files generated in the .jhipster directory

n/a

Browsers and Operating System

m1, macos Version 13.5

deepu105 commented 1 year ago

I'm not seeing this in a generated app. Could you provide more info? what error do you see. I guess if you disable translation there might be lable and placeholder repeating twice on the same component?

mshima commented 1 year ago

The .yo-rc.json looks wrong, should be missing enableTranslation: false. https://github.com/jhipster/generator-jhipster/blob/a5138a04b1a536f47b59bacd1dc84ede9ab8e0cd/generators/vue/templates/src/main/webapp/app/account/login-form/login-form.vue.ejs#L11

The translation process replaces the v-bind:label with a label tag. So we should remove the conditional tag.

oopsaleem commented 1 year ago

You are 100% right. Thank you very much. I will close this issue.