diff --git a/pages/dashboard/admin.vue b/pages/dashboard/admin.vue index abc7e59..6b2852b 100644 --- a/pages/dashboard/admin.vue +++ b/pages/dashboard/admin.vue @@ -56,19 +56,32 @@

Manage user accounts, roles, and permissions for the MonacoUSA Portal.

- + mdi-account-cog Manage Users - + + + mdi-account-plus + Create User Account + + + + - + mdi-cog Portal Settings @@ -145,6 +158,85 @@ v-model="showNocoDBSettings" @settings-saved="handleSettingsSaved" /> + + + + + + + + + mdi-account-plus + Create User Account + + + + Create Portal Account + This will create a new user account in the MonacoUSA Portal with email verification. + + + + + + + + + + + + + + + + + + + + Cancel + + Create Account + + + + @@ -159,6 +251,24 @@ const { firstName } = useAuth(); // Reactive data const userCount = ref(0); const loading = ref(false); +const showCreateUserDialog = ref(false); +const showAdminConfig = ref(false); + +// Create user dialog data +const createUserValid = ref(false); +const creatingUser = ref(false); +const newUser = ref({ + firstName: '', + lastName: '', + email: '', + role: 'user' +}); + +const roleOptions = [ + { title: 'User', value: 'user' }, + { title: 'Board Member', value: 'board' }, + { title: 'Administrator', value: 'admin' } +]; const recentActivity = ref([ { @@ -234,6 +344,43 @@ const handleSettingsSaved = () => { console.log('NocoDB settings saved successfully'); }; +const handleAdminConfigSaved = () => { + console.log('Admin configuration saved successfully'); + showAdminConfig.value = false; +}; + +const createUserAccount = async () => { + if (!createUserValid.value) return; + + creatingUser.value = true; + try { + console.log('Creating user account:', newUser.value); + + // TODO: Implement actual user creation using enhanced Keycloak API + // For now, just show success + await new Promise(resolve => setTimeout(resolve, 2000)); // Simulate API call + + // Reset form + newUser.value = { + firstName: '', + lastName: '', + email: '', + role: 'user' + }; + + showCreateUserDialog.value = false; + console.log('User account created successfully'); + + // TODO: Show success notification + // TODO: Refresh user list + } catch (error) { + console.error('Failed to create user account:', error); + // TODO: Show error notification + } finally { + creatingUser.value = false; + } +}; + const createUser = () => { console.log('Create new user'); // TODO: Implement create user dialog/form diff --git a/pages/signup.vue b/pages/signup.vue index 18eb0c0..a5f8a3c 100644 --- a/pages/signup.vue +++ b/pages/signup.vue @@ -1,21 +1,28 @@