Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

new: support numeric appearance bearing #278

Merged
merged 1 commit into from
Jan 27, 2022
Merged

Conversation

florianm
Copy link
Contributor

@florianm florianm added this to the 0.4.1 hotfixes milestone Jan 27, 2022
@florianm florianm self-assigned this Jan 27, 2022
@florianm florianm added this to In progress in Roadmap via automation Jan 27, 2022
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Appearances are passed through to the XLSForm export without any extra effort needed, right?

Roadmap automation moved this from In progress to Reviewer approved Jan 27, 2022
@florianm
Copy link
Contributor Author

I will verify that in a tic. I suspect some unit tests might need to be adjusted.

@florianm florianm merged commit 3a6a4f9 into getodk:master Jan 27, 2022
Roadmap automation moved this from Reviewer approved to Done Jan 27, 2022
@florianm florianm deleted the 193-bearing branch January 27, 2022 21:45
@florianm
Copy link
Contributor Author

florianm commented Jan 28, 2022

This indeed requires an addition to build2xlsform. Coming soon. Currently we get the last option in the list of numeric appearances (range) with its defaults (1 to 10 in steps of 1) which is wrong.

Build now produces a valid bearing appearance:

<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:odk="http://www.opendatakit.org/xforms">
  <h:head>
    <h:title>bearing test</h:title>
    <model>
      <instance>
        <data id="bearing-test" version="1643329891">
          <meta>
            <instanceID/>
          </meta>
          <q_bearing/>
        </data>
      </instance>
      <itext>
        <translation lang="English">
          <text id="/data/q_bearing:label">
            <value>Direction to something</value>
          </text>
          <text id="/data/q_bearing:hint">
            <value>Point the device towards the thing</value>
          </text>
        </translation>
      </itext>
      <bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid"/>
      <bind nodeset="/data/q_bearing" type="decimal"/>
    </model>
  </h:head>
  <h:body>
    <input ref="/data/q_bearing" appearance="bearing">
      <label ref="jr:itext('/data/q_bearing:label')"/>
      <hint ref="jr:itext('/data/q_bearing:hint')"/>
    </input>
  </h:body>
</h:html>

I've included a bearing question in a test form, which uploads without errors and submits fine. Screenshot of bearing question in submission tab in Central:
image

New appearance context help:
image

@lognaturel
Copy link
Member

Aha, thanks for the thorough check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Support appearance "bearing" for numeric fields
2 participants