Update enterprise feature visible metadata fields and summary text (#2976)

* Update summary enterprise help text

* Hide breaking change for enterprise features

* Show only enterprise metadata fields on  metadata edit page for enterprise features

* Remove launch_bug_url and breaking change from enterprise features

* Refactor rendering in enterprise and non enterprise functions
This commit is contained in:
Yann Dago 2023-05-04 15:56:45 -04:00 коммит произвёл GitHub
Родитель 5b11e9e798
Коммит 54c62e8637
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 152 добавлений и 121 удалений

Просмотреть файл

@ -319,6 +319,16 @@ export class ChromedashFeaturePage extends LitElement {
`;
}
renderEnterpriseFeatureContent() {
return html`
${this.feature.summary ? html`
<section id="summary">
<p class="preformatted">${autolink(this.feature.summary)}</p>
</section>
`: nothing}
`;
}
renderFeatureContent() {
return html`
${this.feature.unlisted ? html`
@ -529,10 +539,12 @@ export class ChromedashFeaturePage extends LitElement {
return html`
${this.renderSubHeader()}
<div id="feature">
${this.renderFeatureContent()}
${this.feature.is_enterprise_feature ?
this.renderEnterpriseFeatureStatus() :
this.renderFeatureStatus()}
this.renderEnterpriseFeatureContent() :
this.renderFeatureContent()}
${this.feature.is_enterprise_feature ?
this.renderEnterpriseFeatureStatus() :
this.renderFeatureStatus()}
${this.renderUpdated()}
</div>
${this.renderFeatureDetails()}

Просмотреть файл

@ -194,11 +194,14 @@ export class ChromedashFormField extends LitElement {
}
render() {
const helpText = this.forEnterprise && this.fieldProps.enterprise_help_text ?
this.fieldProps.enterprise_help_text :
this.fieldProps.help_text;
const extraHelpText = this.fieldProps.extra_help;
const helpText =
this.forEnterprise && (this.fieldProps.enterprise_help_text !== undefined) ?
this.fieldProps.enterprise_help_text :
this.fieldProps.help_text;
const extraHelpText =
this.forEnterprise && (this.fieldProps.enterprise_extra_help !== undefined) ?
this.fieldProps.enterprise_extra_help :
this.fieldProps.extra_help;
return html`
${this.fieldProps.label ? html`
<tr>

Просмотреть файл

@ -182,7 +182,9 @@ export class ChromedashGuideMetadataPage extends LitElement {
<input type="hidden" name="nextPage" value=${this.getNextPage()} >
<chromedash-form-table ${ref(this.registerHandlers)}>
${this.renderSections(formattedFeature, FLAT_METADATA_FIELDS.sections)}
${this.renderSections(formattedFeature, formattedFeature.is_enterprise_feature ?
FLAT_ENTERPRISE_METADATA_FIELDS.sections :
FLAT_METADATA_FIELDS.sections)}
</chromedash-form-table>
<div class="final_buttons">

Просмотреть файл

@ -1,6 +1,6 @@
import {LitElement, css, html, nothing} from 'lit';
import {ref} from 'lit/directives/ref.js';
import {autolink, flattenSections, renderHTMLIf} from './utils.js';
import {autolink, flattenSections} from './utils.js';
import './chromedash-form-table';
import './chromedash-form-field';
import {ENTERPRISE_FEATURE_CATEGORIES_DISPLAYNAME} from './form-field-enums';
@ -104,6 +104,60 @@ export class ChromedashGuideMetadata extends LitElement {
});
}
renderReadOnlyTableForEnterprise() {
return html`
<div id="metadata-readonly">
<div style="margin-bottom: 1em">
<div id="metadata-buttons">
<a id="open-metadata" @click=${() => this.editing = true}>Edit</a>
${this.isAdmin ? html`
<div>
<a id="delete-feature" class="delete-button"
@click=${this.handleDeleteFeature}>Delete</a>
</div>
`: nothing}
</div>
<div>${autolink(this.feature.summary)}</div>
</div>
<div class="flex-cols">
<table class="property-sheet">
<tr>
<th>Owners</th>
<td>
${this.feature.browsers.chrome.owners.map((owner) => html`
<a href="mailto:${owner}">${owner}</a>
`)}
</td>
</tr>
<tr>
<th>Editors</th>
<td>
${this.feature.editors ?
this.feature.editors.map((editor)=> html`
<a href="mailto:${editor}">${editor}</a>
`): html`
None
`}
</td>
</tr>
<tr>
<th>Categories</th>
<td>${this.feature.enterprise_feature_categories.map(id =>
ENTERPRISE_FEATURE_CATEGORIES_DISPLAYNAME[id]) || 'None'}</td>
</tr>
<tr>
<th>Feature type</th>
<td>${this.feature.feature_type}</td>
</tr>
</div>
</div>
`;
}
renderReadOnlyTable() {
return html`
<div id="metadata-readonly">
@ -138,75 +192,58 @@ export class ChromedashGuideMetadata extends LitElement {
</td>
</tr>
${!this.feature.is_enterprise_feature ? html`
<tr>
<th>CC</th>
<td>
${this.feature.cc_recipients ?
this.feature.cc_recipients.map((ccRecipient)=> html`
<a href="mailto:${ccRecipient}">${ccRecipient}</a>
`): html`
None
`}
</td>
</tr>` :
nothing}
${!this.feature.is_enterprise_feature ? html`
<tr>
<th>DevRel</th>
<td>
${this.feature.browsers.chrome.devrel ?
this.feature.browsers.chrome.devrel.map((dev) => html`
<a href="mailto:${dev}">${dev}</a>
<tr>
<th>CC</th>
<td>
${this.feature.cc_recipients ?
this.feature.cc_recipients.map((ccRecipient)=> html`
<a href="mailto:${ccRecipient}">${ccRecipient}</a>
`): html`
None
`}
</td>
</tr>` :
nothing}
</td>
</tr>
${this.feature.is_enterprise_feature ? html`
<tr>
<th>Editors</th>
<td>
${this.feature.editors ?
this.feature.editors.map((editor)=> html`
<a href="mailto:${editor}">${editor}</a>
`): html`
None
`}
</td>
</tr>` :
nothing}
<tr>
<th>DevRel</th>
<td>
${this.feature.browsers.chrome.devrel ?
this.feature.browsers.chrome.devrel.map((dev) => html`
<a href="mailto:${dev}">${dev}</a>
`): html`
None
`}
</td>
</tr>
${!this.feature.is_enterprise_feature ? html`
<tr>
<th>Category</th>
<td>${this.feature.category}</td>
</tr>` :
nothing}
${this.feature.is_enterprise_feature ? html`
<tr>
<th>Categories</th>
<td>${this.feature.enterprise_feature_categories.map(id =>
ENTERPRISE_FEATURE_CATEGORIES_DISPLAYNAME[id]) || 'None'}</td>
</tr>` :
nothing}
<tr>
<th>Editors</th>
<td>
${this.feature.editors ?
this.feature.editors.map((editor)=> html`
<a href="mailto:${editor}">${editor}</a>
`): html`
None
`}
</td>
</tr>
<tr>
<th>Category</th>
<td>${this.feature.category}</td>
</tr>
<tr>
<th>Feature type</th>
<td>${this.feature.feature_type}</td>
</tr>
${renderHTMLIf(!this.feature.is_enterprise_feature, html`
<tr>
<th>Process stage</th>
<td>${this.feature.intent_stage}</td>
</tr>`,
)}
<tr>
<th>Process stage</th>
<td>${this.feature.intent_stage}</td>
</tr>
${this.feature.tags && !this.feature.is_enterprise_feature ? html`
${this.feature.tags ? html`
<tr>
<th>Search tags</th>
<td>
@ -221,30 +258,26 @@ export class ChromedashGuideMetadata extends LitElement {
<table class="property-sheet">
${!this.feature.is_enterprise_feature ? html`
<tr>
<th>Implementation status</th>
<td>${this.feature.browsers.chrome.status.text}</td>
</tr>` :
nothing}
<tr>
<th>Implementation status</th>
<td>${this.feature.browsers.chrome.status.text}</td>
</tr>
<tr>
<th>Blink components</th>
<td>${this.feature.browsers.chrome.blink_components.join(', ')}</td>
</tr>
${!this.feature.is_enterprise_feature ? html`
<tr>
<th>Tracking bug</th>
<td>
${this.feature.browsers.chrome.bug ? html`
<a href="${this.feature.browsers.chrome.bug}">${this.feature.browsers.chrome.bug}</a>
`: html`
None
`}
</td>
</tr>` :
nothing}
<tr>
<th>Tracking bug</th>
<td>
${this.feature.browsers.chrome.bug ? html`
<a href="${this.feature.browsers.chrome.bug}">${this.feature.browsers.chrome.bug}</a>
`: html`
None
`}
</td>
</tr>
<tr>
<th>Launch bug</th>
@ -256,7 +289,6 @@ export class ChromedashGuideMetadata extends LitElement {
`}
</td>
</tr>
<tr>
<th>Breaking change</th>
<td>${this.feature.breaking_change}</td>
@ -302,7 +334,10 @@ export class ChromedashGuideMetadata extends LitElement {
render() {
return html`
<section id="metadata">
${this.editing ? this.renderEditForm() : this.renderReadOnlyTable()}
${this.editing ?
this.renderEditForm() :this.feature.is_enterprise_feature ?
this.renderReadOnlyTableForEnterprise() :
this.renderReadOnlyTable()}
</section>
`;
}

Просмотреть файл

@ -116,8 +116,8 @@ describe('chromedash-guide-metadata', () => {
assert.notInclude(metadataDiv.innerHTML, 'tag_one');
// feature status is listed
assert.notInclude(metadataDiv.innerHTML, 'fake chrome status text');
// feature blink component is listed
assert.include(metadataDiv.innerHTML, 'Blink');
// feature blink component is not listed
assert.notInclude(metadataDiv.innerHTML, 'Blink');
// delete button does not exists
assert.notInclude(metadataDiv.innerHTML, 'class="delete-button"');
});

Просмотреть файл

@ -123,7 +123,6 @@ export const ENTERPRISE_NEW_FEATURE_FORM_FIELDS = [
'summary',
'owner',
'editors',
'launch_bug_url',
'enterprise_feature_categories',
];
@ -176,17 +175,8 @@ export const FLAT_ENTERPRISE_METADATA_FIELDS = {
'owner',
'editors',
'enterprise_feature_categories',
'breaking_change',
],
},
// Implementation
{
name: 'Implementation in Chromium',
fields: [
'launch_bug_url',
],
isImplementationSection: true,
},
],
};

Просмотреть файл

@ -114,18 +114,14 @@ export const ALL_FIELDS = {
required: true,
label: 'Summary',
enterprise_help_text: html`
<p>This text will be used in the
<a href="https://support.google.com/chrome/a/answer/7679408?hl=en" target="_blank">
enterprise release notes</a>,
which are publicly visible and primarily written for IT admins.</p>
<p>Explain what's changing from the point of view of an end-user,
developer, or administrator. Indicate what the motivation is for
this change, especially if theres security or privacy benefits to
the change. If an admin should do something (like test or set an enterprise policy),
please explain. Finally, if the change has a user-visible benefit
(eg. better security or privacy), explain that motivation.
See <a href="go/releasenotes-examples" target="_blank">go/releasenotes-examples</a>
for examples.</p>`,
<p>This text will be used in the enterprise release notes, which are publicly visible and primarily written for IT admins.</p>
<p>Explain what's changing from the point of view of an end-user, developer, or administrator.
Indicate what the motivation is for this change, especially if theres security or privacy benefits to the change.
If an admin should do something (like test or set an enterprise policy), please explain. Finally, if the change has
a user-visible benefit (eg. better security or privacy), explain that motivation. If there are already publicly visible comms
(e.g. blog posts), you should link to them here as well.</p>
<p>See <a href="https://docs.google.com/document/d/1SdQ-DKeA5O7I8ju5Cb8zSM5S4NPwUACNJ9qbEhz-AYU" target="_blank">go/releasenotes-examples</a>
for examples.</p>`,
help_text: html`
<p>Text in the beta release post, the enterprise release notes,
and other external sources will be based on this text.</p>
@ -161,6 +157,7 @@ export const ALL_FIELDS = {
Splits the HTTP cache using the top frame origin (and possibly subframe origin) to prevent documents from one origin from knowing whether a resource from another origin was cached. The HTTP cache is currently one per profile, with a single namespace for all resources and subresources regardless of origin or renderer process. Splitting the cache on top frame origins helps the browser deflect side-channel attacks where one site can detect resources in another site's cache.
</blockquote>
`,
enterprise_extra_help: '',
},
'owner': {

Просмотреть файл

@ -167,10 +167,7 @@ PI_ENTERPRISE_POLICIES = ProgressItem('Enterprise policies', 'enterprise_policie
# features that are marked as breaking changes.
FEATURE_ROLLOUT_STAGE = ProcessStage(
'Start feature rollout',
'Lock in shipping milestone. '
'Create feature flag for the feature. '
'Create policies to enable/disable and control the feature. '
'Finalize docs and announcements and start rolling out the feature.',
'',
[PI_ROLLOUT_IMPACT,
PI_ROLLOUT_MILESTONE,
PI_ROLLOUT_PLATFORMS,
@ -535,10 +532,7 @@ DEPRECATION_STAGES = [
ENTERPRISE_STAGES = [
ProcessStage(
'Start feature rollout',
'Lock in shipping milestone. '
'Create feature flag for the feature. '
'Create policies to enable/disable and control the feature. '
'Finalize docs and announcements and start rolling out the feature.',
'',
[PI_ROLLOUT_IMPACT,
PI_ROLLOUT_MILESTONE,
PI_ROLLOUT_PLATFORMS,

Просмотреть файл

@ -139,8 +139,6 @@ class EnterpriseFeatureCreateHandler(FeatureCreateHandler):
summary=self.form.get('summary'),
owner_emails=owners,
editor_emails=editors,
launch_bug_url=self.form.get('launch_bug_url'),
breaking_change=self.form.get('breaking_change') == 'on',
creator_email=signed_in_user.email(),
updater_email=signed_in_user.email(),
accurate_as_of=datetime.now(),