Skip to content
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

[ACTION] Toggl Client & Project Creation #8973

Closed
wants to merge 9 commits into from

Conversation

gitstart
Copy link

@gitstart gitstart commented Nov 15, 2023

WHAT

closes: #7928

🤖 Generated by Copilot at 8013b58

This pull request adds four new actions to the toggl component that allow the user to create and update clients and projects in toggl using the API. It also creates a new component for the dictionary API by copying and modifying the .gitignore files from several existing components.

🤖 Generated by Copilot at 8013b58

dictionary_api
New component for words
.gitignore changed

WHY

Actions:
Create new client / Update client
https://developers.track.toggl.com/docs/api/clients

Create project / Update project
https://developers.track.toggl.com/docs/api/projects

HOW

🤖 Generated by Copilot at 8013b58

  • Add four new actions to the toggl component: create new client, update client, create project, and update project (link, link, link, link)
  • Each action uses the toggl API version 9, which is added as a new constant in the components/toggl/common/constants.mjs file (link)
  • Each action calls a new method in the components/toggl/toggl.app.mjs file that implements the API request using the _makeRequest helper method (link)
  • Copy the .gitignore file from various existing components and comment out the lines that ignore the .js and .mjs files to allow them to be tracked by git (link, link, link, link, link, link)

Demo Video (Create & update client):
https://www.loom.com/share/791aebcf943a46a7a9e06e93835bfc28?sid=c70cb3fa-2fa6-4124-98c7-7efb75b38ff6

Demo Video (Create & update project):
https://www.loom.com/share/e6bfd8cbae81478e8eb17e7383174cf6?sid=233cb8da-1fbb-46d5-b4db-4ec2349c8b2a


This code was written and reviewed by GitStart Community. Growing great engineers, one PR at a time.

Copy link

vercel bot commented Nov 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pipedream-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 8:04am
pipedream-docs-redirect-do-not-edit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 8:04am

@dylburger dylburger added the User submitted Submitted by a user label Nov 15, 2023
@dylburger dylburger added the triaged For maintainers: This issue has been triaged by a Pipedream employee label Nov 15, 2023
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gitstart , thanks for your contribution! I made a few comments that should be checked before we can move forward with this.

workspace_id: this.workspace_id,
})

response && $.export("$summary", "Successfully created new client");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the response should be the return value of the step

Suggested change
response && $.export("$summary", "Successfully created new client");
response && $.export("$summary", "Successfully created new client");
return response;

type: "string",
label: "Name",
},
workspace_id: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use camelCase for prop names

import toggl from "../../toggl.app.mjs";

export default {
name: "Create a new client",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "Create a new client",
name: "Create Client",

version: "0.0.1",
description: "Create a new Client [See docs here.](https://developers.track.toggl.com/docs/api/clients/index.html#post-create-client)",
type: "action",
key: "toggle-create-new-client",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
key: "toggle-create-new-client",
key: "toggle-create-client",

Comment on lines +11 to +15
name: {
type: "string",
label: "Name",
},
workspace_id: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add descriptions, even if very brief, to these props if possible

type: 'boolean',
label: 'Auto Estimates',
optional: true,
description: "whether the estimated hours are automatically calculated based on task estimations or manually fixed based on the value of 'estimated_hours' (premium functionality) ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "whether the estimated hours are automatically calculated based on task estimations or manually fixed based on the value of 'estimated_hours' (premium functionality) ",
description: "Whether the estimated hours are automatically calculated based on task estimations or manually fixed based on the value of `Estimated Hours` (premium functionality) ",

type: 'boolean',
label: 'Estimated Hours',
optional: true,
description: "if auto_estimates is true then the sum of task estimations is returned, otherwise user inserted hours (premium functionality)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "if auto_estimates is true then the sum of task estimations is returned, otherwise user inserted hours (premium functionality)"
description: "If `Auto Estimates` is true then the sum of task estimations is returned, otherwise user inserted hours (premium functionality)"

Comment on lines +78 to +105
rate: {
type: 'integer',
label: 'Rate',
description: 'Hourly Rate. premium feature',
optional: true,
},
fixed_fee: {
type: 'integer',
label: 'Rate',
description: 'Project fixed fee. premium feature',
optional: true,
},
currency: {
type: 'string',
label: 'Currency',
description: 'Project currency. premium feature',
optional: true,
},
start_date: {
type: 'string',
label: 'Start Date',
description: 'Start date of a project timeframe',
},
end_date: {
type: 'string',
label: 'End Date',
description: 'End date of a project timeframe',
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase and capitalization after periods

import toggl from "../../toggl.app.mjs";

export default {
name: "Update a Project",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "Update a Project",
name: "Update Project",

description: "Update project for given workspace. [See docs here.](https://developers.track.toggl.com/docs/api/projects#post-workspaceprojects)",
type: "action",
key: "toggle-update-project",
props: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These props also need to be updated with camelCase and proper capitalization

color: {
type: 'string',
label: 'Color',
description: 'Project color (hex value in the form of #[0-9a-f]{6}.)',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'Project color (hex value in the form of #[0-9a-f]{6}.)',
description: 'Project color (hex value in the form of #[0-9a-f]{6}.)',
optional: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged For maintainers: This issue has been triaged by a Pipedream employee User submitted Submitted by a user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ACTION] Toggl Client & Project Creation
7 participants