Skip to content

Commit

Permalink
Merge pull request #237 from tnc-ca-geo/category-config-fix
Browse files Browse the repository at this point in the history
Accomodate long category names in automation rule form
  • Loading branch information
nathanielrindlaub authored Aug 23, 2024
2 parents 4d0dcc3 + 209fb83 commit ecd2108
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/features/projects/AddAutomationRuleForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ const AddAutomationRuleForm = ({ project, availableModels, hideAddRuleForm, rule
<FieldArray name="categoryConfigs">
<>
{Object.entries(values.action.categoryConfig)
.filter(([k]) => k !== 'empty') // NOTE: manually hiding "empty" categories b/c it isn't a real category returned by MDv5
.filter(
([k]) =>
!(values.action.model.value.includes('megadetector') && k === 'empty'),
) // NOTE: manually hiding "empty" categories b/c it isn't a real category returned by MDv5
.map(([k, v]) => (
<CategoryConfigForm key={k} catName={k} config={v} />
))}
Expand Down
6 changes: 4 additions & 2 deletions src/features/projects/CategoryConfigForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CategoryName = styled(CheckboxLabel, {
fontSize: '$3',
fontFamily: '$Roboto',
fontWeight: '$2',
minWidth: '130px',
minWidth: '250px',
});

const ConfThreshold = styled('div', {
Expand Down Expand Up @@ -146,7 +146,9 @@ const CategoryConfigForm = ({ catName, config }) => {
disabled={config.disabled}
/>
</div>
<ConfDisplay disabled={config.disabled}>{Math.round(config.confThreshold * 100)}%</ConfDisplay>
<ConfDisplay disabled={config.disabled}>
{Math.round(config.confThreshold * 100)}%
</ConfDisplay>
</ConfThreshold>
</StyledFieldRow>
);
Expand Down

0 comments on commit ecd2108

Please sign in to comment.