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

Fixes map type field non readable issues #188

Open
wants to merge 3 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 7 additions & 2 deletions radlab-ui/webapp/src/components/forms/fields/ListField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ const ListField: React.FC<ListField> = ({ variable }) => {
return (
<div>
{values[variable.name].map((setvalue: string, index: number) => (
<div key={index} className="badge badge-info gap-2 m-1">
<span>{setvalue}</span>
<div
key={setvalue}
className="badge badge-info gap-2 my-1 mr-1 w-auto h-auto py-1 px-2 md:px-4"
>
<span className="w-auto" style={{ overflowWrap: "anywhere" }}>
{setvalue}
</span>
<XIcon
onClick={() => remove(index)}
className="h-4 w-4 cursor-pointer"
Expand Down
31 changes: 16 additions & 15 deletions radlab-ui/webapp/src/components/forms/fields/MapField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,22 @@ const MapField: React.FC<MapField> = ({ variable, validate }) => {
}
return (
<div>
{Object.keys(values[variable.name]).map(
(map_data: string, index: number) => (
<div key={index} className="badge badge-info gap-2 m-1">
<span>
{map_data} = {values[variable.name][map_data]}
</span>
<button
type="button"
onClick={handleRemove(values[variable.name], map_data)}
>
<XIcon className="h-4 w-4 cursor-pointer" />
</button>
</div>
),
)}
{Object.keys(values[variable.name]).map((map_data: string) => (
<div
key={map_data}
className="badge badge-info gap-2 my-1 mr-1 w-auto h-auto py-1 px-2 md:px-4"
>
<span className="w-auto" style={{ overflowWrap: "anywhere" }}>
{map_data} = {values[variable.name][map_data]}
</span>
<button
type="button"
onClick={handleRemove(values[variable.name], map_data)}
>
<XIcon className="h-4 w-4 cursor-pointer" />
</button>
</div>
))}
<div className="flex mt-1">
<input type="hidden" value={deleteItem} />
<Field
Expand Down
9 changes: 7 additions & 2 deletions radlab-ui/webapp/src/components/forms/fields/SetField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ const SetField: React.FC<SetField> = ({ variable }) => {
return (
<div>
{values[variable.name].map((setvalue: string, index: number) => (
<div key={index} className="badge badge-info gap-2 m-1">
<span>{setvalue}</span>
<div
key={setvalue}
className="badge badge-info gap-2 my-1 mr-1 w-auto h-auto py-1 px-2 md:px-4"
>
<span className="w-auto" style={{ overflowWrap: "anywhere" }}>
{setvalue}
</span>
<XIcon
onClick={() => remove(index)}
className="h-4 w-4 cursor-pointer"
Expand Down
Loading