Skip to content

Commit 37762f8

Browse files
committed
replace overInputs with panelHeader in login page injection configuration
1 parent 30def17 commit 37762f8

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

adminforth/commands/createCustomComponent/configUpdater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export async function injectLoginComponent(indexFilePath, componentPath, injecti
295295
if (!n.ObjectExpression.check(loginPageInjections)) return false;
296296

297297
// Determine target property based on injection type
298-
targetProperty = injectionType === 'beforeLogin' ? 'overInputs' : 'underInputs';
298+
targetProperty = injectionType === 'beforeLogin' ? 'panelHeader' : 'underInputs';
299299

300300
let targetProp = loginPageInjections.properties.find(
301301
p => n.ObjectProperty.check(p) && n.Identifier.check(p.key) && p.key.name === targetProperty

adminforth/documentation/docs/tutorial/03-Customization/08-pageInjections.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Here is how it looks:
141141
142142
You can also inject custom components to the login page.
143143
144-
`loginPageInjections.underInputs` and `loginPageInjections.overInputs` allows to add one or more panels under or over the login form inputs:
144+
`loginPageInjections.underInputs` and `loginPageInjections.panelHeader` allows to add one or more panels under or over the login form inputs:
145145
146146
![login Page Injections underInputs](<loginPageInjection.png>)
147147
@@ -172,7 +172,7 @@ Now create file `CustomLoginFooter.vue` in the `custom` folder of your project:
172172
</template>
173173
```
174174
175-
Also you can add `overInputs`
175+
Also you can add `panelHeader`
176176
177177
```ts title="/index.ts"
178178
@@ -182,7 +182,7 @@ new AdminForth({
182182
loginPageInjections: {
183183
underInputs: '@@/CustomLoginFooter.vue',
184184
//diff-add
185-
overInputs: '@@/CustomLoginHeader.vue',
185+
panelHeader: '@@/CustomLoginHeader.vue',
186186
}
187187
...
188188
}

adminforth/modules/configValidator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ export default class ConfigValidator implements IConfigValidator {
115115

116116
const loginPageInjections: AdminForthConfigCustomization['loginPageInjections'] = {
117117
underInputs: [],
118-
overInputs: [],
118+
panelHeader: [],
119119
};
120120

121121
if (this.inputConfig.customization?.loginPageInjections) {
122-
const ALLOWED_LOGIN_INJECTIONS = ['underInputs', 'overInputs']
122+
const ALLOWED_LOGIN_INJECTIONS = ['underInputs', 'panelHeader']
123123
Object.keys(this.inputConfig.customization.loginPageInjections).forEach((injection) => {
124124
if (ALLOWED_LOGIN_INJECTIONS.includes(injection)) {
125125
loginPageInjections[injection] = this.validateAndListifyInjectionNew(this.inputConfig.customization.loginPageInjections, injection, errors);

adminforth/spa/src/views/LoginView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
<!-- Modal header -->
3232
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
3333

34-
<div v-if="coreStore?.config?.loginPageInjections?.overInputs.length > 0">
34+
<div v-if="coreStore?.config?.loginPageInjections?.panelHeader.length > 0">
3535
<component
36-
v-for="(c, index) in coreStore?.config?.loginPageInjections?.overInputs || []"
36+
v-for="(c, index) in coreStore?.config?.loginPageInjections?.panelHeader || []"
3737
:key="index"
3838
:is="getCustomComponent(c)"
3939
:meta="c.meta"

adminforth/types/Back.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ interface AdminForthInputConfigCustomization {
747747
*/
748748
loginPageInjections?: {
749749
underInputs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
750-
overInputs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
750+
panelHeader?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
751751
}
752752

753753
/**
@@ -1055,7 +1055,7 @@ export interface AdminForthConfigCustomization extends Omit<AdminForthInputConfi
10551055

10561056
loginPageInjections: {
10571057
underInputs: Array<AdminForthComponentDeclarationFull>,
1058-
overInputs: Array<AdminForthComponentDeclarationFull>,
1058+
panelHeader: Array<AdminForthComponentDeclarationFull>,
10591059
},
10601060

10611061
globalInjections: {

adminforth/types/Common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ export interface AdminForthConfigForFrontend {
10601060
loginPromptHTML?: string,
10611061
loginPageInjections: {
10621062
underInputs: Array<AdminForthComponentDeclaration>,
1063-
overInputs: Array<AdminForthComponentDeclaration>,
1063+
panelHeader: Array<AdminForthComponentDeclaration>,
10641064
},
10651065
rememberMeDays: number,
10661066
showBrandNameInSidebar: boolean,

0 commit comments

Comments
 (0)