Skip to content

Commit

Permalink
fix: reorder state for badge text and field value
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpascual authored and awinberg-aws committed Aug 18, 2023
1 parent 604e0e9 commit e17d8b5
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1691,17 +1691,17 @@ export default function MyMemberForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.teamID(
selectedTeamIDRecords.find((r) => r.id === value) ??
teamIDRecords.find((r) => r.id === value)
teamIDRecords.find((r) => r.id === value) ??
selectedTeamIDRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentTeamIDDisplayValue(
value
? getDisplayValue.teamID(
selectedTeamIDRecords.find((r) => r.id === value) ??
teamIDRecords.find((r) => r.id === value)
teamIDRecords.find((r) => r.id === value) ??
selectedTeamIDRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down Expand Up @@ -4006,17 +4006,17 @@ export default function CommentCreateForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentPostIDDisplayValue(
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down Expand Up @@ -9605,17 +9605,17 @@ export default function CommentUpdateForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentPostIDDisplayValue(
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down Expand Up @@ -10338,17 +10338,17 @@ export default function CommentUpdateForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentPostIDDisplayValue(
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down Expand Up @@ -10994,17 +10994,17 @@ export default function CommentUpdateForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentPostIDDisplayValue(
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down Expand Up @@ -13861,11 +13861,11 @@ export default function CreateCompositeToyForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.compositeDogCompositeToysName(
selectedCompositeDogCompositeToysNameRecords.find(
(r) => r.id === value
compositeDogCompositeToysNameRecords.find(
(r) => r.name === value
) ??
compositeDogCompositeToysNameRecords.find(
(r) => r.name === value
selectedCompositeDogCompositeToysNameRecords.find(
(r) => r.id === value
)
)
: \\"\\"
Expand All @@ -13874,11 +13874,11 @@ export default function CreateCompositeToyForm(props) {
setCurrentCompositeDogCompositeToysNameDisplayValue(
value
? getDisplayValue.compositeDogCompositeToysName(
selectedCompositeDogCompositeToysNameRecords.find(
(r) => r.id === value
compositeDogCompositeToysNameRecords.find(
(r) => r.name === value
) ??
compositeDogCompositeToysNameRecords.find(
(r) => r.name === value
selectedCompositeDogCompositeToysNameRecords.find(
(r) => r.id === value
)
)
: \\"\\"
Expand Down Expand Up @@ -13977,11 +13977,11 @@ export default function CreateCompositeToyForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.compositeDogCompositeToysDescription(
selectedCompositeDogCompositeToysDescriptionRecords.find(
(r) => r.id === value
compositeDogCompositeToysDescriptionRecords.find(
(r) => r.description === value
) ??
compositeDogCompositeToysDescriptionRecords.find(
(r) => r.description === value
selectedCompositeDogCompositeToysDescriptionRecords.find(
(r) => r.id === value
)
)
: \\"\\"
Expand All @@ -13990,11 +13990,11 @@ export default function CreateCompositeToyForm(props) {
setCurrentCompositeDogCompositeToysDescriptionDisplayValue(
value
? getDisplayValue.compositeDogCompositeToysDescription(
selectedCompositeDogCompositeToysDescriptionRecords.find(
(r) => r.id === value
compositeDogCompositeToysDescriptionRecords.find(
(r) => r.description === value
) ??
compositeDogCompositeToysDescriptionRecords.find(
(r) => r.description === value
selectedCompositeDogCompositeToysDescriptionRecords.find(
(r) => r.id === value
)
)
: \\"\\"
Expand Down Expand Up @@ -14936,17 +14936,17 @@ export default function CreateCommentForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.postCommentsId(
selectedPostCommentsIdRecords.find((r) => r.id === value) ??
postCommentsIdRecords.find((r) => r.id === value)
postCommentsIdRecords.find((r) => r.id === value) ??
selectedPostCommentsIdRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentPostCommentsIdDisplayValue(
value
? getDisplayValue.postCommentsId(
selectedPostCommentsIdRecords.find((r) => r.id === value) ??
postCommentsIdRecords.find((r) => r.id === value)
postCommentsIdRecords.find((r) => r.id === value) ??
selectedPostCommentsIdRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down Expand Up @@ -17790,11 +17790,11 @@ export default function ChildItemUpdateForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.customKeyModelChildrenMycustomkey(
selectedCustomKeyModelChildrenMycustomkeyRecords.find(
(r) => r.id === value
customKeyModelChildrenMycustomkeyRecords.find(
(r) => r.mycustomkey === value
) ??
customKeyModelChildrenMycustomkeyRecords.find(
(r) => r.mycustomkey === value
selectedCustomKeyModelChildrenMycustomkeyRecords.find(
(r) => r.id === value
)
)
: \\"\\"
Expand All @@ -17803,11 +17803,11 @@ export default function ChildItemUpdateForm(props) {
setCurrentCustomKeyModelChildrenMycustomkeyDisplayValue(
value
? getDisplayValue.customKeyModelChildrenMycustomkey(
selectedCustomKeyModelChildrenMycustomkeyRecords.find(
(r) => r.id === value
customKeyModelChildrenMycustomkeyRecords.find(
(r) => r.mycustomkey === value
) ??
customKeyModelChildrenMycustomkeyRecords.find(
(r) => r.mycustomkey === value
selectedCustomKeyModelChildrenMycustomkeyRecords.find(
(r) => r.id === value
)
)
: \\"\\"
Expand Down Expand Up @@ -20194,17 +20194,17 @@ export default function CommentUpdateForm(props) {
getBadgeText={(value) =>
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
}
setFieldValue={(value) => {
setCurrentPostIDDisplayValue(
value
? getDisplayValue.postID(
selectedPostIDRecords.find((r) => r.id === value) ??
postIDRecords.find((r) => r.id === value)
postIDRecords.find((r) => r.id === value) ??
selectedPostIDRecords.find((r) => r.id === value)
)
: \\"\\"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function getDisplayValueScalar(fieldName: string, model: string, key: str
? factory.createBinaryExpression(
factory.createCallExpression(
factory.createPropertyAccessExpression(
factory.createIdentifier(`selected${capitalizeFirstLetter(fieldName)}Records`),
factory.createIdentifier(getRecordsName(model)),
factory.createIdentifier('find'),
),
undefined,
Expand All @@ -108,15 +108,14 @@ export function getDisplayValueScalar(fieldName: string, model: string, key: str
factory.createIdentifier(recordString),
undefined,
undefined,
undefined,
),
],
undefined,
factory.createToken(SyntaxKind.EqualsGreaterThanToken),
factory.createBinaryExpression(
factory.createPropertyAccessExpression(
factory.createIdentifier(recordString),
factory.createIdentifier('id'),
factory.createIdentifier(key),
),
factory.createToken(SyntaxKind.EqualsEqualsEqualsToken),
factory.createIdentifier('value'),
Expand All @@ -127,7 +126,7 @@ export function getDisplayValueScalar(fieldName: string, model: string, key: str
factory.createToken(SyntaxKind.QuestionQuestionToken),
factory.createCallExpression(
factory.createPropertyAccessExpression(
factory.createIdentifier(getRecordsName(model)),
factory.createIdentifier(`selected${capitalizeFirstLetter(fieldName)}Records`),
factory.createIdentifier('find'),
),
undefined,
Expand All @@ -143,14 +142,15 @@ export function getDisplayValueScalar(fieldName: string, model: string, key: str
factory.createIdentifier(recordString),
undefined,
undefined,
undefined,
),
],
undefined,
factory.createToken(SyntaxKind.EqualsGreaterThanToken),
factory.createBinaryExpression(
factory.createPropertyAccessExpression(
factory.createIdentifier(recordString),
factory.createIdentifier(key),
factory.createIdentifier('id'),
),
factory.createToken(SyntaxKind.EqualsEqualsEqualsToken),
factory.createIdentifier('value'),
Expand Down

0 comments on commit e17d8b5

Please sign in to comment.