Skip to content

Commit

Permalink
Merge pull request Expensify#49283 from Expensify/vit-removeWorkspace…
Browse files Browse the repository at this point in the history
…FeedsBeta

[NoQA] Remove workspace feeds beta
  • Loading branch information
madmax330 authored Oct 10, 2024
2 parents fb523d3 + fd6d4ad commit 8f5ba1e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ const CONST = {
P2P_DISTANCE_REQUESTS: 'p2pDistanceRequests',
SPOTNANA_TRAVEL: 'spotnanaTravel',
REPORT_FIELDS_FEATURE: 'reportFieldsFeature',
WORKSPACE_FEEDS: 'workspaceFeeds',
COMPANY_CARD_FEEDS: 'companyCardFeeds',
DIRECT_FEEDS: 'directFeeds',
NETSUITE_USA_TAX: 'netsuiteUsaTax',
Expand Down
5 changes: 0 additions & 5 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ function canUseSpotnanaTravel(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.SPOTNANA_TRAVEL) || canUseAllBetas(betas);
}

function canUseWorkspaceFeeds(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.WORKSPACE_FEEDS) || canUseAllBetas(betas);
}

function canUseCompanyCardFeeds(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.COMPANY_CARD_FEEDS) || canUseAllBetas(betas);
}
Expand Down Expand Up @@ -86,7 +82,6 @@ export default {
canUseDupeDetection,
canUseP2PDistanceRequests,
canUseSpotnanaTravel,
canUseWorkspaceFeeds,
canUseCompanyCardFeeds,
canUseDirectFeeds,
canUseNetSuiteUSATax,
Expand Down
12 changes: 4 additions & 8 deletions src/pages/workspace/WorkspaceMoreFeaturesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
const styles = useThemeStyles();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const {translate} = useLocalize();
const {canUseWorkspaceFeeds, canUseWorkspaceRules, canUseCompanyCardFeeds} = usePermissions();
const {canUseWorkspaceRules, canUseCompanyCardFeeds} = usePermissions();
const hasAccountingConnection = !isEmptyObject(policy?.connections);
const isAccountingEnabled = !!policy?.areConnectionsEnabled || !isEmptyObject(policy?.connections);
const isSyncTaxEnabled =
Expand Down Expand Up @@ -100,11 +100,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
DistanceRate.enablePolicyDistanceRates(policyID, isEnabled);
},
},
];

// TODO remove this when feature will be fully done, and move spend item inside spendItems array
if (canUseWorkspaceFeeds) {
spendItems.push({
{
icon: Illustrations.HandCard,
titleTranslationKey: 'workspace.moreFeatures.expensifyCard.title',
subtitleTranslationKey: 'workspace.moreFeatures.expensifyCard.subtitle',
Expand All @@ -120,8 +116,8 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
disabledAction: () => {
setIsDisableExpensifyCardWarningModalOpen(true);
},
});
}
},
];

if (canUseCompanyCardFeeds) {
spendItems.push({
Expand Down
5 changes: 2 additions & 3 deletions src/pages/workspace/accounting/PolicyAccountingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false);
const [datetimeToRelative, setDateTimeToRelative] = useState('');
const threeDotsMenuContainerRef = useRef<View>(null);
const {canUseWorkspaceFeeds, canUseNewDotQBD} = usePermissions();
const {canUseNewDotQBD} = usePermissions();
const {startIntegrationFlow, popoverAnchorRefs} = useAccountingContext();

const route = useRoute();
Expand Down Expand Up @@ -315,7 +315,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
},
];

if (!canUseWorkspaceFeeds || !policy?.areExpensifyCardsEnabled) {
if (!policy?.areExpensifyCardsEnabled) {
configurationOptions.splice(2, 1);
}

Expand Down Expand Up @@ -370,7 +370,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
styles.pb0,
styles.mt5,
styles.popoverMenuIcon,
canUseWorkspaceFeeds,
styles.justifyContentCenter,
connectionSyncProgress?.stageInProgress,
datetimeToRelative,
Expand Down

0 comments on commit 8f5ba1e

Please sign in to comment.