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

alkem-io / client-web / #8906

24 Sep 2024 10:02AM UTC coverage: 6.028%. First build
#8906

Pull #6938

travis-ci

Pull Request #6938: Templates release v0.72.3

200 of 10087 branches covered (1.98%)

Branch coverage included in aggregate %.

75 of 1034 new or added lines in 76 files covered. (7.25%)

1471 of 17634 relevant lines covered (8.34%)

0.2 hits per line

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

0.0
/src/main/admin/users/adminUsers/AdminUsersPage.tsx
1
import React, { FC, useState } from 'react';
2
import AdminLayout from '@/domain/platformAdmin/layout/toplevel/AdminLayout';
3
import { AdminSection } from '@/domain/platformAdmin/layout/toplevel/constants';
4
import useAdminGlobalUserList from '@/domain/platformAdmin/domain/users/useAdminGlobalUserList';
5
import SearchableListLayout from '@/domain/shared/components/SearchableList/SearchableListLayout';
6
import { SearchableListItem } from '@/domain/shared/components/SearchableList/SimpleSearchableTable';
7
import { IconButton } from '@mui/material';
8
import { TuneOutlined } from '@mui/icons-material';
9
import LicensePlanDialog from '@/domain/platformAdmin/domain/organizations/LicensePlanDialog';
10
import AdminSearchableTable from '@/domain/platformAdmin/components/AdminSearchableTable';
11

12
const AdminUsersPage: FC = () => {
13
  const { userList, licensePlans, ...listProps } = useAdminGlobalUserList();
×
NEW
14

×
15
  const [licenseDialogOpen, setLicenseDialogOpen] = useState(false);
NEW
16
  const [selectedItem, setSelectedItem] = useState<SearchableListItem | undefined>(undefined);
×
NEW
17

×
18
  const onSettingsClick = (item: SearchableListItem) => {
NEW
19
    setSelectedItem(item);
×
NEW
20
    setLicenseDialogOpen(true);
×
NEW
21
  };
×
22

23
  const assignLicense = async (entityId: string, planId: string) => {
NEW
24
    await listProps.assignLicensePlan(entityId, planId);
×
NEW
25
    setLicenseDialogOpen(false);
×
NEW
26
  };
×
27

28
  const revokeLicense = async (entityId: string, planId: string) => {
NEW
29
    await listProps.revokeLicensePlan(entityId, planId);
×
NEW
30
    setLicenseDialogOpen(false);
×
NEW
31
  };
×
32

33
  const getActions = (item: SearchableListItem) => {
NEW
34
    return (
×
NEW
35
      <IconButton onClick={() => onSettingsClick(item)} size="large" aria-label={'License'}>
×
NEW
36
        <TuneOutlined />
×
37
      </IconButton>
38
    );
39
  };
40

41
  return (
42
    <AdminLayout currentTab={AdminSection.User}>
×
43
      <SearchableListLayout>
44
        <AdminSearchableTable data={userList} {...listProps} itemActions={getActions} />
45
      </SearchableListLayout>
46
      {selectedItem?.accountId && (
47
        <LicensePlanDialog
×
48
          open={licenseDialogOpen}
49
          accountId={selectedItem?.accountId}
50
          onClose={() => setLicenseDialogOpen(false)}
NEW
51
          licensePlans={licensePlans}
×
52
          assignLicensePlan={assignLicense}
53
          revokeLicensePlan={revokeLicense}
54
          activeLicensePlanIds={selectedItem.activeLicensePlanIds}
55
        />
56
      )}
57
    </AdminLayout>
58
  );
59
};
60

61
export default AdminUsersPage;
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

© 2026 Coveralls, Inc