diff --git a/packages/backend-core/src/db/constants.js b/packages/backend-core/src/db/constants.js
deleted file mode 100644
index 4f2f1f556a..0000000000
--- a/packages/backend-core/src/db/constants.js
+++ /dev/null
@@ -1,41 +0,0 @@
-exports.SEPARATOR = "_"
-
-const PRE_APP = "app"
-const PRE_DEV = "dev"
-
-exports.DocumentTypes = {
- USER: "us",
- WORKSPACE: "workspace",
- CONFIG: "config",
- TEMPLATE: "template",
- APP: PRE_APP,
- DEV: PRE_DEV,
- APP_DEV: `${PRE_APP}${exports.SEPARATOR}${PRE_DEV}`,
- APP_METADATA: `${PRE_APP}${exports.SEPARATOR}metadata`,
- ROLE: "role",
- MIGRATIONS: "migrations",
- DEV_INFO: "devinfo",
- GROUP: "gr",
-}
-
-exports.StaticDatabases = {
- GLOBAL: {
- name: "global-db",
- docs: {
- apiKeys: "apikeys",
- usageQuota: "usage_quota",
- licenseInfo: "license_info",
- },
- },
- // contains information about tenancy and so on
- PLATFORM_INFO: {
- name: "global-info",
- docs: {
- tenants: "tenants",
- },
- },
-}
-
-exports.APP_PREFIX = exports.DocumentTypes.APP + exports.SEPARATOR
-exports.APP_DEV = exports.APP_DEV_PREFIX =
- exports.DocumentTypes.APP_DEV + exports.SEPARATOR
diff --git a/packages/backend-core/src/db/constants.ts b/packages/backend-core/src/db/constants.ts
index be0e824e61..3d642f63c0 100644
--- a/packages/backend-core/src/db/constants.ts
+++ b/packages/backend-core/src/db/constants.ts
@@ -21,6 +21,7 @@ export enum ViewNames {
export enum DocumentTypes {
USER = "us",
+ GROUP = "gr",
WORKSPACE = "workspace",
CONFIG = "config",
TEMPLATE = "template",
diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts
index f9a1a987f4..4a99dfee32 100644
--- a/packages/backend-core/src/db/utils.ts
+++ b/packages/backend-core/src/db/utils.ts
@@ -150,7 +150,7 @@ exports.generateUserGroupID = () => {
/**
* Gets parameters for retrieving groups.
*/
-exports.getUserGroupsParams = (groupId, otherProps = {}) => {
+exports.getUserGroupsParams = (groupId: any, otherProps = {}) => {
if (!groupId) {
groupId = ""
}
diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock
index 7d4d422631..77dbc61425 100644
--- a/packages/backend-core/yarn.lock
+++ b/packages/backend-core/yarn.lock
@@ -291,11 +291,6 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
-"@budibase/types@^1.0.206":
- version "1.0.208"
- resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.0.208.tgz#c45cb494fb5b85229e15a34c6ac1805bae5be867"
- integrity sha512-zKIHg6TGK+soVxMNZNrGypP3DCrd3jhlUQEFeQ+rZR6/tCue1G74bjzydY5FjnLEsXeLH1a0hkS5HulTmvQ2bA==
-
"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte
index a3cc406fcc..1e7ba9cb4e 100644
--- a/packages/builder/src/pages/builder/portal/_layout.svelte
+++ b/packages/builder/src/pages/builder/portal/_layout.svelte
@@ -127,7 +127,6 @@
} else {
try {
await organisation.init()
- await roles.fetch()
} catch (error) {
notifications.error("Error getting org config")
}
diff --git a/packages/builder/src/pages/builder/portal/manage/groups/_components/CreateEditGroupModal.svelte b/packages/builder/src/pages/builder/portal/manage/groups/_components/CreateEditGroupModal.svelte
index c34731d0e5..75cb1fd6ec 100644
--- a/packages/builder/src/pages/builder/portal/manage/groups/_components/CreateEditGroupModal.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/groups/_components/CreateEditGroupModal.svelte
@@ -22,19 +22,13 @@
Icon
- (group.icon = e.detail)}
- bind:value={group.icon}
- />
+ (group.icon = e.detail)} />
Color
- (group.color = e.detail)}
- />
+ (group.color = e.detail)} />
diff --git a/packages/builder/src/pages/builder/portal/manage/groups/index.svelte b/packages/builder/src/pages/builder/portal/manage/groups/index.svelte
index 6841be9e61..898a2e4e0a 100644
--- a/packages/builder/src/pages/builder/portal/manage/groups/index.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/groups/index.svelte
@@ -18,8 +18,8 @@
let modal
let group = {
name: "",
- icon: "",
- color: "",
+ icon: "UserGroup",
+ color: "var(--spectrum-global-color-blue-600)",
users: [],
apps: [],
}
@@ -34,6 +34,7 @@
}
async function saveGroup(group) {
+ console.log(group)
try {
await groups.actions.save(group)
} catch (error) {
diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte
index 597164ecf9..12cf55dd4d 100644
--- a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte
@@ -20,13 +20,8 @@
export let showOnboardingTypeModal
const dispatch = createEventDispatcher()
- const password = Math.random().toString(36).substring(2, 22)
- const options = ["Email onboarding", "Basic onboarding"]
- const [email, error, touched] = createValidationStore("", emailValidator)
let disabled
- let builder
- let admin
let selected = "Email onboarding"
$: userData = [{ email: "", role: "", groups: [], error: null }]
@@ -38,46 +33,11 @@
function setValue(e) {
userData.groups = e.detail
}
- $: basic = selected === "Basic onboarding"
-
- function addUser() {
- if (basic) {
- createUser()
- } else {
- createUserFlow()
- }
- }
-
- async function createUser() {
- try {
- await users.create({
- email: $email,
- password,
- builder,
- admin,
- forceResetPassword: true,
- })
- notifications.success("Successfully created user")
- dispatch("created")
- } catch (error) {
- notifications.error("Error creating user")
- }
- }
-
- async function createUserFlow() {
- try {
- const res = await users.invite({ email: $email, builder, admin })
- notifications.success(res.message)
- } catch (error) {
- notifications.error("Error inviting user")
- }
- }
{
showOnboardingTypeModal()
- addUser()
dispatch("change", userData)
}}
size="M"
@@ -102,32 +62,7 @@
-
-
- If you have SMTP configured and an email for the new user, you can use
- the automated email onboarding flow. Otherwise, use our basic onboarding
- process with autogenerated passwords.
-
-
-
-
-
- {#if basic}
-
- {/if}
-
+
user.email.includes(search || ""))
- .map(user => ({
- ...user,
- group: ["All users"],
- developmentAccess: !!user.builder?.global,
- adminAccess: !!user.admin?.global,
- }))
-
- $: enrichedUsers = $users.map(user => {
- let userGroups = []
- let userApps = []
- $groups.forEach(group => {
- if (group.users) {
- group.users?.forEach(y => {
- if (y._id === user._id) {
- userGroups.push(group)
- userApps = group.apps
- }
- })
- }
- })
- return {
- ...user,
- name: user.firstName ? user.firstName + " " + user.lastName : "",
- userGroups,
- apps: [...new Set(Object.keys(user.roles))],
- }
- })
+ $: console.log(page)
function showOnboardingTypeModal() {
onboardingTypeModal.show()
@@ -206,22 +176,6 @@
>Import Users
- $goto(`./${detail._id}`)}
- {schema}
- data={$users.data}
- allowEditColumns={false}
- allowEditRows={false}
- allowSelectRows={true}
- showHeaderBorder={false}
- customRenderers={[
- { column: "userGroups", component: GroupsTableRenderer },
- { column: "apps", component: AppsTableRenderer },
- { column: "name", component: NameTableRenderer },
- { column: "settings", component: SettingsTableRenderer },
- { column: "role", component: RoleTableRenderer },
- ]}
- />