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 #1391

Merged
merged 6 commits into from
Sep 17, 2024
Merged

fix #1391

Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { LocalizationService } from "./Localization/service";

const ADMIN_CODE = ({ tenantId, hierarchyType }) => {
if(Digit.Utils.getMultiRootTenant()){
return hierarchyType.code;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why overriding this way ? then how the boundary codes gets localised
? @aaradhya-egov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In localisation code, previously it is creating code with tenant but in our case tenant will be dynamic thats why i have removed tenant from localisaed code. from here i am just taking code. and below we have getlocalities function where I am using that localisation code @jagankumar-egov

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

}else{
return tenantId.replace(".", "_").toUpperCase() + "_" + hierarchyType.code;
}
};

const getI18nKeys = (localitiesWithLocalizationKeys) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {
name="mobileNumber"
placeholder="Enter a valid Mobile No."
onChange={(value) => setUserMobileNumber(value)}
disable={true}
disable={Digit.Utils.getMultiRootTenant()?false : true}
nabeelmd-eGov marked this conversation as resolved.
Show resolved Hide resolved
nabeelmd-eGov marked this conversation as resolved.
Show resolved Hide resolved
{...{
required: true,
pattern: "[6-9]{1}[0-9]{9}",
Expand Down Expand Up @@ -759,7 +759,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {
name="email"
value={email}
onChange={(e) => setUserEmailAddress(e.target.value)}
disabled={editScreen}
disabled={Digit.Utils.getMultiRootTenant()?true : editScreen}
/>
{errors?.emailAddress && (
<ErrorMessage
Expand All @@ -776,7 +776,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => {

<LabelFieldPair>
<div style={{ width: "100%" }}>
{changepassword == false ? (
{changepassword == false && !Digit.Utils.getMultiRootTenant()? (
nabeelmd-eGov marked this conversation as resolved.
Show resolved Hide resolved
<Button
label={t("CORE_COMMON_CHANGE_PASSWORD")}
variation={"teritiary"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const SingleInput = ({ isFocus, onChange, onFocus, value, ...rest }) => {
onChange={onChange}
onFocus={onFocus}
ref={inputRef}
type="number"
type="text"
value={value ? value : ""}
{...rest}
/>
Expand All @@ -29,7 +29,7 @@ const OTPInput = (props) => {
const [activeInput, setActiveInput] = useState(0);

const isInputValueValid = (value) => {
return typeof value === "string" && value.trim().length === 1;
return /^[0-9]$/.test(value);
};

const changeCodeAtFocus = (value) => {
Expand Down Expand Up @@ -60,9 +60,12 @@ const OTPInput = (props) => {

function inputChange(event) {
const { value } = event.target;
changeCodeAtFocus(value);

if (isInputValueValid(value)) {
changeCodeAtFocus(value);
focusNextInput();
} else if (value === "") {
changeCodeAtFocus(""); // Handle clearing the input
}
}

Expand Down