Skip to content

Commit

Permalink
Merge pull request #480 from teambition/feat/add-card-schema
Browse files Browse the repository at this point in the history
feat(Schema): 新增工作台卡片 DashboardCardSchema
  • Loading branch information
chuan6 authored Jun 27, 2018
2 parents b1a7d8d + c436ef0 commit 9e6d05f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/schemas/DashboardCard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { DashboardCardId, UserId } from 'teambition-types'

export enum OfficialKey {
Recent = 'recent',
TaskExecuted = 'task_executed',
TaskInvolved = 'task_involved',
TaskCreated = 'task_created',
Favorite = 'favorite',
WorkCreated = 'work_created',
EventInvolved = 'event_involved',
History = 'history',
Apps = 'apps'
}

export enum CardCategory {
Custom = 'custom',
Official = 'official'
}

export enum DataSource {
Tql = 'tql',
Api = 'api'
}

export enum CardType {
ListPlain = 'list.plain',
ListPage = 'list.page',
ListModal = 'list.modal'
}

export interface DashboardCardSchema {
_id: DashboardCardId
category: CardCategory
created: string
dataSource: DataSource
dataUrl: string
description: string
isDeleted: boolean
name: string
officialKey?: OfficialKey
pos: number
updated: string
viewType: CardType
_userId: UserId
}
2 changes: 2 additions & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import './Collection'
export * from './Collection'
import './CustomRole'
export * from './CustomRole'
// import './DashboardCard' // 目前不需建表
export { DashboardCardSchema } from './DashboardCard'
import './DefaultRole'
export * from './DefaultRole'
import './Event'
Expand Down
1 change: 1 addition & 0 deletions src/teambition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ declare module 'teambition-types' {
export interface CustomFieldLinkId extends String { kind?: 'CustomFieldLinkId' }
export interface CustomFieldValueId extends String { kind?: 'CustomFieldValueId' }
export interface CustomRoleId extends String { kind?: 'CustomRoleId' }
export interface DashboardCardId extends String { kind?: 'DashboardCardId' }
export interface EntryCategoryId extends String { kind?: 'EntryCategoryId' }
export interface EntryId extends String { kind?: 'EntryId' }
export interface EventId extends String { kind?: 'EventId' }
Expand Down

0 comments on commit 9e6d05f

Please sign in to comment.