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

XLSX converter doesn't trim whitespace from column names #157

Closed
albertchae opened this issue Apr 26, 2020 · 3 comments · Fixed by odk-x/app-designer#157
Closed

XLSX converter doesn't trim whitespace from column names #157

albertchae opened this issue Apr 26, 2020 · 3 comments · Fixed by odk-x/app-designer#157
Assignees
Labels
Application Designer ODK-X Application Designer bug Something isn't working easy win

Comments

@albertchae
Copy link

example calculation_name on the calculates tab will result in an error

@elmps2018 elmps2018 added Application Designer ODK-X Application Designer bug Something isn't working labels Jun 24, 2020
@linl33
Copy link
Member

linl33 commented Apr 4, 2021

https://github.com/odk-x/app-designer/blob/9e06f420276a2c08f7e8ca5091b65aa3bc38ee0c/xlsxconverter/XLSXConverter2.js#L581-L587

        _.each(row, function(value, key){
            if(_.isString(value)){
                value = value.replace(/\r/g, "");
                value = value.trim();
            }
            outRow[key] = value;
        });

Calling trim on key should fix this issue.

@linl33 linl33 added the easy win label Apr 4, 2021
@EstherPhebe
Copy link
Collaborator

@linl33 I'd like to work on this. From what I see the trim method should be called on the key parameter to remove the trailing whitespace. Will the key argument always be a string?

@linl33
Copy link
Member

linl33 commented Apr 5, 2021

@EstherPhebe I've assigned this issue to you. Be sure to test thoroughly that fixing this issue doesn't break existing forms. Thanks!

key should always be a string given that it was used to index outRow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Application Designer ODK-X Application Designer bug Something isn't working easy win
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants