diff --git a/.astro/settings.json b/.astro/settings.json index a284d735d..ceb2ed8a8 100644 --- a/.astro/settings.json +++ b/.astro/settings.json @@ -3,6 +3,6 @@ "enabled": false }, "_variables": { - "lastUpdateCheck": 1728161578172 + "lastUpdateCheck": 1728296475293 } } \ No newline at end of file diff --git a/src/components/Activity/ActivityStream.tsx b/src/components/Activity/ActivityStream.tsx index 7817d72bb..3de1c1e1a 100644 --- a/src/components/Activity/ActivityStream.tsx +++ b/src/components/Activity/ActivityStream.tsx @@ -56,9 +56,11 @@ export function ActivityStream(props: ActivityStreamProps) { return (
-

- Learning Activity -

+ {activities.length > 0 && ( +

+ Learning Activity +

+ )} {selectedActivity && (
- +

No Progress

diff --git a/src/components/Activity/EmptyStream.tsx b/src/components/Activity/EmptyStream.tsx index ca57f2c2c..94b037937 100644 --- a/src/components/Activity/EmptyStream.tsx +++ b/src/components/Activity/EmptyStream.tsx @@ -4,26 +4,11 @@ export function EmptyStream() { return (

- + -

No Activities

+

No Activity

- Activities will appear here as you start tracking your  - - Roadmaps - - ,  - - Best Practices - -  or  - - Questions - -  progress. + Activities will appear here as you start tracking your progress.

diff --git a/src/components/CreateTeam/RoadmapSelector.tsx b/src/components/CreateTeam/RoadmapSelector.tsx index 869bf5518..66096042f 100644 --- a/src/components/CreateTeam/RoadmapSelector.tsx +++ b/src/components/CreateTeam/RoadmapSelector.tsx @@ -166,8 +166,8 @@ export function RoadmapSelector(props: RoadmapSelectorProps) { {showSelectRoadmapModal && ( setShowSelectRoadmapModal(false)} - teamResourceConfig={teamResources} - allRoadmaps={allRoadmaps.filter(r => r.renderer === 'editor')} + teamResourceConfig={teamResources.map((r) => r.resourceId)} + allRoadmaps={allRoadmaps.filter((r) => r.renderer === 'editor')} teamId={teamId} onRoadmapAdd={(roadmapId) => { addTeamResource(roadmapId).finally(() => { diff --git a/src/components/CreateTeam/SelectRoadmapModal.tsx b/src/components/CreateTeam/SelectRoadmapModal.tsx index 3ae63317a..4642f9a40 100644 --- a/src/components/CreateTeam/SelectRoadmapModal.tsx +++ b/src/components/CreateTeam/SelectRoadmapModal.tsx @@ -10,7 +10,7 @@ export type SelectRoadmapModalProps = { teamId: string; allRoadmaps: PageType[]; onClose: () => void; - teamResourceConfig: TeamResourceConfig; + teamResourceConfig: string[]; onRoadmapAdd: (roadmapId: string) => void; onRoadmapRemove: (roadmapId: string) => void; }; @@ -100,9 +100,7 @@ export function SelectRoadmapModal(props: SelectRoadmapModalProps) { {roleBasedRoadmaps.length > 0 && (
{roleBasedRoadmaps.map((roadmap) => { - const isSelected = !!teamResourceConfig?.find( - (r) => r.resourceId === roadmap.id, - ); + const isSelected = teamResourceConfig.includes(roadmap.id); return (
{skillBasedRoadmaps.map((roadmap) => { - const isSelected = !!teamResourceConfig.find( - (r) => r.resourceId === roadmap.id, - ); + const isSelected = teamResourceConfig.includes(roadmap.id); return (
-
-

More Official Roadmaps Coming Soon

+
+

+ More Official Roadmaps Coming Soon +

- We are currently adding more of our official - roadmaps to this list. If you don't see the roadmap you are - looking for, please check back later. + We are currently adding more of our official roadmaps to this + list. If you don't see the roadmap you are looking for, please + check back later.

diff --git a/src/components/Dashboard/DashboardPage.tsx b/src/components/Dashboard/DashboardPage.tsx index 3284ab58e..b7d832983 100644 --- a/src/components/Dashboard/DashboardPage.tsx +++ b/src/components/Dashboard/DashboardPage.tsx @@ -8,21 +8,29 @@ import { DashboardTab } from './DashboardTab'; import { PersonalDashboard, type BuiltInRoadmap } from './PersonalDashboard'; import { TeamDashboard } from './TeamDashboard'; import { getUser } from '../../lib/jwt'; +import { useParams } from '../../hooks/use-params'; type DashboardPageProps = { builtInRoleRoadmaps?: BuiltInRoadmap[]; builtInSkillRoadmaps?: BuiltInRoadmap[]; builtInBestPractices?: BuiltInRoadmap[]; + isTeamPage?: boolean; }; export function DashboardPage(props: DashboardPageProps) { - const { builtInRoleRoadmaps, builtInBestPractices, builtInSkillRoadmaps } = - props; + const { + builtInRoleRoadmaps, + builtInBestPractices, + builtInSkillRoadmaps, + isTeamPage = false, + } = props; const currentUser = getUser(); const toast = useToast(); const teamList = useStore($teamList); + const { t: currTeamId } = useParams(); + const [isLoading, setIsLoading] = useState(true); const [selectedTeamId, setSelectedTeamId] = useState(); @@ -43,8 +51,14 @@ export function DashboardPage(props: DashboardPageProps) { } useEffect(() => { - getAllTeams().finally(() => setIsLoading(false)); - }, []); + getAllTeams().finally(() => { + if (currTeamId) { + setSelectedTeamId(currTeamId); + } + + setIsLoading(false); + }); + }, [currTeamId]); const userAvatar = currentUser?.avatar && !isLoading @@ -57,8 +71,8 @@ export function DashboardPage(props: DashboardPageProps) {
setSelectedTeamId(undefined)} + isActive={!selectedTeamId && !isTeamPage} + href="/dashboard" avatar={userAvatar} /> @@ -86,10 +100,7 @@ export function DashboardPage(props: DashboardPageProps) { href: `/respond-invite?i=${team.memberId}`, } : { - href: `/team/activity?t=${team._id}`, - // onClick: () => { - // setSelectedTeamId(team._id); - // }, + href: `/team?t=${team._id}`, })} avatar={avatarUrl} /> @@ -105,14 +116,21 @@ export function DashboardPage(props: DashboardPageProps) { )}
- {!selectedTeamId && ( + {!selectedTeamId && !isTeamPage && ( )} - {selectedTeamId && } + + {(selectedTeamId || isTeamPage) && ( + + )}
); diff --git a/src/components/Dashboard/DashboardTeamRoadmaps.tsx b/src/components/Dashboard/DashboardTeamRoadmaps.tsx new file mode 100644 index 000000000..3b7cb7439 --- /dev/null +++ b/src/components/Dashboard/DashboardTeamRoadmaps.tsx @@ -0,0 +1,303 @@ +import { useEffect, useMemo, useState } from 'react'; +import { ResourceProgress } from '../Activity/ResourceProgress'; +import { RoadmapIcon } from '../ReactIcons/RoadmapIcon'; +import type { UserProgress } from '../TeamProgress/TeamProgressPage'; +import { LoadingProgress } from './LoadingProgress'; +import { PickRoadmapOptionModal } from '../TeamRoadmaps/PickRoadmapOptionModal'; +import { SelectRoadmapModal } from '../CreateTeam/SelectRoadmapModal'; +import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal'; +import { ContentConfirmationModal } from '../CreateTeam/ContentConfirmationModal'; +import { httpGet, httpPut } from '../../lib/http'; +import type { PageType } from '../CommandMenu/CommandMenu'; +import { useToast } from '../../hooks/use-toast'; +import type { TeamResourceConfig } from '../CreateTeam/RoadmapSelector'; +import { pageProgressMessage } from '../../stores/page'; +import type { BuiltInRoadmap } from './PersonalDashboard'; +import { MapIcon, Users2 } from 'lucide-react'; + +type DashboardTeamRoadmapsProps = { + isLoading: boolean; + teamId: string; + learningRoadmapsToShow: (UserProgress & { + defaultRoadmapId?: string; + })[]; + canManageCurrentTeam: boolean; + onUpdate: () => void; + + builtInRoleRoadmaps: BuiltInRoadmap[]; + builtInSkillRoadmaps: BuiltInRoadmap[]; +}; + +export function DashboardTeamRoadmaps(props: DashboardTeamRoadmapsProps) { + const { + isLoading, + teamId, + learningRoadmapsToShow, + canManageCurrentTeam, + onUpdate, + + builtInRoleRoadmaps, + builtInSkillRoadmaps, + } = props; + + const toast = useToast(); + const [isPickingOptions, setIsPickingOptions] = useState(false); + const [isAddingRoadmap, setIsAddingRoadmap] = useState(false); + const [isCreatingRoadmap, setIsCreatingRoadmap] = useState(false); + const [confirmationContentId, setConfirmationContentId] = useState(); + + const allRoadmaps = useMemo( + () => + builtInRoleRoadmaps.concat(builtInSkillRoadmaps).map((r) => { + return { + id: r.id, + title: r.title, + url: r.url, + group: 'Roadmaps', + renderer: r.renderer || 'balsamiq', + metadata: r.metadata, + }; + }), + [builtInRoleRoadmaps, builtInSkillRoadmaps], + ); + + async function onAdd(roadmapId: string, shouldCopyContent = false) { + if (!teamId) { + return; + } + + toast.loading('Adding roadmap'); + pageProgressMessage.set('Adding roadmap'); + const roadmap = allRoadmaps.find((r) => r.id === roadmapId); + const { error, response } = await httpPut( + `${ + import.meta.env.PUBLIC_API_URL + }/v1-update-team-resource-config/${teamId}`, + { + teamId: teamId, + resourceId: roadmapId, + resourceType: 'roadmap', + removed: [], + renderer: roadmap?.renderer || 'balsamiq', + shouldCopyContent, + }, + ); + + if (error || !response) { + toast.error(error?.message || 'Error adding roadmap'); + return; + } + + onUpdate(); + toast.success('Roadmap added'); + if (roadmap?.renderer === 'editor') { + setIsAddingRoadmap(false); + } + } + + async function deleteResource(roadmapId: string) { + if (!teamId) { + return; + } + + toast.loading('Deleting roadmap'); + pageProgressMessage.set(`Deleting roadmap from team`); + const { error, response } = await httpPut( + `${import.meta.env.PUBLIC_API_URL}/v1-delete-team-resource-config/${ + teamId + }`, + { + resourceId: roadmapId, + resourceType: 'roadmap', + }, + ); + + if (error || !response) { + toast.error(error?.message || 'Something went wrong'); + return; + } + + toast.success('Roadmap removed'); + onUpdate(); + } + + async function onRemove(resourceId: string) { + pageProgressMessage.set('Removing roadmap'); + + deleteResource(resourceId).finally(() => { + pageProgressMessage.set(''); + }); + } + + const pickRoadmapOptionModal = isPickingOptions && ( + setIsPickingOptions(false)} + showDefaultRoadmapsModal={() => { + setIsAddingRoadmap(true); + setIsPickingOptions(false); + }} + showCreateCustomRoadmapModal={() => { + setIsCreatingRoadmap(true); + setIsPickingOptions(false); + }} + /> + ); + + const filteredAllRoadmaps = allRoadmaps.filter( + (r) => !learningRoadmapsToShow.find((c) => c?.defaultRoadmapId === r.id), + ); + + const addRoadmapModal = isAddingRoadmap && ( + setIsAddingRoadmap(false)} + teamResourceConfig={learningRoadmapsToShow.map((r) => r.resourceId)} + allRoadmaps={filteredAllRoadmaps.filter((r) => r.renderer === 'editor')} + teamId={teamId} + onRoadmapAdd={(roadmapId: string) => { + const isEditorRoadmap = allRoadmaps.find( + (r) => r.id === roadmapId && r.renderer === 'editor', + ); + + if (!isEditorRoadmap) { + onAdd(roadmapId).finally(() => { + pageProgressMessage.set(''); + }); + + return; + } + + setIsAddingRoadmap(false); + setConfirmationContentId(roadmapId); + }} + onRoadmapRemove={(roadmapId: string) => { + if (confirm('Are you sure you want to remove this roadmap?')) { + onRemove(roadmapId).finally(() => {}); + } + }} + /> + ); + + const confirmationContentIdModal = confirmationContentId && ( + { + setConfirmationContentId(''); + }} + onClick={(shouldCopy) => { + onAdd(confirmationContentId, shouldCopy).finally(() => { + pageProgressMessage.set(''); + setConfirmationContentId(''); + }); + }} + /> + ); + + const createRoadmapModal = isCreatingRoadmap && ( + { + setIsCreatingRoadmap(false); + }} + onCreated={() => { + setIsCreatingRoadmap(false); + }} + /> + ); + + const roadmapHeading = ( +
+

Roadmaps

+ + {canManageCurrentTeam && ( + + + Roadmaps + + )} +
+ ); + + if (!isLoading && learningRoadmapsToShow.length === 0) { + return ( + <> + {roadmapHeading} +
+ {pickRoadmapOptionModal} + {addRoadmapModal} + {createRoadmapModal} + {confirmationContentIdModal} + + + +

No roadmaps

+

+ {canManageCurrentTeam + ? 'Add a roadmap to start tracking your team' + : 'Ask your team admin to add some roadmaps'} +

+ + {canManageCurrentTeam && ( + + )} +
+ + ); + } + + return ( + <> + {pickRoadmapOptionModal} + {addRoadmapModal} + {createRoadmapModal} + {confirmationContentIdModal} + + {roadmapHeading} + {isLoading && } + {!isLoading && learningRoadmapsToShow.length > 0 && ( +
+ {learningRoadmapsToShow.map((roadmap) => { + const learningCount = roadmap.learning || 0; + const doneCount = roadmap.done || 0; + const totalCount = roadmap.total || 0; + const skippedCount = roadmap.skipped || 0; + + return ( + totalCount ? totalCount : doneCount} + learningCount={ + learningCount > totalCount ? totalCount : learningCount + } + totalCount={totalCount} + skippedCount={skippedCount} + resourceId={roadmap.resourceId} + resourceType="roadmap" + updatedAt={roadmap.updatedAt} + title={roadmap.resourceTitle} + showActions={false} + roadmapSlug={roadmap.roadmapSlug} + /> + ); + })} + + {canManageCurrentTeam && ( + + )} +
+ )} + + ); +} diff --git a/src/components/Dashboard/PersonalDashboard.tsx b/src/components/Dashboard/PersonalDashboard.tsx index 6d3a9cf7c..eb23d7c98 100644 --- a/src/components/Dashboard/PersonalDashboard.tsx +++ b/src/components/Dashboard/PersonalDashboard.tsx @@ -17,6 +17,7 @@ import { DashboardAiRoadmaps } from './DashboardAiRoadmaps.tsx'; import type { AllowedProfileVisibility } from '../../api/user.ts'; import { PencilIcon, type LucideIcon } from 'lucide-react'; import { cn } from '../../lib/classname.ts'; +import type { AllowedRoadmapRenderer } from '../../lib/roadmap.ts'; type UserDashboardResponse = { name: string; @@ -42,6 +43,8 @@ export type BuiltInRoadmap = { description: string; isFavorite?: boolean; relatedRoadmapIds?: string[]; + renderer?: AllowedRoadmapRenderer; + metadata?: Record; }; type PersonalDashboardProps = { @@ -350,13 +353,11 @@ function DashboardCard(props: DashboardCardProps) { } = props; return ( -
- +
+ {Icon && (
diff --git a/src/components/Dashboard/TeamDashboard.tsx b/src/components/Dashboard/TeamDashboard.tsx index f8aab7c4e..8315c3668 100644 --- a/src/components/Dashboard/TeamDashboard.tsx +++ b/src/components/Dashboard/TeamDashboard.tsx @@ -3,29 +3,35 @@ import type { TeamMember } from '../TeamProgress/TeamProgressPage'; import { httpGet } from '../../lib/http'; import { useToast } from '../../hooks/use-toast'; import { getUser } from '../../lib/jwt'; -import { LoadingProgress } from './LoadingProgress'; -import { ResourceProgress } from '../Activity/ResourceProgress'; import { TeamActivityPage } from '../TeamActivity/TeamActivityPage'; import { cn } from '../../lib/classname'; import { Tooltip } from '../Tooltip'; +import { DashboardTeamRoadmaps } from './DashboardTeamRoadmaps'; +import type { BuiltInRoadmap } from './PersonalDashboard'; +import { InviteMemberPopup } from '../TeamMembers/InviteMemberPopup'; +import { Users, Users2 } from 'lucide-react'; type TeamDashboardProps = { + builtInRoleRoadmaps: BuiltInRoadmap[]; + builtInSkillRoadmaps: BuiltInRoadmap[]; teamId: string; }; export function TeamDashboard(props: TeamDashboardProps) { - const { teamId } = props; + const { teamId, builtInRoleRoadmaps, builtInSkillRoadmaps } = props; const toast = useToast(); const currentUser = getUser(); const [isLoading, setIsLoading] = useState(true); const [teamMembers, setTeamMembers] = useState([]); + const [isInvitingMember, setIsInvitingMember] = useState(false); async function getTeamProgress() { const { response, error } = await httpGet( `${import.meta.env.PUBLIC_API_URL}/v1-get-team-progress/${teamId}`, ); + if (error || !response) { toast.error(error?.message || 'Failed to get team progress'); return; @@ -54,12 +60,8 @@ export function TeamDashboard(props: TeamDashboardProps) { getTeamProgress().finally(() => setIsLoading(false)); }, [teamId]); - if (!currentUser) { - return null; - } - const currentMember = teamMembers.find( - (member) => member.email === currentUser.email, + (member) => member.email === currentUser?.email, ); const learningRoadmapsToShow = currentMember?.progress?.filter( @@ -67,53 +69,58 @@ export function TeamDashboard(props: TeamDashboardProps) { ) || []; const allMembersWithoutCurrentUser = teamMembers.sort((a, b) => { - if (a.email === currentUser.email) { + if (a.email === currentUser?.email) { return -1; } - if (b.email === currentUser.email) { + if (b.email === currentUser?.email) { return 1; } return 0; }); + const canManageCurrentTeam = ['admin', 'manager'].includes( + currentMember?.role!, + ); + return (
-

Roadmaps

- {isLoading && } - {!isLoading && learningRoadmapsToShow.length > 0 && ( -
- {learningRoadmapsToShow.map((roadmap) => { - const learningCount = roadmap.learning || 0; - const doneCount = roadmap.done || 0; - const totalCount = roadmap.total || 0; - const skippedCount = roadmap.skipped || 0; - - return ( - totalCount ? totalCount : doneCount} - learningCount={ - learningCount > totalCount ? totalCount : learningCount - } - totalCount={totalCount} - skippedCount={skippedCount} - resourceId={roadmap.resourceId} - resourceType="roadmap" - updatedAt={roadmap.updatedAt} - title={roadmap.resourceTitle} - showActions={false} - roadmapSlug={roadmap.roadmapSlug} - /> - ); - })} -
+ {isInvitingMember && ( + { + toast.success('Invite sent'); + getTeamProgress().finally(() => null); + setIsInvitingMember(false); + }} + onClose={() => { + setIsInvitingMember(false); + }} + /> )} -

+ + +

Team Members + + {canManageCurrentTeam && ( + + + Members + + )}

{isLoading && } {!isLoading && ( @@ -123,7 +130,11 @@ export function TeamDashboard(props: TeamDashboardProps) { ? `${import.meta.env.PUBLIC_AVATAR_BASE_URL}/${member.avatar}` : '/images/default-avatar.png'; return ( - +
{member.name} - + ); })} + + {canManageCurrentTeam && ( + + )}

)} - + ); } diff --git a/src/components/TeamActivity/TeamActivityItem.tsx b/src/components/TeamActivity/TeamActivityItem.tsx index f0e287ee6..1a35410e8 100644 --- a/src/components/TeamActivity/TeamActivityItem.tsx +++ b/src/components/TeamActivity/TeamActivityItem.tsx @@ -102,7 +102,7 @@ export function TeamActivityItem(props: TeamActivityItemProps) { return (
  • {actionType === 'in_progress' && ( <> @@ -158,7 +158,7 @@ export function TeamActivityItem(props: TeamActivityItemProps) { const activityLimit = showAll ? activities.length : 5; return ( -
  • +
  • {username} has {activities.length} updates in {uniqueResourcesCount}  resource(s) diff --git a/src/components/TeamActivity/TeamActivityPage.tsx b/src/components/TeamActivity/TeamActivityPage.tsx index 5fe64182d..e655536c1 100644 --- a/src/components/TeamActivity/TeamActivityPage.tsx +++ b/src/components/TeamActivity/TeamActivityPage.tsx @@ -9,6 +9,12 @@ import { TeamActivityItem } from './TeamActivityItem'; import { TeamActivityTopicsModal } from './TeamActivityTopicsModal'; import { TeamEmptyStream } from './TeamEmptyStream'; import { Pagination } from '../Pagination/Pagination'; +import { + ChartNoAxesGantt, + CircleDashed, + Flag, + LoaderCircle, +} from 'lucide-react'; export type TeamStreamActivity = { _id?: string; @@ -51,10 +57,11 @@ type GetTeamActivityResponse = { type TeamActivityPageProps = { teamId?: string; + canManageCurrentTeam?: boolean; }; export function TeamActivityPage(props: TeamActivityPageProps) { - const { teamId: defaultTeamId } = props; + const { teamId: defaultTeamId, canManageCurrentTeam = false } = props; const { t: teamId = defaultTeamId } = getUrlParams(); const toast = useToast(); @@ -182,13 +189,44 @@ export function TeamActivityPage(props: TeamActivityPageProps) { return enrichedUsers; }, [users, activities]); - if (!teamId) { - window.location.href = '/'; - return; - } + const sectionHeading = ( +

    + Team Activity + + {canManageCurrentTeam && ( + + + Progresses + + )} +

    + ); if (isLoading) { - return null; + return ( + <> + {sectionHeading} +
    + {Array.from({ length: 4 }).map((_, index) => ( +
    + ))} +
    + + ); + } + + if (!teamId) { + if (typeof window !== 'undefined') { + window.location.href = '/'; + } else { + return null; + } } return ( @@ -202,9 +240,7 @@ export function TeamActivityPage(props: TeamActivityPageProps) { {usersWithActivities.length > 0 ? ( <> -

    - Team Activity -

    + {sectionHeading}
      {usersWithActivities.map((user, index) => { return ( @@ -233,7 +269,12 @@ export function TeamActivityPage(props: TeamActivityPageProps) { /> ) : ( - + <> + {sectionHeading} +
      + +
      + )} ); diff --git a/src/components/TeamActivity/TeamEmptyStream.tsx b/src/components/TeamActivity/TeamEmptyStream.tsx index 9fa63487b..25823c291 100644 --- a/src/components/TeamActivity/TeamEmptyStream.tsx +++ b/src/components/TeamActivity/TeamEmptyStream.tsx @@ -10,7 +10,7 @@ export function TeamEmptyStream(props: TeamActivityItemProps) { return (
      - +

      No Activity

      diff --git a/src/components/TeamMemberDetails/TeamMemberEmptyPage.tsx b/src/components/TeamMemberDetails/TeamMemberEmptyPage.tsx index b3537c34d..4de37f834 100644 --- a/src/components/TeamMemberDetails/TeamMemberEmptyPage.tsx +++ b/src/components/TeamMemberDetails/TeamMemberEmptyPage.tsx @@ -10,18 +10,11 @@ export function TeamMemberEmptyPage(props: TeamMemberEmptyPageProps) { return (

      - +

      No Progress

      - Progress will appear here as they start tracking their{' '} - - Roadmaps - {' '} - progress. + Progress will appear here as they start tracking their roadmaps.

      diff --git a/src/components/TeamMembers/InviteMemberPopup.tsx b/src/components/TeamMembers/InviteMemberPopup.tsx index 4982661ce..eb37ad43f 100644 --- a/src/components/TeamMembers/InviteMemberPopup.tsx +++ b/src/components/TeamMembers/InviteMemberPopup.tsx @@ -7,10 +7,11 @@ import { type AllowedRoles, RoleDropdown } from '../CreateTeam/RoleDropdown'; type InviteMemberPopupProps = { onInvited: () => void; onClose: () => void; + teamId?: string; }; export function InviteMemberPopup(props: InviteMemberPopupProps) { - const { onClose, onInvited } = props; + const { onClose, onInvited, teamId: defaultTeamId } = props; const popupBodyRef = useRef(null); const emailRef = useRef(null); @@ -18,7 +19,7 @@ export function InviteMemberPopup(props: InviteMemberPopupProps) { const [email, setEmail] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); - const { teamId } = useTeamId(); + const { teamId = defaultTeamId } = useTeamId(); useEffect(() => { emailRef?.current?.focus(); @@ -31,7 +32,7 @@ export function InviteMemberPopup(props: InviteMemberPopupProps) { const { response, error } = await httpPost( `${import.meta.env.PUBLIC_API_URL}/v1-invite-member/${teamId}`, - { email, role: selectedRole } + { email, role: selectedRole }, ); if (error || !response) { @@ -92,7 +93,7 @@ export function InviteMemberPopup(props: InviteMemberPopupProps) {
      {error && ( -

      +

      {error}

      )} diff --git a/src/components/TeamRoadmapsList/TeamRoadmaps.tsx b/src/components/TeamRoadmapsList/TeamRoadmaps.tsx index 8bd94389b..a33156a19 100644 --- a/src/components/TeamRoadmapsList/TeamRoadmaps.tsx +++ b/src/components/TeamRoadmapsList/TeamRoadmaps.tsx @@ -233,7 +233,7 @@ export function TeamRoadmaps() { const addRoadmapModal = isAddingRoadmap && ( setIsAddingRoadmap(false)} - teamResourceConfig={teamResources} + teamResourceConfig={teamResources.map((c) => c.resourceId)} allRoadmaps={filteredAllRoadmaps.filter((r) => r.renderer === 'editor')} teamId={teamId} onRoadmapAdd={(roadmapId: string) => { @@ -309,9 +309,9 @@ export function TeamRoadmaps() { {createRoadmapModal} {confirmationContentIdModal} - + -

      No roadmaps

      +

      No roadmaps

      {canManageCurrentTeam ? 'Add a roadmap to start tracking your team' @@ -320,7 +320,7 @@ export function TeamRoadmaps() { {canManageCurrentTeam && (