-
Notifications
You must be signed in to change notification settings - Fork 172
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
Editable Index #4239
Editable Index #4239
Conversation
…working index edit
…iting a dictionary field or when adding a new dictionary field
… code cleanup, unit test fixes
/** | ||
* Ajax callback to return index fields. | ||
*/ | ||
public static function subIndexFormAjax(array &$form, FormStateInterface $form_state) { | ||
return $form["field_json_metadata"]["widget"][0]["indexes"]["fields"]; | ||
//return $form["field_json_metadata"]["widget"][0]["indexes"]["edit_index"]["index_key_0"]["group"]["fields"]["fields"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove at later date.
$current_index_fields = $index_data_results ?? NULL; | ||
// Creating ajax buttons/fields to be placed in correct location later. | ||
foreach ($index_data_results as $indexKey => $data) { | ||
if (self::checkIndexEditingField('index_field_key_' . $indexKey, $op_index, $index_fields_being_modified)) { | ||
$element['edit_index_fields']['index_field_key_' . $indexKey] = IndexFieldEditCreation::editIndexFields('index_field_key_' . $indexKey, $current_index_fields, $index_fields_being_modified); | ||
} | ||
else { | ||
//$element['edit_index_fields_buttons']['index_field_key_' . $indexKey]['edit_index_fields_button'] = IndexFieldButtons::editIndexButtons('index_field_key_' . $indexKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up later.
// Set access to index fields Add button when index fields being modified. | ||
$element['indexes']['add_row_button']['#access'] = $index_being_modified == NULL ? TRUE : FALSE; | ||
|
||
// if ($index_field_values || $current_index_fields || $index_being_modified || $index_fields_being_modified) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up later.
@@ -20,6 +20,7 @@ | |||
<td>{{ row.length }}</td> | |||
<td> | |||
{{ row.edit_index_button }} | |||
{# {{ row.edit_index_fields_button }} #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Kaise! I just put notes for future reference to mark commented out code for cleaning.
fixes [org/repo/issue#]
QA Steps
Test Data File:
test_data.csv
PART 1
PART 2
{ "identifier": "fc034f0d-c96d-484e-b1e4-79a9aed7c2e6", "data": { "title": "Data Dictionary and Index", "fields": [ { "name": "termination_date", "title": "Termination Date", "type": "date", "format": "%m/%d/%Y", "description": "Termination Date" }, { "name": "fda_approval_date", "title": "FDA Approval Date", "type": "date", "format": "%m/%d/%Y", "description": "FDA Approval Date" } ], "indexes": [ { "description": "Data Index", "type": "index", "fields": [ { "name": "termination_date", "length": 20 }, { "name": "fda_approval_date", "length": 20 } ] } ] } }
PART 3
PART 4
PART 5
ddev drush dkan:dataset-info {{uuid here}}
ddev drush sqlc
'{{table_name goes here}};
PART 6
show index from datastore_0dbbe7015bf8d423d859697cff8fe729;