Merge branch 'master' into view-calculation-sort-by-calculations
This commit is contained in:
commit
11b02fdb0e
|
@ -14,7 +14,13 @@
|
||||||
function daysUntilCancel() {
|
function daysUntilCancel() {
|
||||||
const cancelAt = license?.billing?.subscription?.cancelAt
|
const cancelAt = license?.billing?.subscription?.cancelAt
|
||||||
const diffTime = Math.abs(cancelAt - new Date().getTime()) / 1000
|
const diffTime = Math.abs(cancelAt - new Date().getTime()) / 1000
|
||||||
return Math.floor(diffTime / oneDayInSeconds)
|
const days = Math.floor(diffTime / oneDayInSeconds)
|
||||||
|
if (days === 1) {
|
||||||
|
return "tomorrow."
|
||||||
|
} else if (days === 0) {
|
||||||
|
return "today."
|
||||||
|
}
|
||||||
|
return `in ${days} days.`
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -28,7 +34,7 @@
|
||||||
extraLinkAction={$licensing.goToUpgradePage}
|
extraLinkAction={$licensing.goToUpgradePage}
|
||||||
showCloseButton={false}
|
showCloseButton={false}
|
||||||
>
|
>
|
||||||
Your free trial will end in {daysUntilCancel()} days.
|
Your free trial will end {daysUntilCancel()}
|
||||||
</Banner>
|
</Banner>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
subtype: column.subtype,
|
subtype: column.subtype,
|
||||||
visible: column.visible,
|
visible: column.visible,
|
||||||
readonly: column.readonly,
|
readonly: column.readonly,
|
||||||
constraints: column.constraints, // This is needed to properly display "users" column
|
icon: column.icon,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,6 +19,10 @@ export const getCellID = (rowId, fieldName) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getColumnIcon = column => {
|
export const getColumnIcon = column => {
|
||||||
|
if (column.schema.icon) {
|
||||||
|
return column.schema.icon
|
||||||
|
}
|
||||||
|
|
||||||
if (column.schema.autocolumn) {
|
if (column.schema.autocolumn) {
|
||||||
return "MagicWand"
|
return "MagicWand"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
BBReferenceFieldSubType,
|
||||||
CalculationType,
|
CalculationType,
|
||||||
canGroupBy,
|
canGroupBy,
|
||||||
FeatureFlag,
|
FeatureFlag,
|
||||||
|
@ -7,6 +8,7 @@ import {
|
||||||
PermissionLevel,
|
PermissionLevel,
|
||||||
RelationSchemaField,
|
RelationSchemaField,
|
||||||
RenameColumn,
|
RenameColumn,
|
||||||
|
RequiredKeys,
|
||||||
Table,
|
Table,
|
||||||
TableSchema,
|
TableSchema,
|
||||||
View,
|
View,
|
||||||
|
@ -325,13 +327,26 @@ export async function enrichSchema(
|
||||||
const viewFieldSchema = viewFields[relTableFieldName]
|
const viewFieldSchema = viewFields[relTableFieldName]
|
||||||
const isVisible = !!viewFieldSchema?.visible
|
const isVisible = !!viewFieldSchema?.visible
|
||||||
const isReadonly = !!viewFieldSchema?.readonly
|
const isReadonly = !!viewFieldSchema?.readonly
|
||||||
result[relTableFieldName] = {
|
const enrichedFieldSchema: RequiredKeys<ViewV2ColumnEnriched> = {
|
||||||
...relTableField,
|
|
||||||
...viewFieldSchema,
|
|
||||||
name: relTableField.name,
|
|
||||||
visible: isVisible,
|
visible: isVisible,
|
||||||
readonly: isReadonly,
|
readonly: isReadonly,
|
||||||
|
order: viewFieldSchema?.order,
|
||||||
|
width: viewFieldSchema?.width,
|
||||||
|
|
||||||
|
icon: relTableField.icon,
|
||||||
|
type: relTableField.type,
|
||||||
|
subtype: relTableField.subtype,
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
!enrichedFieldSchema.icon &&
|
||||||
|
relTableField.type === FieldType.BB_REFERENCE &&
|
||||||
|
relTableField.subtype === BBReferenceFieldSubType.USER &&
|
||||||
|
!helpers.schema.isDeprecatedSingleUserColumn(relTableField)
|
||||||
|
) {
|
||||||
|
// Forcing the icon, otherwise we would need to pass the constraints to show the proper icon
|
||||||
|
enrichedFieldSchema.icon = "UserGroup"
|
||||||
|
}
|
||||||
|
result[relTableFieldName] = enrichedFieldSchema
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,13 +355,11 @@ describe("table sdk", () => {
|
||||||
visible: true,
|
visible: true,
|
||||||
columns: {
|
columns: {
|
||||||
title: {
|
title: {
|
||||||
name: "title",
|
|
||||||
type: "string",
|
type: "string",
|
||||||
visible: true,
|
visible: true,
|
||||||
readonly: true,
|
readonly: true,
|
||||||
},
|
},
|
||||||
age: {
|
age: {
|
||||||
name: "age",
|
|
||||||
type: "number",
|
type: "number",
|
||||||
visible: false,
|
visible: false,
|
||||||
readonly: false,
|
readonly: false,
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
import { FieldSchema, RelationSchemaField, ViewV2 } from "../documents"
|
import {
|
||||||
|
FieldSchema,
|
||||||
|
FieldSubType,
|
||||||
|
FieldType,
|
||||||
|
RelationSchemaField,
|
||||||
|
ViewV2,
|
||||||
|
} from "../documents"
|
||||||
|
|
||||||
export interface ViewV2Enriched extends ViewV2 {
|
export interface ViewV2Enriched extends ViewV2 {
|
||||||
schema?: {
|
schema?: {
|
||||||
|
@ -8,4 +14,7 @@ export interface ViewV2Enriched extends ViewV2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ViewV2ColumnEnriched = RelationSchemaField & FieldSchema
|
export interface ViewV2ColumnEnriched extends RelationSchemaField {
|
||||||
|
type: FieldType
|
||||||
|
subtype?: FieldSubType
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue