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

toast and minor ui #1809

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -64,7 +64,8 @@ const Checkboxes = ({
/>
{item.optionComment && <FieldV1
// className="example"
disabled={dis}
// disabled={dis}
nonEditable={dis}
type={"textarea"}
populators={{
resizeSmart: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,15 @@ const CreateQuestion = ({ onSelect, className, level = 1, initialQuestionData, p
<div className="question-field-container">
<div className="question-field" style={{ display: "flex", height: "3.5rem", gap: "1.5rem" }}>
<TextInput
disabled={dis}
// disabled={dis}
nonEditable={dis}
isRequired={true}
className="tetxinput-example"
type={"text"}
name="title"
value={field?.title || ""}
onChange={(event) => handleUpdateField(event.target.value, "title", field.key, field.id)}
placeholder={"Type your question here"}
placeholder={t("TYPE_YOUR_QUESTION_HERE")}
/>
{!dis && <Dropdown
style={{ width: "20%" }}
Expand Down Expand Up @@ -497,7 +498,8 @@ const CreateQuestion = ({ onSelect, className, level = 1, initialQuestionData, p
{
(field?.type?.code === "Short Answer") && (
<FieldV1
disabled={dis}
nonEditable={dis}
// disabled={dis}
suryansh-egov marked this conversation as resolved.
Show resolved Hide resolved
className="example"
type={"textarea"}
populators={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const Dropdowns = ({
/>
{item.optionComment && <FieldV1
// className="example"
disabled={dis}
// disabled={dis}
nonEditable={dis}
type={"textarea"}
populators={{
resizeSmart: true
Expand Down Expand Up @@ -178,7 +179,8 @@ const DropdownOption = ({
>
<TextInput
// style={{ maxWidth: "40rem" }}
disabled={dis}
// disabled={dis}
nonEditable={dis}
suryansh-egov marked this conversation as resolved.
Show resolved Hide resolved
name="title"
ref={optionInputRef}
// value={field?.title || ""}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const MultipleChoice = ({
></RadioButtonOption>
{item.optionComment && <FieldV1
// className="example"
disabled={dis}
// disabled={dis}
nonEditable={dis}
type={"textarea"}
populators={{
resizeSmart: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,24 +205,8 @@ const ViewHierarchy = () => {

// Initialize the label with a failure message
label = `${t("WBH_BOUNDARY_CREATION_FAIL")}: `;
if(error?.message) label += `${t(error?.message)}`;
suryansh-egov marked this conversation as resolved.
Show resolved Hide resolved

// Check if the error has a response with detailed error information
if (error.response?.data?.Errors?.length > 0) {
// Append each error code to the label
error.response.data.Errors.forEach((err, idx) => {
const transformedError = t(Digit.Utils.locale.getTransformedLocale(err.code));

// Add comma separation except for the last item
if (idx === error.response.data.Errors.length - 1) {
label += `${transformedError}.`;
} else {
label += `${transformedError}, `;
}
});
} else {
// Fallback if no error details are provided in the response
label += error.message || t("WBH_UNKNOWN_ERROR");
}
}

setShowToast({ label, isError: "error" });
Expand Down