Skip to content

Tasks#202

Merged
mariobalca merged 35 commits intomainfrom
feature/tasks
Nov 14, 2022
Merged

Tasks#202
mariobalca merged 35 commits intomainfrom
feature/tasks

Conversation

@gaspergrom
Copy link
Copy Markdown
Contributor

Changes proposed ✍️

  • tasks page (open tasks, suggested tasks, closed tasks, archived tasks)
  • dashboard tasks widget
  • member overview task widget

Screenshots (front-end changes only)

image

image

image

image

image

Checklist ✅

  • Label appropriately with type:feature 🚀, type:enhancement ✨, type:bug 🐞, or type:documentation 📜.
  • Tests are passing.
  • New backend functionality has been unit-tested.
  • Environment variables have been updated
    • Front-end: frontend/.env.dist
    • Backend: backend/.env.dist, backend/.env.dist.staging, backend/.env.dist.staging.
    • Configuration docs have been updated.
    • Team members only: update environment variables in Password manager and update the team
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.
  • All changes have been tested in a staging site.
  • All changes are working locally running crowd.dev's Docker local environment.

@gaspergrom gaspergrom self-assigned this Nov 11, 2022
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 11, 2022

Deploy Preview for open-crowd-prod failed.

Name Link
🔨 Latest commit 0a8bc25
🔍 Latest deploy log https://app.netlify.com/sites/open-crowd-prod/deploys/637271e328c66200089d0180

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 11, 2022

Deploy Preview for open-devfounders failed.

Name Link
🔨 Latest commit 0a8bc25
🔍 Latest deploy log https://app.netlify.com/sites/open-devfounders/deploys/637271e369671e000955b356

Comment thread frontend/src/modules/task/task-model.js Outdated
).then(({ rows }) => {
return rows.map((r) => ({
id: r.id,
label: r.fullName,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <prettier/prettier> reported by reviewdog 🐶
Delete ,

Suggested change
label: r.fullName,
label: r.fullName

Comment thread frontend/src/modules/task/task-model.js Outdated
return rows.map((r) => ({
...r,
id: r.id,
label: r.displayName,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <prettier/prettier> reported by reviewdog 🐶
Delete ,

Suggested change
label: r.displayName,
label: r.displayName

Copy link
Copy Markdown
Contributor

@mariobalca mariobalca left a comment

Choose a reason for hiding this comment

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

Really some nice work here @gaspergrom! The UX of this feature looks and feels great 👍

Unfortunately, I'm a bit concerned with some of the architectural decisions that were made for this task module — let me elaborate:

Right now, when I create a task based on a suggestion, within the Tasks page, the frontend is making the following requests to the API:

  • PUT request to update the value
  • POST (query) request with { filter: { type: "suggested"} }
  • POST (query) request with { filter: { type: "regular", status: "in-progress"} }
  • POST (query) request with { filter: { {type: "regular", status: { eq: "in-progress" } }
  • POST (query) request with { filter: { type: "regular", status: "done" } }

Personally, this feels a bit too much since these 5 requests could probably be just one action (with one API call, the PUT request) that would receive the updated record from the API, and mutate/update the global state as we do in the rest of our modules.

By decentralizing a lot of the logic from the actions/store, using this event-driven architecture where we subscribe to store actions and move most of the logic to components, I think the code also got a lot more scattered, and harder to follow/manage.

At the same time, I'm also concerned that refactoring all these things might not be affordable right now, so I'll need to double-check with @joanreyero what's the best way to proceed.

Either way, thank you for this work! As I said, the experience of using the whole feature is really good 🙌

@gaspergrom
Copy link
Copy Markdown
Contributor Author

Really some nice work here @gaspergrom! The UX of this feature looks and feels great 👍

Unfortunately, I'm a bit concerned with some of the architectural decisions that were made for this task module — let me elaborate:

Right now, when I create a task based on a suggestion, within the Tasks page, the frontend is making the following requests to the API:

  • PUT request to update the value
  • POST (query) request with { filter: { type: "suggested"} }
  • POST (query) request with { filter: { type: "regular", status: "in-progress"} }
  • POST (query) request with { filter: { {type: "regular", status: { eq: "in-progress" } }
  • POST (query) request with { filter: { type: "regular", status: "done" } }

Personally, this feels a bit too much since these 5 requests could probably be just one action (with one API call, the PUT request) that would receive the updated record from the API, and mutate/update the global state as we do in the rest of our modules.

By decentralizing a lot of the logic from the actions/store, using this event-driven architecture where we subscribe to store actions and move most of the logic to components, I think the code also got a lot more scattered, and harder to follow/manage.

At the same time, I'm also concerned that refactoring all these things might not be affordable, right now, so I'll need to double-check with @joanreyero what's the best way to proceed.

Either way, thank you for this work! As I said, the experience of using the whole feature is really good 🙌

It would be really hard to put this into store since stuff isn't used on more places and for example in tasks we got 3 different filters where it takes tasks of all people in tenant, on home page we got just users tasks and suggested tasks in same component, on members page we display tasks related just to member so it was struggle to find solution to put this just into store since components didn't use same type of data

Copy link
Copy Markdown
Contributor

@mariobalca mariobalca left a comment

Choose a reason for hiding this comment

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

As discussed, will merge this for now 👍
Later on, if we feel that this approach represents a problem in terms of network usage, we'll revisit some of these decisions and refactor what will be needed.
Thanks again for all the hard work @gaspergrom 🙌

@mariobalca mariobalca merged commit 5e46b6f into main Nov 14, 2022
@mariobalca mariobalca deleted the feature/tasks branch November 14, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants