Skip to content

Commit

Permalink
Merge pull request jhipster#23742 from mshima/skip_ci-documentation
Browse files Browse the repository at this point in the history
rename javadoc to documentation
  • Loading branch information
DanielFran authored Oct 4, 2023
2 parents 1ad4fc8 + 17f3429 commit 6db62a4
Show file tree
Hide file tree
Showing 118 changed files with 1,057 additions and 1,013 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const fieldName = field.fieldName;
const fieldType = field.fieldType;
_%>
<dt><span <%= jhiPrefix %>Translate="<%= field.fieldTranslationKey %>"<% if (field.javadoc) { if (enableTranslation) { %> [ngbTooltip]="'<%= i18nKeyPrefix %>.help.<%= fieldName %>' | translate"<% } else { %> ngbTooltip="<%= field.javadoc %>"<% } } %>>__jhiTransformTranslate__('<%- field.fieldTranslationKey %>')</span></dt>
<dt><span <%= jhiPrefix %>Translate="<%= field.fieldTranslationKey %>"<% if (field.documentation) { if (enableTranslation) { %> [ngbTooltip]="'<%= i18nKeyPrefix %>.help.<%= fieldName %>' | translate"<% } else { %> ngbTooltip="<%= field.documentation %>"<% } } %>>__jhiTransformTranslate__('<%- field.fieldTranslationKey %>')</span></dt>
<dd>
<%_ if (field.fieldIsEnum) { _%>
<%# TODO: import enum and use its key as label _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
_%>
<div class="mb-3"<% if (field.autoGenerate) { %> *ngIf="editForm.controls.<%= field.fieldName %>.value !== null"<% } %>>
<label class="form-label" <%= jhiPrefix %>Translate="<%= translationKey %>" for="field_<%= fieldName %>"<% if (field.javadoc) { if (enableTranslation) { %> [ngbTooltip]="'<%= i18nKeyPrefix %>.help.<%= fieldName %>' | translate"<% } else { %> ngbTooltip="<%= field.javadoc %>"<% } } %>><%= fieldNameHumanized %></label>
<label class="form-label" <%= jhiPrefix %>Translate="<%= translationKey %>" for="field_<%= fieldName %>"<% if (field.documentation) { if (enableTranslation) { %> [ngbTooltip]="'<%= i18nKeyPrefix %>.help.<%= fieldName %>' | translate"<% } else { %> ngbTooltip="<%= field.documentation %>"<% } } %>><%= fieldNameHumanized %></label>
<%_ if (field.fieldIsEnum) { _%>
<select class="form-control" name="<%= fieldName %>" formControlName="<%= fieldName %>" id="field_<%= fieldName %>" data-cy="<%= fieldName %>">
<%_ const enumPrefix = frontendAppName + '.'+ fieldType; _%>
Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/support/enum.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const getEnumInfo = (field, clientRootFolder) => {
const customValuesState = getCustomValuesState(enums);
return {
enumName: field.fieldType,
javadoc: field.fieldTypeJavadoc && formatDocAsJavaDoc(field.fieldTypeJavadoc),
javadoc: field.fieldTypeDocumentation && formatDocAsJavaDoc(field.fieldTypeDocumentation),
enumInstance: field.enumInstance,
enums,
...customValuesState,
Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/support/enum.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('base-application - support - enum', () => {

before(() => {
const clientRootFolder = 'root';
const field = { enumName: 'fieldName', fieldType: 'BigLetters', fieldValues: 'AAA, BBB', fieldTypeJavadoc: 'enum comment' };
const field = { enumName: 'fieldName', fieldType: 'BigLetters', fieldValues: 'AAA, BBB', fieldTypeDocumentation: 'enum comment' };
enumInfo = getEnumInfo(field, clientRootFolder);
});

Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/support/prepare-entity.mts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export function preparePostEntityCommonDerivedProperties(entity: Entity) {
const fieldsType = sortedUniq(fields.map(({ fieldType }) => fieldType).filter(fieldType => !fieldIsEnum(fieldType)));

// TODO move to server generator
entity.anyFieldHasDocumentation = entity.fields.some(({ javadoc }) => javadoc);
entity.anyFieldHasDocumentation = entity.fields.some(({ documentation }) => documentation);

entity.anyFieldIsZonedDateTime = fieldsType.includes(ZONED_DATE_TIME);
entity.anyFieldIsInstant = fieldsType.includes(INSTANT);
Expand Down
8 changes: 7 additions & 1 deletion generators/base-application/support/prepare-field.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ export function fieldToReference(entity, field, pathPrefix = []) {
field,
multiple: false,
owned: true,
doc: field.javadoc,
doc: field.documentation,
get propertyJavadoc() {
return field.fieldJavadoc;
},
get propertyApiDescription() {
return field.fieldApiDescription;
},
label: field.fieldNameHumanized,
name: field.fieldName,
type: field.fieldType,
Expand Down
8 changes: 7 additions & 1 deletion generators/base-application/support/prepare-relationship.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ function relationshipToReference(entity, relationship, pathPrefix = []) {
relationship,
owned: relationship.ownerSide,
collection,
doc: relationship.javaDoc,
doc: relationship.documentation,
get propertyJavadoc() {
return relationship.relationshipJavadoc;
},
get propertyApiDescription() {
return relationship.relationshipApiDescription;
},
name,
nameCapitalized: collection ? relationship.relationshipNameCapitalizedPlural : relationship.relationshipNameCapitalized,
get type() {
Expand Down
13 changes: 13 additions & 0 deletions generators/bootstrap-application-server/generator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
hibernateSnakeCase,
loadServerConfig,
loadDerivedServerConfig,
prepareRelationship,
} from '../server/support/index.mjs';
import { prepareField as prepareFieldForLiquibaseTemplates } from '../liquibase/support/index.mjs';
import { dockerPlaceholderGenerator, getDockerfileContainers } from '../docker/utils.mjs';
Expand Down Expand Up @@ -183,6 +184,18 @@ export default class BoostrapApplicationServer extends BaseApplicationGenerator
return this.preparingEachEntityField;
}

get preparingEachEntityRelationship() {
return this.asPreparingEachEntityRelationshipTaskGroup({
prepareRelationship({ entity, relationship }) {
prepareRelationship({ entity, relationship });
},
});
}

get [BaseApplicationGenerator.PREPARING_EACH_ENTITY_RELATIONSHIP]() {
return this.preparingEachEntityRelationship;
}

get postPreparingEachEntity() {
return this.asPostPreparingEachEntityTaskGroup({
processDerivedPrimaryKeyFields({ entity }) {
Expand Down
33 changes: 33 additions & 0 deletions generators/common/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,39 @@ export default class CommonGenerator extends BaseApplicationGenerator {
return this.delegateTasksToBlueprint(() => this.configuring);
}

get configuringEachEntity() {
return this.asConfiguringEachEntityTaskGroup({
migrateEntity({ entityConfig, entityStorage }) {
for (const field of entityConfig.fields) {
if (field.javadoc) {
field.documentation = field.javadoc;
delete field.javadoc;
}
if (field.fieldTypeJavadoc) {
field.fieldTypeDocumentation = field.fieldTypeJavadoc;
delete field.fieldTypeJavadoc;
}
}
for (const relationship of entityConfig.relationships) {
if (relationship.javadoc) {
relationship.documentation = relationship.javadoc;
delete relationship.javadoc;
}
}
if (entityConfig.javadoc) {
entityConfig.documentation = entityConfig.javadoc;
delete entityConfig.javadoc;
} else {
entityStorage.save();
}
},
});
}

get [BaseApplicationGenerator.CONFIGURING_EACH_ENTITY]() {
return this.asInitializingTaskGroup(this.delegateTasksToBlueprint(() => this.configuringEachEntity));
}

// Public API method used by the getter and also by Blueprints
get loading() {
return {
Expand Down
6 changes: 3 additions & 3 deletions generators/export-jdl/export-jdl.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const files = {
{
fieldName: 'countryId',
fieldType: 'Long',
javadoc: 'The country Id',
documentation: 'The country Id',
},
{
fieldName: 'countryName',
Expand Down Expand Up @@ -106,7 +106,7 @@ const files = {
},
{
fieldName: 'firstName',
javadoc: 'The firstname attribute.',
documentation: 'The firstname attribute.',
fieldType: 'String',
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@ const files = {
},
],
changelogDate: '20160926083805',
javadoc: 'The Employee entity.',
documentation: 'The Employee entity.',
entityTableName: 'emp',
dto: 'mapstruct',
pagination: 'infinite-scroll',
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_al.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<%for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_bg.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_bn.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_by.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_ca.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_cs.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_da.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_de.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
6 changes: 3 additions & 3 deletions generators/languages/templates/entity/i18n/entity_el.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ let helpBlocks = 0; %>
"detail": {
"title": "<%= entityClassHumanized %>"
}<% for (idx in fields) {
if (typeof fields[idx].javadoc !== 'undefined') ++helpBlocks; %>,
if (typeof fields[idx].documentation !== 'undefined') ++helpBlocks; %>,
"<%= fields[idx].fieldName %>": "<%= fields[idx].fieldNameHumanized %>"<% } %><% for (idx in relationships) { %>,
"<%= relationships[idx].relationshipName %>": "<%= relationships[idx].relationshipNameHumanized %>"<% } if (helpBlocks > 0) { %>,
"help": {<% for (idx in fields) {
if (fields[idx].javadoc) {
if (fields[idx].documentation) {
--helpBlocks; %>
"<%= fields[idx].fieldName %>": "<%= fields[idx].javadoc %>"<% if (helpBlocks > 0) { %>,<% }
"<%= fields[idx].fieldName %>": "<%= fields[idx].documentation %>"<% if (helpBlocks > 0) { %>,<% }
}
} %>
}<% } %>
Expand Down
4 changes: 2 additions & 2 deletions generators/languages/templates/entity/i18n/entity_en.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
,
"<%= relationship.relationshipName %>": "<%= relationship.relationshipNameHumanized %>"
<%_ } -%>
<%_ const fieldsWithDoc = fields.filter(field => field.javadoc); -%>
<%_ const fieldsWithDoc = fields.filter(field => field.documentation); -%>
<%_ if (fieldsWithDoc.length > 0) { -%>
<%_ const lastField = fieldsWithDoc[fieldsWithDoc.length - 1]; -%>
,
"help": {
<%_ for (const field of fieldsWithDoc) { _%>
"<%= field.fieldName %>": "<%= field.javadoc %>"<% if (field !== lastField) { %>,<% } %>
"<%= field.fieldName %>": "<%= field.documentation %>"<% if (field !== lastField) { %>,<% } %>
<%_ } _%>
}
<%_ } _%>
Expand Down
Loading

0 comments on commit 6db62a4

Please sign in to comment.