FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

improve types · devforth/adminforth@7ec1e03 · GitHub

Repository navigation

Commit 7ec1e03

Browse files
committed
improve types
1 parent 8791370 commit 7ec1e03

8 files changed

Lines changed: 29 additions & 13 deletions

File tree

‎Changelog.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- fixed sources for allowedActions in hooks
2424
- menu now auto-closes on mobile after selecting item
2525
- backplate on mobile now is higher then table sticky header
26+
- fix split js error when going to 404 page in logged out state
2627

2728
### Improved
2829

@@ -31,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3132
- added `adminforth.menu.refreshMenuBadges()` to refresh all badges in menu from the frontend component
3233
- created env HEAVY_DEBUG_QUERY to log SQL queries in the console
3334
- simplified logic on detecting whether to init user Dropdown or not
35+
- add autocomplete suggestion for password inputs
36+
3437

3538
### Added
3639

‎adminforth/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎adminforth/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "adminforth",
3-
"version": "1.4.3-next.38",
3+
"version": "1.4.3-next.39",
44
"description": "OpenSource Vue3 powered forth-generation admin panel",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

‎adminforth/plugins/email-password-reset/custom/ResetPassword.vue‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">New password</label>
4242
<input
4343
:type="unmasked ? 'text' : 'password'"
44-
name="password" id="password"
44+
name="password" id="password"
45+
autocomplete="new-password"
4546
v-model="password"
4647
@keydown.enter="passwordConfirmationInput.focus()"
4748
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
@@ -63,6 +64,7 @@
6364
<input
6465
:type="unmasked ? 'text' : 'password'"
6566
name="password_confirmation" id="password_confirmation"
67+
autocomplete="new-password"
6668
v-model="passwordConfirmation"
6769
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
6870
placeholder="Confirm new password" required

‎adminforth/plugins/open-signup/custom/SignupPage.vue‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
<label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your email</label>
4242
<input type="email" name="email" id="email"
4343
tabindex="1"
44-
@keydown.enter="passwordInput.focus()"
44+
autocomplete="username"
45+
@keydown.enter="passwordInput?.focus()"
4546
ref="emailInput"
4647
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
4748
placeholder="name@company.com"
@@ -52,11 +53,12 @@
5253
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">New password</label>
5354
<input
5455
tabindex="2"
56+
autocomplete="new-password"
5557
ref="passwordInput"
5658
:type="unmasked ? 'text' : 'password'"
5759
name="password" id="password"
5860
v-model="password"
59-
@keydown.enter="passwordConfirmationInput.focus()"
61+
@keydown.enter="passwordConfirmationInput?.focus()"
6062
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
6163
placeholder="New password" required
6264
/>
@@ -75,6 +77,7 @@
7577
<label for="password_confirmation" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Confirm new password</label>
7678
<input
7779
ref="passwordConfirmationInput"
80+
autocomplete="new-password"
7881
:type="unmasked ? 'text' : 'password'"
7982
name="password_confirmation" id="password_confirmation"
8083
tabindex="3"
@@ -142,9 +145,9 @@ const inProgress = ref(false);
142145
const coreStore = useCoreStore();
143146
const requestSent = ref(false);
144147
145-
const emailInput = ref(null);
146-
const passwordInput = ref(null);
147-
const passwordConfirmationInput = ref(null);
148+
const emailInput: Ref<HTMLInputElement | null> = ref(null);
149+
const passwordInput: Ref<HTMLInputElement | null> = ref(null);
150+
const passwordConfirmationInput: Ref<HTMLInputElement | null> = ref(null);
148151
149152
const password = ref("");
150153
const passwordConfirmation = ref("");
@@ -219,7 +222,7 @@ onMounted(async () => {
219222
return;
220223
221224
}
222-
emailInput.value.focus();
225+
emailInput.value?.focus();
223226
});
224227
225228

‎adminforth/plugins/open-signup/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class OpenSignupPlugin extends AdminForthPlugin {
101101
}
102102
// unshift because if e.g. 2fa set it's hook, this one should be first
103103
(adminforth.config.auth.beforeLoginConfirmation as BeforeLoginConfirmationFunction[]).unshift(
104-
async ({ adminUser }) => {
104+
async ({ adminUser }: { adminUser: AdminUser }): Promise<{ body: { allowedLogin: boolean }; error?: string; }> => {
105105
if (!adminUser.dbUser[this.emailConfirmedField.name]) {
106106
return { body: { allowedLogin: false }, error: 'You need to confirm your email to be able to login' };
107107
}

‎adminforth/spa/src/App.vue‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ function humanizeSnake(str: string): string {
328328
watch([route, () => coreStore.resourceById], async () => {
329329
handleCustomLayout()
330330
await new Promise((resolve) => setTimeout(resolve, 0));
331-
const firstParam = Object.values(route.params)[0];
331+
let firstParam: string | null | string[] = Object.values(route.params)[0];
332+
if (typeof firstParam !== 'string') {
333+
firstParam = null;
334+
}
332335
const resourceTitle = coreStore.resourceById[route.params?.resourceId as string]?.label || (firstParam ? humanizeSnake(firstParam as string) : null);
333336
title.value = `${coreStore.config?.title || coreStore.config?.brandName || 'Adminforth'} | ${ resourceTitle || route.meta.title || ' '}`;
334337
useHead({

‎adminforth/spa/src/views/LoginView.vue‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
<form class="space-y-4" @submit.prevent>
4040
<div>
4141
<label for="username" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your {{ coreStore.config?.usernameFieldName?.toLowerCase() }}</label>
42-
<input type="username" name="username" id="username"
42+
<input
43+
autocomplete="username"
44+
type="username"
45+
name="username"
46+
id="username"
4347
ref="usernameInput"
4448
@keydown.enter="passwordInput.focus()"
4549
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" placeholder="name@company.com" required />
@@ -48,6 +52,7 @@
4852
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your password</label>
4953
<input
5054
ref="passwordInput"
55+
autocomplete="current-password"
5156
@keydown.enter="login"
5257
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" required />
5358
<button type="button" @click="showPw = !showPw" class="absolute top-12 right-3 -translate-y-1/2 text-gray-400 dark:text-gray-300">

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL