-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui/ux(admin): Improve description for BlueprintEdit view. Add reusabl…
…e info-collapsible component.
- Loading branch information
Showing
6 changed files
with
204 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="ddm-info-accordion"> | ||
|
||
<div class="ddm-info-accordion-header" id="info-collapsible-heading-{{ element_id }}"> | ||
<button class="ddm-info-accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#info-collapsible-{{ element_id }}" aria-expanded="false" aria-controls="info-collapsible-{{ element_id }}"> | ||
<i class="bi bi-info-circle"></i> {{ title }} | ||
</button> | ||
</div> | ||
|
||
<div id="info-collapsible-{{ element_id }}" class="accordion-collapse collapse" aria-labelledby="info-collapsible-heading-{{ element_id }}"> | ||
<div class="ddm-info-accordion-body"> | ||
{% if include_path != "" %} | ||
{% include include_path %} | ||
{% else %} | ||
{{ body|safe }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
</div> |
101 changes: 88 additions & 13 deletions
101
ddm/templates/ddm/admin/data_donation/donation_blueprint/block_data_extraction.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,90 @@ | ||
<h5 class="pt-4"><b>Data Extraction</b></h5> | ||
<ul> | ||
<li>The data extraction follows <i>extraction rules</i> which can be configured below. These rules are applied | ||
consecutively in the defined order. | ||
<p class="mt-0"> | ||
If a file has been successfully validated, the relevant information will be extracted according to <code>extraction rules</code> which can be configured below. | ||
These rules are applied to the uploaded data consecutively in the defined order. If no rules are configured, no data are extracted. | ||
All the data extraction steps are executed on the participant's device in the browser using JavaScript. | ||
</p> | ||
|
||
<p>To configure the data extraction, follow these steps:</p> | ||
|
||
<ol class="mb-2 mt-2"> | ||
<li> | ||
For every field that you want to keep in the uploaded data, create an <code>extraction rule</code> with the "Keep field" operator. | ||
</li> | ||
<li><b>Keep data:</b> For every field/column/variable that you want to | ||
keep in the donated data, you first have to define an extraction rule with the "Keep field" operator. | ||
<li> | ||
Next, you can add rules to filter (i.e., delete) or alter entries in the uploaded data. For this, several comparison and regex operations are available (see below for an overview). | ||
</li> | ||
<li><b>Filter and alter data:</b> Next, you can add rules to filter (i.e., delete) or alter entries in the | ||
uploaded data | ||
(e.g., to delete all entries where the date is < 01.01.2020, or to replace | ||
e-mail-addresses with "ANONYMIZED EMAIL"). For this, there are several comparison and regex operations | ||
available. | ||
</li> | ||
</ul> | ||
</ol> | ||
|
||
<p>When a file is uploaded, the configured rules are applied row-wise/entry-wise. This means, for every data row/entry in the uploaded data, the rules are applied in the configured order.</p> | ||
|
||
<p><b>Available extraction operators</b></p> | ||
|
||
<table id="inlineform-table" class="table table-borderless fs-08"> | ||
<tr class="border-bottom"> | ||
<th>Extraction Operator</th> | ||
<th>Description</th> | ||
<th>Note</th> | ||
</tr> | ||
<tr> | ||
<td>Keep Field</td> | ||
<td>Keep this field in the uploaded data.</td> | ||
<td>–</td> | ||
</tr> | ||
<tr> | ||
<td>Equal (==)</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> equals the <code>comparison value</code>.</td> | ||
<td>Works for strings, integers, and dates<sup>1</sup>.</td> | ||
</tr> | ||
<tr> | ||
<td>Not Equal !=</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> does not equal the <code>comparison value</code>.</td> | ||
<td>Works for strings, integers, and dates<sup>1</sup>.</td> | ||
</tr> | ||
<tr> | ||
<td>Greater than (>)</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> is greater than the <code>comparison value</code>.</td> | ||
<td>Works for integers and dates<sup>1</sup>. String values are skipped and the row will be kept in the data.</td> | ||
</tr> | ||
<tr> | ||
<td>Smaller than (<)</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> is smaller than the <code>comparison value</code>.</td> | ||
<td>Works for integers and dates<sup>1</sup>. String values are skipped and the row will be kept in the data.</td> | ||
</tr> | ||
<tr> | ||
<td>Greater than or equal (>=)</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> is greater than or equal to the <code>comparison value</code>.</td> | ||
<td>Works for integers and dates<sup>1</sup>. String values are skipped and the row will be kept in the data.</td> | ||
</tr> | ||
<tr> | ||
<td>Smaller than or equal (<=)</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> is smaller than or equal to the <code>comparison value</code>.</td> | ||
<td>Works for integers and dates<sup>1</sup>. String values are skipped and the row will be kept in the data.</td> | ||
</tr> | ||
<tr> | ||
<td>Delete match (regex)</td> | ||
<td>Delete parts of the value contained in the given <code>field</code> that match the given <code>regular expression (regex)</code> | ||
(e.g., if the <code>regular expression (regex)</code> = "^Watched " and a field contains the value "Watched video XY" the following | ||
value will be kept in the uploaded data: "video XY").</td> | ||
<td>All field values are converted to strings before this operation is applied.</td> | ||
</tr> | ||
<tr> | ||
<td>Replace match (regex)</td> | ||
<td>Replace parts of the value contained in the given <code>field</code> that match the given <code>regular expression (regex)</code> | ||
(e.g., if the <code>regular expression (regex)</code> = "[\w-\.]+@([\w-]+\.)+[\w-]{2,4}" and | ||
the <code>replacement value</code> = "_anonymized_" and a field contains the value "some text email@address.com" the following | ||
value will be kept in the uploaded data: "some text _anonymized_").</td> | ||
<td>All field values are converted to strings before this operation is applied.</td> | ||
</tr> | ||
<tr> | ||
<td>Delete row when match (regex)</td> | ||
<td>Delete row/entry if the value contained in the given <code>field</code> matches the given <code>regular expression (regex)</code> (e.g., if | ||
<code>regular expression (regex)</code> = "^Watched " and a field contains the value "Watched video XY" | ||
the row/entry will be deleted from the uploaded data).</td> | ||
<td>All field values are converted to strings before this operation is applied.</td> | ||
</tr> | ||
</table> | ||
|
||
<p style="font-size: 0.75rem; color: grey;"> | ||
<sup>1</sup>Dates are inferred from string values if they are formatted according to ISO, RFC2822, or HTTP standards, | ||
and only if both the field value and the comparison value follow the same format. Otherwise, the entry will be treated as a regular string. | ||
</p> |
28 changes: 11 additions & 17 deletions
28
ddm/templates/ddm/admin/data_donation/donation_blueprint/block_file_validation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
<div class="ddm-admin-form pt-5"> | ||
<h4>Data Extraction Settings</h4> | ||
|
||
<p>Data Extraction is a two-step process consisting of first the <b>file validation</b> and second the <b>data extraction</b>.</p> | ||
|
||
<h5><b>File Validation</b></h5> | ||
<ul> | ||
<li>First, it is checked whether the expected file is included in the uploaded data (only applies to ZIP uploads). | ||
If the associated File Uploader expects a ZIP Upload, the correct file is identified | ||
using the provided <code>file path</code> (this is skipped for single file uploads).</li> | ||
<li>Second, it is checked whether the uploaded file is in the <code>expected file format</code>.</li> | ||
<li>Third, it is checked whether the identified file contains <b>all</b> <code>expected fields</code>.</li> | ||
<li> | ||
If any of these validation steps fail, the participant will be shown an | ||
exception message explaining what went wrong and no data is extracted.</li> | ||
</ul> | ||
</div> | ||
<p class="mt-0"> | ||
When a file is uploaded, it is first validated following these steps: | ||
</p> | ||
<ol class="mb-2 mt-2"> | ||
<li><span class="fs-08">[Only applies to ZIP uploads]</span> It is checked whether the uploaded ZIP container contains the expected file as specified in the <code>file path</code> setting.</li> | ||
<li>It is checked whether the uploaded file is in the <code>expected file format</code>.</li> | ||
<li>It is checked whether the identified file contains <i>all</i> <code>expected fields</code>.</li> | ||
</ol> | ||
<p class="mt-0"> | ||
If any of these validation steps fail, no data is extracted and an exception message explaining what went wrong will be shown to the participant. | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters