-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[FEATURE] Microsoft Components #15489
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis PR updates several Microsoft Outlook and Microsoft Outlook Calendar components. Key changes include renaming the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant A as Add Label Action
participant M as Microsoft Outlook API
U->>A: Trigger add label to email
A->>A: Check if label exists in current email labels
alt Label exists
A->>U: Throw ConfigurationError ("Label already present")
else Label not present
A->>M: Update email with new label (append to categories)
M-->>A: Confirm update
A->>U: Return success response
end
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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: 0
🧹 Nitpick comments (1)
components/microsoft_outlook/microsoft_outlook.app.mjs (1)
103-124
: Great improvements to the label property implementation!The changes improve clarity and add powerful filtering capabilities. A few suggestions to enhance it further:
- Add JSDoc documentation for the options function parameters
- Consider extracting the filtering logic into a separate helper method
- Add type checking for the parameters
Example enhancement:
label: { type: "string", label: "Label", description: "The name of the label/category to add", + /** + * @param {Object} params + * @param {string} [params.messageId] - The ID of the message to filter labels + * @param {boolean} [params.excludeMessageLabels] - If true, exclude labels that match message categories + * @param {boolean} [params.onlyMessageLabels] - If true, include only labels that match message categories + * @returns {Promise<string[]>} Array of label display names + */ async options({ messageId, excludeMessageLabels, onlyMessageLabels, }) { + // Type checking + if (messageId && typeof messageId !== 'string') { + throw new TypeError('messageId must be a string'); + } const { value } = await this.listLabels(); let labels = value; if (messageId) { - const { categories } = await this.getMessage({ - messageId, - }); - labels = excludeMessageLabels - ? labels.filter(({ displayName }) => !categories.includes(displayName)) - : onlyMessageLabels - ? labels.filter(({ displayName }) => categories.includes(displayName)) - : labels; + labels = await this._filterLabelsByMessage(labels, messageId, { + excludeMessageLabels, + onlyMessageLabels, + }); } return labels?.map(({ displayName }) => displayName) || []; }, }, +/** + * Helper method to filter labels based on message categories + * @private + */ +async _filterLabelsByMessage(labels, messageId, { excludeMessageLabels, onlyMessageLabels }) { + const { categories } = await this.getMessage({ messageId }); + return excludeMessageLabels + ? labels.filter(({ displayName }) => !categories.includes(displayName)) + : onlyMessageLabels + ? labels.filter(({ displayName }) => categories.includes(displayName)) + : labels; +}
📜 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 (16)
components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs
(3 hunks)components/microsoft_outlook/actions/create-contact/create-contact.mjs
(1 hunks)components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs
(1 hunks)components/microsoft_outlook/actions/find-contacts/find-contacts.mjs
(1 hunks)components/microsoft_outlook/actions/list-contacts/list-contacts.mjs
(1 hunks)components/microsoft_outlook/actions/list-labels/list-labels.mjs
(1 hunks)components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs
(3 hunks)components/microsoft_outlook/actions/send-email/send-email.mjs
(1 hunks)components/microsoft_outlook/actions/update-contact/update-contact.mjs
(1 hunks)components/microsoft_outlook/microsoft_outlook.app.mjs
(1 hunks)components/microsoft_outlook/package.json
(1 hunks)components/microsoft_outlook/sources/new-contact/new-contact.mjs
(1 hunks)components/microsoft_outlook/sources/new-email/new-email.mjs
(1 hunks)components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs
(1 hunks)components/microsoft_outlook_calendar/actions/list-events/list-events.mjs
(2 hunks)components/microsoft_outlook_calendar/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (11)
- components/microsoft_outlook/package.json
- components/microsoft_outlook_calendar/package.json
- components/microsoft_outlook/actions/list-contacts/list-contacts.mjs
- components/microsoft_outlook/sources/new-email/new-email.mjs
- components/microsoft_outlook/actions/create-contact/create-contact.mjs
- components/microsoft_outlook/actions/update-contact/update-contact.mjs
- components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs
- components/microsoft_outlook/actions/send-email/send-email.mjs
- components/microsoft_outlook/actions/list-labels/list-labels.mjs
- components/microsoft_outlook/sources/new-contact/new-contact.mjs
- components/microsoft_outlook/actions/find-contacts/find-contacts.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (14)
components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs (3)
7-7
: LGTM!Version update is consistent with other files in the PR.
17-27
: LGTM!The property renaming from
labelId
tolabel
and its updated definition improve clarity and consistency. The context function enhances label selection by providing message context.
36-36
: LGTM!Logic update correctly reflects property renaming from
labelId
tolabel
.components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs (5)
2-2
: LGTM!Import of
ConfigurationError
supports new error handling for duplicate labels.
8-8
: LGTM!Version update is consistent with other files in the PR.
18-27
: LGTM!The property renaming from
labelId
tolabel
and its updated definition improve clarity and consistency. The context function enhances label selection by providing message context.
37-39
: LGTM!Good addition of error handling to prevent duplicate labels, which improves user experience by providing clear feedback.
47-47
: LGTM!Logic update correctly reflects property renaming from
labelId
tolabel
.components/microsoft_outlook_calendar/actions/list-events/list-events.mjs (4)
7-7
: LGTM!Version update is consistent with other files in the PR.
14-14
: LGTM!Filter description update provides a clearer example and better documentation reference.
20-22
: LGTM!OrderBy description update and default value change simplify sorting by combining direction with field.
35-35
: LGTM!Run method update correctly reflects the simplified sorting approach.
components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs (2)
7-7
: LGTM!Version update is consistent with other files in the PR.
13-14
: LGTM!Label and description updates improve clarity by using more familiar terminology and providing a clear example of the expected format.
/approve |
Resolves #15434
Summary by CodeRabbit
New Features
Chores