1
0
Fork 0
mirror of synced 2024-09-21 03:43:21 +12:00
budibase/packages/frontend-core/src/constants.js

148 lines
3.3 KiB
JavaScript
Raw Normal View History

/**
* Operator options for lucene queries
*/
export { OperatorOptions, SqlNumberTypeRangeMap } from "@budibase/shared-core"
export { Feature as Features } from "@budibase/types"
2024-03-13 01:45:09 +13:00
import { BpmCorrelationKey } from "@budibase/shared-core"
2024-04-26 22:23:11 +12:00
import { FieldType, BBReferenceFieldSubType } from "@budibase/types"
// Cookie names
export const Cookies = {
Auth: "budibase:auth",
CurrentApp: "budibase:currentapp",
ReturnUrl: "budibase:returnurl",
2022-09-15 22:59:46 +12:00
AccountReturnUrl: "budibase:account:returnurl",
2024-03-13 01:45:09 +13:00
OnboardingProcessCorrelationKey: BpmCorrelationKey.ONBOARDING,
}
// Table names
export const TableNames = {
USERS: "ta_users",
}
export const BudibaseRoles = {
AppUser: "appUser",
Developer: "developer",
Creator: "creator",
Admin: "admin",
}
export const BudibaseRoleOptionsOld = [
{
label: "Developer",
value: BudibaseRoles.Developer,
},
]
export const BudibaseRoleOptions = [
2023-08-30 01:40:56 +12:00
{
label: "Account admin",
value: BudibaseRoles.Admin,
2023-08-30 01:40:56 +12:00
subtitle: "Has full access to all apps and settings in your account",
},
{
label: "Creator",
value: BudibaseRoles.Creator,
subtitle: "Can create and edit apps they have access to",
},
{
label: "App user",
value: BudibaseRoles.AppUser,
subtitle: "Can only use published apps they have access to",
2023-08-30 01:40:56 +12:00
},
]
2022-07-14 02:46:10 +12:00
export const PlanType = {
FREE: "free",
TEAM: "team",
PRO: "pro",
2022-07-14 02:46:10 +12:00
BUSINESS: "business",
ENTERPRISE: "enterprise",
ENTERPRISE_BASIC_TRIAL: "enterprise_basic_trial",
2022-07-14 02:46:10 +12:00
}
/**
* API version header attached to all requests.
* Version changelog:
* v1:
* - Coerce types for search endpoint
*/
export const ApiVersion = "1"
// Role IDs
export const Roles = {
ADMIN: "ADMIN",
POWER: "POWER",
BASIC: "BASIC",
PUBLIC: "PUBLIC",
BUILDER: "BUILDER",
CREATOR: "CREATOR",
}
2022-07-27 00:41:46 +12:00
export const Themes = [
{
class: "lightest",
name: "Lightest",
},
{
class: "light",
name: "Light",
},
{
class: "dark",
name: "Dark",
},
{
class: "darkest",
name: "Darkest",
},
{
class: "nord",
name: "Nord",
base: "darkest",
},
{
class: "midnight",
name: "Midnight",
base: "darkest",
},
2022-07-27 00:41:46 +12:00
]
export const EventPublishType = {
ENV_VAR_UPGRADE_PANEL_OPENED: "environment_variable_upgrade_panel_opened",
}
export const ContextScopes = {
Local: "local",
Global: "global",
}
2024-04-10 21:52:19 +12:00
export const TypeIconMap = {
[FieldType.STRING]: "Text",
[FieldType.OPTIONS]: "Dropdown",
2024-04-10 22:03:46 +12:00
[FieldType.DATETIME]: "Calendar",
2024-04-10 21:52:19 +12:00
[FieldType.BARCODEQR]: "Camera",
[FieldType.SIGNATURE_SINGLE]: "AnnotatePen",
2024-04-10 21:52:19 +12:00
[FieldType.LONGFORM]: "TextAlignLeft",
2024-04-10 22:01:41 +12:00
[FieldType.ARRAY]: "Duplicate",
2024-04-10 21:52:19 +12:00
[FieldType.NUMBER]: "123",
[FieldType.BOOLEAN]: "Boolean",
2024-05-08 00:57:40 +12:00
[FieldType.ATTACHMENTS]: "DocumentFragmentGroup",
[FieldType.ATTACHMENT_SINGLE]: "DocumentFragment",
2024-04-10 21:52:19 +12:00
[FieldType.LINK]: "DataCorrelated",
[FieldType.FORMULA]: "Calculator",
[FieldType.JSON]: "Brackets",
[FieldType.BIGINT]: "TagBold",
2024-04-10 22:06:53 +12:00
[FieldType.AUTO]: "MagicWand",
2024-04-10 21:52:19 +12:00
[FieldType.BB_REFERENCE]: {
2024-05-04 03:29:47 +12:00
[BBReferenceFieldSubType.USER]: "UserGroup",
2024-04-26 22:23:11 +12:00
[BBReferenceFieldSubType.USERS]: "UserGroup",
2024-04-10 21:52:19 +12:00
},
2024-04-22 22:32:51 +12:00
[FieldType.BB_REFERENCE_SINGLE]: {
[BBReferenceFieldSubType.USER]: "User",
2024-04-22 22:32:51 +12:00
},
2024-04-10 21:52:19 +12:00
}
export const OptionColours = [...new Array(9).keys()].map(idx => {
return `hsla(${((idx + 1) * 222) % 360}, 90%, 75%, 0.3)`
})