Skip to content

Commit

Permalink
Update amiSetEntityProcessForm for AMI Update Operations changes (#204)
Browse files Browse the repository at this point in the history
AMI Update Operations changes:
- Change 'replace' Operation to be default
- Change 'update' Operation title to "Complete (All JSON keys) Update" instead of "Normal"
- Clarify language for each Operation type
- Add note linking to documentation and recommendation to test against a single row/object csv.

* Update amiSetEntityProcessForm.php
  • Loading branch information
alliomeria authored Jun 26, 2024
1 parent 0dda14a commit 427f09b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Form/amiSetEntityProcessForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,9 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'patch',
];
$ops_update = [
'update' => $this->t("Normal Update. Will update a complete existing ADO's configured target field with new JSON Content."),
'replace' => $this->t("Replace Update. Will replace JSON keys found in an ADO's configured target field with new JSON content. Not provided ones will be kept"),
'append' => $this->t("Append Update. Will append values to existing JSON keys in an ADO's configured target field. New ones will be added too."),
];
'replace' => $this->t("Replace Update. Will replace JSON keys found in an ADO's configured target field(s) with new JSON values. Not provided JSON keys will be kept."),
'update' => $this->t("Complete (All JSON keys) Update. Will update a complete existing ADO's JSON data with all new JSON data."),
'append' => $this->t("Append Update. Will append values to existing JSON key(s) in an ADO's configured target field(s). New JSON keys will be added too."),

if (!in_array($op, $ops)) {
$form['status'] = [
Expand Down Expand Up @@ -341,8 +340,10 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'ops_secondary_update' => [
'#type' => 'select',
'#title' => $this->t('Update Operation'),
'#description' => $this->t(
'Please review the <a href="https://docs.archipelago.nyc/1.4.0/ami_update/">AMI Update Sets Documentation</a> before proceeding, and consider first testing your planned updates against a single row/object CSV before executing updates across a larger batch of objects. There is no "undo" operation for AMI Update Sets.'),
'#options' => $ops_update,
'#default_value' => 'update',
'#default_value' => 'replace',
'#wrapper_attributes' => [
'class' => ['container-inline'],
],
Expand Down

0 comments on commit 427f09b

Please sign in to comment.