Skip to content

Conversation

Aegean09
Copy link
Contributor

@Aegean09 Aegean09 commented Apr 7, 2025

Gurubu Planner Share Link Feature

This PR adds a link-sharing functionality to Gurubu Planner. Users can now share their planner configuration via URL, allowing others to bypass the initial team selection process and directly access the same planner view. Additionally, I've created a new PlannerContext to improve state management throughout the application.

Key Features

  • Added link sharing capability to Gurubu Planner
  • Created a new PlannerContext for better state management
  • Implemented URL parameter handling for team and board selection
  • Streamlined user experience by enabling direct access via shared links

Technical Implementation

  • Created PlannerContext to centralize planner state management
  • Added support for reading team and board parameters from URL
  • Implemented URL state synchronization with application state
  • Fixed issues with team/board selection and persistence

Related Issues

Closes #354

Copy link

vercel bot commented Apr 7, 2025

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

Name Status Preview Comments Updated (UTC)
gurubu ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2025 7:52pm

Comment on lines 49 to 81
useEffect(() => {
const fetchDataFromUrl = async () => {
const teamFromUrl = searchParams.get('team');
const boardFromUrl = searchParams.get('board');
const boardSearchFromUrl = searchParams.get('boardSearch');

if (teamFromUrl) {
const response = await pService.getOrganizationDetails(teamFromUrl);
if (response.isSuccess && response.data) {
setAssignees(response.data);
localStorage.setItem('JIRA_DEFAULT_ASSIGNEES', JSON.stringify(response.data));
}
}

if (boardSearchFromUrl) {
await fetchBoards(boardSearchFromUrl);
}

if (boardFromUrl) {
try {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/jira/${boardFromUrl}/future`);
const data: SprintResponse = await response.json();
setSprints(data.values);
localStorage.setItem('JIRA_BOARD', boardFromUrl);
handleRefresh();
} catch (error) {
console.error('Error fetching future sprints:', error);
}
}
};

fetchDataFromUrl();
}, [searchParams]);
Copy link
Member

Choose a reason for hiding this comment

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

Is searchParams constantly updated, for example, I wonder if this place will be hit every time I press a character.

Comment on lines 83 to 110
useEffect(() => {
const teamFromUrl = searchParams.get('team');
const boardFromUrl = searchParams.get('board');

if (teamFromUrl) setSelectedTeam(teamFromUrl);
if (boardFromUrl) setSelectedBoard(boardFromUrl);
}, [searchParams]);

useEffect(() => {
const fetchDataFromUrl = async () => {
const teamFromUrl = searchParams.get('team');
const boardFromUrl = searchParams.get('board');
const boardSearchFromUrl = searchParams.get('boardSearch');

if (teamFromUrl) {
const response = await pService.getOrganizationDetails(teamFromUrl);
if (response.isSuccess && response.data) {
setAssignees(response.data);
localStorage.setItem('JIRA_DEFAULT_ASSIGNEES', JSON.stringify(response.data));
}
}

if (boardSearchFromUrl) {
await fetchBoards(boardSearchFromUrl);
}

if (boardFromUrl) {
try {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/jira/${boardFromUrl}/future`);
const data: SprintResponse = await response.json();
setSprints(data.values);
localStorage.setItem('JIRA_BOARD', boardFromUrl);
handleRefresh();
} catch (error) {
console.error('Error fetching future sprints:', error);
}
}
};

fetchDataFromUrl();
}, [searchParams]);
Copy link
Member

Choose a reason for hiding this comment

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

This is very similar to the code above

@mertcanaltin
Copy link
Member

please enter pr details @Aegean09 🚀 , may be too short

@Aegean09
Copy link
Contributor Author

Aegean09 commented Apr 8, 2025

@mertcanaltin this pr is not ready for review mate, I'm trying to solve conflicts with the previous merged pr (enes')

@mertcanaltin mertcanaltin changed the title feat: Added share link option to gurubu planner [WİP] feat: Added share link option to gurubu planner Apr 8, 2025
@mertcanaltin
Copy link
Member

I got it, mate, I marked your pr as WIP (it means you working on it)

@mertcanaltin mertcanaltin added the wip work in progress label Apr 8, 2025
@Aegean09 Aegean09 added review wanted and removed wip work in progress labels Apr 9, 2025
@Aegean09 Aegean09 changed the title [WİP] feat: Added share link option to gurubu planner feat: Added share link option to gurubu planner Apr 9, 2025
@armagandalkiran
Copy link
Collaborator

@mertcanaltin i'm going to merge this, is your comments resolved?

@mertcanaltin
Copy link
Member

if you don't have any problems we can unite, my question is not too critical @armagandalkiran

Copy link
Member

@mertcanaltin mertcanaltin left a comment

Choose a reason for hiding this comment

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

LGTM

@armagandalkiran armagandalkiran merged commit 519e066 into main Apr 10, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Share Link feature to Gurubu-Planner
3 participants