-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move profile list items into profiles
- Loading branch information
1 parent
7d5878e
commit 48ff9e2
Showing
7 changed files
with
116 additions
and
31 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
plugin-hrm-form/src/components/profile/ProfileListPage/ProfileListPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright (C) 2021-2023 Technology Matters | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see https://www.gnu.org/licenses/. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { CLTable, CLTableRow, CLTableCell } from '../../../styles/caseList'; | ||
import { useProfileListLoader } from '../../../states/profile/hooks/useProfileListLoader'; | ||
import { useProfileList } from '../../../states/profile/hooks/useProfileList'; | ||
import ProfileListRow from './ProfileListRow'; | ||
|
||
const ProfileListPage: React.FC = () => { | ||
useProfileListLoader(); | ||
const { loading, profileIds } = useProfileList(); | ||
|
||
if (loading) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
return ( | ||
<> | ||
<h1>Clients</h1> | ||
<CLTable> | ||
<CLTableRow> | ||
<CLTableCell> Client</CLTableCell> | ||
<CLTableCell> Identifier(s)</CLTableCell> | ||
<CLTableCell> Status</CLTableCell> | ||
<CLTableCell> Blocked</CLTableCell> | ||
<CLTableCell> Overview</CLTableCell> | ||
</CLTableRow> | ||
{profileIds?.map(profileId => ( | ||
<ProfileListRow key={profileId} profileId={profileId} /> | ||
))} | ||
</CLTable> | ||
</> | ||
); | ||
}; | ||
|
||
// eslint-disable-next-line import/no-unused-modules | ||
export default ProfileListPage; |
36 changes: 36 additions & 0 deletions
36
plugin-hrm-form/src/components/profile/ProfileListPage/ProfileListRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (C) 2021-2023 Technology Matters | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see https://www.gnu.org/licenses/. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { useProfile } from '../../../states/profile/hooks/useProfile'; | ||
import { Profile } from '../../../states/profile/types'; | ||
import { CLTableRow, CLTableCell } from '../../../styles/caseList'; | ||
|
||
type Props = { | ||
profileId: Profile['id']; | ||
}; | ||
|
||
const ProfileListRow: React.FC<Props> = ({ profileId }) => { | ||
const { profile } = useProfile({ profileId }); | ||
return ( | ||
<CLTableRow> | ||
<CLTableCell>{profile?.name}</CLTableCell> | ||
</CLTableRow> | ||
); | ||
}; | ||
|
||
export default ProfileListRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters