Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/#8786 - Implement JS entry point for RRM #8948

Merged
merged 44 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
78579b3
Add Reader Revenue Manager Settings components.
hussain-t Jul 1, 2024
0dd60bd
Add Reader Revenue Manager module entrypoint.
hussain-t Jul 1, 2024
cb85d3f
Add Settings constants.
hussain-t Jul 1, 2024
2bebd7f
Add new badge for RRM in SetupModule.
hussain-t Jul 1, 2024
cb5cb2b
Add new badge for RRM in SettingsActiveModule Header.
hussain-t Jul 1, 2024
3c8bfdb
Add Reader Revenue Manager module initialization.
hussain-t Jul 1, 2024
35e600b
Add Reader Revenue Manager SettingsEdit component.
hussain-t Jul 1, 2024
5968db2
Add Reader Revenue Manager SettingsView component.
hussain-t Jul 1, 2024
cc32f18
Add Reader Revenue Manager SetupMain component.
hussain-t Jul 1, 2024
45a3be2
Add RRM base data store.
hussain-t Jul 1, 2024
2a9f3b4
Add RRM data store constants.
hussain-t Jul 1, 2024
e175967
Add RRM registerStore.
hussain-t Jul 1, 2024
e56ecf5
Add RRM setup_assets method.
hussain-t Jul 1, 2024
c64fd97
Add RRM settings datastore.
hussain-t Jul 1, 2024
74b9219
Add RRM Validation utilities..
hussain-t Jul 1, 2024
82c4cdb
Add RRM svg logo.
hussain-t Jul 1, 2024
b2a4e60
Add RRM module entry in webpack config.
hussain-t Jul 1, 2024
71cbe5a
Add Reader Revenue Manager Setup components.
hussain-t Jul 1, 2024
27c1822
Merge branch 'develop' into enhance/#8786-add-rrm-js-entry-point.
ankitrox Jul 2, 2024
d3b1623
Add rrm base data store tests.
hussain-t Jul 2, 2024
ef74274
Add rrm index test base.
hussain-t Jul 2, 2024
127dfaa
Merge branch 'enhance/#8786-add-rrm-js-entry-point' of github.com:goo…
hussain-t Jul 2, 2024
f941c7d
Add rrm settings test base file.
hussain-t Jul 2, 2024
c556ad5
Add Validation function tests.
hussain-t Jul 2, 2024
306e1a6
Add SettingsEdit storybook.
hussain-t Jul 2, 2024
d0c8886
Add SettingsEdit test file.
hussain-t Jul 2, 2024
712ed3d
Add SettingsView storybook.
hussain-t Jul 2, 2024
1653114
Add SettingsView test file.
hussain-t Jul 2, 2024
d1a9dde
Add SetupMain storybook.
hussain-t Jul 2, 2024
741087e
Add SetupMain test file.
hussain-t Jul 2, 2024
1640fd2
Add todo comment in the registerModule features.
hussain-t Jul 2, 2024
35ab985
Add modulesReaderRevenueManager in tests/js/utils.
hussain-t Jul 2, 2024
328ca75
Fix settings test.
hussain-t Jul 2, 2024
cbf8f7e
Order imports.
hussain-t Jul 2, 2024
2761f76
Improve isURLUsingHTTPS fn.
hussain-t Jul 2, 2024
861a464
Improve isURLUsingHTTPS tests.
hussain-t Jul 2, 2024
9143609
Ensure the site info is resolved to get the home URL.
hussain-t Jul 2, 2024
fff0ef4
Address review feedback.
hussain-t Jul 2, 2024
e1f755b
Update publication ID validation to match base64 characters.
hussain-t Jul 3, 2024
3fbfd99
Fix tests for the updated validation.
hussain-t Jul 3, 2024
361f573
Merge branch 'develop' into enhance/#8786-add-rrm-js-entry-point.
hussain-t Jul 3, 2024
c802cad
Improve isURLUsingHTTPS logic.
hussain-t Jul 3, 2024
0be6bd6
Improve isURLUsingHTTPS tests.
hussain-t Jul 3, 2024
180e164
Remove datastore-forms and modules-data from RRM assets.
hussain-t Jul 3, 2024
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
5 changes: 4 additions & 1 deletion assets/js/components/settings/SettingsActiveModule/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { useSelect } from 'googlesitekit-data';
import { Button } from 'googlesitekit-components';
import { CORE_MODULES } from '../../../googlesitekit/modules/datastore/constants';
import { EXPERIMENTAL_MODULES } from '../../dashboard-sharing/DashboardSharingSettings/constants';
import { NEW_MODULES } from '../constants';
import { Grid, Row, Cell } from '../../../material-components';
import { useKeyCodesInside } from '../../../hooks/useKeyCodesInside';
import ModuleIcon from '../../ModuleIcon';
Expand Down Expand Up @@ -180,7 +181,9 @@ export default function Header( { slug } ) {
hasLeftSpacing
/>
) }
{ slug === 'ads' && <NewBadge hasLeftSpacing /> }
{ NEW_MODULES.includes( slug ) && (
<NewBadge hasLeftSpacing />
) }
</div>
</Cell>

