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

fix: added search on connection list page #884

Merged
merged 15 commits into from
Jan 27, 2025
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
3 changes: 3 additions & 0 deletions src/components/ConnectionsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const ConnectionList = () => {
nextPage: '',
lastPage: '',
});
const [searchText, setSearchText] = useState("");

const getConnections = async (apiParameter: IConnectionListAPIParameter) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
Expand Down Expand Up @@ -105,6 +106,7 @@ const ConnectionList = () => {

//onChange of Search input text
const searchInputChange = (e: ChangeEvent<HTMLInputElement>) => {
setSearchText(e.target.value)
setListAPIParameter({
...listAPIParameter,
search: e.target.value,
Expand Down Expand Up @@ -150,6 +152,7 @@ const ConnectionList = () => {
)}
<SortDataTable
onInputChange={searchInputChange}
searchValue={searchText}
refresh={refreshPage}
header={header}
data={connectionList}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Issuance/ConnectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ConnectionList = (props: {
const [tableData, setTableData] = useState<ITableData[]>([]);
const [connectionList, setConnectionList] = useState([]);
const [localOrgs, setLocalOrgs] = useState<LocalOrgs[]>([]);

const [searchText, setSearchText] = useState("");
const [loading, setLoading] = useState<boolean>(false);
const [totalItem, setTotalItem] = useState(0);
const [error, setError] = useState<string | null>(null);
Expand Down Expand Up @@ -188,6 +188,7 @@ const ConnectionList = (props: {

//onChange of Search input text
const searchInputChange = (e: ChangeEvent<HTMLInputElement>) => {
setSearchText(e.target.value)
setListAPIParameter({
...listAPIParameter,
search: e.target.value,
Expand Down Expand Up @@ -278,6 +279,7 @@ const ConnectionList = (props: {
/>
<NewDataTable
isHeader={true}
searchValue={searchText}
isSearch={true}
isRefresh={true}
isSort={true}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Verification/ConnectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ConnectionList = (props: {
const [connectionList, setConnectionList] = useState<ITableData[]>([]);
const [connectionsTableData, setConnectionsTableData] = useState<ITableData[]>([]);
const [localOrgs, setLocalOrgs] = useState<LocalOrgs[]>([]);

const [searchText, setSearchText] = useState("");
const [selectedConnectionList, setSelectedConnectionList] = useState<
ITableData[]
>([]);
Expand Down Expand Up @@ -66,6 +66,7 @@ const ConnectionList = (props: {
}, [listAPIParameter]);

const searchInputChange = (e: ChangeEvent<HTMLInputElement>) => {
setSearchText(e.target.value)
setListAPIParameter({
...listAPIParameter,
search: e.target.value,
Expand Down Expand Up @@ -299,6 +300,7 @@ const extractConnectionFields = (item: IConnectionList) => {
/>
<SortDataTable
onInputChange={searchInputChange}
searchValue={searchText}
refresh={refreshPage}
header={verification_header}
data={connectionsTableData}
Expand Down
Loading