Skip to content

Commit

Permalink
Merge pull request #432 from teambition/fix/type-visibility
Browse files Browse the repository at this point in the history
fix(type): 新添 VisibleOption 代替定义错误的 Visibility
  • Loading branch information
chuan6 authored Mar 19, 2018
2 parents 9e308e0 + daa9c97 commit 2f1cee7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/apis/post/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Observable } from 'rxjs/Observable'
import { SDK } from '../../SDK'
import { SDKFetch } from '../../SDKFetch'
import { PostModeOptions, PostSchema } from '../../schemas/Post'
import { ProjectId, Visibility, FileId, UserId, TagId } from 'teambition-types'
import { ProjectId, VisibleOption, FileId, UserId, TagId } from 'teambition-types'

export interface CreatePostOptions {
_projectId: ProjectId
title: string
content: string
postMode?: PostModeOptions
visiable?: Visibility
visible?: VisibleOption
attachments?: FileId[]
involveMembers?: UserId[]
tagIds?: TagId[]
Expand All @@ -27,7 +27,7 @@ declare module '../../SDKFetch' {
}
}

export function createPost (this: SDK, options: CreatePostOptions): Observable<PostSchema> {
export function createPost(this: SDK, options: CreatePostOptions): Observable<PostSchema> {
return this.lift({
request: this.fetch.createPost(options),
tableName: 'Post',
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/Entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
EntryCategoryId,
ProjectId,
UserId,
Visibility,
VisibleOption,
TagId
} from 'teambition-types'

Expand All @@ -18,7 +18,7 @@ export interface EntryData {
amount: number
status: string
involveMembers: string[]
visible: Visibility
visible: VisibleOption
tagIds: TagId[]
created: string
updated: string
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/Event.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SchemaDef, RDBType, Relationship } from 'reactivedb/interface'
import { schemaColl } from './schemas'
import {
Visibility,
VisibleOption,
EventId,
UserId,
ProjectId,
Expand Down Expand Up @@ -36,7 +36,7 @@ export interface EventSchema {
recurrence: string[]
reminders: string[]
isArchived: boolean
visible: Visibility
visible: VisibleOption
isDeleted: boolean
created: string
updated: string
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TagId,
ProjectId,
UserId,
Visibility,
VisibleOption,
ExecutorOrCreator
} from 'teambition-types'

Expand All @@ -25,7 +25,7 @@ export interface FileSchema {
_creatorId: UserId
creator: ExecutorOrCreator
tagIds: TagId[]
visible: Visibility
visible: VisibleOption
downloadUrl: string
thumbnail: string
thumbnailUrl: string
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/Task.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RDBType, Relationship, SchemaDef } from 'reactivedb/interface'
import { CustomFieldValue, ExecutorOrCreator, Reminder, Visibility } from 'teambition-types'
import { CustomFieldValue, ExecutorOrCreator, Reminder, VisibleOption } from 'teambition-types'
import {
ProjectId,
ScenarioFieldConfigId,
Expand Down Expand Up @@ -32,7 +32,7 @@ export interface TaskSchema {
isDeleted: boolean
created: string
updated: string
visible: Visibility
visible: VisibleOption
_sprintId?: SprintId
_stageId: StageId
_creatorId: UserId
Expand Down
2 changes: 1 addition & 1 deletion src/teambition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ declare module 'teambition-types' {
export type TaskPriority = 0 | 1 | 2
export type TaskScenarioFieldIcon = 'task' | 'requirement' | 'bug' | 'hr' | 'resource' | 'order' | 'salesLead' | 'subtask'
export type TeamMemberStatus = 'in' | 'quited' | 'disabled'
export type Visibility = 'all' | 'members' | 'organization' | 'project'
export type VisibleOption = 'members' | 'involves'
}

declare module 'teambition-types' {
Expand Down

0 comments on commit 2f1cee7

Please sign in to comment.