Files
baserow/web-frontend/modules/core/enums.js
Tsering Paljor 472e877d79 feat: Improve duration support in advanced formulas (#5426)
* Refactor to_duration() to accept an optional format arg.

* Add tests for duration utils

* Add tests for new DurationFormation* arg type

* Expand tests for RuntimeToDuration

* Add duration_format()

* Add tests for RuntimeDurationFormat

* Add a Utility formula category, and recategorize some functions

* Allow formula validation visitor allows validating deferred args.

* Improve test coverage

* Add changelog

* Fix frontend test failure

* Remove changes around deferred arg validation

* Clean up stale logic

* Fix docstring

* Ensure tokenize_duration_format/tokenizeDurationFormat supports fractional seconds.

* Use rounding instead of truncating for fractional precision to match the existing format_duration_value()

* Add missing test coverage for duration field formatting.

* Add support to tokenizer to escape tokens.

* format_duration_value/formatDurationFalue is now just a shim that wraps a call to the unified formatValueWithDurationFormat.

* Fix to_duration() example.
2026-06-15 15:09:34 +07:00

88 lines
1.9 KiB
JavaScript

export const IMAGE_FILE_TYPES = [
'image/jpeg',
'image/jpg',
'image/png',
'image/apng',
'image/gif',
'image/tiff',
'image/bmp',
'image/webp',
]
export const FAVICON_IMAGE_FILE_TYPES = [...IMAGE_FILE_TYPES, 'image/x-icon']
// Keep these in sync with the backend options in
// baserow.core.models.Settings.EmailVerificationOptions
export const EMAIL_VERIFICATION_OPTIONS = {
NO_VERIFICATION: 'no_verification',
RECOMMENDED: 'recommended',
ENFORCED: 'enforced',
}
// Keep these in sync with the backend options in
// baserow.core.models.UserProfile.EmailNotificationFrequencyOptions
export const EMAIL_NOTIFICATIONS_FREQUENCY_OPTIONS = {
INSTANT: 'instant',
DAILY: 'daily',
WEEKLY: 'weekly',
NEVER: 'never',
}
export const DATA_TYPE_TO_ICON_MAP = {
string: 'iconoir-text',
number: 'baserow-icon-hashtag',
integer: 'baserow-icon-hashtag',
boolean: 'baserow-icon-circle-checked',
date: 'iconoir-calendar',
datetime: 'iconoir-calendar',
array: 'iconoir-list',
file: 'iconoir-attachment',
union: 'iconoir-union-alt',
}
export const UNKNOWN_DATA_TYPE_ICON = 'iconoir-question-mark'
export const RATING_STYLES = {
STAR: 'star',
HEART: 'heart',
THUMBS_UP: 'thumbs-up',
FLAG: 'flag',
SMILE: 'smile',
}
export const FORMULA_TYPE = {
FUNCTION: 'function',
OPERATOR: 'operator',
}
export const FORMULA_CATEGORY = {
TEXT: {
category: 'categoryText',
iconClass: 'baserow-icon-text',
},
NUMBER: {
category: 'categoryNumber',
iconClass: 'baserow-icon-hashtag',
},
BOOLEAN: {
category: 'categoryBoolean',
iconClass: 'baserow-icon-circle-checked',
},
DATE: {
category: 'categoryDate',
iconClass: 'iconoir-calendar',
},
FILE: {
category: 'categoryFile',
iconClass: 'baserow-icon-file',
},
CONDITION: {
category: 'categoryCondition',
iconClass: 'iconoir-code-brackets-square',
},
UTILITY: {
category: 'categoryUtility',
iconClass: 'iconoir-tools',
},
}