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

Issue/2772 add form version column (Connect #2772) #2966

Merged
merged 8 commits into from
Apr 8, 2019

Conversation

stellanl
Copy link
Contributor

@stellanl stellanl commented Feb 11, 2019

Before the PR (what is the issue or what needed to be done)

Form version of a form instance was hidden

The solution

Show it in exports and allow instances created by data cleaning import to set it.

Screenshots (if appropriate)

Checklist

  • Connect the issue
  • Test plan
  • Copyright header
  • Code formatting
  • Documentation

@ghost ghost assigned stellanl Feb 11, 2019
@ghost ghost added the In progress label Feb 11, 2019
@stellanl stellanl requested a review from muloem February 11, 2019 23:10
inst.setDeviceIdentifier("IMPORTER");
inst.setUuid(UUID.randomUUID().toString());
inst.setSurveyedLocaleId(importReq.getSurveyedLocaleId());
inst.setUuid(UUID.randomUUID().toString());
inst.setSubmitterName(importReq.getSubmitter());
inst.setSurveyalTime(importReq.getSurveyDuration());
inst.setFormVersion(importReq.getFormVersion());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean its possible to (re)set the form version when (re)importing data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only when importing new data. It will be ignored when reimporting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jana said to handle it just like SurveyalTime, so I did.

Row row = sheet.getRow(headerRow);
for (int i = 0; i < firstQuestionColumnIndex; i++) {
String header = row.getCell(i).getStringCellValue();
if (header.equalsIgnoreCase(IDENTIFIER_LABEL)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tricky part of using the label to determine which column we are dealing with is the possibility that the user inadvertently changes the text or its in another language. This change would have to go hand in hand with making our documentation clearly state what the column headers should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. There is also the possibility of locking or colouring the headers in the data_cleaning output to indicate they are important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue now lists what needs to change in the documentation. Jana said she would handle that.

// options.put(TYPE_OPT, DATA_CLEANING_TYPE);
options.put(TYPE_OPT, DATA_ANALYSIS_TYPE);
options.put(TYPE_OPT, DATA_CLEANING_TYPE);
// options.put(TYPE_OPT, DATA_ANALYSIS_TYPE);
Copy link
Contributor

@valllllll2000 valllllll2000 Apr 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the commented out code necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That code is only used when debugging locally, and then you uncomment one of the three report types.

@valllllll2000 valllllll2000 merged commit e772ec0 into develop Apr 8, 2019
@valllllll2000 valllllll2000 deleted the issue/2772-add-form-version-column branch April 8, 2019 14:11
@valllllll2000 valllllll2000 restored the issue/2772-add-form-version-column branch April 10, 2019 14:15
@stellanl stellanl deleted the issue/2772-add-form-version-column branch April 10, 2019 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants