Skip to content

Commit

Permalink
Release build 7.4.0 [ci release]
Browse files Browse the repository at this point in the history
  • Loading branch information
mgurgel authored and github-actions[bot] committed Dec 6, 2024
1 parent 50bd30a commit 022c845
Show file tree
Hide file tree
Showing 35 changed files with 473 additions and 159 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Toggle Report translations + minor fixes (#253)
- Malware status support and design updates - macOS (#250)
- Adds schema folder to NPM package (#254)
5 changes: 0 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,5 @@ let package = Package(
.copy("app/img"),
.copy ("app/public"),
.copy ("app/index.html")]),

.testTarget(
name: "PrivacyDashboardTests",
dependencies: ["PrivacyDashboardResources"],
path: "swift-package/Tests"),
]
)
35 changes: 35 additions & 0 deletions build/app/public/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -3928,6 +3928,41 @@ body.environment--macos, body.environment--browser, body.environment--windows, b
background: rgba(57, 105, 239, 0.2);
color: var(--color-accent-blue-active);
}
.button[data-variant=standard] {
text-align: center;
padding: 10px 12px;
cursor: pointer;
display: block;
text-decoration: none;
width: 100%;
box-shadow: var(--btn-accent-shadow);
border-radius: var(--btn-accent-border-radius);
border: var(--btn-accent-border);
color: var(--btn-accent-color);
background: var(--btn-accent-bg);
}
.button[data-variant=standard]:hover {
background: var(--btn-accent-bg-hover);
}
.button[data-variant=standard]:active {
background: var(--btn-accent-bg-active);
}
.environment--windows .button[data-variant=standard] {
/* Windows/Label */
box-shadow: none;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 19px;
border-radius: 4px;
}
.environment--windows .button[data-variant=standard]:focus {
/* todo(Shane): where does this live? */
box-shadow: 0px 0px 0px 1px #ffffff, 0px 0px 0px 3px #3969ef;
}
.environment--windows .button[data-variant=standard]:active {
box-shadow: none;
}

.button-bar[data-layout=horizontal] {
display: grid;
Expand Down
133 changes: 94 additions & 39 deletions build/app/public/js/base.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions integration-tests/DashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ export class DashboardPage {
await page.locator('[data-page="connection"]').getByText(text).waitFor();
}

async clickReportAsSafeLink() {
const { page } = this;
await page.getByRole('link', { name: 'Report site as safe' }).click();
}

async clickHelpPageLink() {
const { page } = this;
await page.getByRole('link', { name: 'About our phishing and malware protection' }).click();
}

async hasPhishingIcon() {
const { page } = this;
await expect(page.locator('#key-insight div').nth(1)).toHaveClass(/hero-icon--phishing/);
Expand All @@ -189,6 +199,28 @@ export class DashboardPage {
await expect(page.locator('#main-nav div')).toContainText('Site May Be Deceptive');
}

async hasMalwareIcon() {
const { page } = this;
await expect(page.locator('#key-insight div').nth(1)).toHaveClass(/hero-icon--phishing/);
}

async hasMalwareHeadingText() {
const { page } = this;
await expect(page.getByRole('heading', { name: 'privacy-test-pages.site' })).toBeVisible();
}

async hasMalwareWarningText() {
const { page } = this;
await expect(page.locator('#popup-container')).toContainText(
'This site has been flagged for distributing malware designed to compromise your device or steal your personal information.'
);
}

async hasMalwareStatusText() {
const { page } = this;
await expect(page.locator('#main-nav div')).toContainText('Site May Be Deceptive');
}

async connectionLinkDoesntShow() {
await expect(this.connectInfoLink()).not.toBeVisible();
}
Expand Down
33 changes: 17 additions & 16 deletions integration-tests/Mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,30 +347,31 @@ export class Mocks {
}

async calledForAboutLink() {
return this.calledForOpenURLInNewTab('https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/');
}

async calledForHelpPagesLink() {
return this.calledForOpenURLInNewTab('https://duckduckgo.com/duckduckgo-help-pages/privacy/phishing-and-malware-protection/');
}

async calledForReportAsSafeLink(urlParam) {
const url = new URL('https://duckduckgo.com/malicious-site-protection/report-error');
url.searchParams.set('url', urlParam);

return this.calledForOpenURLInNewTab(url.toString());
}

async calledForOpenURLInNewTab(url) {
if (this.platform.name === 'android') {
const calls = await this.outgoing({ names: ['openInNewTab'] });
expect(calls).toMatchObject([
[
'openInNewTab',
JSON.stringify({
url: 'https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/',
}),
],
]);
expect(calls).toMatchObject([['openInNewTab', JSON.stringify({ url })]]);
return;
}
if (this.platform.name === 'macos' || this.platform.name === 'ios') {
const calls = await this.outgoing({
names: ['privacyDashboardOpenUrlInNewTab'],
});
expect(calls).toMatchObject([
[
'privacyDashboardOpenUrlInNewTab',
{
url: 'https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/',
},
],
]);
expect(calls).toMatchObject([['privacyDashboardOpenUrlInNewTab', { url }]]);
return;
}
throw new Error('unreachable. mockCalledForAboutLink must be handled');
Expand Down
50 changes: 40 additions & 10 deletions integration-tests/macos.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,46 @@ test('invalid/missing certificate', { tag: '@screenshots' }, async ({ page }) =>
await dash.showsInvalidCertDetail();
});

test('phishing warning', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { platform: 'macos' });
await dash.addState([testDataStates.phishing]);
await dash.screenshot('phishing-warning.png');
await dash.hasPhishingIcon();
await dash.hasPhishingHeadingText();
await dash.hasPhishingWarningText();
await dash.hasPhishingStatusText();
await dash.connectionLinkDoesntShow();
test.describe('phishing & malware protection', () => {
test('phishing warning', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { platform: 'macos' });
await dash.addState([testDataStates.phishing]);
await dash.screenshot('phishing-warning.png');
await dash.hasPhishingIcon();
await dash.hasPhishingHeadingText();
await dash.hasPhishingWarningText();
await dash.hasPhishingStatusText();
await dash.connectionLinkDoesntShow();
});

test('malware warning', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { platform: 'macos' });
await dash.addState([testDataStates.malware]);
await dash.screenshot('malware-warning.png');
await dash.hasMalwareIcon();
await dash.hasMalwareHeadingText();
await dash.hasMalwareWarningText();
await dash.hasMalwareStatusText();
await dash.connectionLinkDoesntShow();
});

