Skip to content

Commit

Permalink
Merge pull request #59 from chaitanyakole/user_field_remove
Browse files Browse the repository at this point in the history
1.On Cohort page type is removed,Archived status is removed, List of cohort added tenant name.  2.From user creation/update mobile,and email fields are removed.
  • Loading branch information
gouravmore authored Feb 20, 2025
2 parents 92b0d03 + 351a575 commit f3dff8e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 50 deletions.
9 changes: 5 additions & 4 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
"SEND_INVITATION_TO_NEW_ADMIN": "Send Invitation to new cohort admin",
"SEND_INVITATION": "Send Invitation",
"METABASE_REPORTS": "Metabase Report",
"USER_JOURNEY_REPORT":"User Journey Report",
"USER_RESPONSE_EVENT":"User Response Event Report"
"USER_JOURNEY_REPORT": "User Journey Report",
"USER_RESPONSE_EVENT": "User Response Event Report"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down Expand Up @@ -439,7 +439,8 @@
"DOMAIN": "Domain",
"CREATE_TENANT_ADMIN": "Create Tenant Admin",
"CREATE_COHORT_ADMIN": "Create Cohort Admin",
"USERID": "UserId"
"USERID": "UserId",
"TENANT_NAME": "Tenant Name"
},
"WORKSPACE": {
"EDITOR_WORKSPACE": "Editor Workspace",
Expand Down Expand Up @@ -492,7 +493,7 @@
"INVITED_TO_JOIN_COHORT": "Invited to join cohort",
"INVITED_BY": "Invited by",
"REVOKE_INVITATION": "Revoke Invitation",

"DELETE_CONFIRMATION": "Revoke request of ",
"CANCEL": "Cancel",
"REVOKE": "Revoke",
Expand Down
15 changes: 0 additions & 15 deletions src/components/UserUpdateSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@
"fieldId": null,
"type": "string",
"validation": []
},
"mobileNo": {
"title": "Mobile Number",
"fieldId": null,
"type": "string",
"pattern": "^\\d{10}$",
"validation": []
},
"email": {
"title": "Email Address",
"type": "string",
"format": "email",
"pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$",
"validation": ["required"],
"shouldSkipDefaultValidation": true
}
},
"dependencies": {}
Expand Down
2 changes: 1 addition & 1 deletion src/data/tableColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const getCohortTableData = (
) => {
const configs: ColumnConfig[] = [
{ key: "name", titleKey: "TABLE_TITLE.NAME", width: 130 },
{ key: "type", titleKey: "TABLE_TITLE.TYPE", width: 90 },
{ key: "tenantName", titleKey: "TABLE_TITLE.TENANT_NAME", width: 130 },
// { key: "updatedBy", titleKey: "TABLE_TITLE.UPDATED_BY", width: 130 },
// { key: "createdBy", titleKey: "TABLE_TITLE.CREATED_BY", width: 130 },
{ key: "createdAt", titleKey: "TABLE_TITLE.CREATED_DATE", width: 130 },
Expand Down
37 changes: 21 additions & 16 deletions src/pages/cohorts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const Center: React.FC = () => {
};

const [filters, setFilters] = useState<cohortFilterDetails>({
type: CohortTypes.COHORT,
type: "cohort",
// states: "",
status: [statusValue],
// districts: "",
Expand Down Expand Up @@ -336,25 +336,29 @@ const Center: React.FC = () => {
filters: filters,
};

// Call getCohortList API
const resp = await getCohortList(data);

if (resp) {
const result = resp?.results;

// Map response data to required format
const resultData = result?.map((item: any) => ({
name: item?.name,
type: item?.type === "cohort" ? "Cohort" : item?.type,
status: item?.status,
tenantId: item?.tenantId,
updatedBy: item?.updatedBy,
createdBy: item?.createdBy,
createdAt: item?.createdAt,
updatedAt: item?.updatedAt,
cohortId: item?.cohortId,
userRoleTenantMapping: { code: item?.role },
}));
const resultData = result?.map((item: any) => {
const matchingTenant = listOfTenants.find(
(tenant: any) => tenant?.tenantId === item?.tenantId
);
return {
name: item?.name,
type: item?.type === "cohort" ? "Cohort" : item?.type,
status: item?.status,
tenantId: item?.tenantId,
tenantName: matchingTenant?.name || "Unknown Tenant",
updatedBy: item?.updatedBy,
createdBy: item?.createdBy,
createdAt: item?.createdAt,
updatedAt: item?.updatedAt,
cohortId: item?.cohortId,
userRoleTenantMapping: { code: item?.role },
};
});

setCohortData(resultData || []);
const totalCount = resp?.count;
Expand Down Expand Up @@ -401,6 +405,7 @@ const Center: React.FC = () => {
filters.states,
filters.status,
createCenterStatus,
listOfTenants,
]);

// handle functions
Expand Down Expand Up @@ -931,7 +936,7 @@ const Center: React.FC = () => {
isTenantShow: true,
selectedSort: selectedSort,
selectedFilter: selectedFilter,
statusArchived: true,
statusArchived: false,
statusInactive: true,
selectedTenant: selectedTenant,
handleTenantChange: handleTenantChange,
Expand Down
14 changes: 0 additions & 14 deletions src/pages/userSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@
"type": "string",
"validation": []
},
"mobileNo": {
"title": "Mobile Number",
"fieldId": null,
"type": "string",
"pattern": "^[6-9]\\d{9}$",
"validation": ["mobile"]
},
"email": {
"title": "Email Address",
"type": "string",
"format": "email",
"pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$",
"validation": ["required"]
},
"username": {
"title": "Username",
"fieldId": null,
Expand Down

0 comments on commit f3dff8e

Please sign in to comment.