diff --git a/js/src/admin/components/AdminNav.js b/js/src/admin/components/AdminNav.js
index 8ee4b9699..0c307e7b3 100644
--- a/js/src/admin/components/AdminNav.js
+++ b/js/src/admin/components/AdminNav.js
@@ -126,16 +126,17 @@ export default class AdminNav extends Component {
categorizedExtensions[category].map((extension) => {
const query = this.query().toUpperCase();
- const title = extension.extra['flarum-extension'].title;
+ const title = extension.extra['flarum-extension'].title || '';
+ const description = extension.description || '';
- if (!query || title.toUpperCase().includes(query) || extension.description.toUpperCase().includes(query)) {
+ if (!query || title.toUpperCase().includes(query) || description.toUpperCase().includes(query)) {
items.add(
`extension-${extension.id}`,
{title}
,
diff --git a/js/src/admin/components/AdminPage.js b/js/src/admin/components/AdminPage.js
index 4c009c7da..6dc1a5a4a 100644
--- a/js/src/admin/components/AdminPage.js
+++ b/js/src/admin/components/AdminPage.js
@@ -98,35 +98,41 @@ export default class AdminPage extends Page {
return entry.call(this);
}
- const setting = entry.setting;
- const help = entry.help;
- delete entry.help;
+ const { setting, help, ...componentAttrs } = entry;
+
+ delete componentAttrs.help;
const value = this.setting([setting])();
- if (['bool', 'checkbox', 'switch', 'boolean'].includes(entry.type)) {
+ if (['bool', 'checkbox', 'switch', 'boolean'].includes(componentAttrs.type)) {
return (
-
- {entry.label}
+
+ {componentAttrs.label}
{help}
);
- } else if (['select', 'dropdown', 'selectdropdown'].includes(entry.type)) {
+ } else if (['select', 'dropdown', 'selectdropdown'].includes(componentAttrs.type)) {
return (
-
+
{help}
-
+
);
} else {
- entry.className = classList(['FormControl', entry.className]);
+ componentAttrs.className = classList(['FormControl', componentAttrs.className]);
return (
- {entry.label ?
: ''}
+ {componentAttrs.label ?
: ''}
{help}
-
+
);
}