Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion api/api_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
('search_tags', 'split_str'),
('security_review_status', 'int'),
('security_risks', 'str'),
('spec_link', 'link'),
('spec_links', 'links'),
('spec_mentor_emails', 'emails'),
('standard_maturity', 'int'),
('summary', 'str'),
Expand Down
6 changes: 3 additions & 3 deletions api/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def feature_entry_to_json_verbose(
'initial_public_proposal_url': fe.initial_public_proposal_url,
'explainer_links': fe.explainer_links,
'requires_embedder_support': fe.requires_embedder_support,
'spec_link': fe.spec_link,
'spec_links': fe.spec_links,
'api_spec': fe.api_spec,
'interop_compat_risks': fe.interop_compat_risks,
'all_platforms': fe.all_platforms,
Expand Down Expand Up @@ -496,7 +496,7 @@ def feature_entry_to_json_verbose(
'enterprise_feature_categories': fe.enterprise_feature_categories or [],
'enterprise_product_category': fe.enterprise_product_category or ENTERPRISE_PRODUCT_CATEGORY_CHROME_BROWSER_UPDATE,
'standards': {
'spec': fe.spec_link,
'specs': fe.spec_links,
'maturity': {
'text': STANDARD_MATURITY_CHOICES.get(fe.standard_maturity),
'short_text': STANDARD_MATURITY_SHORT.get(fe.standard_maturity),
Expand Down Expand Up @@ -552,7 +552,7 @@ def feature_entry_to_json_basic(fe: FeatureEntry,
'updated': {'by': fe.updater_email, 'when': _date_to_str(fe.updated)},
'accurate_as_of': _date_to_str(fe.accurate_as_of),
'standards': {
'spec': fe.spec_link,
'specs': fe.spec_links,
'maturity': {
'text': STANDARD_MATURITY_CHOICES.get(fe.standard_maturity),
'short_text': STANDARD_MATURITY_SHORT.get(fe.standard_maturity),
Expand Down
4 changes: 2 additions & 2 deletions api/converters_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setUp(self):
owner_emails=['[email protected]'], feature_type=0,
editor_emails=['[email protected]', '[email protected]'],
impl_status_chrome=5, blink_components=['Blink'], shipping_year=2024,
spec_link='https://example.com/spec',
spec_links=['https://example.com/spec'],
sample_links=['https://example.com/samples'],
screenshot_links=['https://example.com/screenshot'],
first_enterprise_notification_milestone=100, standard_maturity=1,
Expand Down Expand Up @@ -325,7 +325,7 @@ def test_feature_entry_to_json_verbose__normal(self):
'doc_links': ['https://example.com/docs'],
'prefixed': False,
'requires_embedder_support': False,
'spec_link': 'https://example.com/spec',
'spec_links': ['https://example.com/spec'],
'sample_links': ['https://example.com/samples'],
'screenshot_links': ['https://example.com/screenshot'],
'first_enterprise_notification_milestone': 100,
Expand Down
2 changes: 1 addition & 1 deletion api/legacy_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def feature_to_legacy_json(f: Feature) -> dict[str, Any]:
}
d['accurate_as_of'] = d.pop('accurate_as_of', None)
d['standards'] = {
'spec': d.pop('spec_link', None),
'specs': d.pop('spec_links', None),
'status': {
'text': STANDARDIZATION[f.standardization],
'val': d.pop('standardization', None),
Expand Down
2 changes: 1 addition & 1 deletion api/processes_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def setUp(self):
self.feature_1 = core_models.FeatureEntry(
name='feature one', summary='sum Z',
owner_emails=['[email protected]'],
spec_link='fake spec link', category=1, web_dev_views=1,
spec_links=['fake spec link'], category=1, web_dev_views=1,
impl_status_chrome=5, intent_stage=core_enums.INTENT_IMPLEMENT,
feature_type=0)
self.feature_1.put()
Expand Down
58 changes: 49 additions & 9 deletions client-src/elements/chromedash-feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ class ChromedashFeature extends LitElement {
super.update(changedProperties);
}

updated(changedProps: Map<string, any>) {
if (
(changedProps.has('open') || changedProps.has('feature')) &&
this.open &&
this.feature?.standards?.specs?.length > 1
) {
const dropdown = this.shadowRoot?.querySelector('sl-dropdown');
const trigger = dropdown?.querySelector('[slot="trigger"]');
if (dropdown && trigger && !trigger.hasAttribute('listeners-attached')) {
trigger.setAttribute('listeners-attached', 'true');

trigger.addEventListener('mouseenter', () => dropdown.show());
dropdown.addEventListener('mouseleave', () => dropdown.hide());
}
}
}

_initializeValues() {
this._crBugNumber = this._getCrBugNumber();
this._newBugUrl = this._getNewBugUrl();
Expand Down Expand Up @@ -538,20 +555,43 @@ class ChromedashFeature extends LitElement {
this.feature.standards.maturity.val}"
.max="${MAX_STANDARDS_VAL}"
></chromedash-color-status>
${this.feature.standards.spec
${Array.isArray(this.feature.standards.specs) &&
this.feature.standards.specs.length === 1
? html`
<a
href="${this.feature.standards.spec}"
href="${this.feature.standards.specs[0]}"
target="_blank"
>${this.feature.standards.maturity.short_text}</a
rel="noopener noreferrer"
>
${this.feature.standards.maturity.short_text}
</a>
`
: html`
<label
>${this.feature.standards.maturity
.short_text}</label
>
`}
: Array.isArray(this.feature.standards.specs) &&
this.feature.standards.specs.length > 1
? html`
<sl-dropdown hoist>
<a slot="trigger" class="spec-link-label">
${this.feature.standards.maturity.short_text}
<sl-icon name="chevron-down"></sl-icon>
</a>
<sl-menu>
${this.feature.standards.specs.map(
spec =>
html`<sl-menu-item
@click="${() =>
window.open(spec, '_blank')}"
>
${spec}
</sl-menu-item>`
)}
</sl-menu>
</sl-dropdown>
`
: html`
<label class="spec-label-only">
${this.feature.standards.maturity.short_text}
</label>
`}
</span>
</div>
<div style="font-size:smaller">
Expand Down
10 changes: 5 additions & 5 deletions client-src/elements/form-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface FormattedFeature {
feature_type: number;
intent_stage: number;
accurate_as_of: boolean;
spec_link?: string;
spec_links?: string[];
standard_maturity: number;
tag_review_status?: number;
security_review_status?: number;
Expand Down Expand Up @@ -92,7 +92,7 @@ export function formatFeatureForEdit(feature: Feature): FormattedFeature {
accurate_as_of: true,

// from feature.standards
spec_link: feature.standards.spec,
spec_links: feature.standards.specs,
standard_maturity: feature.standards.maturity.val,

tag_review_status: feature.tag_review_status_int,
Expand Down Expand Up @@ -278,7 +278,7 @@ const FLAT_PROTOTYPE_FIELDS: MetadataFields = {
name: 'Prototype a solution',
fields: [
'motivation',
'spec_link',
'spec_links',
'standard_maturity',
'api_spec',
'spec_mentors',
Expand Down Expand Up @@ -469,7 +469,7 @@ const PSA_IMPLEMENT_FIELDS: MetadataFields = {
// Standardization
{
name: 'Start prototyping',
fields: ['motivation', 'spec_link', 'standard_maturity'],
fields: ['motivation', 'spec_links', 'standard_maturity'],
},
],
};
Expand Down Expand Up @@ -502,7 +502,7 @@ const DEPRECATION_PLAN_FIELDS: MetadataFields = {
sections: [
{
name: 'Write up deprecation plan',
fields: ['motivation', 'spec_link'],
fields: ['motivation', 'spec_links'],
},
],
};
Expand Down
14 changes: 7 additions & 7 deletions client-src/elements/form-field-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -759,14 +759,14 @@ export const ALL_FIELDS: Record<string, Field> = {
),
},

spec_link: {
type: 'input',
attrs: URL_FIELD_ATTRS,
spec_links: {
type: 'textarea',
attrs: MULTI_URL_FIELD_ATTRS,
required: false,
label: 'Spec link',
help_text: html` Link to the spec, if and when available. When implementing
a spec update, please link to a heading in a published spec rather than a
pull request when possible.`,
label: 'Spec link(s)',
help_text: html` Link to the spec(s) (one URL per line), if and when
available. When implementing a spec update, please link to a heading in a
published spec rather than a pull request when possible.`,
extra_help: html`<p>
Specifications should be written in the format and hosted in the URL space
expected by your target standards body. For example, the W3C expects
Expand Down
2 changes: 1 addition & 1 deletion client-src/elements/queriable-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const QUERIABLE_FIELDS: QueryField[] = [
},

// 'standards.maturity': Feature.standard_maturity,
// 'standards.spec': Feature.spec_link,
// 'standards.spec': Feature.spec_links,
// 'api_spec': Feature.api_spec,
// 'spec_mentors': Feature.spec_mentors,
// 'security_review_status': Feature.security_review_status,
Expand Down
2 changes: 1 addition & 1 deletion client-src/elements/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export function getFieldValueFromFeature(
owner: 'browsers.chrome.owners',
editors: 'editors',
search_tags: 'tags',
spec_link: 'standards.spec',
spec_links: 'standards.specs',
standard_maturity: 'standards.maturity.text',
sample_links: 'resources.samples',
docs_links: 'resources.docs',
Expand Down
4 changes: 2 additions & 2 deletions client-src/js-src/cs-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

/**
* @typedef {Object} FeatureDictInnerStandardsInfo
* @property {string} [spec]
* @property {string[]} specs
* @property {FeatureDictInnerMaturityInfo} maturity
*/

Expand Down Expand Up @@ -230,7 +230,7 @@
* @property {string} [initial_public_proposal_url]
* @property {string[]} explainer_links
* @property {boolean} requires_embedder_support
* @property {string} [spec_link]
* @property {string} [spec_links]
* @property {string} [api_spec]
* @property {boolean} [prefixed]
* @property {string} [interop_compat_risks]
Expand Down
8 changes: 4 additions & 4 deletions data/dev_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"requires_embedder_support": false,
"standard_maturity": 1,
"spec_link": "https://example.com/spec_link",
"spec_links": ["https://example.com/spec_link"],
"api_spec": true,
"spec_mentor_emails": [
"[email protected]",
Expand Down Expand Up @@ -140,7 +140,7 @@
],
"requires_embedder_support": false,
"standard_maturity": 1,
"spec_link": "https://example.com/spec_link",
"spec_links": ["https://example.com/spec_link"],
"api_spec": true,
"spec_mentor_emails": [
"[email protected]",
Expand Down Expand Up @@ -232,7 +232,7 @@
],
"requires_embedder_support": true,
"standard_maturity": 4,
"spec_link": "https://example.com/spec_link",
"spec_links": ["https://example.com/spec_link"],
"api_spec": false,
"spec_mentor_emails": [
"[email protected]",
Expand Down Expand Up @@ -323,7 +323,7 @@
],
"requires_embedder_support": true,
"standard_maturity": 4,
"spec_link": "https://example.com/spec_link",
"spec_links": ["https://example.com/spec_link"],
"api_spec": false,
"spec_mentor_emails": [
"[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion internals/core_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class FeatureEntry(ndb.Model): # Copy from Feature
explainer_links = ndb.StringProperty(repeated=True)
requires_embedder_support = ndb.BooleanProperty(default=False)
standard_maturity = ndb.IntegerProperty(required=True, default=UNSET_STD)
spec_link = ndb.StringProperty()
spec_links = ndb.StringProperty(repeated=True)
api_spec = ndb.BooleanProperty(default=False)
spec_mentor_emails = ndb.StringProperty(repeated=True)
interop_compat_risks = ndb.TextProperty()
Expand Down
2 changes: 1 addition & 1 deletion internals/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class VerboseFeatureDict(TypedDict):
initial_public_proposal_url: str | None
explainer_links: list[str]
requires_embedder_support: bool
spec_link: str | None
spec_links: list[str]
api_spec: str | None
prefixed: bool | None
interop_compat_risks: str | None
Expand Down
11 changes: 6 additions & 5 deletions internals/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def process_to_dict(process):
PI_MOTIVATION = ProgressItem('Motivation', 'motivation')
PI_EXPLAINER = ProgressItem('Explainer', 'explainer_links')

PI_SPEC_LINK = ProgressItem('Spec link', 'spec_link')
# here plural?
PI_SPEC_LINK = ProgressItem('Spec links', 'spec_links')
PI_SPEC_MENTOR = ProgressItem('Spec mentor', 'spec_mentors')
PI_DRAFT_API_SPEC = ProgressItem('Draft API spec')
PI_I2P_EMAIL = ProgressItem(
Expand Down Expand Up @@ -678,11 +679,11 @@ def review_is_done(status):
'Doc links':
lambda f, _: f.doc_links and f.doc_links[0],

'Spec link':
lambda f, _: f.spec_link,
'Spec links':
lambda f, _: f.spec_links,

'Draft API spec':
lambda f, _: f.spec_link,
'Draft API specs':
lambda f, _: f.spec_links,

'API spec':
lambda f, _: f.api_spec,
Expand Down
2 changes: 1 addition & 1 deletion internals/search_fulltext.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _get_strings_dict(fe: FeatureEntry) -> dict[str, list[str|None]]:
'initial_public_proposal_url': [fe.initial_public_proposal_url],
'explainer': fe.explainer_links,
# TODO: standard_maturity
'standards.spec': [fe.spec_link],
'standards.spec': fe.spec_links,
'spec_mentors': fe.spec_mentor_emails,
'interop_compat_risks': [fe.interop_compat_risks],
'all_platforms_descr': [fe.all_platforms_descr],
Expand Down
2 changes: 1 addition & 1 deletion internals/search_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def sorted_by_review_date(descending: bool) -> Future:
FeatureEntry.initial_public_proposal_url,
'explainer': FeatureEntry.explainer_links,
'requires_embedder_support': FeatureEntry.requires_embedder_support,
'standards.spec': FeatureEntry.spec_link,
'standards.specs': FeatureEntry.spec_links,
'api_spec': FeatureEntry.api_spec,
'spec_mentors': FeatureEntry.spec_mentor_emails,
'interop_compat_risks': FeatureEntry.interop_compat_risks,
Expand Down
2 changes: 1 addition & 1 deletion scripts/seed_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def add_features(server: str, after: datetime, detailsAfter: datetime):
fe.devrel_emails = f['browsers']['chrome']['devrel']
fe.owner_emails = f['browsers']['chrome']['owners']
fe.prefixed = f['browsers']['chrome']['prefixed']
fe.spec_link = f['standards']['spec']
fe.spec_links = f['standards']['specs']
fe.standard_maturity = f['standards']['maturity']['val']
fe.ff_views = f['browsers']['ff']['view']['val']
fe.ff_views_link = f['browsers']['ff']['view']['url']
Expand Down