Expand Down
5 changes: 4 additions & 1 deletion assets/js/components/settings/SetupModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';
import { CORE_MODULES } from '../../googlesitekit/modules/datastore/constants';
import { CORE_LOCATION } from '../../googlesitekit/datastore/location/constants';
import { EXPERIMENTAL_MODULES } from '../dashboard-sharing/DashboardSharingSettings/constants';
import { NEW_MODULES } from './constants';
import { trackEvent } from '../../util';
import useViewContext from '../../hooks/useViewContext';

Expand Down Expand Up @@ -114,7 +115,9 @@ export default function SetupModule( { slug, name, description } ) {
label={ __( 'Experimental', 'google-site-kit' ) }
/>
) }
{ slug === 'ads' && <NewBadge hasNoSpacing /> }
{ NEW_MODULES.includes( slug ) && (
<NewBadge hasNoSpacing />
) }
</div>
</div>
<p className="googlesitekit-settings-connect-module__text">
Expand Down
19 changes: 19 additions & 0 deletions assets/js/components/settings/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Settings constants.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export const NEW_MODULES = [ 'ads', 'reader-revenue-manager' ];
30 changes: 30 additions & 0 deletions assets/js/googlesitekit-modules-reader-revenue-manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Reader Revenue Manager module entrypoint.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Internal dependencies
*/
import Data from 'googlesitekit-data';
import Modules from 'googlesitekit-modules';
import {
registerStore,
registerModule,
} from './modules/reader-revenue-manager';

registerStore( Data );
registerModule( Modules );
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Reader Revenue Manager SettingsEdit component.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

export default function SettingsEdit() {
return (
<div className="googlesitekit-setup-module googlesitekit-setup-module--thank-with-google">
<h2 className="googlesitekit-heading-3 googlesitekit-setup-module__title">
{ __(
'Reader Revenue Manager Settings Edit',
'google-site-kit'
) }
</h2>

{ /* TODO: Add the rest of the settings steps */ }
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Reader Revenue Manager SettingsEdit component stories.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Internal dependencies
*/
import SettingsEdit from './SettingsEdit';

function Template() {
return <SettingsEdit />;
}

export const Default = Template.bind( {} );
Default.storyName = 'Default';

export default {
title: 'Modules/ReaderRevenueManager/Settings/SettingsEdit',
component: SettingsEdit,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Reader Revenue Manager SettingsEdit component tests.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { render } from '../../../../../../tests/js/test-utils';
import SettingsEdit from './SettingsEdit';

describe( 'SettingsEdit', () => {
it( 'should render the component', () => {
const { getByText } = render( <SettingsEdit /> );

expect(
getByText( /Reader Revenue Manager Settings Edit/i )
).toBeInTheDocument();
} );
} );
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Reader Revenue Manager SettingsView component.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

export default function SettingsView() {
return (
<div className="googlesitekit-setup-module googlesitekit-setup-module--thank-with-google">
<h2 className="googlesitekit-heading-3 googlesitekit-setup-module__title">
{ __(
'Reader Revenue Manager Settings View',
'google-site-kit'
) }
</h2>

{ /* TODO: Add the rest of the settings steps */ }
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Reader Revenue Manager SettingsView component stories.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Internal dependencies
*/
import SettingsView from './SettingsView';

function Template() {
return <SettingsView />;
}

export const Default = Template.bind( {} );
Default.storyName = 'Default';

export default {
title: 'Modules/ReaderRevenueManager/Settings/SettingsView',
component: SettingsView,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Reader Revenue Manager SettingsView component tests.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { render } from '../../../../../../tests/js/test-utils';
import SettingsView from './SettingsView';

describe( 'SettingsView', () => {
it( 'should render the component', () => {
const { getByText } = render( <SettingsView /> );

expect(
getByText( /Reader Revenue Manager Settings View/i )
).toBeInTheDocument();
} );
} );
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Reader Revenue Manager Settings components.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export { default as SettingsEdit } from './SettingsEdit';
export { default as SettingsView } from './SettingsView';
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Reader Revenue Manager SetupMain component.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* WordPress dependencies
*/
import { _x } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import ReaderRevenueManagerIcon from '../../../../../svg/graphics/reader-revenue-manager.svg';

export default function SetupMain() {
return (
<div className="googlesitekit-setup-module googlesitekit-setup-module--reader-revenue-manager">
<div className="googlesitekit-setup-module__logo">
<ReaderRevenueManagerIcon width="33" height="33" />
</div>

<h2 className="googlesitekit-heading-3 googlesitekit-setup-module__title">
{ _x(
'Reader Revenue Manager',
'Service name',
'google-site-kit'
) }
</h2>

{ /* TODO: Add the rest of the setup steps */ }
</div>
);
}
Loading
Loading