Compare commits

..

111 Commits

Author SHA1 Message Date
Kamran Ahmed
4d735df233 chore: disable teams 2023-07-20 19:23:41 +01:00
Kamran Ahmed
1ecab3981e Update team forms 2023-07-20 19:08:13 +01:00
Kamran Ahmed
7ea9943544 Team pages responsiveness 2023-07-20 18:58:34 +01:00
Kamran Ahmed
d2f76c4726 Responsiveness of progress tab 2023-07-20 18:19:33 +01:00
Kamran Ahmed
758072cca9 Merge branch 'master' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-20 17:50:29 +01:00
Kamran Ahmed
c565dfa5a7 Add toast instead of alert 2023-07-20 17:48:37 +01:00
Kamran Ahmed
1b8cf1734e Add toast 2023-07-20 17:47:18 +01:00
Kamran Ahmed
8376b543cc Update 2023-07-20 13:00:00 +01:00
Arik Chakma
cf31795f58 wip: user avatar in progress 2023-07-20 07:41:10 +06:00
Kamran Ahmed
0dd21e15d1 Update button styles 2023-07-20 02:23:20 +01:00
Kamran Ahmed
598ee44168 Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-20 02:05:41 +01:00
Arik Chakma
57de0720c5 chore: add external link 2023-07-20 06:13:06 +06:00
Arik Chakma
ae14d560a1 fix: progress details 2023-07-20 05:59:54 +06:00
Kamran Ahmed
c5e18ed461 Remove header from progress 2023-07-20 00:58:51 +01:00
Kamran Ahmed
f7a33d8991 Refactor toast 2023-07-20 00:48:46 +01:00
Kamran Ahmed
b65982d7e1 Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-20 00:45:13 +01:00
Kamran Ahmed
76facf70ec Refactor delete team 2023-07-20 00:45:06 +01:00
Arik Chakma
1e8751deae fix: refactor group logic 2023-07-20 04:38:30 +06:00
Arik Chakma
2103102c96 wip: group by roadmap items 2023-07-20 04:14:28 +06:00
Arik Chakma
2328931bc9 Merge branch 'feat/team' of https://github.com/kamranahmedse/developer-roadmap into feat/team 2023-07-20 02:46:15 +06:00
Arik Chakma
340733d979 wip: error handling 2023-07-20 02:45:03 +06:00
Kamran Ahmed
9dbcb50161 Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-19 21:29:56 +01:00
Kamran Ahmed
02c79dca56 Add store for user teams 2023-07-19 21:29:48 +01:00
Arik Chakma
805699f956 wip: error handling 2023-07-20 02:25:51 +06:00
Kamran Ahmed
02dd91e35a Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-19 21:22:15 +01:00
Kamran Ahmed
6157ec9c35 Permissions 2023-07-19 21:22:09 +01:00
Arik Chakma
3b318b4ca7 wip: add toast 2023-07-20 01:59:44 +06:00
Kamran Ahmed
65a98de213 Update team progress page 2023-07-19 20:30:44 +01:00
Kamran Ahmed
1254e8e7f9 Add update member functionality 2023-07-19 20:10:31 +01:00
Kamran Ahmed
10d105241f Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-19 19:17:15 +01:00
Kamran Ahmed
23651e070a Invite member changes 2023-07-19 19:17:08 +01:00
Arik Chakma
e8aaee7375 chore: team versions mob 2023-07-19 22:40:24 +06:00
Kamran Ahmed
952a514d1d Open user progress in new page 2023-07-19 17:33:33 +01:00
Kamran Ahmed
1303167be4 Add more popup changes 2023-07-19 17:28:58 +01:00
Kamran Ahmed
d4995a9092 Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-19 17:17:00 +01:00
Kamran Ahmed
783bfeea36 Add team roadmaps and removal 2023-07-19 17:16:51 +01:00
Arik Chakma
87ba7252e7 wip: team version responsive 2023-07-19 07:40:41 +06:00
Kamran Ahmed
442bf489c8 Add roadmap removal and updation 2023-07-19 00:31:13 +01:00
Kamran Ahmed
b6682710dd Ignore progress tracking on removed items 2023-07-18 23:50:24 +01:00
Kamran Ahmed
8f8f26514b Add team version loading 2023-07-18 23:39:07 +01:00
Kamran Ahmed
df3a66fe22 Merge branch 'feat/team' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-18 22:52:53 +01:00
Kamran Ahmed
fa5a71e4b9 Team roadmaps 2023-07-18 22:52:47 +01:00
Arik Chakma
339cd8cc1e fix: removed node css 2023-07-19 03:08:23 +06:00
Arik Chakma
52670089af chore: modal responsive 2023-07-19 02:58:53 +06:00
Arik Chakma
c9599ef9e3 wip: team progress responsive 2023-07-19 02:53:46 +06:00
Arik Chakma
8fdd9ea653 fix: progress renderer 2023-07-19 01:58:42 +06:00
Arik Chakma
db07a161ae wip: team versions 2023-07-19 01:09:38 +06:00
Kamran Ahmed
edb79d466c Member progress modal 2023-07-18 17:48:58 +01:00
Kamran Ahmed
18d2e18bb3 Add member progress modal 2023-07-18 17:39:44 +01:00
Kamran Ahmed
42d43baa71 Fix: show only team roadmaps 2023-07-18 16:14:47 +01:00
Kamran Ahmed
55c0233dc2 Handle draft team 2023-07-18 15:48:14 +01:00
Kamran Ahmed
180c990bb6 Member progress page 2023-07-18 15:33:25 +01:00
Kamran Ahmed
72efdca722 Fix invalid image size 2023-07-18 13:00:10 +01:00
Kamran Ahmed
d9b386e9f1 Member listing and options page 2023-07-18 05:30:46 +01:00
Kamran Ahmed
1501fa631e Invitation workflow 2023-07-18 05:11:27 +01:00
Kamran Ahmed
fdb2c23911 Team creation 2023-07-17 17:51:10 +01:00
Kamran Ahmed
3f00c70c36 Team creation 2023-07-17 17:46:14 +01:00
Kamran Ahmed
762dff1d42 Add team invite form 2023-07-17 15:56:41 +01:00
Kamran Ahmed
6405744ec6 Search icon color 2023-07-16 20:20:24 +01:00
Kamran Ahmed
a8c20ba372 Team roadmaps 2023-07-16 20:05:58 +01:00
Kamran Ahmed
71bb3d4d3f Team skill rendering 2023-07-16 20:00:11 +01:00
Kamran Ahmed
0de4b38bb3 Team skill rendering 2023-07-16 19:53:08 +01:00
Kamran Ahmed
ac585b3f0b Team resource config updation 2023-07-16 19:42:05 +01:00
Kamran Ahmed
e214119c45 Add resource modification popup 2023-07-16 19:14:02 +01:00
Kamran Ahmed
5f43ae1e61 Roadmap selector 2023-07-15 21:44:05 +01:00
Kamran Ahmed
6f3693bf1b Allow removing roadmaps 2023-07-15 21:10:21 +01:00
Kamran Ahmed
3bbb1d7541 Roadmap addition to backend 2023-07-15 20:44:30 +01:00
Kamran Ahmed
18b0563c75 wip: refactor team creation 2023-07-15 17:02:58 +01:00
Kamran Ahmed
102ec5021f wip: refactor team creation 2023-07-14 01:35:19 +01:00
Kamran Ahmed
62c24ca8e1 wip: refactor team creation 2023-07-13 14:30:13 +01:00
Kamran Ahmed
2914433f0f wip: refactor team creation 2023-07-13 14:17:12 +01:00
Kamran Ahmed
afd319f88f wip: refactor team creation 2023-07-13 14:02:02 +01:00
Kamran Ahmed
b06f08fc67 wip: refactor team creation 2023-07-12 22:48:42 +01:00
Kamran Ahmed
485182a9cf Update team response format 2023-07-12 12:30:52 +01:00
Kamran Ahmed
6716c0375d Fix team sidebar dropdown not working on mobile 2023-07-12 12:11:36 +01:00
Kamran Ahmed
3f763051bb Add spinner to team dropdown 2023-07-11 19:12:50 +01:00
Kamran Ahmed
fef7a2e6e0 Responsiveness and teams page 2023-07-11 18:47:32 +01:00
Kamran Ahmed
75891d5eb1 Merge branch 'master' of github.com:kamranahmedse/developer-roadmap into feat/team 2023-07-11 15:42:02 +01:00
Arik Chakma
fdf67ae9f5 chore: team member resource progress map 2023-07-11 02:28:27 +06:00
Arik Chakma
9c7dd705c3 chore: team sidebar icon 2023-07-11 00:59:06 +06:00
Arik Chakma
62a9fbbc0e Merge branch 'master' into feat/team 2023-07-11 00:44:09 +06:00
Arik Chakma
dec256866e chore: team progress design 2023-07-11 00:39:57 +06:00
Arik Chakma
a1df2ff992 chore: max team members 2023-07-10 21:36:10 +06:00
Arik Chakma
8bd092e489 chore: auth hydrate 2023-07-10 21:29:54 +06:00
Arik Chakma
843445e59d chore: avatar sidebar 2023-07-10 20:48:30 +06:00
Arik Chakma
6fe4db8109 chore: team member page design 2023-07-10 20:08:40 +06:00
Arik Chakma
528cf0f380 chore: empty state 2023-07-10 18:48:18 +06:00
Arik Chakma
b06655ecb3 fix: bugs 2023-07-10 16:56:54 +06:00
Arik Chakma
e3b057dde7 fix: layout shift 2023-07-10 13:40:55 +06:00
Arik Chakma
d5b9836465 chore: update team 2023-07-10 10:49:16 +06:00
Arik Chakma
591fe5daa8 chore: delete team 2023-07-10 10:31:49 +06:00
Arik Chakma
99f8f32d66 chore: update team logo 2023-07-08 22:07:52 +06:00
Arik Chakma
9b08945d62 chore: resend invite dropdown 2023-07-08 18:55:07 +06:00
Arik Chakma
06e1e12ce8 chore: delete member 2023-07-08 02:29:03 +06:00
Arik Chakma
4c347b9df0 chore: notification count 2023-07-08 01:47:45 +06:00
Arik Chakma
271ddc1e5e chore: invite notifications 2023-07-08 00:33:32 +06:00
Arik Chakma
490a4509a0 chore: respond invite 2023-07-07 22:55:23 +06:00
Arik Chakma
ad23bb1bf8 chore: respond invite 2023-07-07 21:41:43 +06:00
Arik Chakma
7e15ccd231 chore: update team 2023-07-07 00:56:38 +06:00
Arik Chakma
5c10caa19a fix: search bug 2023-07-07 00:11:27 +06:00
Arik Chakma
2f9eacdff9 chore: team member progress 2023-07-06 19:40:01 +06:00
Arik Chakma
fd7ddc3819 chore: team progress page 2023-07-06 03:50:47 +06:00
Arik Chakma
3a1529e7f4 chore: search selector active on focus 2023-07-06 02:50:16 +06:00
Arik Chakma
f4db87bed3 chore: team sidebar 2023-07-06 02:32:05 +06:00
Arik Chakma
e648425505 fix: set team size 2023-07-05 23:39:27 +06:00
Arik Chakma
f2c4da4aad chore: team size 2023-07-05 23:35:15 +06:00
Arik Chakma
db268b2966 fix: tab keydown in selector 2023-07-05 00:35:40 +06:00
Arik Chakma
c88024906f chore: create team 2023-07-05 00:19:53 +06:00
Arik Chakma
c7b5bb426c chore: slugify identifier 2023-07-05 00:11:51 +06:00
Arik Chakma
00be0781aa chore: select resources 2023-07-05 00:07:08 +06:00
Arik Chakma
a27d41b718 chore: team sidebar 2023-07-04 04:29:43 +06:00
8 changed files with 47 additions and 166 deletions

