Skip to content

Commit

Permalink
Merge pull request #18 from chaitanyakole/filter_fixes
Browse files Browse the repository at this point in the history
[fix]Text corrections, Adding a cohort ID filter in the user list, Showing correct list in filter.
  • Loading branch information
gouravmore authored Jan 6, 2025
2 parents c31b03b + 32ff04d commit b2af1ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"SEARCH_COHORT": "Search Cohort",
"DELETE_SUCCESSFULLY": "Cohort Deleted Successfully",
"ALL_STATES": "All States",
"COHORT_MEMBER": "Cohort Member",
"COHORT_MEMBER": "Cohort",
"ADD_NEW_COHORT_ADMIN": "Add New Cohort Admin"
},
"COURSE_PLANNER": {
Expand Down Expand Up @@ -448,7 +448,7 @@
"SEARCH": "Search Tenant",
"ROLE_ASSIGNED": "Role Created Successfully",
"ROLE_ASSIGNED_fAILED": "Role Assigned Failed",
"TENANT_MEMBER": "Tenant Member",
"TENANT_MEMBER": "Tenant",
"ALL_TENANTS": "All Tenants",
"ADD_NEW_TENANT_ADMIN": "Add New Tenant Admin",
"TENANT_ADMIN_CREATE": "Tenant Admin Created Successfully",
Expand Down
2 changes: 1 addition & 1 deletion src/components/FormControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const MultipleSelectCheckmarks: React.FC<MultipleSelectCheckmarksProps> = ({
let selectedNames = typeof value === "string" ? value.split(",") : value;

if (selectedNames.includes("all")) {
selectedNames = defaultValue ? [defaultValue] : [];
selectedNames = defaultValue ? [defaultValue] : ["All"];
}

const selectedCodes = selectedNames.map(
Expand Down
9 changes: 6 additions & 3 deletions src/components/UserTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,18 @@ const UserTable: React.FC<UserTableProps> = ({
try {
const result = await getTenantLists(filters);
setListOfTenants(result);
const tenantId = filters?.tenantId
? filters?.tenantId
: result?.[0]?.tenantId;
let data = {
limit: 0,
offset: 0,
filters: {
tenantId: result?.[0]?.tenantId,
tenantId: tenantId,
// cohortId: cohortId,
},
};
if (filters?.tenantId) {
if (tenantId) {
const cohortList = await getCohortList(data);
setListOfCohorts(cohortList?.results);
}
Expand All @@ -319,7 +322,7 @@ const UserTable: React.FC<UserTableProps> = ({
if (filters) {
fetchData();
}
}, [filters]);
}, [filters, selectedCohort]);

const handleChange = (event: SelectChangeEvent<typeof pageSize>) => {
setPageSize(event.target.value);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cohortAdminSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"required": ["name", "username", "password"],
"properties": {
"name": {
"title": "Cohort Name",
"title": "Cohort Admin Name",
"type": "string",
"fieldId": null,
"validation": [],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tenantAdminSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"required": ["name", "username", "password", "role"],
"properties": {
"name": {
"title": "Full Name",
"title": "Tenant Admin Name",
"fieldId": null,
"type": "string",
"validation": []
Expand Down

0 comments on commit b2af1ec

Please sign in to comment.