Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c166b8e
Remove feature toggle for policy violations in Synchronize_Publicatio…
hussain-t Mar 4, 2026
e063107
Refactor SettingsTest to remove rrmPolicyViolations feature flag.
hussain-t Mar 4, 2026
d642372
Refactor Reader_Revenue_ManagerTest to remove rrmPolicyViolations fea…
hussain-t Mar 4, 2026
249355a
Refactor Synchronize_Publication to remove feature flag for content p…
hussain-t Mar 4, 2026
bf2ffe3
Refactor Settings to eliminate feature flag for content policy status…
hussain-t Mar 4, 2026
7c29aad
Refactor Reader_Revenue_Manager to remove feature flag for policy vio…
hussain-t Mar 4, 2026
13a2bf7
Refactor Reader_Revenue_Manager settings tests to remove feature flag.
hussain-t Mar 4, 2026
d27d84f
Refactor Reader_Revenue_Manager settings to remove feature flag for c…
hussain-t Mar 4, 2026
fd27148
Remove rrmPolicyViolations feature flag from feature-flags.json.
hussain-t Mar 4, 2026
3e2e69e
Remove usage of rrmPolicyViolations feature flag in publications test…
hussain-t Mar 4, 2026
02211d0
Refactor publications.js to eliminate rrmPolicyViolations feature flag.
hussain-t Mar 4, 2026
ed4562e
Remove rrmPolicyViolations feature flag in the base datastore.
hussain-t Mar 4, 2026
440678e
Remove rrmPolicyViolations feature flag from SettingsView stories.
hussain-t Mar 4, 2026
7a8d264
Remove rrmPolicyViolations feature flag from SettingsActiveModules st…
hussain-t Mar 4, 2026
d8c3a7e
Remove rrmPolicyViolations feature flag from SettingsEdit stories.
hussain-t Mar 4, 2026
bae394a
Remove rrmPolicyViolations feature flag from Reader Revenue Manager n…
hussain-t Mar 4, 2026
c34c203
Remove rrmPolicyViolations feature flag from SettingsForm component i…
hussain-t Mar 4, 2026
f638371
Remove rrmPolicyViolations feature flag from SettingsView component i…
hussain-t Mar 4, 2026
c75f26d
Add contentPolicyStatus to settings in SetupForm tests.
hussain-t Mar 4, 2026
15b54fd
Add contentPolicyStatus to settings in SetupMain tests.
hussain-t Mar 4, 2026
750aba3
Add contentPolicyState to debug fields in Reader Revenue Manager tests.
hussain-t Mar 4, 2026
26f7bac
Merge branch 'main' into enhancement/#12232-remove-rrmPolicyViolation…
hussain-t Mar 5, 2026
d10efe2
Remove dynamic imports in Reader Revenue Manager settings.
hussain-t Mar 5, 2026
3e69c1a
Imporve comments.
hussain-t Mar 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ WithRRMActionNeeded.args = {
} );
},
};
WithRRMActionNeeded.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithRRMActionNeeded.scenario = {};

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ MissingProductID.args = {
export const WithPolicyViolationPending = Template.bind( {} );
WithPolicyViolationPending.storyName = 'With Policy Violation (Pending)';
WithPolicyViolationPending.scenario = {};
WithPolicyViolationPending.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithPolicyViolationPending.args = {
setupRegistry: ( registry ) => {
setupPublicationsWithProduct( registry, 0, 'product-b' );
Expand All @@ -239,9 +236,6 @@ WithPolicyViolationPending.args = {
export const WithPolicyViolationActive = Template.bind( {} );
WithPolicyViolationActive.storyName = 'With Policy Violation (Active)';
WithPolicyViolationActive.scenario = {};
WithPolicyViolationActive.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithPolicyViolationActive.args = {
setupRegistry: ( registry ) => {
setupPublicationsWithProduct( registry, 0, 'product-b' );
Expand All @@ -259,9 +253,6 @@ WithPolicyViolationActive.args = {
export const WithPolicyViolationExtreme = Template.bind( {} );
WithPolicyViolationExtreme.storyName = 'With Policy Violation (Extreme)';
WithPolicyViolationExtreme.scenario = {};
WithPolicyViolationExtreme.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithPolicyViolationExtreme.args = {
setupRegistry: ( registry ) => {
setupPublicationsWithProduct( registry, 0, 'product-b' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
PublicationSelect,
SnippetModeSelect,
} from '@/js/modules/reader-revenue-manager/components/common';
import { useFeature } from '@/js/hooks/useFeature';
import ProductIDSettings from './ProductIDSettings';
import StoreErrorNotices from '@/js/components/StoreErrorNotices';
import { getProductIDLabel } from '@/js/modules/reader-revenue-manager/utils/settings';
Expand All @@ -45,8 +44,6 @@ import ErrorNotice from '@/js/components/ErrorNotice';
import Typography from '@/js/components/Typography';

export default function SettingsForm( { hasModuleAccess } ) {
const rrmPolicyViolationsEnabled = useFeature( 'rrmPolicyViolations' );

const publicationID = useSelect( ( select ) =>
select( MODULES_READER_REVENUE_MANAGER ).getPublicationID()
);
Expand Down Expand Up @@ -162,11 +159,9 @@ export default function SettingsForm( { hasModuleAccess } ) {
{ hasModuleAccess && publicationAvailable && (
<PublicationOnboardingStateNotice />
) }
{ hasModuleAccess &&
publicationAvailable &&
rrmPolicyViolationsEnabled && (
<PolicyViolationSettingsNotice />
) }
{ hasModuleAccess && publicationAvailable && (
<PolicyViolationSettingsNotice />
) }
{ ! hasModuleAccess && (
<Notice
className="googlesitekit-moduleaccess-warning-notice"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ import {
PolicyViolationSettingsNotice,
PublicationOnboardingStateNotice,
} from '@/js/modules/reader-revenue-manager/components/common';
import { useFeature } from '@/js/hooks/useFeature';
import Typography from '@/js/components/Typography';

export default function SettingsView() {
const rrmPolicyViolationsEnabled = useFeature( 'rrmPolicyViolations' );

const publicationID = useSelect( ( select ) =>
select( MODULES_READER_REVENUE_MANAGER ).getPublicationID()
);
Expand Down Expand Up @@ -138,9 +135,7 @@ export default function SettingsView() {
</div>

{ hasModuleAccess && <PublicationOnboardingStateNotice /> }
{ hasModuleAccess && rrmPolicyViolationsEnabled && (
<PolicyViolationSettingsNotice />
) }
{ hasModuleAccess && <PolicyViolationSettingsNotice /> }

<div className="googlesitekit-settings-module__meta-items">
<div className="googlesitekit-settings-module__meta-item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ WithoutModuleAccess.scenario = {};

export const WithPolicyViolationPending = Template.bind( {} );
WithPolicyViolationPending.storyName = 'With Policy Violation (Pending)';
WithPolicyViolationPending.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithPolicyViolationPending.args = {
contentPolicyState:
CONTENT_POLICY_STATES.CONTENT_POLICY_VIOLATION_GRACE_PERIOD,
Expand All @@ -124,19 +121,13 @@ WithPolicyViolationPending.scenario = {};

export const WithPolicyViolationActive = Template.bind( {} );
WithPolicyViolationActive.storyName = 'With Policy Violation (Active)';
WithPolicyViolationActive.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithPolicyViolationActive.args = {
contentPolicyState: CONTENT_POLICY_STATES.CONTENT_POLICY_VIOLATION_ACTIVE,
};
WithPolicyViolationActive.scenario = {};

export const WithPolicyViolationExtreme = Template.bind( {} );
WithPolicyViolationExtreme.storyName = 'With Policy Violation (Extreme)';
WithPolicyViolationExtreme.parameters = {
features: [ 'rrmPolicyViolations' ],
};
WithPolicyViolationExtreme.args = {
contentPolicyState:
CONTENT_POLICY_STATES.CONTENT_POLICY_ORGANIZATION_VIOLATION_ACTIVE_IMMEDIATE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe( 'SetupForm', () => {
.receiveGetSettings( {
snippetMode: 'post_types',
postTypes: [ 'post' ],
contentPolicyStatus: {},
} );
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe( 'SetupMain', () => {
.receiveGetSettings( {
snippetMode: 'post_types',
postTypes: [ 'post' ],
contentPolicyStatus: {},
} );
} );

Expand Down
5 changes: 1 addition & 4 deletions assets/js/modules/reader-revenue-manager/datastore/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import Modules from 'googlesitekit-modules';
import { MODULES_READER_REVENUE_MANAGER } from './constants';
import { MODULE_SLUG_READER_REVENUE_MANAGER } from '@/js/modules/reader-revenue-manager/constants';
import { submitChanges, validateCanSubmitChanges } from './settings';
import { isFeatureEnabled } from '@/js/features';

export default Modules.createModuleStore( MODULE_SLUG_READER_REVENUE_MANAGER, {
storeName: MODULES_READER_REVENUE_MANAGER,
submitChanges,
validateCanSubmitChanges,
ownedSettingsSlugs: [ 'publicationID' ],
settingSlugs: [
'contentPolicyStatus',
'ownerID',
'publicationID',
'publicationOnboardingState',
Expand All @@ -40,8 +40,5 @@ export default Modules.createModuleStore( MODULE_SLUG_READER_REVENUE_MANAGER, {
'productID',
'productIDs',
'paymentOption',
...( isFeatureEnabled( 'rrmPolicyViolations' )
? [ 'contentPolicyStatus' ]
: [] ),
],
} );
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
} from './constants';
import { MODULE_SLUG_READER_REVENUE_MANAGER } from '@/js/modules/reader-revenue-manager/constants';
import { actions as errorStoreActions } from '@/js/googlesitekit/data/create-error-store';
import { isFeatureEnabled } from '@/js/features';

const fetchGetPublicationsStore = createFetchStore( {
baseName: 'getPublications',
Expand Down Expand Up @@ -281,10 +280,7 @@ const baseActions = {

settings.productID = 'openaccess';

if (
isFeatureEnabled( 'rrmPolicyViolations' ) &&
contentPolicyStatus
) {
if ( contentPolicyStatus ) {
settings.contentPolicyStatus = contentPolicyStatus;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
provideModuleRegistrations,
muteFetch,
} from '../../../../../tests/js/utils';
import { setEnabledFeatures } from '../../../../../tests/js/test-utils';
import * as fixtures from './__fixtures__';
import {
MODULES_READER_REVENUE_MANAGER,
Expand Down Expand Up @@ -493,8 +492,6 @@ describe( 'modules/reader-revenue-manager publications', () => {
} );

it( 'should set `contentPolicyStatus` in state when provided', () => {
setEnabledFeatures( [ 'rrmPolicyViolations' ] );

const contentPolicyStatus = {
contentPolicyState: 'CONTENT_POLICY_VIOLATION_ACTIVE',
policyInfoLink: 'https://example.com/policy-info',
Expand All @@ -518,8 +515,6 @@ describe( 'modules/reader-revenue-manager publications', () => {
} );

it( 'should not set `contentPolicyStatus` when not provided', () => {
setEnabledFeatures( [ 'rrmPolicyViolations' ] );

registry
.dispatch( MODULES_READER_REVENUE_MANAGER )
.selectPublication( {
Expand Down
18 changes: 7 additions & 11 deletions assets/js/modules/reader-revenue-manager/datastore/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import {
isValidOnboardingState,
isValidSnippetMode,
} from '@/js/modules/reader-revenue-manager/utils/validation';
import { isFeatureEnabled } from '@/js/features';

// Invariant error messages.
export const INVARIANT_INVALID_PUBLICATION_ID =
'a valid publicationID is required';
Expand Down Expand Up @@ -128,16 +126,14 @@ export function validateCanSubmitChanges( select ) {
INVARIANT_INVALID_PAYMENT_OPTION
);

if ( isFeatureEnabled( 'rrmPolicyViolations' ) ) {
const contentPolicyStatus = strictSelect(
MODULES_READER_REVENUE_MANAGER
).getContentPolicyStatus();
const contentPolicyStatus = strictSelect(
MODULES_READER_REVENUE_MANAGER
).getContentPolicyStatus();

invariant(
isPlainObject( contentPolicyStatus ),
INVARIANT_INVALID_CONTENT_POLICY_STATUS
);
}
invariant(
isPlainObject( contentPolicyStatus ),
INVARIANT_INVALID_CONTENT_POLICY_STATUS
);
}

export async function submitChanges( { dispatch, select } ) {
Expand Down
Loading
Loading