View File

@@ -4,7 +4,6 @@ import type { TeamDocument } from './CreateTeam/CreateTeamForm';
import { useTeamId } from '../hooks/use-team-id';
import { useOutsideClick } from '../hooks/use-outside-click';
import { useKeydown } from '../hooks/use-keydown';
import { useToast } from '../hooks/use-toast';
type DeleteTeamPopupProps = {
onClose: () => void;
@@ -13,7 +12,6 @@ type DeleteTeamPopupProps = {
export function DeleteTeamPopup(props: DeleteTeamPopupProps) {
const { onClose } = props;
const toast = useToast();
const popupBodyEl = useRef<HTMLDivElement>(null);
const inputEl = useRef<HTMLInputElement>(null);
@@ -55,7 +53,6 @@ export function DeleteTeamPopup(props: DeleteTeamPopupProps) {
return;
}
toast.success('Team deleted successfully');
window.location.href = '/account';
};
@@ -75,9 +72,9 @@ export function DeleteTeamPopup(props: DeleteTeamPopupProps) {
ref={popupBodyEl}
class="popup-body relative rounded-lg bg-white p-4 shadow"
>
<h2 class="text-2xl font-semibold text-black">Delete Team</h2>
<p className="text-gray-500">
This will permanently delete your team and all associated data.
<p>
This will permanently delete your account and all your associated
data including your progress.
</p>
<p class="-mb-2 mt-3 text-base font-medium text-black">

View File

@@ -79,7 +79,7 @@ export function TeamDropdown() {
if (
!user?.email.endsWith('@insightpartners.com') &&
!user?.email.endsWith('@roadmap.sh') &&
!['arikchangma@gmail.com', 'kamranahmed.se@gmail.com', 'stephen.chetcuti@gmail.com'].includes(user?.email!)
!['arikchangma@gmail.com', 'kamranahmed.se@gmail.com'].includes(user?.email!)
) {
return null;
}
@@ -101,8 +101,9 @@ export function TeamDropdown() {
<img
src={
selectedAvatar
? `${import.meta.env.PUBLIC_AVATAR_BASE_URL
}/${selectedAvatar}`
? `${
import.meta.env.PUBLIC_AVATAR_BASE_URL
}/${selectedAvatar}`
: '/images/default-avatar.png'
}
alt=""

View File

@@ -1,30 +1,40 @@
import { useState } from 'preact/hooks';
import { LeaveTeamPopup } from './LeaveTeamPopup';
import { useState } from "preact/hooks";
import { httpDelete } from "../../lib/http";
import { Spinner } from "../ReactIcons/Spinner";
import { useToast } from "../../hooks/use-toast";
type LeaveTeamButtonProps = {
teamId: string;
};
export function LeaveTeamButton(props: LeaveTeamButtonProps) {
const [showLeaveTeamPopup, setShowLeaveTeamPopup] = useState(false);
const toast = useToast();
const [isLoading, setIsLoading] = useState(false);
const { teamId } = props;
async function leaveTeam() {
setIsLoading(true);
const { response, error } = await httpDelete(
`${import.meta.env.PUBLIC_API_URL}/v1-leave-team/${teamId}`,
{}
);
if (error || !response) {
setIsLoading(false);
toast.error(error?.message || 'Something went wrong');
return;
}
window.location.href = '/account';
}
return (
<>
{showLeaveTeamPopup && (
<LeaveTeamPopup
onClose={() => {
setShowLeaveTeamPopup(false);
}}
/>
)}
<button
onClick={() => {
setShowLeaveTeamPopup(true);
}}
className="flex h-7 min-w-[95px] items-center justify-center rounded-md border border-gray-200 bg-gray-50 px-2 py-1.5 text-sm font-medium leading-none text-red-600"
>
Leave team
</button>
</>
);
<button
disabled={isLoading}
onClick={leaveTeam}
className="bg-gray-50 text-red-600 text-sm font-medium px-2 leading-none py-1.5 rounded-md border border-gray-200 h-7 flex items-center justify-center min-w-[95px]">
{isLoading ? <Spinner isDualRing={false} /> : 'Leave team'}
</button>
)
}

View File

@@ -1,124 +0,0 @@
import { useEffect, useRef, useState } from 'preact/hooks';
import { httpDelete } from '../../lib/http';
import { useTeamId } from '../../hooks/use-team-id';
import { useOutsideClick } from '../../hooks/use-outside-click';
type LeaveTeamPopupProps = {
onClose: () => void;
};
export function LeaveTeamPopup(props: LeaveTeamPopupProps) {
const { onClose } = props;
const popupBodyRef = useRef<HTMLDivElement>(null);
const confirmationEl = useRef<HTMLInputElement>(null);
const [confirmationText, setConfirmationText] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState('');
const { teamId } = useTeamId();
useEffect(() => {
setError('');
setConfirmationText('');
confirmationEl?.current?.focus();
}, []);
const handleSubmit = async (e: Event) => {
e.preventDefault();
setIsLoading(true);
setError('');
if (confirmationText.toUpperCase() !== 'LEAVE') {
setError('Verification text does not match');
setIsLoading(false);
return;
}
const { response, error } = await httpDelete(
`${import.meta.env.PUBLIC_API_URL}/v1-leave-team/${teamId}`,
{}
);
if (error || !response) {
setIsLoading(false);
setError(error?.message || 'Something went wrong');
return;
}
window.location.href = '/account';
};
const handleClosePopup = () => {
setIsLoading(false);
setError('');
setConfirmationText('');
onClose();
};
useOutsideClick(popupBodyRef, handleClosePopup);
return (
<div class="popup fixed left-0 right-0 top-0 z-50 flex h-full items-center justify-center overflow-y-auto overflow-x-hidden bg-black/50">
<div class="relative h-full w-full max-w-md p-4 md:h-auto">
<div
ref={popupBodyRef}
class="popup-body relative rounded-lg bg-white p-4 shadow"
>
<h2 class="text-2xl font-semibold text-black">
Leave Team
</h2>
<p className="text-gray-500">
You will lose access to the team, the roadmaps and progress of other team members.
</p>
<p className="-mb-2 mt-3 text-base font-medium text-black">
Please type "leave" to confirm.
</p>
<form onSubmit={handleSubmit}>
<div className="my-4">
<input
ref={confirmationEl}
type="text"
name="leave-team"
id="leave-team"
className="mt-2 block w-full rounded-md border border-gray-300 px-3 py-2 outline-none placeholder:text-gray-400 focus:border-gray-400"
placeholder={'Type "leave" to confirm'}
required
autoFocus
value={confirmationText}
onInput={(e) =>
setConfirmationText((e.target as HTMLInputElement).value)
}
/>
{error && (
<p className="mt-2 rounded-lg bg-red-100 p-2 text-red-700">
{error}
</p>
)}
</div>
<div className="flex items-center gap-2">
<button
type="button"
disabled={isLoading}
onClick={handleClosePopup}
className="flex-grow cursor-pointer rounded-lg bg-gray-200 py-2 text-center"
>
Cancel
</button>
<button
type="submit"
disabled={
isLoading || confirmationText.toUpperCase() !== 'LEAVE'
}
className="flex-grow cursor-pointer rounded-lg bg-red-500 py-2 text-white disabled:opacity-40"
>
{isLoading ? 'Please wait ..' : 'Leave Team'}
</button>
</div>
</form>
</div>
</div>
</div>
);
}

View File

@@ -60,7 +60,7 @@ export function MemberProgressItem(props: MemberProgressItemProps) {
>
<span className="relative z-10 flex items-center justify-between text-sm">
<span className="inline-grid">
<span className={'truncate'}>{progress.resourceTitle}</span>
<span className={'truncate'}>{progress.resourceTitle}</span>
</span>
<span className="text-xs text-gray-400 shrink-0 ml-1.5">
{progress.done} / {progress.total}

View File

@@ -10,7 +10,6 @@ import { GroupRoadmapItem } from './GroupRoadmapItem';
import { setUrlParams } from '../../lib/browser';
import { getUrlParams } from '../../lib/browser';
import { $toastMessage } from '../../stores/toast';
import { useAuth } from '../../hooks/use-auth';
export type UserProgress = {
resourceTitle: string;
@@ -56,7 +55,6 @@ export function TeamProgressPage() {
const [isLoading, setIsLoading] = useState(true);
const toast = useToast();
const currentTeam = useStore($currentTeam);
const user = useAuth();
const [teamMembers, setTeamMembers] = useState<TeamMember[]>([]);
const [selectedGrouping, setSelectedGrouping] = useState<
@@ -72,10 +70,7 @@ export function TeamProgressPage() {
return;
}
const currentUserProgress = response.find((member) => member.email === user?.email)
const otherUserProgresses = response.filter(member => member.email !== user?.email);
const allUserProgresses = currentUserProgress ? [currentUserProgress, ...otherUserProgresses] : otherUserProgresses;
setTeamMembers(allUserProgresses);
setTeamMembers(response);
}
useEffect(() => {
@@ -139,10 +134,11 @@ export function TeamProgressPage() {
<div className="flex items-center gap-2">
{groupingTypes.map((grouping) => (
<button
className={`rounded-md border p-1 px-2 text-sm ${selectedGrouping === grouping.value
? ' border-gray-400 bg-gray-200 '
: ''
}`}
className={`rounded-md border p-1 px-2 text-sm ${
selectedGrouping === grouping.value
? ' border-gray-400 bg-gray-200 '
: ''
}`}
onClick={() => setSelectedGrouping(grouping.value)}
>
{grouping.label}

View File

@@ -267,6 +267,7 @@ export function UpdateTeamForm() {
{isDeleting && (
<DeleteTeamPopup
onClose={() => {
toast.success('Team deleted successfully');
setIsDeleting(false);
}}
/>

View File

@@ -19,7 +19,7 @@ export function Toaster(props: Props) {
const removeMessage = setTimeout(() => {
if (toastMessage?.type !== 'loading') {
$toastMessage.set(undefined);
// $toastMessage.set(undefined);
}
}, 2500);