Skip to content

Commit

Permalink
link issue to todos
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Aug 5, 2024
1 parent 4acdd47 commit c79964d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2032,7 +2032,7 @@ function getOptions(

const shouldShowInvoiceRoom =
includeInvoiceRooms && ReportUtils.isInvoiceRoom(reportOption.item) && ReportUtils.isPolicyAdmin(reportOption.policyID ?? '', policies) && !reportOption.isArchivedRoom;
// TODO: Uncomment the following line when the invoices screen is ready
// TODO: Uncomment the following line when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
// && PolicyUtils.canSendInvoiceFromWorkspace(reportOption.policyID);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ function canSendInvoiceFromWorkspace(policyID: string | undefined): boolean {
/** Whether the user can send invoice */
function canSendInvoice(policies: OnyxCollection<Policy> | null): boolean {
return getActiveAdminWorkspaces(policies).length > 0;
// TODO: Uncomment the following line when the invoices screen is ready
// TODO: Uncomment the following line when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
// return getActiveAdminWorkspaces(policies).some((policy) => canSendInvoiceFromWorkspace(policy.id));
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6086,7 +6086,7 @@ function getMoneyRequestOptions(report: OnyxEntry<Report>, policy: OnyxEntry<Pol
}

if (isInvoiceRoom(report)) {
// TODO: Uncomment the following line when the invoices screen is ready
// TODO: Uncomment the following line when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
// if (PolicyUtils.canSendInvoiceFromWorkspace(policy?.id) && isPolicyAdmin(report?.policyID ?? '-1', allPolicies)) {
if (isPolicyAdmin(report?.policyID ?? '-1', allPolicies)) {
return [CONST.IOU.TYPE.INVOICE];
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function getPolicy(policyID: string | undefined): OnyxEntry<Policy> {
/**
* Returns a primary policy for the user
*/
// TODO: Use getInvoicePrimaryWorkspace when the invoices screen is ready
// TODO: Use getInvoicePrimaryWorkspace when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
function getPrimaryPolicy(activePolicyID?: OnyxEntry<string>): Policy | undefined {
const activeAdminWorkspaces = PolicyUtils.getActiveAdminWorkspaces(allPolicies);
const primaryPolicy: Policy | null | undefined = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID ?? '-1'}`];
Expand Down Expand Up @@ -2986,7 +2986,7 @@ function enablePolicyInvoices(policyID: string, enabled: boolean) {

API.write(WRITE_COMMANDS.ENABLE_POLICY_INVOICES, parameters, onyxData);

// TODO: Uncomment the following line when the invoices screen is ready
// TODO: Uncomment the following line when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
// if (enabled && getIsNarrowLayout()) {
// navigateWhenEnableFeature(policyID);
// }
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/request/MoneyRequestParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function MoneyRequestParticipantsSelector({participants = CONST.EMPTY_ARRAY, onF
];

if (iouType === CONST.IOU.TYPE.INVOICE) {
// TODO: Use getInvoicePrimaryWorkspace when the invoices screen is ready
// TODO: Use getInvoicePrimaryWorkspace when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
const policyID = option.item && ReportUtils.isInvoiceRoom(option.item) ? option.policyID : Policy.getPrimaryPolicy(activePolicyID)?.id;
newParticipants.push({
policyID,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/request/step/IOURequestStepSendFrom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function IOURequestStepSendFrom({route, transaction, allPolicies}: IOURequestSte

const workspaceOptions: WorkspaceListItem[] = useMemo(() => {
const availableWorkspaces = PolicyUtils.getActiveAdminWorkspaces(allPolicies);
// TODO: Uncomment the following line when the invoices screen is ready
// TODO: Uncomment the following line when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
// .filter((policy) => PolicyUtils.canSendInvoiceFromWorkspace(policy.id));

return availableWorkspaces
Expand Down

0 comments on commit c79964d

Please sign in to comment.