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

[Simple Homepage] Dashboard Menu + Activity Components #7107

Merged
merged 8 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
895 changes: 294 additions & 601 deletions src/core/apollo/generated/apollo-hooks.ts

Large diffs are not rendered by default.

711 changes: 227 additions & 484 deletions src/core/apollo/generated/graphql-schema.ts

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions src/core/i18n/en/translation.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2162,9 +2162,18 @@
"home": {
"title": "My Dashboard",
"subtitle": "Ready to make some impact?",
"mainNavigation": {
"invitations": "Invitations",
"myLatestActivity": "My Latest Activity",
"myLatestSpacesActivity": "Latest Activity In My Spaces",
"tipsAndTricks": "Tips & Tricks",
"myAccount": "My Account",
"createSpace": "Create my own Space",
"activityView": "Activity View"
},
"sections": {
"latestContributions": {
"title": "Latest Contributions in my Spaces",
"title": "Latest Activity in my Spaces",
"filter": {
"space": {
"label": "Space:",
Expand All @@ -2177,7 +2186,7 @@
}
},
"myLatestContributions": {
"title": "My Latest Contributions",
"title": "My Latest Activity",
"card": {
"journey": "in: <journeyicon /> {{journey}}"
},
Expand Down
26 changes: 26 additions & 0 deletions src/domain/InnovationPack/admin/AdminInnovationPacks.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,29 @@ fragment InnovationPackProviderProfileWithAvatar on Contributor {
url
}
}

fragment InnovationPackCard on InnovationPack {
id
nameID
profile {
id
displayName
description
tagset {
...TagsetDetails
}
url
}
templatesSet {
id
postTemplatesCount
whiteboardTemplatesCount
innovationFlowTemplatesCount
calloutTemplatesCount
communityGuidelinesTemplatesCount
}
provider {
...InnovationPackProviderProfileWithAvatar
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import InvitationActionsContainer from '../invitations/InvitationActionsContaine
import { CommunityContributorType, VisualType } from '../../../core/apollo/generated/graphql-schema';
import BackButton from '../../../core/ui/actions/BackButton';
import useNavigate from '../../../core/routing/useNavigate';
import { useNewMembershipsQuery } from '../../../core/apollo/generated/apollo-hooks';
import { PendingMembershipsDialogType, usePendingMembershipsDialog } from './PendingMembershipsDialogContext';
import { defer } from 'lodash';
import { getChildJourneyTypeName } from '../../shared/utils/spaceLevel';
Expand All @@ -40,8 +39,6 @@ const PendingMembershipsUserMenuItem = ({ children }: PendingMembershipsUserMenu

const navigate = useNavigate();

const { refetch: refetchNewMembershipsQuery } = useNewMembershipsQuery();

const { openDialog, setOpenDialog } = usePendingMembershipsDialog();

const closeDialog = () => setOpenDialog(undefined);
Expand Down Expand Up @@ -72,8 +69,6 @@ const PendingMembershipsUserMenuItem = ({ children }: PendingMembershipsUserMenu
const pendingMembershipsCount = invitations && applications ? invitations.length + applications.length : undefined;

const onInvitationAccept = () => {
refetchNewMembershipsQuery();

if (openDialog?.journeyUri) {
navigate(openDialog?.journeyUri);
defer(closeDialog); // Deferring for appearance purpose only
Expand All @@ -83,7 +78,6 @@ const PendingMembershipsUserMenuItem = ({ children }: PendingMembershipsUserMenu
};

const onInvitationReject = () => {
refetchNewMembershipsQuery();
setOpenDialog({ type: PendingMembershipsDialogType.PendingMembershipsList });
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ query UserProvider {
...UserDetails
account {
id
authorization {
id
myPrivileges
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface UserContextValue {
loadingMe: boolean; // Loading Authentication and Profile data. Once it's false that's enough for showing the page header and avatar.
verified: boolean;
isAuthenticated: boolean;
accountPrivileges: string[];
}

const UserContext = React.createContext<UserContextValue>({
Expand All @@ -26,6 +27,7 @@ const UserContext = React.createContext<UserContextValue>({
loadingMe: true,
verified: false,
isAuthenticated: false,
accountPrivileges: [],
});

const UserProvider: FC<{}> = ({ children }) => {
Expand Down Expand Up @@ -73,6 +75,7 @@ const UserProvider: FC<{}> = ({ children }) => {
loadingMe: loadingMeAndParentQueries,
verified,
isAuthenticated,
accountPrivileges: meData?.me.user?.account?.authorization?.myPrivileges ?? [],
bobbykolev marked this conversation as resolved.
Show resolved Hide resolved
}),
[userMetadata, loading, loadingMeAndParentQueries, verified, isAuthenticated]
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query DashboardSpaces($visibilities: [SpaceVisibility!] = [ACTIVE]) {
spaces(filter: { visibilities: $visibilities }) {
...SpaceCard
}
}
139 changes: 0 additions & 139 deletions src/domain/journey/space/FilterByTag/FilterButtons.tsx

This file was deleted.

77 changes: 0 additions & 77 deletions src/domain/journey/space/FilterByTag/FilterByTag.tsx

This file was deleted.

4 changes: 4 additions & 0 deletions src/main/routing/urlBuilders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ export const buildInnovationHubUrl = (subdomain: string): string => {
}
}
};

export const getAccountLink = (profileUrl?: string) => {
return profileUrl ? `${profileUrl}/settings/account` : '';
};
bobbykolev marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 13 additions & 3 deletions src/main/topLevelPages/Home/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from 'react';
import React, { Suspense } from 'react';
import HomePageLayout from './HomePageLayout';
import InnovationHubHomePage from '../../../domain/innovationHub/InnovationHubHomePage/InnovationHubHomePage';
import Loading from '../../../core/ui/loading/Loading';
import useInnovationHub from '../../../domain/innovationHub/useInnovationHub/useInnovationHub';
import MyDashboard from '../myDashboard/MyDashboard';
import PageContent from '../../../core/ui/content/PageContent';

const MyDashboard = React.lazy(() => import('../myDashboard/MyDashboard'));

const HomePage = () => {
const { innovationHub, innovationHubLoading } = useInnovationHub();
Expand All @@ -20,7 +22,15 @@ const HomePage = () => {
return <InnovationHubHomePage innovationHub={innovationHub} />;
}

return <MyDashboard />;
return (
<HomePageLayout>
<PageContent>
<Suspense fallback={<Loading />}>
<MyDashboard />
</Suspense>
</PageContent>
</HomePageLayout>
);
};

export default HomePage;
Loading