Skip to content

Commit

Permalink
Merge pull request #34225 from DylanDylann/fix/31944
Browse files Browse the repository at this point in the history
[TS migration] Migrate 'WorkspaceList' page to TypeScript
  • Loading branch information
Julesssss authored Jan 22, 2024
2 parents 476d3cb + ae2acc7 commit b542031
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 234 deletions.
1 change: 1 addition & 0 deletions src/components/OfflineWithFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ function OfflineWithFeedback({
OfflineWithFeedback.displayName = 'OfflineWithFeedback';

export default OfflineWithFeedback;
export type {OfflineWithFeedbackProps};
5 changes: 3 additions & 2 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Str from 'expensify-common/lib/str';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PersonalDetailsList, Policy, PolicyMembers, PolicyTag, PolicyTags} from '@src/types/onyx';
Expand Down Expand Up @@ -72,12 +73,12 @@ function getUnitRateValue(customUnitRate: UnitRate, toLocaleDigit: (arg: string)
/**
* Get the brick road indicator status for a policy. The policy has an error status if there is a policy member error, a custom unit error or a field error.
*/
function getPolicyBrickRoadIndicatorStatus(policy: OnyxEntry<Policy>, policyMembersCollection: OnyxCollection<PolicyMembers>): string {
function getPolicyBrickRoadIndicatorStatus(policy: OnyxEntry<Policy>, policyMembersCollection: OnyxCollection<PolicyMembers>): ValueOf<typeof CONST.BRICK_ROAD_INDICATOR_STATUS> | undefined {
const policyMembers = policyMembersCollection?.[`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policy?.id}`] ?? {};
if (hasPolicyMemberError(policyMembers) || hasCustomUnitsError(policy) || hasPolicyErrorFields(policy)) {
return CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
}
return '';
return undefined;
}

/**
Expand Down
232 changes: 0 additions & 232 deletions src/pages/workspace/WorkspacesListPage.js

This file was deleted.

Loading

0 comments on commit b542031

Please sign in to comment.