test('shows report as safe link', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { platform: 'macos' });
await dash.addState([testDataStates.malware]);
await dash.clickReportAsSafeLink();
await dash.mocks.calledForReportAsSafeLink('https://privacy-test-pages.site/security/badware/malware.html');
});

test('shows help page link', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { platform: 'macos' });
await dash.addState([testDataStates.malware]);
await dash.clickHelpPageLink();
await dash.mocks.calledForHelpPagesLink();
});
});

test('insecure certificate', async ({ page }) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"node": ">=22.0.0",
"npm": ">=9.0.0"
},
"version": "7.3.2",
"files": [
"build"
"build",
"schema/__**/*"
],
"scripts": {
"start": "npm run dev",
Expand Down
6 changes: 3 additions & 3 deletions schema/__generated__/schema.parsers.mjs

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

10 changes: 5 additions & 5 deletions schema/__generated__/schema.types.ts

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

4 changes: 2 additions & 2 deletions schema/get-privacy-dashboard-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"localeSettings": {
"$ref": "./locale.json"
},
"phishingStatus": {
"$ref": "./phishing.json"
"maliciousSiteStatus": {
"$ref": "./malicious-site.json"
},
"parentEntity": { "$ref": "./parent-entity.json" },
"specialDomainName": {
Expand Down
14 changes: 14 additions & 0 deletions schema/malicious-site.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MaliciousSiteStatus",
"type": "object",
"description": "This describes the payload required to set the phishing & malware status",
"additionalProperties": false,
"required": ["kind"],
"properties": {
"kind": {
"description": "Kind of threat detected",
"enum": ["phishing", "malware", null]
}
}
}
6 changes: 6 additions & 0 deletions shared/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ export const httpsMessages = {
none: 'site:connectionNotSecure.title',
invalid: 'site:connectionNotSecureInvalidCertificate.title',
phishing: 'site:phishingWebsite.title',
malware: 'site:malwareWebsite.title',
};

export const duckDuckGoURLs = {
phishingAndMalwareHelpPage: 'https://duckduckgo.com/duckduckgo-help-pages/privacy/phishing-and-malware-protection/',
reportSiteAsSafeForm: 'https://duckduckgo.com/malicious-site-protection/report-error',
};
10 changes: 5 additions & 5 deletions shared/js/browser/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,19 @@ export function assert(condition, message = '') {
export function onChangeLocale(payload) {}

/**
* Sets the phishing status for a page. This is a required call.
* Sets the phishing & malware status for a page. This is a required call.
*
* Example Payload: see {@link "Generated Schema Definitions".PhishingStatus}
* Example Payload: see {@link "Generated Schema Definitions".MaliciousSiteStatus}
*
* ```json
* {
* "phishingStatus": true
* "kind": "phishing"
* }
* ```
*
* @param {import('../../../schema/__generated__/schema.types').PhishingStatus} payload
* @param {import('../../../schema/__generated__/schema.types').MaliciousSiteStatus} payload
*/
export function onChangePhishingStatus(payload) {}
export function onChangeMaliciousSiteStatus(payload) {}

/**
* Sets the Feature Settings
Expand Down
Loading

0 comments on commit 022c845

Please sign in to comment.