-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
fix: hints option not updating correctly and hints section not visible in subggoal list #2044
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/api/HintsAPI/index.ts
Outdated
for (const hint of availableGoalHints) { | ||
if (hint.id === goalId) { | ||
deletedGoalHint = hint; | ||
} else { | ||
updatedGoalHints.push(hint); | ||
} | ||
} |
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.
🚫 [eslint] <no-restricted-syntax> reported by reviewdog 🐶
iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.
|
||
const updatedDeletedGoalHints = goalHintsItem.deletedGoalHints ? [...goalHintsItem.deletedGoalHints] : []; | ||
|
||
if (deletedGoalHint) { | ||
const deletedHintDetails: IGoalHint = { ...deletedGoalHint }; | ||
delete deletedHintDetails.id; | ||
const { id, ...deletedHintDetails } = deletedGoalHint; |
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.
'id' is assigned a value but never used.
@@ -17,6 +17,8 @@ import GoalItemSummary from "@src/common/GoalItemSummary/GoalItemSummary"; | |||
import GoalsList from "../GoalsList"; | |||
import GoalHistory from "./components/GoalHistory"; | |||
import "./GoalSublist.scss"; | |||
import AvailableGoalHints from "@pages/GoalsPage/components/AvailableGoalHints"; |
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.
🚫 [eslint] <import/order> reported by reviewdog 🐶@pages/GoalsPage/components/AvailableGoalHints
import should occur before import of ../GoalsList
@@ -17,6 +17,8 @@ | |||
import GoalsList from "../GoalsList"; | |||
import GoalHistory from "./components/GoalHistory"; | |||
import "./GoalSublist.scss"; | |||
import AvailableGoalHints from "@pages/GoalsPage/components/AvailableGoalHints"; | |||
import { AvailableGoalHintProvider } from "@src/contexts/availableGoalHint-context"; |
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.
🚫 [eslint] <import/order> reported by reviewdog 🐶@src/contexts/availableGoalHint-context
import should occur before import of ../GoalsList
|
||
useEffect(() => { | ||
if (activeGoalId) { | ||
const hint = goalHints.find((goal) => { |
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.
return goal.id === activeGoalId; | ||
}); | ||
console.log(hint); | ||
setGoal(hint ? hint : undefined); |
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.
🚫 [eslint] <no-unneeded-ternary> reported by reviewdog 🐶
Unnecessary use of conditional expression for default assignment.
setGoal(hint ? hint : undefined); | |
setGoal(hint || undefined); |
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.
can you resolve eslint warnings
@@ -348,7 +348,7 @@ export const getAllLevelGoalsOfId = async (id: string, resetSharedStatus = false | |||
export const addHintGoaltoMyGoals = async (goal: GoalItem) => { |
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.
what if we use Promise.all here ?
@Tushar-4781 ready for review |
resolves #2043
resolves #2029