-
Notifications
You must be signed in to change notification settings - Fork 5.3k
ConnectWise actions improvements #16091
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request updates several actions within the ConnectWise PSA component. The create-contact action now supports an optional primary contact flag ( Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/connectwise_psa/actions/create-contact/create-contact.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
components/connectwise_psa/common/utils.mjs (1)
9-22
: Consider adding null/undefined check.The function handles string and object inputs well, but might throw an error if
value
is null or undefined when callingObject.entries(obj)
.export function parseObjectEntries(value) { + if (!value) return {}; const obj = typeof value === "string" ? JSON.parse(value) : value; return Object.fromEntries( Object.entries(obj).map(([ key, value, ]) => [ key, optionalParseAsJSON(value), ]), ); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
components/connectwise_psa/actions/create-contact/create-contact.mjs
(3 hunks)components/connectwise_psa/actions/create-ticket/create-ticket.mjs
(3 hunks)components/connectwise_psa/common/utils.mjs
(1 hunks)components/connectwise_psa/package.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
🔇 Additional comments (11)
components/connectwise_psa/package.json (1)
3-3
: Version bump is appropriate.The version increment from 0.1.1 to 0.1.2 properly reflects the feature additions in this PR, following semantic versioning principles where the patch version is increased for backward-compatible features.
components/connectwise_psa/common/utils.mjs (1)
1-7
: Good utility function implementation.This helper function safely attempts to parse JSON and gracefully falls back to the original value if parsing fails, preventing runtime errors.
components/connectwise_psa/actions/create-contact/create-contact.mjs (4)
8-8
: Version update is appropriate.The version bump from 0.0.1 to 0.1.0 correctly reflects the addition of new features to this action.
95-100
: Good addition of primary contact flag.Adding the
isDefault
property enhances the functionality by allowing users to specify whether the contact is the primary contact for the company.
101-105
: Feature enhancement with additionalOptions.This new property provides excellent flexibility by allowing users to include additional parameters in the request beyond the predefined props.
160-161
: Good implementation of new properties.The code correctly implements the new
isDefault
property and properly handles theadditionalOptions
using theparseObjectEntries
utility function.components/connectwise_psa/actions/create-ticket/create-ticket.mjs (5)
7-7
: Version update is appropriate.The version update to 0.1.0 properly reflects the addition of note functionality to the ticket creation action.
34-39
: Good addition of note property.Adding the ability to include notes during ticket creation enhances the utility of this action. The property is well-defined with appropriate types and description.
41-50
: Well-implemented API method.The
createTicketNote
method is properly implemented to make API requests for creating notes associated with a ticket.
72-92
: Robust note creation implementation.The implementation correctly handles:
- Checking if notes exist before processing
- Converting single notes to array format for consistent handling
- Creating each note via API calls
- Collecting responses for return value
The use of optional chaining (
note?.length
) is a good practice for handling potentially undefined values.
93-104
: Thoughtful response handling.The code elegantly:
- Provides a clear summary message that adapts based on whether notes were added
- Structures the return object to include both the ticket and notes information
- Only includes the notes property when notes were actually created
This approach maintains backward compatibility while enhancing the response with new information.
components/connectwise_psa/actions/create-contact/create-contact.mjs
Outdated
Show resolved
Hide resolved
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.
Hi @GTFalcao lgtm! Ready for QA!
components/connectwise_psa/actions/create-contact/create-contact.mjs
Outdated
Show resolved
Hide resolved
/approve |
Closes #16016
Summary by CodeRabbit