Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Generate API types
run: pnpm generate:api

- name: Build
run: pnpm build

- name: Create dist archive
run: tar -czf nexo-ui-dist.tar.gz -C dist .

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: nexo-ui-dist.tar.gz
generate_release_notes: true
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Generate API types
run: pnpm generate:api

- name: Lint
run: pnpm lint

- name: Build
run: pnpm build
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export default tseslint.config(
{ allowConstantExport: true },
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
}],
},
},
)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@dnd-kit/utilities": "^3.2.2",
"@excalidraw/excalidraw": "^0.17.6",
"@glideapps/glide-data-grid-cells": "^3.4.1",
"@labbs/openblock-core": "v1.0.0",
"@labbs/openblock-react": "v1.0.0",
"@labbs/openblock-core": "v1.0.1",
"@labbs/openblock-react": "v1.0.1",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-avatar": "^1.1.2",
"@radix-ui/react-checkbox": "^1.3.3",
Expand Down
48 changes: 37 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/components/database/DatabaseTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Database } from 'lucide-react'
import { useDraggable } from '@dnd-kit/core'
import { cn, parseStoredIcon } from '@/lib/utils'
import { DocumentIcon } from '@/components/ui/icon-picker'
import { useDatabases } from '@/hooks/use-database'
import { useDatabases, type DatabaseItem } from '@/hooks/use-database'

export interface DatabaseTreeProps {
spaceId: string
Expand All @@ -18,7 +18,7 @@ export function DatabaseTree({ spaceId, canEdit }: DatabaseTreeProps) {
const location = useLocation()

// Only show databases that are NOT attached to a document (root level databases)
const rootDatabases = databases.filter((db) => !db.document_id)
const rootDatabases = databases.filter((db: DatabaseItem) => !db.document_id)

if (isLoading) {
return (
Expand All @@ -33,7 +33,7 @@ export function DatabaseTree({ spaceId, canEdit }: DatabaseTreeProps) {

return (
<div className="space-y-0.5">
{rootDatabases.map((db) => {
{rootDatabases.map((db: DatabaseItem) => {
if (!db.id) return null
const isActive = location.pathname === `/space/${spaceId}/database/${db.id}`
return (
Expand Down
37 changes: 20 additions & 17 deletions src/components/database/common/property-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,25 +568,27 @@ export const PropertyCell = memo(function PropertyCell({
case 'created_at':
case 'updated_at':
case 'last_edited_time':
// Handle various date value formats
const dateValue = (() => {
if (!value) return null
if (typeof value === 'string') return value
if (typeof value === 'object' && value !== null) {
// Handle object format like { date: '...' } or { value: '...' }
const obj = value as Record<string, unknown>
return obj.date || obj.value || obj.created_at || obj.updated_at
}
return null
})()
return (
<div className="min-h-[32px] px-2 py-1 flex items-center text-muted-foreground text-sm">
{dateValue ? format(new Date(dateValue as string), 'MMM d, yyyy HH:mm') : '-'}
</div>
)
{
// Handle various date value formats
const dateValue = (() => {
if (!value) return null
if (typeof value === 'string') return value
if (typeof value === 'object' && value !== null) {
// Handle object format like { date: '...' } or { value: '...' }
const obj = value as Record<string, unknown>
return obj.date || obj.value || obj.created_at || obj.updated_at
}
return null
})()
return (
<div className="min-h-[32px] px-2 py-1 flex items-center text-muted-foreground text-sm">
{dateValue ? format(new Date(dateValue as string), 'MMM d, yyyy HH:mm') : '-'}
</div>
)
}

case 'created_by':
case 'last_edited_by':
case 'last_edited_by': {
// Handle user info object { id, username, avatar_url }
const userInfo = value as { id?: string; username?: string; avatar_url?: string } | null | undefined
const username = userInfo?.username
Expand Down Expand Up @@ -614,6 +616,7 @@ export const PropertyCell = memo(function PropertyCell({
)}
</div>
)
}

default:
return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/database/document/document-edit-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ export function DocumentEditSidebar({
// Find title column
const titleColumn = useMemo(() => {
if (!database?.schema) return null
return database.schema.find(col => col.type === 'title') || database.schema[0]
return database.schema.find((col: PropertySchema) => col.type === 'title') || database.schema[0]
}, [database?.schema])

// Get non-title columns for the fields header
const fieldColumns = useMemo(() => {
if (!database?.schema) return []
return database.schema.filter(col => col.type !== 'title')
return database.schema.filter((col: PropertySchema) => col.type !== 'title')
}, [database?.schema])

// Get current title value
Expand Down
6 changes: 4 additions & 2 deletions src/components/database/document/document-table-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export function DocumentTableView({
}
break

case 'Enter':
case 'Enter': {
e.preventDefault()
// Start editing the focused cell
const row = rows[rowIndex]
Expand All @@ -313,9 +313,10 @@ export function DocumentTableView({
setEditingCell({ rowId: row.id, propertyId })
}
break
}

case 'Delete':
case 'Backspace':
case 'Backspace': {
// Clear the cell content
if (!editingCell) {
e.preventDefault()
Expand All @@ -327,6 +328,7 @@ export function DocumentTableView({
}
}
break
}
}
}

Expand Down
Loading
Loading