-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Clockify - new components #18989
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
Open
michelle0927
wants to merge
4
commits into
master
Choose a base branch
from
issue-18914
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+878
−75
Open
Clockify - new components #18989
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
components/clockify/actions/get-time-entry-report/get-time-entry-report.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| import clockify from "../../clockify.app.mjs"; | ||
|
|
||
| export default { | ||
| name: "Get Time Entry Report", | ||
| description: "Get a time entry report. [See the documentation](https://docs.clockify.me/#tag/Time-Entry-Report/operation/generateDetailedReport)", | ||
| key: "clockify-get-time-entry-report", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| clockify, | ||
| workspaceId: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "workspaceId", | ||
| ], | ||
| }, | ||
| dateRangeStart: { | ||
| type: "string", | ||
| label: "Date Range Start", | ||
| description: "The start date of the date range. Format: YYYY-MM-DDTHH:MM:SS.ssssssZ", | ||
| }, | ||
| dateRangeEnd: { | ||
| type: "string", | ||
| label: "Date Range End", | ||
| description: "The end date of the date range. Format: YYYY-MM-DDTHH:MM:SS.ssssssZ", | ||
| }, | ||
| clientIds: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "clientId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| type: "string[]", | ||
| label: "Client IDs", | ||
| description: "Array of client identifiers", | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| projectId: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "projectId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| taskIds: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "taskId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| projectId: c.projectId, | ||
| }), | ||
| ], | ||
| type: "string[]", | ||
| label: "Task IDs", | ||
| description: "Array of task identifiers", | ||
| optional: true, | ||
| }, | ||
| tagIds: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "tagIds", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| userIds: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "memberIds", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.clockify.getTimeEntryReport({ | ||
| $, | ||
| workspaceId: this.workspaceId, | ||
| data: { | ||
| dateRangeStart: this.dateRangeStart, | ||
| dateRangeEnd: this.dateRangeEnd, | ||
| detailedFilter: { | ||
| options: { | ||
| totals: "CALCULATE", | ||
| }, | ||
| }, | ||
| clients: this.clientIds | ||
| ? { | ||
| contains: "CONTAINS", | ||
| ids: this.clientIds, | ||
| status: "ALL", | ||
| } | ||
| : undefined, | ||
| projects: this.projectId | ||
| ? { | ||
| contains: "CONTAINS", | ||
| ids: [ | ||
| this.projectId, | ||
| ], | ||
| status: "ALL", | ||
| } | ||
| : undefined, | ||
| tasks: this.taskIds | ||
| ? { | ||
| contains: "CONTAINS", | ||
| ids: this.taskIds, | ||
| status: "ALL", | ||
| } | ||
| : undefined, | ||
| tags: this.tagIds | ||
| ? { | ||
| contains: "CONTAINS", | ||
| ids: this.tagIds, | ||
| status: "ALL", | ||
| } | ||
| : undefined, | ||
| users: this.userIds | ||
| ? { | ||
| contains: "CONTAINS", | ||
| ids: this.userIds, | ||
| status: "ALL", | ||
| } | ||
| : undefined, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully retrieved time entry report"); | ||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
190 changes: 190 additions & 0 deletions
190
components/clockify/actions/list-projects/list-projects.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| import clockify from "../../clockify.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "clockify-list-projects", | ||
| name: "List Projects", | ||
| description: "List all projects in a Clockify workspace. [See the documentation](https://docs.clockify.me/#tag/Project/operation/getProjects)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| clockify, | ||
| workspaceId: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "workspaceId", | ||
| ], | ||
| }, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "If provided, you'll get a filtered list of projects that contains the provided string in the project name", | ||
| optional: true, | ||
| }, | ||
| strictNameSearch: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "strictNameSearch", | ||
| ], | ||
| }, | ||
| archived: { | ||
| type: "boolean", | ||
| label: "Archived", | ||
| description: "If set to `true`, you'll only get archived projects", | ||
| optional: true, | ||
| }, | ||
| billable: { | ||
| type: "boolean", | ||
| label: "Billable", | ||
| description: "If set to `true`, you'll only get billable projects", | ||
| optional: true, | ||
| }, | ||
| clients: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "clientId", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| type: "string[]", | ||
| label: "Clients", | ||
| description: "Array of client identifiers", | ||
| }, | ||
| containsClient: { | ||
| type: "boolean", | ||
| label: "Contains Client", | ||
| description: "If set to `true`, you'll get a filtered list of projects that contain clients which match the provided id(s) in 'clients' field. If set to `false`, you'll get a filtered list of projects which do NOT contain clients that match the provided id(s) in 'clients' field.", | ||
| optional: true, | ||
| }, | ||
| clientStatus: { | ||
| type: "string", | ||
| label: "Client Status", | ||
| description: "Filters projects based on client status provided", | ||
| optional: true, | ||
| options: [ | ||
| "ACTIVE", | ||
| "ARCHIVED", | ||
| "ALL", | ||
| ], | ||
| }, | ||
| users: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "memberIds", | ||
| (c) => ({ | ||
| workspaceId: c.workspaceId, | ||
| }), | ||
| ], | ||
| label: "Users", | ||
| description: "Array of member/user identifiers", | ||
| optional: true, | ||
| }, | ||
| containsUser: { | ||
| type: "boolean", | ||
| label: "Contains User", | ||
| description: "If set to `true`, you'll get a filtered list of projects that contain users which match the provided id(s) in 'users' field. If set to `false`, you'll get a filtered list of projects which do NOT contain users that match the provided id(s) in 'users' field.", | ||
| optional: true, | ||
| }, | ||
| userStatus: { | ||
| type: "string", | ||
| label: "User Status", | ||
| description: "Filters projects based on user status provided", | ||
| optional: true, | ||
| options: [ | ||
| "PENDING", | ||
| "ACTIVE", | ||
| "DECLINED", | ||
| "INACTIVE", | ||
| "ALL", | ||
| ], | ||
| }, | ||
| isTemplate: { | ||
| type: "boolean", | ||
| label: "Is Template", | ||
| description: "Filters projects based on whether they are used as a template or not", | ||
| optional: true, | ||
| }, | ||
| sortColumn: { | ||
| type: "string", | ||
| label: "Sort Column", | ||
| description: "The column to sort the projects by", | ||
| optional: true, | ||
| options: [ | ||
| "ID", | ||
| "NAME", | ||
| "CLIENT_NAME", | ||
| "DURATION", | ||
| "BUDGET", | ||
| "PROGRESS", | ||
| ], | ||
| }, | ||
| sortOrder: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "sortOrder", | ||
| ], | ||
| }, | ||
| hydrated: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "hydrated", | ||
| ], | ||
| }, | ||
| access: { | ||
| type: "string", | ||
| label: "Access", | ||
| description: "If provided, you'll get a filtered list of projects that matches the provided access", | ||
| optional: true, | ||
| options: [ | ||
| "PUBLIC", | ||
| "PRIVATE", | ||
| ], | ||
| }, | ||
| page: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "page", | ||
| ], | ||
| }, | ||
| pageSize: { | ||
| propDefinition: [ | ||
| clockify, | ||
| "pageSize", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.clockify.listProjects({ | ||
| $, | ||
| workspaceId: this.workspaceId, | ||
| params: { | ||
| "name": this.name, | ||
| "strict-name-search": this.strictNameSearch, | ||
| "archived": this.archived, | ||
| "billable": this.billable, | ||
| "clients": this.clients, | ||
| "contains-client": this.containsClient, | ||
| "client-status": this.clientStatus, | ||
| "users": this.users, | ||
| "contains-user": this.containsUser, | ||
| "user-status": this.userStatus, | ||
| "is-template": this.isTemplate, | ||
| "sort-column": this.sortColumn, | ||
| "sort-order": this.sortOrder, | ||
| "hydrated": this.hydrated, | ||
| "access": this.access, | ||
| "page": this.page, | ||
| "page-size": this.pageSize, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully listed ${response.length} projects in the workspace`); | ||
|
|
||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.