Skip to content

Commit 97e2e81

Browse files
committed
refactor: update component type in configuration and streamline component injection logic
1 parent 0772b2b commit 97e2e81

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

adminforth/modules/codeInjector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ class CodeInjector implements ICodeInjector {
484484

485485
if (this.adminforth.config.auth.userMenuSettingsPages) {
486486
for (const settingPage of this.adminforth.config.auth.userMenuSettingsPages) {
487-
checkInjections([{ file: settingPage.component }]);
487+
checkInjections([settingPage.component]);
488488
}
489489
}
490490

adminforth/modules/configValidator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ export default class ConfigValidator implements IConfigValidator {
10011001
}
10021002
if (newConfig.auth.userMenuSettingsPages) {
10031003
for (const page of newConfig.auth.userMenuSettingsPages) {
1004-
this.validateComponent({file: page.component}, errors);
1004+
this.validateComponent(page.component, errors);
10051005
}
10061006
}
10071007

adminforth/spa/src/views/SettingsView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<template v-for="(c,i) in coreStore?.config?.settingPages" :key="`${settingPageSlotName(c,i)}-content`" v-slot:[settingPageSlotName(c,i)]>
1515
<component
16-
:is="getCustomComponent({file: c.component || ''})"
16+
:is="getCustomComponent(c.component)"
1717
:resource="coreStore.resource"
1818
:adminUser="coreStore.adminUser"
1919
/>

adminforth/types/Back.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ export interface AdminForthInputConfig {
10441044
icon?: string,
10451045
pageLabel: string,
10461046
slug?: string,
1047-
component: string
1047+
component: AdminForthComponentDeclarationFull,
10481048
}[],
10491049
},
10501050

adminforth/types/Common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ export interface AdminForthConfigForFrontend {
10981098
icon?: string,
10991099
pageLabel: string,
11001100
slug?: string,
1101-
component?: string,
1101+
component?: AdminForthComponentDeclarationFull,
11021102
}[],
11031103
}
11041104

0 commit comments

Comments
 (0)