Skip to content

Commit 3e83e2d

Browse files
committed
Merge branch 'main' into test/conditional
* main: refactor items to include demo elements Update build_deploy.yml Update build_deploy.yml remove maxLength from demo protocol update contexts and schema versions Update activities/Activity1/items/static_item Update build_deploy.yml Update build_deploy.yml Update build_deploy.yml Update build_deploy.yml Update activities/Activity1/items/static_item Update activities/Activity1/items/static_item fix: change text add variable name add a static item set up automatically fetching checksum
2 parents cf4f71c + 660717b commit 3e83e2d

35 files changed

+152
-85
lines changed

.github/workflows/build_deploy.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,41 @@
22

33
name: CI
44

5-
env:
6-
CHECKSUM: 8c5ca141a109ed3075b65c1da2691648e7fc8b16
75
# Controls when the action will run. Triggers the workflow on push or pull request
86
# events but only for the master branch
97
on:
108
push:
11-
branches: [ master ]
9+
branches: [ main ]
1210
pull_request:
13-
branches: [ master ]
11+
branches: [ main ]
1412

1513
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1614
jobs:
1715
# This workflow contains a single job called "build"
1816
build:
17+
name: Build UI
1918
# The type of runner that the job will run on
2019
runs-on: ubuntu-latest
2120

2221
# Steps represent a sequence of tasks that will be executed as part of the job
2322
steps:
2423

2524
- name: Setup Node
26-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v4
2726
with:
28-
node-version: '12.x'
27+
node-version: '21.x'
28+
# Install jq if it's not already available
29+
- name: Install jq
30+
run: sudo apt-get install jq
2931

