Skip to content

Commit ff29beb

Browse files
committed
✨ Update highlights context settings interface
1 parent e6ea23e commit ff29beb

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

static/app/data/forms/projectGeneralSettings.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,12 @@ export const fields: Record<string, Field> = {
132132
return schema;
133133
},
134134
validate: ({id, form}) => {
135-
if (!form.schema) {
136-
return [];
137-
}
138-
139-
try {
140-
JSON.parse(form.schema);
141-
} catch (e) {
142-
return [[id, 'Invalid JSON']];
135+
if (form.highlightContext) {
136+
try {
137+
JSON.parse(form.highlightContext);
138+
} catch (e) {
139+
return [[id, 'Invalid JSON']];
140+
}
143141
}
144142
return [];
145143
},

static/app/views/settings/projectGeneralSettings/index.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,24 +302,23 @@ class ProjectGeneralSettings extends DeprecatedAsyncView<Props, State> {
302302
},
303303
};
304304

305-
const detailsFields = [fields.name, fields.platform];
306-
if (organization.features.includes('event-tags-tree-ui')) {
307-
detailsFields.push(fields.highlightTags);
308-
detailsFields.push(fields.highlightContext);
309-
}
310-
311305
return (
312306
<div>
313307
<SettingsPageHeader title={t('Project Settings')} />
314308
<PermissionAlert project={project} />
315-
316309
<Form {...formProps}>
317310
<JsonForm
318311
{...jsonFormProps}
319312
title={t('Project Details')}
320-
fields={detailsFields}
313+
fields={[fields.name, fields.platform]}
321314
/>
322-
315+
{organization.features.includes('event-tags-tree-ui') && (
316+
<JsonForm
317+
{...jsonFormProps}
318+
title={t('Highlights')}
319+
fields={[fields.highlightTags, fields.highlightContext]}
320+
/>
321+
)}
323322
<JsonForm
324323
{...jsonFormProps}
325324
title={t('Email')}

0 commit comments

Comments
 (0)