|
|
@ -26,7 +26,6 @@ |
|
|
import OnboardingTypeModal from "./_components/OnboardingTypeModal.svelte" |
|
|
import OnboardingTypeModal from "./_components/OnboardingTypeModal.svelte" |
|
|
import PasswordModal from "./_components/PasswordModal.svelte" |
|
|
import PasswordModal from "./_components/PasswordModal.svelte" |
|
|
import ImportUsersModal from "./_components/ImportUsersModal.svelte" |
|
|
import ImportUsersModal from "./_components/ImportUsersModal.svelte" |
|
|
import analytics, { Events } from "analytics" |
|
|
|
|
|
import { createPaginationStore } from "helpers/pagination" |
|
|
import { createPaginationStore } from "helpers/pagination" |
|
|
|
|
|
|
|
|
const schema = { |
|
|
const schema = { |
|
|
@ -74,6 +73,7 @@ |
|
|
let pageInfo = createPaginationStore() |
|
|
let pageInfo = createPaginationStore() |
|
|
let prevEmail = undefined, |
|
|
let prevEmail = undefined, |
|
|
searchEmail = undefined |
|
|
searchEmail = undefined |
|
|
|
|
|
|
|
|
$: page = $pageInfo.page |
|
|
$: page = $pageInfo.page |
|
|
$: fetchUsers(page, searchEmail) |
|
|
$: fetchUsers(page, searchEmail) |
|
|
|
|
|
|
|
|
@ -110,42 +110,30 @@ |
|
|
admin: true, |
|
|
admin: true, |
|
|
}) |
|
|
}) |
|
|
notifications.success(res.message) |
|
|
notifications.success(res.message) |
|
|
analytics.captureEvent(Events.USER.INVITE, { type: "Email onboarding" }) |
|
|
|
|
|
inviteConfirmationModal.show() |
|
|
inviteConfirmationModal.show() |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log(error) |
|
|
console.log(error) |
|
|
notifications.error("Error inviting user") |
|
|
notifications.error("Error inviting user") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
/* |
|
|
|
|
|
async function createUser() { |
|
|
async function createUser() { |
|
|
try { |
|
|
try { |
|
|
await users.create({ |
|
|
await users.create(userData) |
|
|
email: $email, |
|
|
|
|
|
password, |
|
|
|
|
|
builder, |
|
|
|
|
|
admin, |
|
|
|
|
|
forceResetPassword: true, |
|
|
|
|
|
}) |
|
|
|
|
|
notifications.success("Successfully created user") |
|
|
notifications.success("Successfully created user") |
|
|
|
|
|
await groups.actions.init() |
|
|
|
|
|
passwordModal.show() |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
|
|
|
console.log(error) |
|
|
notifications.error("Error creating user") |
|
|
notifications.error("Error creating user") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
*/ |
|
|
|
|
|
async function chooseCreationType(onboardingType) { |
|
|
async function chooseCreationType(onboardingType) { |
|
|
if (onboardingType === "emailOnboarding") { |
|
|
if (onboardingType === "emailOnboarding") { |
|
|
createUserFlow() |
|
|
createUserFlow() |
|
|
} else { |
|
|
} else { |
|
|
await users.create({ |
|
|
await createUser() |
|
|
email: "auser5@test.com", |
|
|
|
|
|
password: Math.random().toString(36).slice(2, 20), |
|
|
|
|
|
builder: true, |
|
|
|
|
|
admin: true, |
|
|
|
|
|
forceResetPassword: true, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
passwordModal.show() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -266,7 +254,7 @@ |
|
|
</Modal> |
|
|
</Modal> |
|
|
|
|
|
|
|
|
<Modal bind:this={passwordModal}> |
|
|
<Modal bind:this={passwordModal}> |
|
|
<PasswordModal /> |
|
|
<PasswordModal userData={userData.users} /> |
|
|
</Modal> |
|
|
</Modal> |
|
|
|
|
|
|
|
|
<Modal bind:this={importUsersModal}> |
|
|
<Modal bind:this={importUsersModal}> |
|
|
|