32+
# Fetch the latest commit hash
33+
- name: Get latest commit hash from reproschema-ui
34+
run: |
35+
LATEST_HASH=$(curl -s https://api.github.com/repos/ReproNim/reproschema-ui/commits/main | jq -r '.sha')
36+
echo "CHECKSUM=${LATEST_HASH}" >> "$GITHUB_ENV"
37+
3038
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31-
- uses: actions/checkout@v2
39+
- uses: actions/checkout@v4
3240

3341
# Runs a set of commands using the runners shell
3442
- name: Check for syntax errors
@@ -38,15 +46,15 @@ jobs:
3846
grep -r "@context" DemoProtocol | cut -d: -f1 | xargs -I fname jsonlint -q fname
3947
4048
# Validate the protocol
41-
- name: Set up Python 3.8
42-
uses: actions/setup-python@v2
49+
- name: Set up Python 3.11
50+
uses: actions/setup-python@v5
4351
with:
44-
python-version: 3.8
52+
python-version: "3.11"
4553
- name: Install dependencies
4654
run: |
4755
python -m pip install --upgrade pip setuptools
4856
pip install reproschema requests_cache pre-commit
49-
- name: Test with pyshacl
57+
- name: Validate with reproschema
5058
run: |
5159
reproschema -l DEBUG validate activities
5260
reproschema -l DEBUG validate DemoProtocol/DemoProtocol_schema
@@ -64,8 +72,8 @@ jobs:
6472
touch dist/.nojekyll
6573
6674
- name: Deploy 🚀
67-
uses: JamesIves/github-pages-deploy-action@releases/v3
68-
if: github.ref == 'refs/heads/master'
75+
uses: JamesIves/github-pages-deploy-action@v4
76+
if: github.ref == 'refs/heads/main'
6977
with:
7078
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
7179
BRANCH: gh-pages # The branch the action should deploy to.

DemoProtocol/DemoProtocol_schema

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Protocol",
44
"@id": "DemoProtocol_schema",
55
"prefLabel": {
66
"en": "Protocol1",
77
"es": "Protocol1_es"
88
},
99
"description": "example Protocol",
10-
"schemaVersion": "1.0.0-rc2",
10+
"schemaVersion": "1.0.0",
1111
"version": "0.0.1",
1212
"landingPage": [{
1313
"@id": "README.md",
@@ -62,6 +62,7 @@
6262
],
6363
"shuffle": false,
6464
"allow": [
65+
"reproschema:AutoAdvance",
6566
"reproschema:AllowExport"
6667
]
6768
}

activities/Activity1/activity1_schema

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": [ "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": [ "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
{
44
"rl": "https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/"
55
}
@@ -8,10 +8,14 @@
88
"@id": "activity1_schema",
99
"prefLabel": "Screening",
1010
"description": "example of an activity",
11-
"schemaVersion": "1.0.0-rc2",
11+
"schemaVersion": "1.0.0",
1212
"version": "0.0.1",
1313
"ui": {
1414
"addProperties": [
15+
{"isAbout": "items/static_item",
16+
"variableName": "static_item",
17+
"isVis": true
18+
},
1519
{"isAbout": "items/document_upload_item",
1620
"variableName": "document_upload_item",
1721
"isVis": true,
@@ -21,11 +25,11 @@
2125
}
2226
],
2327
"order": [
28+
"items/static_item",
2429
"items/document_upload_item"
2530
],
2631
"shuffle": false,
2732
"allow": [
28-
"reproschema:AutoAdvance",
2933
"reproschema:AllowExport"
3034
]
3135
}

activities/Activity1/items/document_upload_item

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Field",
44
"@id": "document_upload_item",
55
"prefLabel": "document upload item",
66
"description": "This is a document upload item.",
7-
"schemaVersion": "1.0.0-rc2",
7+
"schemaVersion": "1.0.0",
88
"version": "0.0.1",
99
"question": "This is an item where the user can upload a document.",
1010
"ui": {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
3+
"@type": "reproschema:Field",
4+
"@id": "static_item",
5+
"prefLabel": "Static text",
6+
"description": "Display a static text",
7+
"schemaVersion": "1.0.0",
8+
"version": "0.0.1",
9+
"question": {
10+
"en": "You are starting today's activity"
11+
},
12+
"ui": {
13+
"inputType": "static",
14+
"readonlyValue": true
15+
}
16+
}

activities/Activity2/Activity2_schema

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Activity",
44
"@id": "Activity2_schema",
55
"prefLabel": "demo of all input types and widgets",
66
"description": "dummy activity to show all inputs types and widgets",
77
"preamble": "This activity will show you all the different input type and widgets currently available.",
8-
"schemaVersion": "1.0.0-rc1",
8+
"schemaVersion": "1.0.0",
99
"version": "0.0.1",
1010
"ui": {
1111
"addProperties": [
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Field",
44
"@id": "country_item",
55
"prefLabel": "country item",
66
"description": "This is a country item.",
7-
"schemaVersion": "1.0.0-rc2",
7+
"schemaVersion": "1.0.0",
88
"version": "0.0.1",
99
"question": "This is an item where the user can select a country.",
1010
"ui": {
1111
"inputType": "selectCountry"
1212
},
1313
"responseOptions": {
1414
"valueType": "xsd:string",
15-
"maxLength": 50,
1615
"choices": "https://raw.githubusercontent.com/samayo/country-json/master/src/country-by-name.json"
1716
}
1817
}

activities/Activity2/items/date_item

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Field",
44
"@id": "date_item",
55
"prefLabel": "date item",
66
"description": "This is a date item.",
7-
"schemaVersion": "1.0.0-rc2",
7+
"schemaVersion": "1.0.0",
88
"version": "0.0.1",
99
"question": "This is an item where the user can input a date.",
1010
"ui": {

activities/Activity2/items/language_item

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Field",
44
"@id": "language_item",
55
"prefLabel": "language item",
66
"description": "This is a language item.",
7-
"schemaVersion": "1.0.0-rc2",
7+
"schemaVersion": "1.0.0",
88
"version": "0.0.1",
99
"question": "This is an item where the user can select several language.",
1010
"ui": {

activities/Activity2/items/state_item

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc2/contexts/generic",
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
33
"@type": "reproschema:Field",
44
"@id": "state_item",
55
"prefLabel": "state item",
66
"description": "This is a state item.",
7-
"schemaVersion": "1.0.0-rc2",
7+
"schemaVersion": "1.0.0",
88
"version": "0.0.1",
99
"question": "This is an item where the user can select a USA state.",
1010
"ui": {

0 commit comments

Comments
 (0)