Skip to content

Instantly share code, notes, and snippets.

@zindel
Created April 13, 2016 13:18
Show Gist options
  • Save zindel/e67d95bc63866d133f573273a50d554c to your computer and use it in GitHub Desktop.
Save zindel/e67d95bc63866d133f573273a50d554c to your computer and use it in GitHub Desktop.
upgrade-enrollment:
type: form
entity: study_enrollment
title: Upgrade Enrollment
submit_button: Upgrade
input:
- study_enrollment[has-new-version]
value: |
{
current := top(study_enrollment.filter(id()=$study_enrollment))
.study_version.__title__,
new := top(study_enrollment.filter(id()=$study_enrollment))
.study_version.study
.active_version.__title__
}
fields:
- value_key: current
label: Current Version
read_only: true
- value_key: new
label: New Version
read_only: true
query: |
/do(
$new := top(study_enrollment.filter(id()=$study_enrollment))
.study_version.study
.active_version.id(),
$id := migrate_study_enrollment($study_enrollment, $new),
{id := $id}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment