Skip to content

Commit 0ba936d

Browse files
committed
Address blimpich review nits for tag GL codes PR
Remove unnecessary comments, restore TagPicker blank line, and use inline eslint-disable for GL Code naming in the unit test.
1 parent 01fc237 commit 0ba936d

5 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎src/components/Search/SearchList/ListItem/TransactionListItem/types.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ type TransactionListItemSharedProps<TItem extends ListItem> = {
3030
exportedReportActions: ReportAction[];
3131
policyCategories?: PolicyCategories;
3232
policyTagLists?: PolicyTagLists;
33-
/** Policy fields merged from the row snapshot and live Onyx data. */
3433
rowPolicy?: Policy;
3534
nonPersonalAndWorkspaceCards?: CardList;
3635
isAttendeesEnabledForMovingPolicy?: boolean;

‎src/components/TagPicker/index.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ function TagPicker({
165165
data: option.data.sort((a, b) => localeCompare(a.text ?? '', b.text ?? '')),
166166
}))
167167
: tagSections;
168+
168169
const selectedOptionKey = sections.at(0)?.data?.find((policyTag) => policyTag.searchText === selectedTag)?.keyForList;
169170

170171
const textInputOptions = {

‎src/components/TransactionItemRow/DataCells/TagCell.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ function TagCell({canEdit, onSave, shouldUseNarrowLayout, shouldShowTooltip, tra
3131

3232
const [livePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
3333
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`);
34-
// Search rows can have policy fields that are absent from the live Onyx policy entry. Preserve those
35-
// snapshot fields while allowing newer live values (including optimistic toggle updates) to win.
3634
const policy = livePolicy ? {...policyProp, ...livePolicy} : policyProp;
3735

3836
const policyHasDependentTags = hasDependentTags(policy, policyTags);

‎src/libs/TagsOptionsListUtils.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ function getTagListSections({
102102
}) {
103103
const tagSections = [];
104104
const sortedTags = sortTags(tags, localeCompare);
105-
// O(1) lookup for selected/recent shims that lack the PolicyTag GL Code field.
106105
const tagByName = new Map(sortedTags.map((tag) => [tag.name, tag]));
107106
const withGLCode = (tag: SelectedTagOption | PolicyTag): TagOptionInput => {
108107
if (!shouldShowGLCode) {

‎tests/unit/TagsOptionsListUtilsTest.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,12 +959,11 @@ describe('TagsOptionsListUtils', () => {
959959
});
960960

961961
describe('getTagListSections GL code display', () => {
962-
/* eslint-disable @typescript-eslint/naming-convention -- PolicyTag GL Code field uses backend naming */
962+
// eslint-disable-next-line @typescript-eslint/naming-convention -- PolicyTag GL Code field uses backend naming
963963
const tagsWithGLCode: Record<string, {name: string; enabled: boolean; 'GL Code'?: string}> = {
964-
ProjectA: {name: 'Project A', enabled: true, 'GL Code': 'SP4100'},
964+
ProjectA: {name: 'Project A', enabled: true, 'GL Code': 'SP4100'}, // eslint-disable-line @typescript-eslint/naming-convention
965965
ProjectB: {name: 'Project B', enabled: true},
966966
};
967-
/* eslint-enable @typescript-eslint/naming-convention */
968967

969968
it('sets alternateText when shouldShowGLCode is true and tag has a GL code', () => {
970969
const result = getTagListSections({

0 commit comments

Comments
 (0)