Skip to content

Commit

Permalink
Remove areChatRoomsEnabled checks
Browse files Browse the repository at this point in the history
  • Loading branch information
iwiznia committed Jan 5, 2024
1 parent ae4245e commit de0a96b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ type UnitRate = {rate: number};
* These are policies that we can use to create reports with in NewDot.
*/
function getActivePolicies(policies: OnyxCollection<Policy>): Policy[] | undefined {
return Object.values(policies ?? {}).filter<Policy>(
(policy): policy is Policy =>
policy !== null && policy && (policy.isPolicyExpenseChatEnabled || policy.areChatRoomsEnabled) && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
return Object.values(policies ?? {}).filter<Policy>((policy): policy is Policy => policy !== null && policy && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ type Policy = {
/** The custom units data for this policy */
customUnits?: Record<string, CustomUnit>;

/** Whether chat rooms can be created and used on this policy. Enabled manually by CQ/JS snippet. Always true for free policies. */
areChatRoomsEnabled: boolean;

/** Whether policy expense chats can be created and used on this policy. Enabled manually by CQ/JS snippet. Always true for free policies. */
isPolicyExpenseChatEnabled: boolean;

Expand Down
1 change: 0 additions & 1 deletion tests/utils/LHNTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ function getFakePolicy(id = 1, name = 'Workspace-Test-001') {
avatar: '',
employeeList: [],
isPolicyExpenseChatEnabled: true,
areChatRoomsEnabled: true,
lastModified: 1697323926777105,
autoReporting: true,
autoReportingFrequency: 'immediate',
Expand Down
1 change: 0 additions & 1 deletion tests/utils/collections/policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default function createRandomPolicy(index: number): Policy {
id: index.toString(),
name: randWord(),
type: rand(Object.values(CONST.POLICY.TYPE)),
areChatRoomsEnabled: randBoolean(),
autoReporting: randBoolean(),
isPolicyExpenseChatEnabled: randBoolean(),
autoReportingFrequency: rand(Object.values(CONST.POLICY.AUTO_REPORTING_FREQUENCIES)),
Expand Down

0 comments on commit de0a96b

Please sign in to comment.