• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alkem-io / client-web / #9048

11 Oct 2024 01:42PM UTC coverage: 5.943%. First build
#9048

Pull #7022

travis-ci

Pull Request #7022: [v0.74.0] Roles API + Unauthenticated Explore page

202 of 10241 branches covered (1.97%)

Branch coverage included in aggregate %.

63 of 431 new or added lines in 60 files covered. (14.62%)

1468 of 17861 relevant lines covered (8.22%)

0.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/domain/community/user/userProfilePage/UserProfilePageView.tsx
1
import { useTranslation } from 'react-i18next';
2
import UserProfileView, { UserProfileViewProps } from '@/domain/community/profile/views/UserProfileView';
3
import AssociatedOrganizationsLazilyFetched from '@/domain/community/organization/AssociatedOrganizations/AssociatedOrganizationsLazilyFetched';
4
import PageContent from '@/core/ui/content/PageContent';
5
import PageContentColumn from '@/core/ui/content/PageContentColumn';
6
import { SpaceHostedItem } from '@/domain/space/models/SpaceHostedItem.model';
7
import TilesContributionsView from '@/domain/community/contributor/Contributions/TilesContributionsView';
8
import { CaptionSmall } from '@/core/ui/typography';
9
import PageContentBlock from '@/core/ui/content/PageContentBlock';
10
import PageContentBlockHeader from '@/core/ui/content/PageContentBlockHeader';
11
import AccountResourcesView, {
12
  AccountResourcesProps,
13
} from '@/domain/community/contributor/Account/AccountResourcesView';
14
import useFilteredMemberships from '../hooks/useFilteredMemberships';
15
import { RoleType } from '../constants/RoleType';
16
import { useScreenSize } from '@/core/ui/grid/constants';
17

18
export interface UserProfileViewPageProps extends UserProfileViewProps {
19
  contributions: SpaceHostedItem[] | undefined;
20
  organizationIds: string[] | undefined;
21
  accountResources: AccountResourcesProps | undefined;
22
}
23

24
export const UserProfilePageView = ({
25
  contributions = [],
NEW
26
  organizationIds,
×
27
  userModel,
×
28
  accountResources,
29
}: UserProfileViewPageProps) => {
30
  const { t } = useTranslation();
31

32
  const { isMediumSmallScreen } = useScreenSize();
×
33

×
34
  const [filteredMemberships, remainingMemberships] = useFilteredMemberships(contributions, [
×
35
    RoleType.Lead,
36
    RoleType.Admin,
×
37
  ]);
NEW
38

×
39
  const hasAccountResources = accountResources && accountResources.spaces && accountResources.spaces.length > 0;
40

41
  return (
42
    <PageContent>
NEW
43
      <PageContentColumn columns={isMediumSmallScreen ? 12 : 3}>
×
44
        <UserProfileView userModel={userModel} />
45
        <AssociatedOrganizationsLazilyFetched
×
46
          organizationIds={organizationIds ?? []}
47
          title={t('pages.user-profile.associated-organizations.title')}
48
          helpText={t('pages.user-profile.associated-organizations.help')}
49
        />
50
      </PageContentColumn>
×
51
      <PageContentColumn columns={9}>
52
        {hasAccountResources && (
53
          <AccountResourcesView
54
            title={t('pages.user-profile.accountResources.sectionTitle')}
×
55
            accountResources={accountResources}
56
          />
57
        )}
58
        {filteredMemberships.length > 0 && (
59
          <TilesContributionsView
60
            title={t('pages.user-profile.communities.leadSpacesTitle')}
61
            contributions={filteredMemberships}
62
          />
63
        )}
64
        {remainingMemberships.length > 0 ? (
65
          <TilesContributionsView
×
66
            title={t('pages.user-profile.communities.allMembershipsTitle')}
67
            contributions={remainingMemberships}
68
          />
69
        ) : (
70
          <PageContentBlock>
71
            <PageContentBlockHeader title={t('pages.user-profile.communities.allMembershipsTitle')} />
×
72
            <CaptionSmall>{t('pages.user-profile.communities.noMembership')}</CaptionSmall>
73
          </PageContentBlock>
74
        )}
75
      </PageContentColumn>
76
    </PageContent>
77
  );
×
78
};
79

80
export default UserProfilePageView;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc