Skip to content

Commit

Permalink
Merge pull request #8 from chaitanyakole/test_branch
Browse files Browse the repository at this point in the history
Changed column name create role to Enable role and other text changes
  • Loading branch information
gouravmore authored Dec 5, 2024
2 parents 33957fd + 6dc0b87 commit a033680
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 22 deletions.
3 changes: 2 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@
"ADD_NEW_TENANT": "Add New Tenant",
"CREATE_ROLE": "Create Role",
"USER_DELETE_FAILED": "User deletion failed",
"ASSIGN_ROLE": "Assign Role"
"ASSIGN_ROLE": "Assign Role",
"ENABLE_ROLE": "Enable Role"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down
7 changes: 4 additions & 3 deletions src/components/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface DynamicFormProps {
onChange: (event: IChangeEvent<any>) => void;
onError: (errors: any) => void;
showErrorList: boolean;
id?: string; // Optional id prop
id?: string;

widgets?: {
[key: string]: React.FC<WidgetProps<any, RJSFSchema, any>>;
Expand Down Expand Up @@ -127,9 +127,10 @@ const DynamicForm: React.FC<DynamicFormProps> = ({

const transformErrors = (errors: any) => {
const currentYearPattern = new RegExp(getCurrentYearPattern());

errors.length === 0 ? setNoError(true) : setNoError(false);

let updatedUiSchema: UiSchema = { ...uiSchema }; // Ensure the type is UiSchema
let updatedUiSchema: UiSchema = { ...uiSchema };

return errors?.map((error: any) => {
const property = error.property ? error.property.substring(1) : ""; // Check if error.property exists
Expand Down Expand Up @@ -266,7 +267,7 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
};

useEffect(() => {
// setSubmittedButtonStatus(false);
setSubmittedButtonStatus(false);
}, []);
return (
<div className="shreyas shinde">
Expand Down
1 change: 0 additions & 1 deletion src/components/HeaderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { useTheme } from "@mui/material/styles";
import { useTranslation } from "next-i18next";
import { useEffect, useState } from "react";
import { QueryKeys, Role, Status } from "@/utils/app.constant";
import FiberManualRecordIcon from "@mui/icons-material/FiberManualRecord";
import {
getCenterList,
getStateBlockDistrictList,
Expand Down
2 changes: 1 addition & 1 deletion src/components/KaTableComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const KaTableComponent: React.FC<KaTableComponentProps> = ({
}}
>
<Typography variant="body2" fontFamily={"Poppins"}>
{t("COMMON.CREATE_ROLE")}
{t("COMMON.ENABLE_ROLE")}
</Typography>
</Button>
</Tooltip>
Expand Down
5 changes: 2 additions & 3 deletions src/components/TenantSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"required": ["name", "domain"],
"properties": {
"name": {
"title": "Full Name",
"title": "Tenant Name",
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z ]*[a-zA-Z]$",
"fieldId": null,
"validation": [],
"description": "Enter your full name; only letters and spaces are allowed."
"description": "Enter tenant name."
},
"domain": {
"title": "Domain",
Expand Down
2 changes: 1 addition & 1 deletion src/data/tableColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const getTenantTableData = (t: any, isMobile: boolean) => {
// titleKey: "TABLE_TITLE.ARCHIVED_LEARNERS",
// width: 130,
// },
{ key: "roleDefine", titleKey: "COMMON.CREATE_ROLE", width: 130 },
{ key: "roleDefine", titleKey: "COMMON.ENABLE_ROLE", width: 130 },
{ key: "actions", titleKey: "TABLE_TITLE.ACTIONS", width: 125 },
];

Expand Down
5 changes: 2 additions & 3 deletions src/pages/cohortSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"required": ["name", "status", "type"],
"properties": {
"name": {
"title": "Full Name",
"title": "Cohort Name",
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z ]*[a-zA-Z]$",
"fieldId": null,
"validation": [],
"description": "Enter the full name, using only letters and spaces."
"description": "Enter the cohort name."
},
"type": {
"title": "Type",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cohorts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const Center: React.FC = () => {
name: {
"ui:widget": "text",
"ui:placeholder": "Enter your full name",
"ui:help": "Full name, only letters and spaces are allowed.",
"ui:help": "Full name, numbers, letters and spaces are allowed.",
},
username: {
"ui:widget": "text",
Expand Down
15 changes: 8 additions & 7 deletions src/pages/tenant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const Tenant: React.FC = () => {
const [selectedRowData, setSelectedRowData] = useState<any>("");
const [roles, setRoles] = useState([]);
const [updateBtnDisabled, setUpdateBtnDisabled] = React.useState(true);
const [addBtnDisabled, setAddBtnDisabled] = React.useState(true);
const [addBtnDisabled, setAddBtnDisabled] = React.useState(false);
const [addFormData, setAddFormData] = useState({});

const uiSchema = {
Expand All @@ -188,7 +188,7 @@ const Tenant: React.FC = () => {
const cohortUiSchema = {
name: {
"ui:widget": "text",
"ui:placeholder": "Enter full name",
"ui:placeholder": "Enter Cohort Name",
"ui:options": {},
},
type: {
Expand All @@ -197,7 +197,7 @@ const Tenant: React.FC = () => {
// "ui:options": {
// defaultValue: "cohort",
// },
"ui:disabled": true, // This will make the field readonly
"ui:disabled": true,
},
district: {
"ui:widget": "text",
Expand Down Expand Up @@ -1216,8 +1216,8 @@ const Tenant: React.FC = () => {
<Box
style={{
display: "flex",
justifyContent: "right", // Centers the button horizontally
marginTop: "20px", // Adjust margin as needed
justifyContent: "right",
marginTop: "20px",
}}
gap={2}
>
Expand All @@ -1236,18 +1236,19 @@ const Tenant: React.FC = () => {
>
{t("COMMON.CANCEL")}
</Button>

<Button
variant="contained"
type="submit"
form="update-center-form" // Add this line
form="update-center-form"
disabled={addBtnDisabled}
sx={{
fontSize: "14px",
fontWeight: "500",
width: "auto",
height: "40px",
marginLeft: "10px",
}}
disabled={addBtnDisabled}
onClick={() => {
setSubmittedButtonStatus(true);
}}
Expand Down
1 change: 0 additions & 1 deletion src/pages/userSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"title": "Full Name",
"fieldId": null,
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z ]*[a-zA-Z]$",
"validation": []
},
"mobileNo": {
Expand Down

0 comments on commit a033680

Please sign in to comment.