Skip to content

Commit

Permalink
Bug fix (regression w/ lov icons) + Cleanups..
Browse files Browse the repository at this point in the history
  • Loading branch information
evoluteur committed Nov 14, 2022
1 parent 0ec53a5 commit 0133ef1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/components/field/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ const Field = ({
const height = `${emHeight(f)}em`;
return (
<div
key={f.id}
className="disabled evo-rdonly scroll-y"
style={{ height }}
dangerouslySetInnerHTML={createMarkup(d)}
Expand Down Expand Up @@ -362,11 +361,7 @@ const Field = ({
} else {
fw = fieldValue(f, d);
}
return (
<div key={f.id} className="disabled evo-rdonly">
{fw}
</div>
);
return <div className="disabled evo-rdonly">{fw}</div>;
};

const f = model || { type: "text" };
Expand Down
1 change: 1 addition & 0 deletions src/components/views/many/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ List.propTypes = {
entity: PropTypes.string.isRequired,
}),
paramsCollec: PropTypes.object,
/** Indicates that the list instance is nested in a form. */
isNested: PropTypes.bool,
data: PropTypes.any,
};
Expand Down
3 changes: 3 additions & 0 deletions src/components/views/one/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export default class Card extends React.PureComponent {
}

Card.propTypes = {
/** Object Unique key. */
entity: PropTypes.string.isRequired,
/** List of fields metadata. */
fields: PropTypes.array,
/** Data (1 single record/Object). */
data: PropTypes.object,
};
4 changes: 2 additions & 2 deletions src/components/views/one/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class Edit extends OneReadWrite {
})
) : (
<Panel title={title} key="pAllFields">
<div className="evol-fset">{m.fields.map(fnField)}</div>
<div className="evol-fset">{m.fields?.map(fnField)}</div>
</Panel>
)}

Expand Down Expand Up @@ -233,7 +233,7 @@ export default class Edit extends OneReadWrite {
let cMsg;

this.clearValidation();
fields.forEach((f) => {
fields?.forEach((f) => {
cMsg = validation.validateField(f, data[f.id]);
if (cMsg) {
messages.push(cMsg);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/dao-graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const mLOVFields = (entity) =>
// get an array of items
export const getMany = (entity, options) => {
const fields = (m) => m.fields.filter(isFieldMany);
const gqlFields = (m) => "id " + fields(m).map(qField).join(" ");
const gqlFields = (m) => "id " + fields(m)?.map(qField).join(" ");
const qMany = (entity) => {
const m = getModel(entity);
if (m) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function fieldValue(f, d, abbr) {
if (f.type === ft.lov) {
return (
<>
{f.lovIcon && <img src={f.lovIcon} alt=""></img>}
{f.lovIcon && <img src={d.icon} alt=""></img>}
{d}
</>
);
Expand Down

0 comments on commit 0133ef1

Please sign in to comment.