-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: add type to mutateData #27932
Conversation
@@ -202,7 +202,7 @@ export default class AngularGenerator extends BaseApplicationGenerator { | |||
|
|||
return returnValue; | |||
}, | |||
}); | |||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't it as F
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's legit, any other comment of this PR should be ignored
@@ -152,7 +153,7 @@ export const loadDerivedAppConfig = ({ application }: { application: any }) => { | |||
|
|||
projectDescription: ({ projectDescription, baseName }) => projectDescription ?? `Description for ${baseName}`, | |||
endpointPrefix: ({ applicationType, lowercaseBaseName }) => (applicationType === 'microservice' ? `services/${lowercaseBaseName}` : ''), | |||
}); | |||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as ApplicationType?
@@ -285,7 +289,7 @@ export function derivedPrimaryKeyProperties(primaryKey) { | |||
typeLong: primaryKey.type === LONG, | |||
typeInteger: primaryKey.type === INTEGER, | |||
typeNumeric: !primaryKey.composite && primaryKey.fields[0].fieldTypeNumeric, | |||
}); | |||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as PK?
microserviceName: ({ builtIn }) => (!builtIn && config.applicationType === MICROSERVICE ? config.baseName : undefined), | ||
}); | ||
if (entity.searchEngine === true && (!entity.microserviceName || entity.microserviceName === config.baseName)) { | ||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as E?
@@ -647,7 +652,7 @@ function preparePostEntityCommonDerivedPropertiesNotTyped(entity: any) { | |||
entity.eagerLoad || | |||
// Fetch relationships if otherEntityField differs otherwise the id is enough | |||
(ownerSide && otherEntity.primaryKey.name !== otherEntityField)), | |||
}); | |||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as E
} | ||
|
||
mutateData(relationship, { | ||
__override__: false, | ||
columnDataType: data => data.otherEntity.columnType, | ||
columnRequired: data => data.nullable === false || data.relationshipRequired, | ||
liquibaseGenerateFakeData: data => data.columnRequired && data.persistableRelationship && !data.collection, | ||
}); | ||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relationship
@@ -161,7 +159,7 @@ export const loadDerivedServerConfig = ({ application }: { application: any }) = | |||
authenticationUsesCsrf: ({ authenticationType }) => [OAUTH2, SESSION].includes(authenticationType), | |||
imperativeOrReactive: ({ reactive }) => (reactive ? 'reactive' : 'imperative'), | |||
generateSpringAuditor: ctx => ctx.databaseTypeSql || ctx.databaseTypeMongodb || ctx.databaseTypeNeo4j || ctx.databaseTypeCouchbase, | |||
}); | |||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as ApplicationType
@@ -33,7 +34,7 @@ const { MapperTypes } = entityOptions; | |||
const { MAPSTRUCT } = MapperTypes; | |||
const { INTEGER, LONG, UUID } = CommonDBTypes; | |||
|
|||
export default function prepareField(entityWithConfig, field, generator) { | |||
export default function prepareField(entityWithConfig, field: Field & any, generator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduce ServerField type?
@@ -52,7 +53,7 @@ export default function prepareField(entityWithConfig, field, generator) { | |||
fieldJavadoc: formatDocAsJavaDoc(field.documentation, 4), | |||
fieldApiDescription: formatDocAsApiDescription(field.documentation), | |||
propertyApiDescription: ({ fieldApiDescription }) => fieldApiDescription, | |||
}); | |||
} as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServerField?
import { mutateData } from '../../../lib/utils/object.js'; | ||
import { formatDocAsApiDescription, formatDocAsJavaDoc } from '../../java/support/doc.js'; | ||
|
||
export function prepareRelationship({ relationship }: { relationship: any; entity: any }) { | ||
export function prepareRelationship({ relationship }: { relationship: Relationship; entity: any }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServerEntity?
@Tcharl sorry, did not see your reviews before I committed |
@Tcharl |
@DanielFran @mshima No problem! I even think I've made the review post merge. |
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.