Skip to content

Commit 8cdb491

Browse files
ergunshDevtools-frontend LUCI CQ
authored andcommitted
[GdpIntegration] Show the sign up dialog on createProfile click
* Drive-by: Move the view profile link to constants and open it from the badge. Bug: 436201262 Change-Id: I62c5f0632a48893a59270df5f2e1bb38d0d116e3 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6929594 Commit-Queue: Ergün Erdoğmuş <[email protected]> Reviewed-by: Nikolay Vitkov <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]> Auto-Submit: Ergün Erdoğmuş <[email protected]>
1 parent f8e41a2 commit 8cdb491

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

front_end/core/host/GdpClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export interface Profile {
6868
};
6969
}
7070

71+
// TODO(crbug.com/441679275): Update once the API is enabled for prod.
72+
export const GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK = 'https://developers.devsite.corp.google.com/profile/u/';
73+
7174
async function makeHttpRequest<R extends object>(request: DispatchHttpRequestRequest): Promise<R|null> {
7275
if (!Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled) {
7376
return null;

front_end/panels/common/BadgeNotification.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as Lit from '../../ui/lit/lit.js';
1111
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
1212

1313
import badgeNotificationStyles from './badgeNotification.css.js';
14+
import * as GdpSignUpDialog from './GdpSignUpDialog.js';
1415

1516
const {html, render} = Lit;
1617

@@ -194,7 +195,13 @@ export class BadgeNotification extends UI.Widget.Widget {
194195
label: i18nString(UIStrings.remindMeLater),
195196
onClick: () => {/* TODO(ergunsh): Implement */},
196197
},
197-
{label: i18nString(UIStrings.createProfile), onClick: () => { /* TODO(ergunsh): Implement */ }}
198+
{
199+
label: i18nString(UIStrings.createProfile),
200+
onClick: () => {
201+
this.#close();
202+
GdpSignUpDialog.GdpSignUpDialog.show();
203+
}
204+
}
198205
],
199206
imageUri: badge.imageUri,
200207
});
@@ -208,7 +215,12 @@ export class BadgeNotification extends UI.Widget.Widget {
208215
label: i18nString(UIStrings.badgeSettings),
209216
onClick: () => {/* TODO(ergunsh): Implement */},
210217
},
211-
{label: i18nString(UIStrings.viewProfile), onClick: () => { /* TODO(ergunsh): Implement */ }}
218+
{
219+
label: i18nString(UIStrings.viewProfile),
220+
onClick: () => {
221+
UI.UIUtils.openInNewTab(Host.GdpClient.GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK);
222+
}
223+
}
212224
],
213225
imageUri: badge.imageUri,
214226
});

front_end/panels/settings/components/SyncSection.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ function getGdpSubscriptionText(profile: Host.GdpClient.Profile): Platform.UIStr
110110
}
111111

112112
const GDP_LOGO_IMAGE_URL = new URL('../../../Images/gdp-logo-standalone.svg', import.meta.url).toString();
113-
// TODO(crbug.com/441679275): Update once the API is enabled for prod.
114-
const GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK = 'https://developers.devsite.corp.google.com/profile/u/';
115113

116114
export interface SyncSectionData {
117115
syncInfo: Host.InspectorFrontendHostAPI.SyncInformation;
@@ -262,7 +260,7 @@ function renderGdpSectionIfNeeded({
262260
<div class="plan-details">
263261
${getGdpSubscriptionText(gdpProfile)}
264262
&nbsp;·&nbsp;
265-
<x-link class="link" href=${GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK}>
263+
<x-link class="link" href=${Host.GdpClient.GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK}>
266264
${i18nString(UIStrings.viewProfile)}
267265
</x-link></div>
268266
${receiveBadgesSetting ? html`

0 commit comments

Comments
 (0)