Skip to content

Commit

Permalink
Add notes only row type for evaluation grids
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame committed Aug 9, 2024
1 parent 9302c58 commit 02b93d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Models/EvaluationGridRowTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class EvaluationGridRowTemplate extends Model {

const CONTROL_TYPES = ['slider', 'radiobuttons', 'checkbox', 'heading'];
const CONTROL_TYPES = ['slider', 'radiobuttons', 'checkbox', 'heading', 'notes_only'];

/**
* The table associated with the model.
Expand Down
1 change: 1 addition & 0 deletions lang/de/t.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"radiobuttons" => "➖ / ➕ / ✨",
"slider" => "Skala von 1 - 10",
"heading" => "Zwischentitel",
"notes_only" => "Nur Notizfeld",
),
"criterion" => "Kriterium",
"order" => "Sortierreihenfolge"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<div :class="inputColumnClass">
<div class="row">
<div class="col-12 col-lg-6">
<div class="col-12 col-lg-6" v-if="rowTemplate.control_type !== 'notes_only'">
<input-evaluation-grid-row-control
:name="`${name}[value]`"
v-model="currentValue.value"
:row-template="rowTemplate" />
</div>
<div class="col-12 col-lg-6">
<div class="col-12" :class="rowTemplate.control_type === 'notes_only' ? '' : 'col-lg-6'">
<input-evaluation-grid-row-notes
:name="`${name}[notes]`"
v-model="currentValue.notes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ function EvaluationGridRow({rowTemplate, rows, t}) {
return <View style={{ ...styles.evaluationGridRow, fontWeight: '700', padding: '2mm 1.5mm 1mm' }} minPresenceAhead={175}><Text>{ fixNewlines(rowTemplate.criterion) }</Text></View>
}

if (rowTemplate.control_type === 'notes_only') {
return <View style={styles.evaluationGridRow} wrap={false}>
<View style={styles.evaluationGridRowCriterion}><Text>{fixNewlines(rowTemplate.criterion)}</Text></View>
<View style={{ ...styles.evaluationGridRowNotes, minHeight: '12mm' }}><Text>{fixNewlines(row?.notes || '')}</Text></View>
</View>
}

return <View style={styles.evaluationGridRow} wrap={false}>
<View style={styles.evaluationGridRowCriterion}><Text>{fixNewlines(rowTemplate.criterion)}</Text></View>
<View style={styles.evaluationGridRowValue}>
Expand Down

0 comments on commit 02b93d2

Please sign in to comment.