Skip to content

Commit 7378865

Browse files
committed
refactor: clean up unused code and improve null checks in settings components
1 parent bcd3552 commit 7378865

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/metadata-settings/metadataSettings.component.jsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,6 @@ class MetadataSettings extends Component {
207207
td: { border: '1px solid #ddd', padding: '10px' },
208208
}
209209

210-
// const fieldGetter =
211-
// (field, filter = (x) => x) =>
212-
// // eslint-disable-next-line react/display-name, react/prop-types
213-
// ({ rowIndex, ...props }) =>
214-
// (
215-
// <Cell {...props}>
216-
// {filter(this.state.metadataVersions[rowIndex][field])}
217-
// </Cell>
218-
// )
219-
220210
const dateFmt = (str) => new Date(str).toLocaleString()
221211

222212
return (

src/settingsFields.component.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,19 +334,18 @@ class SettingsFields extends React.Component {
334334

335335
// Base config, common for all component types
336336
const validators = []
337-
if (mapping.validators) {
337+
if (mapping && mapping.validators) {
338338
mapping.validators.forEach((name) => {
339339
if (wordToValidatorMap.has(name)) {
340340
const validator = wordToValidatorMap.get(name)
341341
validators.push({
342342
validator,
343-
message: translateValidatorMessage(
344-
validator.message
345-
),
343+
message: translateValidatorMessage(validator.message),
346344
})
347345
}
348346
})
349347
}
348+
350349

351350
const fieldBase = {
352351
name: key,

0 commit comments

Comments
 (0)