Make certain trial creation request form fields required (#3354)

* trial creation form fields are required

* consistent naming convention

* `ot_emails` not required after `ot_owner_email`
This commit is contained in:
Daniel Smith 2023-09-25 11:09:45 -07:00 коммит произвёл GitHub
Родитель 4529ace384
Коммит 837b51bcc0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 56 добавлений и 16 удалений

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

@ -152,7 +152,7 @@ export class ChromedashOTCreationPage extends LitElement {
renderFields(section) {
const fields = section.fields.map(field => {
const value = getStageValue(this.stage, field);
let value = getStageValue(this.stage, field);
let touched = false;
// The requester's email should be a contact by default.
if (field === 'ot_owner_email' && !value) {

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

@ -292,13 +292,7 @@ const FLAT_ORIGIN_TRIAL_FIELDS = {
// TODO(jrobbins): display r4dt_url instead when deprecating.
'i2e_lgtms',
'intent_to_experiment_url',
'ot_chromium_trial_name',
'ot_webfeature_use_counter',
'ot_documentation_url',
'origin_trial_feedback_url',
'ot_is_deprecation_trial',
'ot_has_third_party_support',
'ot_is_critical_trial',
],
},
// Implementation
@ -523,9 +517,9 @@ export const ORIGIN_TRIAL_CREATION_FIELDS = {
'ot_description',
'ot_owner_email',
'ot_emails',
'ot_milestone_desktop_start',
'ot_milestone_desktop_end',
'intent_to_experiment_url',
'ot_creation__milestone_desktop_first',
'ot_creation__milestone_desktop_last',
'ot_intent_to_experiment_url',
'ot_documentation_url',
'ot_feedback_submission_url',
'ot_chromium_trial_name',

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

@ -238,9 +238,13 @@ export const STAGE_SPECIFIC_FIELDS = new Set([
'intent_to_experiment_url',
'intent_to_extend_experiment_url',
'intent_thread_url',
'ot_creation__intent_to_experiment_url',
'r4dt_url',
// Misc fields.
'display_name',
'ot_display_name',
'ot_owner_email',
'origin_trial_feedback_url',
'ot_chromium_trial_name',
'ot_description',
@ -252,6 +256,8 @@ export const STAGE_SPECIFIC_FIELDS = new Set([
'ot_is_deprecation_trial',
'ot_has_third_party_support',
'ot_is_critical_trial',
'ot_creation__milestone_desktop_first',
'ot_creation__milestone_desktop_last',
'finch_url',
'experiment_goals',
'experiment_risks',
@ -277,6 +283,8 @@ export const STAGE_FIELD_NAME_MAPPING = {
ot_milestone_android_end: 'android_last',
ot_milestone_webview_start: 'webview_first',
ot_milestone_webview_end: 'webview_last',
ot_creation__milestone_desktop_first: 'desktop_first',
ot_creation__milestone_desktop_last: 'desktop_last',
dt_milestone_desktop_start: 'desktop_first',
dt_milestone_android_start: 'android_first',
dt_milestone_ios_start: 'ios_first',
@ -290,6 +298,8 @@ export const STAGE_FIELD_NAME_MAPPING = {
intent_to_ship_url: 'intent_thread_url',
intent_to_experiment_url: 'intent_thread_url',
intent_to_extend_experiment_url: 'intent_thread_url',
ot_creation__intent_to_experiment_url: 'intent_thread_url',
r4dt_url: 'intent_thread_url',
};
export const DEPRECATED_FIELDS = new Set([

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

@ -672,6 +672,7 @@ export const ALL_FIELDS = {
'r4dt_url': {
// form field name matches underlying DB field (sets "intent_to_experiment_url" field in DB).
name: 'intent_to_experiment_url',
type: 'input',
attrs: URL_FIELD_ATTRS,
required: false,
@ -1020,18 +1021,21 @@ export const ALL_FIELDS = {
'ot_chromium_trial_name': {
type: 'input',
attrs: TEXT_FIELD_ATTRS,
required: false,
required: true,
label: 'Chromium trial name',
help_text: html`
Name for the trial, as specified in <a target="_blank"
href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5"
>runtime_enabled_features.json5</a>.`,
>runtime_enabled_features.json5</a>.
<br/>
<p style="color: red"><strong>Note:</strong> This name should be unique
and should not be used by any previous origin trials!</p>`,
},
'ot_documentation_url': {
type: 'input',
attrs: URL_FIELD_ATTRS,
required: false,
required: true,
label: 'Documentation link',
help_text: html`
Link to more information to help developers use the trial's feature
@ -1041,7 +1045,7 @@ export const ALL_FIELDS = {
'ot_emails': {
type: 'input',
attrs: MULTI_EMAIL_FIELD_ATTRS,
required: true,
required: false,
label: 'Origin trial contacts',
help_text: html`
List any other individuals or groups to include on the contact list
@ -1092,7 +1096,7 @@ export const ALL_FIELDS = {
placeholder: 'e.g. "kWebFeature"',
pattern: String.raw`k\S*`,
},
required: false,
required: true,
label: 'WebFeature UseCounter name',
help_text: html`
For measuring usage, this must be a single named value from the
@ -1101,6 +1105,38 @@ export const ALL_FIELDS = {
>web_feature.mojom</a>.`,
},
'ot_creation__intent_to_experiment_url': {
name: 'intent_to_experiment_url',
type: 'input',
attrs: URL_FIELD_ATTRS,
required: true,
label: 'Intent to Experiment link',
help_text: html`After you have started the "Intent to Experiment"
discussion thread, link to it here.`,
},
'ot_creation__milestone_desktop_first': {
name: 'ot_milestone_desktop_start',
type: 'input',
attrs: MILESTONE_NUMBER_FIELD_ATTRS,
required: true,
label: 'Trial milestone start',
help_text: html`
First milestone that will support an origin
trial of this feature.`,
},
'ot_creation__milestone_desktop_last': {
name: 'ot_milestone_desktop_end',
type: 'input',
attrs: MILESTONE_NUMBER_FIELD_ATTRS,
required: true,
label: 'Trial milestone end',
help_text: html`
Last milestone that will support an origin
trial of this feature.`,
},
'anticipated_spec_changes': {
type: 'textarea',
attrs: {rows: 4},
@ -1457,7 +1493,7 @@ export const ALL_FIELDS = {
'ot_feedback_submission_url': {
type: 'input',
attrs: URL_FIELD_ATTRS,
required: false,
required: true,
label: 'Feature feedback link',
help_text: html`
Link for developers to file feedback on the feature