- updated styles for criterion data and fixed error related to their displaying;
This commit is contained in:
@@ -15,4 +15,17 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 7px;
|
||||
padding: 10px;
|
||||
background-color: #efefef;
|
||||
font-size: 14px;
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding-left: 15px;
|
||||
|
||||
li a {
|
||||
text-decoration: underline;
|
||||
color: var(--global-textColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,19 +186,32 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const displayCriterionData = (id) => {
|
||||
const criterion = head(data.criteria.filter(o => o.id === id));
|
||||
console.log(id, criterion);
|
||||
setCriterionDataTitle(criterion.label);
|
||||
const content = <div className="criterionRelatedData">
|
||||
<h3>{__('I campi correlati')}</h3>
|
||||
{criterion.criteriaMappedFields.map(o => <div key={o.id} className="criterionRelatedData__item">
|
||||
<strong>{o.fieldLabel}</strong>
|
||||
{o.fieldValue}
|
||||
</div>)}
|
||||
{criterion.criteriaMappedFields.map(o => criteriaDataItem(o))}
|
||||
</div>;
|
||||
setCriterionDataContent(content);
|
||||
setIsVisibleCriterionData(id);
|
||||
}
|
||||
|
||||
const criteriaDataItem = (item) => {
|
||||
const content = is(String, item.fieldValue)
|
||||
? item.fieldValue
|
||||
: item.fieldValue && item.fieldValue.length
|
||||
? <ul>
|
||||
{item.fieldValue.map(o => <li key={o.id}>
|
||||
{o.filePath ? <a href={o.filePath}>{o.name}</a> : null}
|
||||
</li>)}
|
||||
</ul>
|
||||
: null;
|
||||
|
||||
return <div key={item.id} className="criterionRelatedData__item">
|
||||
<strong>{item.fieldLabel}</strong>
|
||||
{content}
|
||||
</div>
|
||||
}
|
||||
|
||||
const hideCriterionData = () => {
|
||||
setIsVisibleCriterionData(0);
|
||||
setCriterionDataTitle('');
|
||||
|
||||
Reference in New Issue
Block a user