Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shipping_year field. #4257

Merged
merged 6 commits into from
Aug 20, 2024
Merged
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
1 change: 1 addition & 0 deletions api/api_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
('availability_expectation', 'str'),
('blink_components', 'split_str'),
('enterprise_impact', 'int'),
('shipping_year', 'int'),
('breaking_change', 'bool'),
('bug_url', 'link'),
('category', 'int'),
Expand Down
1 change: 1 addition & 0 deletions api/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def feature_entry_to_json_verbose(
'first_enterprise_notification_milestone': fe.first_enterprise_notification_milestone,
'enterprise_impact': fe.enterprise_impact,
'breaking_change': fe.breaking_change,
'shipping_year': fe.shipping_year,
'flag_name': fe.flag_name,
'finch_name': fe.finch_name,
'non_finch_justification': fe.non_finch_justification,
Expand Down
3 changes: 2 additions & 1 deletion api/converters_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setUp(self):
updater_email='[email protected]', category=1,
owner_emails=['[email protected]'], feature_type=0,
editor_emails=['[email protected]', '[email protected]'],
impl_status_chrome=5, blink_components=['Blink'],
impl_status_chrome=5, blink_components=['Blink'], shipping_year=2024,
spec_link='https://example.com/spec',
sample_links=['https://example.com/samples'],
screenshot_links=['https://example.com/screenshot'],
Expand Down Expand Up @@ -293,6 +293,7 @@ def test_feature_entry_to_json_verbose__normal(self):
'unlisted': False,
'api_spec': False,
'enterprise_impact': ENTERPRISE_IMPACT_NONE,
'shipping_year': 2024,
'breaking_change': False,
'is_released': True,
'category': 'Web Components',
Expand Down
2 changes: 2 additions & 0 deletions client-src/elements/form-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export const NEW_FEATURE_FORM_FIELDS = [
'summary',
'unlisted',
'enterprise_impact',
'shipping_year',
'owner',
'editors',
'cc_recipients',
Expand Down Expand Up @@ -193,6 +194,7 @@ export const FLAT_METADATA_FIELDS: MetadataFields = {
'summary',
'unlisted',
'enterprise_impact',
'shipping_year',
'owner',
'editors',
'cc_recipients',
Expand Down
11 changes: 11 additions & 0 deletions client-src/elements/form-field-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface FieldAttrs {
chromedash_split_pattern?: string;
disabled?: boolean;
min?: number;
max?: number;
}

interface MilestoneRange {
Expand Down Expand Up @@ -2023,6 +2024,16 @@ export const ALL_FIELDS: Record<string, Field> = {
GitHub issues, or WICG page).`,
},

shipping_year: {
type: 'input',
attrs: {type: 'number', min: 2000, max: 2050},
initial: new Date().getFullYear(),
required: true,
label: 'Estimated shipping year',
help_text: html` Estimate of the calendar year in which this will first ship
on any platform. E.g., 2024.`,
},

enterprise_policies: {
type: 'input',
attrs: MULTI_STRING_FIELD_ATTRS,
Expand Down
1 change: 1 addition & 0 deletions internals/core_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class FeatureEntry(ndb.Model): # Copy from Feature
first_enterprise_notification_milestone = ndb.IntegerProperty()
enterprise_impact = ndb.IntegerProperty(default=ENTERPRISE_IMPACT_NONE)
breaking_change = ndb.BooleanProperty(default=False)
shipping_year = ndb.IntegerProperty()

# Implementation in Chrome
impl_status_chrome = ndb.IntegerProperty(required=True, default=NO_ACTIVE_DEV)
Expand Down
1 change: 1 addition & 0 deletions internals/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class VerboseFeatureDict(TypedDict):
first_enterprise_notification_milestone: int | None
breaking_change: bool
enterprise_impact: int
shipping_year: int | None

# Implementation in Chrome
flag_name: str | None
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions pages/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def process_post_data(self, **kwargs):
# TODO(jrobbins): Validate input, even though it is done on client.

feature_type = int(self.form.get('feature_type', 0))
shipping_year = int(self.form.get('shipping_year', 0))

has_enterprise_impact = int(self.form.get('enterprise_impact', '1')) > ENTERPRISE_IMPACT_NONE
enterprise_notification_milestone = self.form.get('first_enterprise_notification_milestone')
Expand Down Expand Up @@ -90,6 +91,8 @@ def process_post_data(self, **kwargs):
first_enterprise_notification_milestone=enterprise_notification_milestone,
blink_components=blink_components,
tag_review_status=processes.initial_tag_review_status(feature_type))
if shipping_year:
feature_entry.shipping_year = shipping_year
key: ndb.Key = feature_entry.put()
search_fulltext.index_feature(feature_entry)

Expand Down Expand Up @@ -258,6 +261,7 @@ def get_template_data(self, **defaults):
('feature_notes', 'str'),
('breaking_change', 'bool'),
('enterprise_impact', 'int'),
('shipping_year', 'int'),
('ongoing_constraints', 'str')]

# Old field name, new field name
Expand Down