-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add URL generator UI files to Support Tool and show the UI when user navigates to chrome://support-tool/url-generator. Screenshot of the change: https://screenshot.googleplex.com/8sx6kaitoMMufmq.png Bug: b:217931906 Test: Enable SupportTool feature and navigate to chrome: //support-tool/url-generator. The UI should be visible there. Change-Id: Ibdd9eb4ae9c0820adcfda5132a6029e3ffe75a87 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3572054 Reviewed-by: Pavol Marko <pmarko@chromium.org> Commit-Queue: Irem Uguz <iremuguz@google.com> Cr-Commit-Position: refs/heads/main@{#991954}
- Loading branch information
Irem Uguz
authored and
Chromium LUCI CQ
committed
Apr 13, 2022
1 parent
7d88921
commit 706cd66
Showing
12 changed files
with
226 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- Copyright 2022 The Chromium Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. --> | ||
|
||
<style include="support-tool-shared cr-input-style"> | ||
:host { | ||
block-size: fit-content; | ||
display: block; | ||
margin-inline-start: 40px; | ||
margin-top: 72px; | ||
width: fit-content; | ||
} | ||
|
||
.data-collector-list { | ||
height: 148px; | ||
} | ||
|
||
.url-text { | ||
background-color: var(--cr-input-background-color); | ||
height: 32px; | ||
width: 520px; | ||
} | ||
</style> | ||
|
||
<h2>Generate support tool URL</h2> | ||
<div class="support-tool-title">Support Case ID</div> | ||
<cr-input class="support-case-id" value="{{caseId_}}" | ||
spellcheck="false" maxlength="20"> | ||
</cr-input> | ||
<div class="support-tool-title">Data sources to collect</div> | ||
<iron-list class="data-collector-list" items="[[dataCollectors_]]"> | ||
<template> | ||
<cr-checkbox class="data-collector-checkbox" checked="{{item.isIncluded}}"> | ||
[[item.name]] | ||
</cr-checkbox> | ||
</template> | ||
</iron-list> | ||
<div class="support-tool-title">Generated URL</div> | ||
<!-- Use cr-input in disabled mode since we don't want to accept input but want | ||
to have the same styling as cr-input.--> | ||
<cr-input class="url-text" value="[[generatedURL_]]" disabled="true"> | ||
</cr-input> | ||
<div class="navigation-buttons"> | ||
<cr-button id="generateButton" class="action-button" | ||
on-click="onGenerateClick_"> | ||
Generate URL | ||
</cr-button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import './support_tool_shared_css.js'; | ||
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js'; | ||
import 'chrome://resources/cr_elements/shared_vars_css.m.js'; | ||
import 'chrome://resources/cr_elements/cr_input/cr_input.m.js'; | ||
import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.m.js'; | ||
import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; | ||
|
||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
import {BrowserProxy, BrowserProxyImpl, DataCollectorItem} from './browser_proxy.js'; | ||
import {getTemplate} from './url_generator.html.js'; | ||
|
||
export class UrlGeneratorElement extends PolymerElement { | ||
static get is() { | ||
return 'url-generator'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
static get properties() { | ||
return { | ||
caseId_: { | ||
type: String, | ||
value: '', | ||
}, | ||
dataCollectors_: { | ||
type: Array, | ||
value: () => [], | ||
}, | ||
generatedURL_: { | ||
type: String, | ||
value: '', | ||
} | ||
}; | ||
} | ||
|
||
private caseId_: string; | ||
private generatedURL_: string; | ||
private dataCollectors_: DataCollectorItem[]; | ||
private browserProxy_: BrowserProxy = BrowserProxyImpl.getInstance(); | ||
|
||
override connectedCallback() { | ||
super.connectedCallback(); | ||
|
||
this.browserProxy_.getAllDataCollectors().then( | ||
(dataCollectors: DataCollectorItem[]) => { | ||
this.dataCollectors_ = dataCollectors; | ||
}); | ||
} | ||
|
||
private onGenerateClick_() { | ||
// TODO(b/217931906): Send signal to generate URL through BrowserProxy and | ||
// make input fields disabled. | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'url-generator': UrlGeneratorElement; | ||
} | ||
} | ||
|
||
customElements.define(UrlGeneratorElement.is, UrlGeneratorElement); |
16 changes: 16 additions & 0 deletions
16
chrome/browser/resources/support_tool/url_generator_container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE HTML> | ||
<!-- Copyright 2022 The Chromium Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. --> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Support Tool URL Generator</title> | ||
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> | ||
</head> | ||
<body> | ||
<url-generator></url-generator> | ||
<script type="module" src="url_generator.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters