Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dictionary] Fix out of order cols #9669

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions modules/dictionary/jsx/dataDictIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ class DataDictIndex extends Component {
return <td>{cell}
<span style={{color: '#838383'}}>{edited} {editIcon} </span>
</td>;
case 'Data Type':
if (cell == 'enumeration') {
const fieldOptions = rowData['Field Options'];
cell = Array.isArray(fieldOptions) ? fieldOptions.join(';') : '';
}
return <td>{cell}</td>;
default:
return <td>{cell}</td>;
}
Expand Down Expand Up @@ -309,6 +303,15 @@ class DataDictIndex extends Component {
},
},
},
{
label: 'Visits',
show: true,
filter: {
name: 'Visits',
type: 'multiselect',
options: options.visits,
},
},
{
label: 'Cohorts',
show: true,
Expand Down
6 changes: 3 additions & 3 deletions modules/dictionary/php/datadictrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ class DataDictRow implements \LORIS\Data\DataInstance,

$itype = $this->item->getDataType();
if ($itype instanceof \LORIS\Data\Types\Enumeration) {
$val['options'] = $itype->getOptions();
$val['type'] = "enum(".implode(",", $itype->getOptions()).")";
}
if ($scope->__toString() == "session") {
$val['visits'] = $this->visits;
$val['cohorts'] = $this->cohorts;
$val['visits'] = implode(",", $this->visits ?? []);
$val['cohorts'] = implode(",", $this->cohorts ?? []);
}

return $val;
Expand Down
2 changes: 1 addition & 1 deletion modules/dictionary/php/datadictrowprovisioner.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DataDictRowProvisioner extends \LORIS\Data\ProvisionerInstance
}

$cohorts = $DB->pselectCol(
"SELECT GROUP_CONCAT(DISTINCT c.title) FROM test_names tn
"SELECT DISTINCT c.title FROM test_names tn
JOIN test_battery tb ON tn.Test_name=tb.Test_name
JOIN cohort c ON tb.CohortID=c.CohortID
WHERE tn.Test_name=:tn
Expand Down
7 changes: 6 additions & 1 deletion modules/dictionary/php/dictionary.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ class Dictionary extends \DataFrameworkMenu
foreach (array_values($cohorts) as $name) {
$cohort_options[$name] = $name;
}
$visit_options = [];
foreach (\Utility::getVisitList() as $visit) {
$visit_options[$visit] = $visit;
}
return [
'modules' => $amodules,
'categories' => $this->categories,
'cohorts' => $cohort_options
'visits' => $visit_options,
'cohorts' => $cohort_options,
];
}

Expand Down
Loading