- implemented displaying table based submitted data related to criterion;
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
flex-direction: column;
|
||||
gap: 7px;
|
||||
padding: 10px;
|
||||
background-color: #efefef;
|
||||
background-color: #f5f5f5;
|
||||
font-size: 14px;
|
||||
|
||||
ul {
|
||||
@@ -28,4 +28,14 @@
|
||||
color: var(--global-textColor);
|
||||
}
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 1px solid var(--table-border-color);
|
||||
border-collapse: collapse;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 3px;
|
||||
}
|
||||
}
|
||||
@@ -196,15 +196,31 @@ const DomandaEditPreInstructor = () => {
|
||||
}
|
||||
|
||||
const criteriaDataItem = (item) => {
|
||||
const content = is(String, item.fieldValue)
|
||||
? item.fieldValue
|
||||
: item.fieldValue && item.fieldValue.length
|
||||
? <ul>
|
||||
let content = '';
|
||||
|
||||
if (is(String, item.fieldValue)) {
|
||||
content = item.fieldValue;
|
||||
} else if (item.fieldValue && item.fieldValue.length && !isNil(item.fieldValue[0].filePath)) {
|
||||
content = <ul>
|
||||
{item.fieldValue.map(o => <li key={o.id}>
|
||||
{o.filePath ? <a href={o.filePath}>{o.name}</a> : null}
|
||||
</li>)}
|
||||
</ul>
|
||||
: null;
|
||||
</ul>;
|
||||
} else if (item.fieldValue && item.fieldValue.length && isNil(item.fieldValue[0].filePath)) {
|
||||
const th = Object.keys(item.fieldValue[0]);
|
||||
content = <table>
|
||||
<thead>
|
||||
<tr>
|
||||
{th.map(v => <th key={v}>{v}</th>)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{item.fieldValue.map((o, i) => <tr key={i}>
|
||||
{Object.values(o).map(v => <td key={v}>{v}</td>)}
|
||||
</tr>)}
|
||||
</tbody>
|
||||
</table>;
|
||||
}
|
||||
|
||||
return <div key={item.id} className="criterionRelatedData__item">
|
||||
<strong>{item.fieldLabel}</strong>
|
||||
|
||||
Reference in New Issue
Block a user