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

Feature: Add insights card to RWS panel #141

Merged
merged 60 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7788f41
Adds FPS panel and info card
mayan-000 Aug 29, 2023
3cc4349
Merge branch 'develop' into feat/fps
mayan-000 Sep 6, 2023
1c98f2c
Merge branch 'develop' into feat/fps
mayan-000 Sep 7, 2023
e6d04dd
Add script to update RWS json from GH
mayan-000 Sep 8, 2023
6d78961
Update Button props
mayan-000 Sep 8, 2023
c787058
Add utils functions to get rws insights
mayan-000 Sep 8, 2023
94f4b51
Add Insights component
mayan-000 Sep 8, 2023
cbc4c80
Update RWS Panel with Insights
mayan-000 Sep 8, 2023
07ea5e1
Update colors
mayan-000 Sep 8, 2023
da875c7
Update type
mayan-000 Sep 8, 2023
870782f
Update testcase for checking insights util output
mayan-000 Sep 8, 2023
988a361
Update insights tests
mayan-000 Sep 8, 2023
21de754
Remove old component
mayan-000 Sep 8, 2023
4fe5c53
Add validation utils
mayan-000 Sep 8, 2023
7c124c2
Update types
mayan-000 Sep 8, 2023
c9175e4
Add rws specific dumy components
mayan-000 Sep 8, 2023
020aa6a
Add input elements for generator form
mayan-000 Sep 8, 2023
343b898
Add util function to generate form output
mayan-000 Sep 8, 2023
85ea45e
Add Form Output component
mayan-000 Sep 8, 2023
5d7ae7b
Integrate input and add rws json generator to panel
mayan-000 Sep 8, 2023
4f80bbc
Update testcases for form
mayan-000 Sep 11, 2023
9adcea3
Merge branch 'develop' into feat/rws-1
mayan-000 Sep 12, 2023
40c1d65
Update tests
mayan-000 Sep 12, 2023
8bbe01d
Merge branch 'feat/rws-1' into feat/rws-2
mayan-000 Sep 12, 2023
9a926b5
Updates UI and testcases
mayan-000 Sep 12, 2023
4e2d0a3
Update select component
mayan-000 Sep 12, 2023
18f7dba
Add icons for adding and removing
mayan-000 Sep 12, 2023
cfdc65c
Update UI
mayan-000 Sep 12, 2023
8c865a2
Add CTA to RWS repo pr url and pr form fork guide
mayan-000 Sep 12, 2023
e3b334e
UI changes
mayan-000 Sep 12, 2023
a502b58
Update UX for auto scroll and errors
mayan-000 Sep 12, 2023
7dbe14f
Add min width to form
mayan-000 Sep 12, 2023
f6bbe21
Remove fps file
mayan-000 Sep 12, 2023
30775c5
Update UI
mayan-000 Sep 14, 2023
9d44cc1
Update PS Info
mayan-000 Sep 14, 2023
ce06af7
Update UI
mayan-000 Sep 14, 2023
a02b5fe
Add custom hook for handling form
mayan-000 Sep 15, 2023
02f3880
Update form validation util
mayan-000 Sep 15, 2023
f502a1d
Integrate custom hook
mayan-000 Sep 15, 2023
6ffa3f4
Update tests and create reusable button for form
mayan-000 Sep 15, 2023
f6f17d8
Update tests
mayan-000 Sep 15, 2023
c916014
Update colors
mayan-000 Sep 15, 2023
20ee74e
Update prop var text
mayan-000 Sep 15, 2023
1656a94
Update colors
mayan-000 Sep 15, 2023
691d41f
Add titles
mayan-000 Sep 15, 2023
fd26e73
Merge branch 'develop' into feat/rws-1
mayan-000 Sep 15, 2023
a683332
Add title
mayan-000 Sep 15, 2023
a57d0ae
Make checking of tab url in json file reactive
mayan-000 Sep 18, 2023
6a5400e
Add new condition to stop unnecessary processing
mayan-000 Sep 18, 2023
7a7bc8b
Update tests
mayan-000 Sep 18, 2023
bfc8b0e
Add sites listing component for insights
mayan-000 Sep 18, 2023
eefb529
UI changes
mayan-000 Sep 19, 2023
892b7b8
Merge branch 'develop' into feat/rws-1
mayan-000 Sep 19, 2023
5be38a0
Merge branch 'feat/rws-1' into feat/rws-2
mayan-000 Sep 20, 2023
014cce7
Merge branch 'feat/rws-2' into feat/rws-3
mayan-000 Sep 20, 2023
7d9dec2
Merge pull request #148 from GoogleChromeLabs/feat/rws-3
Sep 24, 2023
a1cf9fe
Change file name to actions
mayan-000 Sep 25, 2023
b5990c4
Minor updates
mohdsayed Sep 25, 2023
641811a
Merge pull request #142 from GoogleChromeLabs/feat/rws-2
Sep 25, 2023
efe4f81
Merge develop and resolve conflicts
mohdsayed Sep 25, 2023
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
92 changes: 92 additions & 0 deletions data/related_website_sets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"sets": [
{
"contact": "dmarti@raptive.com",
"primary": "https://cafemedia.com",
"associatedSites": [
"https://cardsayings.net",
"https://nourishingpursuits.com"
],
"rationaleBySite": {
"https://cardsayings.net": "Co-branded content site",
"https://nourishingpursuits.com": "Co-branded content site"
}
},
{
"primary": "https://bild.de",
"contact": "robert.blanck@axelspringer.com",
"associatedSites": [
"https://welt.de",
"https://autobild.de",
"https://computerbild.de",
"https://wieistmeineip.de"
],
"serviceSites": [
"https://www.asadcdn.com"
],
"rationaleBySite": {
"https://welt.de": "News Website welt.de",
"https://autobild.de": "Special Interest Website Autobild",
"https://computerbild.de": "Special Interest Website Computerbild",
"https://wieistmeineip.de": "Internet speed Measurement Website of Computerbild",
"https://www.asadcdn.com": "CDN for Ad Files - Frequency Capping"
}
},
{
"primary": "https://gliadomain.com",
"contact": "carlos.paniagua@glia.com",
"associatedSites": [
"https://salemoveadvisor.com",
"https://salemovefinancial.com",
"https://salemovetravel.com"
],
"rationaleBySite": {
"https://salemoveadvisor.com": "The domains are very clear that they are all a part of the SaleMove family of sites. These sites are used as demo sites to show how multiple sites can be linked together for the purpose of live chat linking across multiple domains. A user would expect the sites to be linked as they are all a part of the same demo family of sites to show how it works",
"https://salemovefinancial.com": "The domains are very clear that they are all a part of the SaleMove family of sites. These sites are used as demo sites to show how multiple sites can be linked together for the purpose of live chat linking across multiple domains. A user would expect the sites to be linked as they are all a part of the same demo family of sites to show how it works",
"https://salemovetravel.com": "The domains are very clear that they are all a part of the SaleMove family of sites. These sites are used as demo sites to show how multiple sites can be linked together for the purpose of live chat linking across multiple domains. A user would expect the sites to be linked as they are all a part of the same demo family of sites to show how it works"
}
},
{
"primary": "https://hapara.com",
"contact": "support@hapara.com",
"associatedSites": [
"https://teacherdashboard.com",
"https://mystudentdashboard.com"
],
"rationaleBySite": {
"https://teacherdashboard.com": "Portal for Hapara teachers",
"https://mystudentdashboard.com": "Portal for Hapara students"
}
},
{
"contact": "support@songstats.com",
"primary": "https://songstats.com",
"associatedSites": [
"https://songshare.com"
],
"rationaleBySite": {
"https://songshare.com": "Specialized Platform for Music Smart Links"
}
},
{
"contact": "prashant.tiwari@htdigital.in",
"primary": "https://hindustantimes.com",
"associatedSites": [
"https://livemint.com"
],
"rationaleBySite": {
"https://livemint.com": "Specialized Platform for economics"
}
},
{
"contact": "alexey@landyrev.com",
"primary": "https://landyrev.com",
"associatedSites": [
"https://landyrev.ru"
],
"rationaleBySite": {
"https://landyrev.ru": "Same publisher's website in a different region"
}
}
]
}
83 changes: 83 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"lint:js:fix": "eslint --fix .",
"prepare": "husky install",
"cookie-db:update": "node scripts/update-cookie-db.cjs",
"rws-json:update": "node scripts/update-rws-json.cjs",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,35 @@
/**
* External dependencies.
*/
import classNames from 'classnames';
import React from 'react';

