forked from nexodus-io/nexodus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nexodus-io#1936 from chirino/frontend-org-membership
frontend: show org membership when you view an org’s details
- Loading branch information
Showing
3 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
BulkDeleteButton, | ||
BulkExportButton, | ||
Datagrid, | ||
List, | ||
TextField, | ||
} from "react-admin"; | ||
import { useParams } from "react-router-dom"; | ||
import React, { Fragment } from "react"; | ||
|
||
function importer(record: any) { | ||
record.id = [record.organization_id, record.user_id]; | ||
return record; | ||
} | ||
|
||
export const UserOrganizationList = () => { | ||
const { id } = useParams(); | ||
|
||
return ( | ||
<List | ||
resource="organizations/users" | ||
queryOptions={{ meta: { ids: [id], importer } }} | ||
sort={{ field: "user_id", order: "ASC" }} | ||
> | ||
<Datagrid | ||
bulkActionButtons={ | ||
<Fragment> | ||
<BulkExportButton /> | ||
<BulkDeleteButton /> | ||
</Fragment> | ||
} | ||
> | ||
<TextField label="Full Name" source="user.full_name" /> | ||
<TextField label="Full Name" source="user.username" /> | ||
</Datagrid> | ||
</List> | ||
); | ||
}; |