-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update types to be consistent with documentation #244
Conversation
@pawelgrimm, I don't think I have permission to assign you as a reviewer. I hope you don't mind the direct tag, thank you! |
Thanks, @thales-fukuda! I'll try to take a look at this tomorrow or on Thursday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the PR! There are a few things I'd like to change slightly, but I'll go ahead and do that myself.
src/types/entities.ts
Outdated
@@ -84,7 +85,7 @@ export const Project = Record({ | |||
isInboxProject: Boolean, | |||
isTeamInbox: Boolean, | |||
order: Int, | |||
viewStyle: String, | |||
viewStyle: Union(Literal('list'), Literal('board')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically the API could return something other than "list" or "board" here.
Let's keep this as String
, but export a new type here for ProjectViewStyle
to get intellisense for requests, like adding or updating projects.
viewStyle: Union(Literal('list'), Literal('board')), | |
viewStyle: String, |
export type ProjectViewStyle = 'list' | 'board'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Addressed in 16e51a1
src/types/requests.ts
Outdated
|
||
export type ProjectViewStyle = 'list' | 'board' | ||
export type ProjectViewStyle = Project['viewStyle'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just reference Project['viewStyle']
instead of creating another type for it here.
export type ProjectViewStyle = Project['viewStyle'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Addressed in 16e51a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ope, I guess we can't do that because it breaks validators.validateProject
. Let's reference the ProjectViewStyle
type here.
src/types/requests.ts
Outdated
} & RequireOneOrNone<{ | ||
dueString?: string | ||
dueDate?: string | ||
dueDatetime?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can specify a dueString
and a dueDate
/dueDatetime
. This is because the dueString
could indicate the recurrence (e.g. "every day at 9am"), whereas the dueDatetime
could indicate the due time of the current instance of the task (e.g. "2023-10-26T12:00:00").
} & RequireOneOrNone<{ | |
dueString?: string | |
dueDate?: string | |
dueDatetime?: string | |
dueString?: string | |
} & RequireOneOrNone<{ | |
dueDate?: string | |
dueDatetime?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Addressed in 8b1c471
src/types/requests.ts
Outdated
} & RequireOneOrNone<{ | ||
dueString?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
♻️ Same situation as my previous comment
} & RequireOneOrNone<{ | |
dueString?: string | |
dueString?: string | |
} & RequireOneOrNone<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Addressed in 8b1c471
src/types/requests.ts
Outdated
} & RequireExactlyOne<{ | ||
taskId?: string | ||
projectId?: string | ||
}> | ||
|
||
export type AddTaskCommentArgs = AddCommentArgs & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of AddTaskCommentArgs
and Add ProjectCommentArgs
now 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Addressed in 97adeb1
Closes #243
Documentation reference: