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

Vue client #69

Merged
merged 45 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
54a0a4c
Add PrimeVue, PrimeFlex, PrimeVue-Sass-Theme
sadiqkhoja Mar 11, 2024
4879c1e
Add icomoon files with required Material icons
sadiqkhoja Mar 11, 2024
3a6dfd2
replace favicon
sadiqkhoja Mar 11, 2024
2addbcf
Turn off max-attributes-per-line rule
sadiqkhoja Mar 11, 2024
738fc76
Added hardcoded FormMenuBar(lang and print) and Form title card
sadiqkhoja Mar 13, 2024
c0a4d91
commit yarn lock file
sadiqkhoja Mar 13, 2024
1834b74
Added panels for group and repeats
sadiqkhoja Mar 13, 2024
22cb192
Move all styling to theme.scss
sadiqkhoja Mar 14, 2024
845856f
remove roboto font file and reference them from node_modules
sadiqkhoja Mar 15, 2024
0281f00
move icomoon fonts to assets folder
sadiqkhoja Mar 29, 2024
17a80e9
Added more repeat forms
sadiqkhoja Mar 29, 2024
ec75510
export AnyLeafNode
sadiqkhoja Mar 29, 2024
5ef888d
Render forms with group, repeats and text type questions
sadiqkhoja Mar 29, 2024
30d0a5f
emit submit event
sadiqkhoja Mar 29, 2024
a934221
added tests for OdkQuestion.vue
sadiqkhoja Mar 29, 2024
7404a26
Handle repeat removal
sadiqkhoja Apr 3, 2024
a4990fc
make menuItems a prop in OdkPanel
sadiqkhoja Apr 3, 2024
274ef7e
lint it
sadiqkhoja Apr 3, 2024
c435ab5
include components files in test project - tsc is complaining
sadiqkhoja Apr 3, 2024
61d3945
make typing of stateFactory bit readable
sadiqkhoja Apr 3, 2024
b341781
Added component tests
sadiqkhoja Apr 4, 2024
bd52014
Added an e2e test to render all test forms
sadiqkhoja Apr 4, 2024
6fdbb94
remove explicit casting for reactive state factory
sadiqkhoja Apr 12, 2024
81c1148
read label of repeat from its current state
sadiqkhoja Apr 12, 2024
6a97bec
capture Vue errors in e2e test
sadiqkhoja Apr 12, 2024
d713f43
Add separate components for leaf nodes/controls
sadiqkhoja Apr 12, 2024
ca7f758
lint and format
sadiqkhoja Apr 12, 2024
8efbb2b
type parameters instead of casting
sadiqkhoja Apr 15, 2024
3bfae05
Component test for label
sadiqkhoja Apr 15, 2024
9ac58ca
Styling changes:
sadiqkhoja Apr 16, 2024
f0b4d5d
lint and format them
sadiqkhoja Apr 16, 2024
f64c161
added lint rule no-undef-components
sadiqkhoja Apr 16, 2024
fd3c755
more eslint rules
sadiqkhoja Apr 16, 2024
086e7ca
Change the order of <template> and <script>
sadiqkhoja Apr 16, 2024
bd5ef17
remove ODK prefix from component name
sadiqkhoja Apr 16, 2024
4ec1ff0
renamed question -> node for group and repeat
sadiqkhoja Apr 16, 2024
70216b8
set the font weight for labels
sadiqkhoja Apr 17, 2024
8ab7301
use v-else for unsupported control
sadiqkhoja Apr 17, 2024
bfd5fa0
use update:model-value event instead of input in InputText
sadiqkhoja Apr 22, 2024
4038a90
use jest style assertion in ui-vue tests
sadiqkhoja Apr 22, 2024
60b5805
rename plugin and use it in the demo
sadiqkhoja Apr 23, 2024
7fe9cb2
added README file for ui-vue package and added license file for Mater…
sadiqkhoja Apr 23, 2024
205858b
Revert "capture Vue errors in e2e test"
sadiqkhoja Apr 23, 2024
bddcce7
Fail e2e test when console has warnings because
sadiqkhoja Apr 23, 2024
959419b
lint and format
sadiqkhoja Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"editor.formatOnSave": true
},
"[vue]": {
// Vue files are ignored in Prettier. Some formatting **will** be applied
// on save by ESLint (via `editor.codeActionsOnSave` settings above)
"editor.formatOnSave": false
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
// This corresponds to the `lib` we're using everywhere. Setting it here
// helps to address editor-only type errors in tooling files, where VSCode
// doesn't pick up the top-level `tsconfig.tools.json`.
"js/ts.implicitProjectConfig.target": "ES2022"
"js/ts.implicitProjectConfig.target": "ES2022",
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
}
}
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ export default tseslint.config(

// Consistent with all other source code
'vue/html-indent': ['error', 'tab'],
// should be based on the printWidth
'vue/max-attributes-per-line': 'off',
'vue/no-undef-components': 'error',
'vue/html-comment-indent': ['error', 'tab'],
'vue/script-indent': ['error', 'tab'],
'vue/no-empty-component-block': 'error',
},
},