interface ButtonProps {
text: string;
onClick: () => void;
onClick?: () => void;
loading?: boolean;
type?: 'button' | 'submit' | 'reset';
variant?: 'primary' | 'secondary' | 'danger';
}
const Button = ({ onClick, text }: ButtonProps) => {
const Button = ({
text,
onClick = undefined,
type = 'button',
variant = 'primary',
}: ButtonProps) => {
return (
<button
data-test-id="button"
onClick={onClick}
className="py-1 px-2 text-white dark:text-jet-black dark:bg-light-blue bg-dark-blue rounded font-medium"
type={type}
onClick={onClick ? onClick : undefined}
className={classNames('py-1 px-2 rounded font-medium', {
'text-white dark:bg-absolute-zero-crayola bg-absolute-zero-crayola hover:bg-ocean-boat-blue':
variant === 'primary',
'bg-transparent dark:bg-transparent dark:text-bright-gray text-raisin-black':
variant === 'secondary',
'text-white dark:text-white dark:bg-red-500 bg-red-500':
variant === 'danger',
})}
>
{text}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const LearnMoreDropdown = ({
)}
<div className="flex items-center justify-start pt-4 border-t border-gray-200 dark:border-gray-500">
<button
className="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700"
className="inline-flex items-center px-3 py-2 text-sm font-medium text-center rounded-lg dark:hover:bg-blue-700 text-white dark:bg-absolute-zero-crayola bg-absolute-zero-crayola hover:bg-ocean-boat-blue"
onClick={() => {
setIsOpen(!isOpen);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,40 @@
/**
* External dependencies.
*/
import React from 'react';
import React, { useState } from 'react';

/**
* Internal dependencies.
*/
import InfoCard from '../../../../design-system/components/infoCard';
import { PSInfoKey } from '../../../../../utils/fetchPSInfo';
import { MessageBox } from '../../../../design-system/components';
import { Button } from '../../../../design-system/components';
import Insights from './insights';

const RelatedWebsiteSets = () => {
const [showForm, setShowForm] = useState(false);

return (
<div
className="w-full h-full overflow-auto"
data-testid="related-website-sets-content"
>
<InfoCard infoKey={PSInfoKey.RelatedWebsiteSets} />
<MessageBox
bodyText="Insights and a JSON generator for RWS registration are coming soon..."
headerText="🚧 Under Construction"
/>
{showForm ? (
<>Placeholder</>
) : (
<>
<InfoCard infoKey={PSInfoKey.RelatedWebsiteSets} />
<div className="text-raisin-black dark:text-bright-gray max-w-2xl dark:bg-davys-grey border border-gray-200 dark:border-quartz rounded-lg shadow p-6 m-3 flex flex-col gap-4 divide-y divide-gray-200 dark:divide-gray-500">
<Insights />
<div className="pt-3">
<Button
text="Generate RWS JSON Resources"
onClick={() => setShowForm(!showForm)}
/>
</div>
</div>
</>
)}
</div>
);
};
Expand Down
Loading
Loading