Skip to content
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

Merged
merged 12 commits into from
Oct 12, 2024

Conversation

vinaybadgujar102
Copy link
Collaborator

resolves #2043
resolves #2029

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
zinzen ✅ Ready (Inspect) Visit Preview Oct 12, 2024 4:25am

Comment on lines 110 to 116
for (const hint of availableGoalHints) {
if (hint.id === goalId) {
deletedGoalHint = hint;
} else {
updatedGoalHints.push(hint);
}
}
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'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";
Copy link
Contributor

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";
Copy link
Contributor

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) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <no-shadow> reported by reviewdog 🐶
'goal' is already declared in the upper scope on line 14 column 10.

return goal.id === activeGoalId;
});
console.log(hint);
setGoal(hint ? hint : undefined);
Copy link
Contributor

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.

Suggested change
setGoal(hint ? hint : undefined);
setGoal(hint || undefined);

tijlleenders
tijlleenders previously approved these changes Sep 16, 2024
Copy link
Collaborator

@Tushar-4781 Tushar-4781 left a 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) => {
Copy link
Collaborator

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 ?

@vinaybadgujar102
Copy link
Collaborator Author

vinaybadgujar102 commented Oct 12, 2024

@Tushar-4781 ready for review

@Tushar-4781 Tushar-4781 merged commit d135a11 into main Oct 12, 2024
5 checks passed
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.

Hints not working on dev Hint toggle value not persisting in goal config modal
3 participants