Expand Down
138 changes: 138 additions & 0 deletions packages/ui-solid/fixtures/xforms/repeats/08-complex-repeats.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms"
xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>Groups and Repeats</h:title>
<model odk:xforms-version="1.0.0">
<instance>
<data id="groups_and_repeats" version="20240326122412">
<simple_text />
<group_without_label>
<first_name />
</group_without_label>
<repeat_without_anything_count />
<repeat_without_anything jr:template="">
<last_name />
</repeat_without_anything>
<repeat_without_anything>
<last_name />
</repeat_without_anything>
<repeat_with_label jr:template="">
<middle_name />
</repeat_with_label>
<repeat_with_label>
<middle_name />
</repeat_with_label>
<repeat_with_label>
<middle_name />
</repeat_with_label>
<nested_group_without_label_1>
<nested_group_without_label_1_1>
<a_name />
</nested_group_without_label_1_1>
</nested_group_without_label_1>
<repeat_with_child_group_1 jr:template="">
<repeat_with_child_group_1_1>
<b_name />
</repeat_with_child_group_1_1>
</repeat_with_child_group_1>
<repeat_with_child_group_1>
<repeat_with_child_group_1_1>
<b_name />
</repeat_with_child_group_1_1>
</repeat_with_child_group_1>
<repeat_without_parent_group>
<c_name />
</repeat_without_parent_group>
<nested_group_1>
<child_group_1_1>
<d_name />
</child_group_1_1>
</nested_group_1>
<meta>
<instanceID />
</meta>
</data>
</instance>
<bind nodeset="/data/simple_text" type="string" />
<bind nodeset="/data/group_without_label/first_name" type="string" />
<bind nodeset="/data/repeat_without_anything_count" type="string" readonly="true()"
calculate="3" />
<bind nodeset="/data/repeat_without_anything/last_name" type="string" />
<bind nodeset="/data/repeat_with_label/middle_name" type="string" />
<bind nodeset="/data/nested_group_without_label_1/nested_group_without_label_1_1/a_name"
type="string" />
<bind nodeset="/data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name"
type="string" />
<bind nodeset="/data/repeat_without_parent_group/c_name" type="string" />
<bind nodeset="/data/nested_group_1/child_group_1_1/d_name" type="string" />
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid" />
</model>
</h:head>
<h:body>
<input ref="/data/simple_text">
<label>Simple textbox</label>
</input>
<group ref="/data/group_without_label">
<input ref="/data/group_without_label/first_name">
<label>First Name</label>
</input>
</group>
<group ref="/data/repeat_without_anything">
<label></label>
<repeat nodeset="/data/repeat_without_anything"
jr:count=" /data/repeat_without_anything_count ">
<input ref="/data/repeat_without_anything/last_name">
<label>Last Name</label>
</input>
</repeat>
</group>
<group ref="/data/repeat_with_label">
<label>Repeat with label</label>
<repeat nodeset="/data/repeat_with_label">
<input ref="/data/repeat_with_label/middle_name">
<label>Middle Name</label>
</input>
</repeat>
</group>
<group ref="/data/nested_group_without_label_1">
<group ref="/data/nested_group_without_label_1/nested_group_without_label_1_1">
<input
ref="/data/nested_group_without_label_1/nested_group_without_label_1_1/a_name">
<label>A name (I have two group ancestors without labels)</label>
</input>
</group>
</group>
<group ref="/data/repeat_with_child_group_1">
<label>Repeat label</label>
<repeat nodeset="/data/repeat_with_child_group_1">
<group ref="/data/repeat_with_child_group_1/repeat_with_child_group_1_1">
<label>
<output
value=" /data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name " />
</label>
<input ref="/data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name">
<label>B Name</label>
</input>
</group>
</repeat>
</group>
<repeat nodeset="/data/repeat_without_parent_group">
<input ref="/data/repeat_without_parent_group/c_name">
<label>C Name</label>
</input>
</repeat>

