Skip to content

Commit

Permalink
Check for name prop on field spec for extensions (#3436)
Browse files Browse the repository at this point in the history
* check for name prop on field spec for extensions

* lint
  • Loading branch information
DanielRyanSmith authored Oct 21, 2023
1 parent c7cc8f6 commit c4f3f5a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions client-src/elements/chromedash-ot-extension-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {LitElement, css, html} from 'lit';
import {ref} from 'lit/directives/ref.js';
import {
formatFeatureChanges,
getStageValue,
showToastMessage,
setupScrollToHash} from './utils.js';
import './chromedash-form-table.js';
import './chromedash-form-field.js';
import {ORIGIN_TRIAL_EXTENSION_FIELDS} from './form-definition.js';
import {OT_EXTENSION_STAGE_MAPPING} from './form-field-enums.js';
import {ALL_FIELDS} from './form-field-specs';
import {SHARED_STYLES} from '../css/shared-css.js';
import {FORM_STYLES} from '../css/forms-css.js';

Expand Down Expand Up @@ -196,20 +196,19 @@ export class ChromedashOTExtensionPage extends LitElement {

renderFields(section) {
const fields = section.fields.map(field => {
const value = getStageValue(this.stage, field);
const featureJSONKey = ALL_FIELDS[field].name || field;
// Add the field to this component's stage before creating the field component.
const index = this.fieldValues.length;
this.fieldValues.push({
name: field,
name: featureJSONKey,
touched: false,
value,
value: null,
stageId: this.stage.id,
});

return html`
<chromedash-form-field
name=${field}
value=${value}
name=${featureJSONKey}
index=${index}
@form-field-update="${this.handleFormFieldUpdate}">
</chromedash-form-field>
Expand Down

0 comments on commit c4f3f5a

Please sign in to comment.