-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Asana - Create Project Bug Fix #16662
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 ↗︎ 3 Skipped Deployments
|
WalkthroughThis update primarily consists of version increments across multiple Asana component actions and sources. Additionally, the "Create Project" action receives substantial updates: prop renaming, additions, removals, description edits, and payload adjustments. The Asana app's Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreateProjectAction
participant AsanaApp
participant AsanaAPI
User->>CreateProjectAction: Provide project creation parameters
CreateProjectAction->>AsanaApp: Fetch teams for workspace (if organization)
AsanaApp->>AsanaAPI: GET /workspaces/{workspace}/teams
AsanaAPI-->>AsanaApp: Return teams list
AsanaApp-->>CreateProjectAction: Return teams list
CreateProjectAction->>AsanaAPI: POST /projects with updated payload (props, privacy, access levels)
AsanaAPI-->>CreateProjectAction: Return created project info
CreateProjectAction-->>User: Output created project GID and summary
Assessment against linked issues
Possibly related PRs
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/asana/actions/create-project/create-project.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
🔭 Outside diff range comments (1)
components/asana/actions/search-user-projects/search-user-projects.mjs (1)
42-51
:⚠️ Potential issueCritical Issue: Asynchronous predicate used in
Array.filter
The.filter(async (project) => { … })
callback returns aPromise<boolean>
rather than a boolean, causing the filter to behave incorrectly (all entries are retained since Promises are truthy).Proposed fix—await all membership checks and apply a synchronous filter:
-let { data: projects } = await this.asana.getProjects({ +let { data: projects } = await this.asana.getProjects({ params: { workspace: this.workspace, }, $, }); - -projects = projects.filter(async (project) => { - const { data } = await this.asana.getProject({ - projectId: project.gid, - $, - }); - - return data.members && !!_.find(data.members, { - gid: this.user, - }); -}); +// Check membership in parallel, then filter synchronously +const checks = await Promise.all(projects.map(async (project) => { + const { data } = await this.asana.getProject({ + projectId: project.gid, + $, + }); + return !!(data.members && data.members.find((m) => m.gid === this.user)); +})); +projects = projects.filter((_, idx) => checks[idx]);
📜 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 (30)
components/asana/actions/add-task-to-section/add-task-to-section.mjs
(1 hunks)components/asana/actions/create-project/create-project.mjs
(7 hunks)components/asana/actions/create-subtask/create-subtask.mjs
(1 hunks)components/asana/actions/create-task-comment/create-task-comment.mjs
(1 hunks)components/asana/actions/create-task-from-template/create-task-from-template.mjs
(1 hunks)components/asana/actions/create-task/create-task.mjs
(1 hunks)components/asana/actions/delete-task/delete-task.mjs
(1 hunks)components/asana/actions/find-task-by-id/find-task-by-id.mjs
(1 hunks)components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs
(1 hunks)components/asana/actions/search-projects/search-projects.mjs
(1 hunks)components/asana/actions/search-sections/search-sections.mjs
(1 hunks)components/asana/actions/search-tasks/search-tasks.mjs
(1 hunks)components/asana/actions/search-user-projects/search-user-projects.mjs
(1 hunks)components/asana/actions/update-task/update-task.mjs
(1 hunks)components/asana/asana.app.mjs
(1 hunks)components/asana/package.json
(1 hunks)components/asana/sources/new-completed-task/new-completed-task.mjs
(1 hunks)components/asana/sources/new-project/new-project.mjs
(1 hunks)components/asana/sources/new-story/new-story.mjs
(1 hunks)components/asana/sources/new-subtask/new-subtask.mjs
(1 hunks)components/asana/sources/new-tag/new-tag.mjs
(1 hunks)components/asana/sources/new-task/new-task.mjs
(1 hunks)components/asana/sources/new-team/new-team.mjs
(1 hunks)components/asana/sources/new-user/new-user.mjs
(1 hunks)components/asana/sources/new-workspace/new-workspace.mjs
(1 hunks)components/asana/sources/tag-added-to-task/tag-added-to-task.mjs
(1 hunks)components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs
(1 hunks)components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs
(1 hunks)components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs
(1 hunks)components/asana/sources/task-updated-in-project/task-updated-in-project.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
🔇 Additional comments (34)
components/asana/actions/create-task/create-task.mjs (1)
8-8
: Approve version bump.
The action’s version has been correctly incremented from0.4.2
to0.4.3
, matching the coordinated updates across Asana components. No further changes are needed here.components/asana/actions/create-subtask/create-subtask.mjs (1)
8-8
: Ensure version bump alignment and documentation updates.
The action version has been updated to"0.4.3"
, matching the coordinated minor bumps across other Asana components in this release. Please verify that the CHANGELOG, package manifest, and any release notes have been updated accordingly.components/asana/actions/search-sections/search-sections.mjs (1)
7-7
: Version updated to “0.2.10”
The patch bump here keeps this action in sync with the other Asana components in this release. No functional changes observed.components/asana/sources/task-updated-in-project/task-updated-in-project.mjs (1)
10-10
: Version bump for maintenance updateThe version has been incremented from "1.1.8" to "1.1.9" as part of the larger bugfix update across Asana components.
components/asana/sources/new-tag/new-tag.mjs (1)
9-9
: Version bump for maintenance updateThe version has been incremented from "0.0.11" to "0.0.12" as part of the larger bugfix update across Asana components.
components/asana/package.json (1)
3-3
: Package version update aligned with component fixesThe package version has been incremented from "0.7.3" to "0.7.4" to reflect the bug fix in the Asana app's
getTeams
method and version bumps across components.components/asana/sources/new-project/new-project.mjs (1)
9-9
: Version bump for maintenance updateThe version has been incremented from "0.1.9" to "0.1.10" as part of the larger bugfix update across Asana components.
components/asana/actions/delete-task/delete-task.mjs (1)
8-8
: Approve version bump
The patch-level version increment from"0.0.10"
→"0.0.11"
is consistent with other Asana action components and does not introduce functional changes.components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs (1)
10-10
: Approve version bump
Incrementing the version from"0.0.8"
→"0.0.9"
aligns with the coordinated patch release across Asana source components. No functional changes detected.components/asana/sources/new-completed-task/new-completed-task.mjs (1)
10-10
: Approve version bump
The version increment from"0.1.9"
→"0.1.10"
is consistent with related source components in this release. No other modifications.components/asana/actions/create-task-from-template/create-task-from-template.mjs (1)
7-7
: Approve version bump
The patch-level version bump from"0.0.4"
→"0.0.5"
is in line with other action components. No structural changes introduced.components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs (1)
10-10
: Version bump to 0.0.9 is correct.
This aligns with the coordinated version increments across Asana source components in this PR, with no functional changes introduced here.components/asana/sources/new-team/new-team.mjs (1)
9-9
: Version bump to 0.1.11 is correct.
No other changes in this file; version increment matches the pattern across Asana sources.components/asana/sources/new-workspace/new-workspace.mjs (1)
9-9
: Version bump to 0.1.11 is correct.
No functional changes beyond the version update, consistent with the rest of the Asana integration.components/asana/sources/tag-added-to-task/tag-added-to-task.mjs (1)
10-10
: Version bump to 0.1.10 is correct.
This update is purely metadata-only, matching the coordinated versioning in this PR.components/asana/sources/new-user/new-user.mjs (1)
9-9
: Version bump to 0.1.10 is correct.
No other modifications; this aligns with the global version increments for Asana sources.components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs (1)
7-7
: Bump version to 0.0.8
Version increment only—no functional changes.components/asana/actions/find-task-by-id/find-task-by-id.mjs (1)
8-8
: Bump version to 0.2.10
Patch version updated without logic changes.components/asana/actions/create-task-comment/create-task-comment.mjs (1)
8-8
: Bump version to 0.2.10
Only the version string was updated.components/asana/sources/new-task/new-task.mjs (1)
10-10
: Bump version to 0.1.10
Version increment aligns with coordinated package release.components/asana/actions/search-tasks/search-tasks.mjs (1)
9-9
: Bump version to 0.3.4
No other changes besides the patch version update.components/asana/sources/new-subtask/new-subtask.mjs (1)
10-10
: Consistent version bump for New Subtask source.The component version has been correctly updated from
1.0.9
to1.0.10
. No functional or structural changes detected.components/asana/actions/search-projects/search-projects.mjs (1)
6-6
: Consistent version bump for Search Projects action.The component version has been correctly updated from
0.2.9
to0.2.10
. This aligns with the coordinated minor release across Asana actions.components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs (1)
10-10
: Consistent version bump for Task Assigned In Project source.The component version has been correctly updated from
0.1.2
to0.1.3
. No logic changes introduced.components/asana/sources/new-story/new-story.mjs (1)
10-10
: Consistent version bump for New Story source.The component version has been correctly updated from
0.1.9
to0.1.10
. Functionality remains unchanged.components/asana/actions/update-task/update-task.mjs (1)
8-8
: Consistent version bump for Update Task action.The component version has been correctly updated from
0.4.2
to0.4.3
. No modifications to props or behavior were made.components/asana/actions/add-task-to-section/add-task-to-section.mjs (1)
8-8
: Version increment looks goodThe version has been properly incremented from 0.2.9 to 0.2.10, which aligns with the version updates across other Asana action components in this PR.
components/asana/actions/create-project/create-project.mjs (7)
8-8
: Version increment looks goodThe version has been properly incremented from 0.10.2 to 0.10.3, reflecting the significant changes made to this component.
31-45
: Team property implementation looks goodThe team property has been properly implemented to dynamically filter teams based on the selected workspace. This improvement supports the bug fix by correctly fetching teams from the workspace.
72-82
: Privacy setting property enhancementThe boolean
public
property has been replaced with a more descriptiveprivacySetting
string property that offers three explicit options. This provides better clarity and more granular control over project visibility.
59-60
: Props renamed to follow camelCase conventionProps have been consistently renamed from snake_case to camelCase (
defaultView
,dueOn
,startOn
,htmlNotes
), improving code consistency.Also applies to: 90-91, 96-97, 115-116
134-165
: New access level properties addedThree new optional properties related to access levels have been added:
defaultAccessLevel
- Controls default access for new membersminimumAccessLevelForCustomization
- Controls who can modify the project's workflowminimumAccessLevelForSharing
- Controls who can share the projectThese additions provide more fine-grained control over project permissions.
175-190
: Request payload updated to match property changesThe request payload in the
run
method has been correctly updated to reflect all property renames and additions:
- Using
team
instead of previous property- Using camelCase in the UI but snake_case in the API request payload
- Added new access level properties
This change ensures the API receives properly formatted data.
195-195
: Improved success messageThe success message now includes the created project's GID, which provides more useful feedback to the user.
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.
LGTM!
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 (2)
components/asana/actions/create-project/create-project.mjs (2)
47-47
: Incorrect description for color propThe description refers to "the color associated with the status update" when it should reference the project color instead.
- description: "The color associated with the status update", + description: "The color associated with the project",
21-34
: Consider validation for team requirementThe description states: "If the workspace for your project is an organization, you must supply a team to share the project with." Consider adding validation to enforce this requirement when applicable.
You could add validation in the run method to check if the workspace is an organization and if so, verify that a team is provided:
async run({ $ }) { // Check if workspace is an organization and team is required if (!this.team) { const workspace = await this.asana.getWorkspace(this.workspace); if (workspace.is_organization) { throw new Error("Team is required when workspace is an organization"); } } // Rest of the existing code... }Alternatively, you could make the team prop conditionally required based on the workspace type.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
components/asana/actions/create-project/create-project.mjs
(7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/asana/actions/create-project/create-project.mjs (8)
8-8
: Version bump looks goodThe version bump from 0.10.2 to 0.10.3 is appropriate for the bug fixes and enhancements being made.
21-34
: Good addition of the team prop with dynamic filteringThe new
team
prop with dynamic filtering based on the selected workspace is a valuable addition. This correctly leverages the updatedgetTeams
method that now fetches teams from the proper API endpoint.
58-61
: Good rename from snake_case to camelCaseRenaming
default_view
todefaultView
improves consistency with JavaScript conventions while the API mapping in the run method correctly translates it back to snake_case for the Asana API.
71-80
: Improved privacy control with explicit optionsReplacing the boolean
public
prop with a more descriptiveprivacySetting
string provides users with clearer options and better maps to Asana's API capabilities.
89-90
: Consistent prop naming to camelCaseThe renaming of props from snake_case to camelCase (
due_on
→dueOn
,start_on
→startOn
,html_notes
→htmlNotes
) improves code consistency while maintaining proper API mapping.Also applies to: 95-96, 114-115
133-164
: Good addition of access level controlsAdding these three new access level props (
defaultAccessLevel
,minimumAccessLevelForCustomization
,minimumAccessLevelForSharing
) provides users with more fine-grained control over project permissions.
174-189
: Correctly mapped camelCase props to snake_case API fieldsThe request payload correctly maps the camelCase component props to the snake_case fields expected by the Asana API, ensuring compatibility.
194-194
: Improved summary message with project GIDIncluding the project GID in the summary export message provides users with a direct reference to the newly created project, improving usability.
/approve |
Resolves #16651
Summary by CodeRabbit