<group ref="/data/nested_group_1">
<label>Top group label</label>
<group ref="/data/nested_group_1/child_group_1_1">
<label>child group label</label>
<input ref="/data/nested_group_1/child_group_1_1/d_name">
<label>D Name</label>
</input>
</group>
</group>
</h:body>
</h:html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms"
xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>Groups and Repeats</h:title>
<model odk:xforms-version="1.0.0">
<instance>
<data id="groups_and_repeats" version="20240328181053">
<repeat_with_child_group_1 jr:template="">
<repeat_with_child_group_1_1>
<b_name />
</repeat_with_child_group_1_1>
</repeat_with_child_group_1>
<repeat_with_child_group_1>
<repeat_with_child_group_1_1>
<b_name />
</repeat_with_child_group_1_1>
</repeat_with_child_group_1>
<meta>
<instanceID />
</meta>
</data>
</instance>
<bind nodeset="/data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name"
type="string" />
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid" />
</model>
</h:head>
<h:body>
<group ref="/data/repeat_with_child_group_1">
<label>Repeat label</label>
<repeat nodeset="/data/repeat_with_child_group_1">
<group ref="/data/repeat_with_child_group_1/repeat_with_child_group_1_1">
<label>
<output value=" ../repeat_with_child_group_1_1/b_name " />
</label>
<input ref="/data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name">
<label>B Name</label>
</input>
</group>
</repeat>
</group>
</h:body>
</h:html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms"
xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>Groups and Repeats</h:title>
<model odk:xforms-version="1.0.0">
<instance>
<data id="groups_and_repeats" version="20240328181053">
<repeat_with_child_group_1 jr:template="">
<repeat_with_child_group_1_1>
<b_name />
</repeat_with_child_group_1_1>
<c_name />
</repeat_with_child_group_1>
<repeat_with_child_group_1>
<repeat_with_child_group_1_1>
<b_name />
</repeat_with_child_group_1_1>
<c_name />
</repeat_with_child_group_1>
<meta>
<instanceID />
</meta>
</data>
</instance>
<bind nodeset="/data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name"
type="string" />
<bind nodeset="/data/repeat_with_child_group_1/c_name"
type="string" />
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid" />
</model>
</h:head>
<h:body>
<group ref="/data/repeat_with_child_group_1">
<label>Repeat label</label>
<repeat nodeset="/data/repeat_with_child_group_1">
<group ref="/data/repeat_with_child_group_1/repeat_with_child_group_1_1">
<label>
<output value=" ../repeat_with_child_group_1_1/b_name " />
</label>
<input ref="/data/repeat_with_child_group_1/repeat_with_child_group_1_1/b_name">
<label>B Name</label>
</input>
</group>
<input ref="/data/repeat_with_child_group_1/c_name">
<label>C Name</label>
</input>
</repeat>
</group>
</h:body>
</h:html>
33 changes: 33 additions & 0 deletions packages/ui-solid/fixtures/xforms/repeats/11-dynamic_label.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms"
xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>dynamic_label</h:title>
<model odk:xforms-version="1.0.0">
<instance>
<data id="dynamic_label" version="20240404140744">
<the_group>
<first_name />
</the_group>
<meta>
<instanceID />
</meta>
</data>
</instance>
<bind nodeset="/data/the_group/first_name" type="string" />
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid" />
</model>
</h:head>
<h:body>
<group ref="/data/the_group">
<label>
<output value=" /data/the_group/first_name " />
</label>
<input ref="/data/the_group/first_name">
<label>First Name</label>
</input>
</group>
</h:body>
</h:html>
57 changes: 57 additions & 0 deletions packages/ui-solid/fixtures/xforms/repeats/12-NestedRepeat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms"
xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>NestedRepeat</h:title>
<model odk:xforms-version="1.0.0">
<instance>
<data id="NestedRepeat" version="20240415142016">
<person_repeat jr:template="">
<person_name />
<language_repeat jr:template="">
<language />
</language_repeat>
<country />
</person_repeat>
<person_repeat>
<person_name />
<language_repeat>
<language />
</language_repeat>
<country />
</person_repeat>
<meta>
<instanceID />
</meta>
</data>
</instance>
<bind nodeset="/data/person_repeat/person_name" type="string" />
<bind nodeset="/data/person_repeat/language_repeat/language" type="string" />
<bind nodeset="/data/person_repeat/country" type="string" />
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid" />
</model>
</h:head>
<h:body>
<group ref="/data/person_repeat">
<label>Persons</label>
<repeat nodeset="/data/person_repeat">
<input ref="/data/person_repeat/person_name">
<label>Person Name</label>
</input>
<group ref="/data/person_repeat/language_repeat">
<label>Languages</label>
<repeat nodeset="/data/person_repeat/language_repeat">
<input ref="/data/person_repeat/language_repeat/language">
<label>Language</label>
</input>
</repeat>
</group>
<input ref="/data/person_repeat/country">
<label>Country</label>
</input>
</repeat>
</group>
</h:body>
</h:html>
Loading
Loading