Skip to content

Commit

Permalink
Merge pull request Expensify#24021 from Expensify/youssef_display_con…
Browse files Browse the repository at this point in the history
…trol_workspaces

Display NVP-enabled Control policies in NewDot
  • Loading branch information
youssef-lr authored Aug 15, 2023
2 parents 82e4911 + 286f8c2 commit 3204802
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/PolicyUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ONYXKEYS from '../ONYXKEYS';
* @returns {Array}
*/
function getActivePolicies(policies) {
return _.filter(policies, (policy) => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
return _.filter(policies, (policy) => policy && policy.isPolicyExpenseChatEnabled && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
}

/**
Expand Down Expand Up @@ -86,7 +86,7 @@ function getPolicyBrickRoadIndicatorStatus(policy, policyMembersCollection) {
function shouldShowPolicy(policy, isOffline) {
return (
policy &&
policy.type === CONST.POLICY.TYPE.FREE &&
policy.isPolicyExpenseChatEnabled &&
policy.role === CONST.POLICY.ROLE.ADMIN &&
(isOffline || policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || !_.isEmpty(policy.errors))
);
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ function createWorkspace(policyOwnerEmail = '', makeMeAdmin = false, policyName
name: workspaceName,
role: CONST.POLICY.ROLE.ADMIN,
owner: sessionEmail,
isPolicyExpenseChatEnabled: true,
outputCurrency: lodashGet(allPersonalDetails, [sessionAccountID, 'localCurrencyCode'], CONST.CURRENCY.USD),
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
customUnits,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const policySelector = (policy) =>
policy && {
type: policy.type,
role: policy.role,
isPolicyExpenseChatEnabled: policy.isPolicyExpenseChatEnabled,
pendingAction: policy.pendingAction,
};

Expand Down

0 comments on commit 3204802

Please sign in to comment.