Skip to content

Commit

Permalink
Merge pull request #370 from threefoldtech/development_fix_connector_…
Browse files Browse the repository at this point in the history
…password

Fix password input validation
  • Loading branch information
zaelgohary authored May 28, 2023
2 parents 1da665c + 846831e commit 9df70a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions packages/playground/src/components/dynamic_tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ const props = defineProps<{
destroy?: boolean;
hideTabs?: boolean;
}>();
const emits = defineEmits<{ (event: "update:modelValue", value: number): void }>();
const emits = defineEmits<{
(event: "update:modelValue", value: number): void;
(event: "tab:change", value: number): void;
}>();

const forms = ref<any[]>([]);

const activeTab = ref<number>(props.modelValue ?? 0);
watch(activeTab, t => emits("update:modelValue", t));
watch(activeTab, t => {
emits("update:modelValue", t);
emits("tab:change", t);
});

const valid = computed(() => forms.value.reduce((r, f) => r && f.valid, true));
const invalid = computed(() => !valid.value);
Expand Down
5 changes: 4 additions & 1 deletion packages/playground/src/weblets/profile_manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
{ title: 'Register', value: 'register' },
]"
v-model="activeTab"
@tab:change="passwordInput.validate(password)"
>
<v-container>
<form-validator v-model="isValidForm">
Expand Down Expand Up @@ -94,6 +95,7 @@
validatePassword,
]"
#="{ props: validationProps }"
ref="passwordInput"
>
<v-text-field
label="Password"
Expand Down Expand Up @@ -245,7 +247,7 @@
import { validateMnemonic } from "bip39";
import Cryptr from "cryptr";
import md5 from "md5";
import { onMounted, ref, watch } from "vue";
import { onMounted, type Ref, ref, watch } from "vue";
import { generateKeyPair } from "web-ssh-keygen";
import { useProfileManager } from "../stores";
Expand All @@ -271,6 +273,7 @@ const balance = ref<Balance>();
const activeTab = ref(0);
const password = ref("");
const passwordInput = ref() as Ref<{ validate(value: string): Promise<boolean> }>;
let interval: any;
watch(
Expand Down

0 comments on commit 9df70a7

Please sign in to comment.