Skip to content

Commit 450c997

Browse files
authored
Add standard_maturity field. (GoogleChrome#1428)
1 parent b275a62 commit 450c997

File tree

4 files changed

+52
-15
lines changed

4 files changed

+52
-15
lines changed

internals/models.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
REVIEW_NA: 'Not applicable',
183183
}
184184

185+
185186
FOOTPRINT_CHOICES = {
186187
MAJOR_NEW_API: ('A major new independent API (e.g. adding many '
187188
'independent concepts with many methods/properties/objects)'),
@@ -267,6 +268,22 @@
267268
NO_STD_OR_DISCUSSION: 'No public standards discussion',
268269
}
269270

271+
UNKNOWN_STD = 1
272+
PROPOSAL_STD = 2
273+
INCUBATION_STD = 3
274+
WORKINGDRAFT_STD = 4
275+
STANDARD_STD = 5
276+
277+
STANDARD_MATURITY_CHOICES = {
278+
UNKNOWN_STD: 'Unknown standards status - check spec link for status',
279+
PROPOSAL_STD: 'Proposal in a personal repository, no adoption from community',
280+
INCUBATION_STD: 'Specification being incubated in a Community Group',
281+
WORKINGDRAFT_STD: ('Specification currently under development in a '
282+
'Working Group'),
283+
STANDARD_STD: ('Final published standard: Recommendation, Living Standard, '
284+
'Candidate Recommendation, or similar final form'),
285+
}
286+
270287
DEV_STRONG_POSITIVE = 1
271288
DEV_POSITIVE = 2
272289
DEV_MIXED_SIGNALS = 3
@@ -290,6 +307,7 @@
290307
'impl_status_chrome': IMPLEMENTATION_STATUS,
291308
'security_review_status': REVIEW_STATUS_CHOICES,
292309
'privacy_review_status': REVIEW_STATUS_CHOICES,
310+
'standard_maturity': STANDARD_MATURITY_CHOICES,
293311
'standardization': STANDARDIZATION,
294312
'ff_views': VENDOR_VIEWS,
295313
'ie_views': VENDOR_VIEWS,
@@ -627,6 +645,10 @@ def format_for_template(self, version=2):
627645
'text': STANDARDIZATION[self.standardization],
628646
'val': d.pop('standardization', None),
629647
},
648+
'maturity': {
649+
'text': STANDARD_MATURITY_CHOICES.get(self.standard_maturity),
650+
'val': d.pop('standard_maturity', None),
651+
},
630652
}
631653
d['tag_review_status'] = REVIEW_STATUS_CHOICES[self.tag_review_status]
632654
d['security_review_status'] = REVIEW_STATUS_CHOICES[
@@ -942,7 +964,7 @@ def get_in_milestone(
942964
all_features.extend(desktop_shipping_features)
943965
all_features.extend(android_only_shipping_features)
944966

945-
# Feature list must be first sorted by implementation status and then by name.
967+
# Feature list must be first sorted by implementation status and then by name.
946968
# The implementation may seem to be counter-intuitive using sort() method.
947969
all_features.sort(key=lambda f: f.name)
948970
all_features.sort(key=lambda f: f.impl_status_chrome)
@@ -959,7 +981,7 @@ def get_in_milestone(
959981

960982
return allowed_feature_list
961983

962-
984+
963985
@classmethod
964986
def get_shipping_samples(self, limit=None, update_cache=False):
965987
cache_key = '%s|%s|%s' % (Feature.DEFAULT_CACHE_KEY, 'samples', limit)
@@ -1130,7 +1152,8 @@ def put(self, notify=True, **kwargs):
11301152
visibility = ndb.IntegerProperty(required=False) # Deprecated
11311153

11321154
# Standards details.
1133-
standardization = ndb.IntegerProperty(required=True)
1155+
standardization = ndb.IntegerProperty(required=True) # Deprecated
1156+
standard_maturity = ndb.IntegerProperty(required=True, default=UNKNOWN_STD)
11341157
spec_link = ndb.StringProperty()
11351158
api_spec = ndb.BooleanProperty(default=False)
11361159
spec_mentors = ndb.StringProperty(repeated=True)

pages/guide.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ def process_post_data(self, feature_id, stage_id=0):
294294
if self.touched('spec_link'):
295295
feature.spec_link = self.parse_link('spec_link')
296296

297+
if self.touched('standard_maturity'):
298+
feature.standard_maturity = self.parse_int('standard_maturity')
299+
297300
if self.touched('api_spec'):
298301
feature.api_spec = self.form.get('api_spec') == 'on'
299302

pages/guideforms.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ def validate(self, value):
169169
'success of this feature, such as a link to the UseCounter(s) you '
170170
'have set up.')),
171171

172-
'standardization': forms.ChoiceField(
173-
required=False, label='Standardization',
174-
choices=models.STANDARDIZATION.items(),
175-
initial=models.EDITORS_DRAFT,
176-
help_text=("The standardization status of the API. In bodies that don't "
177-
"use this nomenclature, use the closest equivalent.")),
172+
# 'standardization' is deprecated
173+
174+
'standard_maturity': forms.ChoiceField(
175+
required=False, label='Standard maturity',
176+
choices=models.STANDARD_MATURITY_CHOICES.items(),
177+
initial=models.PROPOSAL_STD,
178+
help_text=('How far along is the standard that this '
179+
'feature implements?')),
178180

179181
'unlisted': forms.BooleanField(
180182
required=False, initial=False,
@@ -712,7 +714,7 @@ def define_form_class_using_shared_fields(class_name, field_spec_list):
712714

713715
NewFeature_Prototype = define_form_class_using_shared_fields(
714716
'NewFeature_Prototype',
715-
('spec_link', 'api_spec', 'spec_mentors',
717+
('spec_link', 'standard_maturity', 'api_spec', 'spec_mentors',
716718
'intent_to_implement_url', 'comments'))
717719
# TODO(jrobbins): advise user to request a tag review
718720

@@ -740,7 +742,8 @@ def define_form_class_using_shared_fields(class_name, field_spec_list):
740742

741743
NewFeature_EvalReadinessToShip = define_form_class_using_shared_fields(
742744
'NewFeature_EvalReadinessToShip',
743-
('doc_links', 'tag_review', 'spec_link', 'interop_compat_risks',
745+
('doc_links', 'tag_review', 'spec_link',
746+
'standard_maturity', 'interop_compat_risks',
744747
'safari_views', 'safari_views_link', 'safari_views_notes',
745748
'ff_views', 'ff_views_link', 'ff_views_notes',
746749
'ie_views', 'ie_views_link', 'ie_views_notes',
@@ -792,7 +795,7 @@ def define_form_class_using_shared_fields(class_name, field_spec_list):
792795
Existing_Prototype = define_form_class_using_shared_fields(
793796
'Existing_Prototype',
794797
('owner', 'blink_components', 'motivation', 'explainer_links',
795-
'spec_link', 'api_spec', 'bug_url', 'launch_bug_url',
798+
'spec_link', 'standard_maturity', 'api_spec', 'bug_url', 'launch_bug_url',
796799
'intent_to_implement_url', 'comments'))
797800

798801

@@ -806,7 +809,7 @@ def define_form_class_using_shared_fields(class_name, field_spec_list):
806809

807810
PSA_Implement = define_form_class_using_shared_fields(
808811
'Any_Implement',
809-
('spec_link', 'comments'))
812+
('spec_link', 'standard_maturity', 'comments'))
810813
# TODO(jrobbins): advise user to request a tag review
811814

812815

@@ -883,7 +886,8 @@ def define_form_class_using_shared_fields(class_name, field_spec_list):
883886
Flat_Implement = define_form_class_using_shared_fields(
884887
'Flat_Implement',
885888
(# Standardization
886-
'spec_link', 'api_spec', 'spec_mentors', 'intent_to_implement_url'))
889+
'spec_link', 'standard_maturity', 'api_spec', 'spec_mentors',
890+
'intent_to_implement_url'))
887891

888892

889893
Flat_DevTrial = define_form_class_using_shared_fields(
@@ -997,7 +1001,8 @@ def make_display_specs(*shared_field_names):
9971001
'initial_public_proposal_url', 'explainer_links',
9981002
'requires_embedder_support'),
9991003
models.INTENT_IMPLEMENT: make_display_specs(
1000-
'spec_link', 'api_spec', 'spec_mentors', 'intent_to_implement_url'),
1004+
'spec_link', 'standard_maturity', 'api_spec', 'spec_mentors',
1005+
'intent_to_implement_url'),
10011006
models.INTENT_EXPERIMENT: make_display_specs(
10021007
'devtrial_instructions', 'doc_links',
10031008
'interop_compat_risks',

static/elements/chromedash-feature-detail.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ class ChromedashFeatureDetail extends LitElement {
104104
getFieldValue(fieldDef) {
105105
const fieldId = fieldDef[0];
106106
let value = this.feature[fieldId];
107+
if (fieldId == 'spec_link') {
108+
value = this.feature.standards.spec;
109+
}
110+
if (fieldId == 'standard_maturity') {
111+
value = this.feature.standards.maturity;
112+
}
107113
if (value && value.text) {
108114
value = value.text;
109115
}

0 commit comments

Comments
 (0)