Skip to content

Commit

Permalink
Patron: Add communication channel
Browse files Browse the repository at this point in the history
* NEW: Add communication channel and communication language

Signed-off-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Feb 15, 2019
1 parent 579e852 commit 9c22dd4
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 9 deletions.
32 changes: 24 additions & 8 deletions data/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
},
"phone": "+39324993585",
"postal_code": "11100",
"street": "Via Croix Noire 3"
"street": "Via Croix Noire 3",
"communication_channel": "email",
"communication_language": "it"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand All @@ -88,7 +90,9 @@
"$ref": "https://ils.rero.ch/api/patron_types/2"
},
"postal_code": "11100",
"street": "Panoramica Collinare, 47"
"street": "Panoramica Collinare, 47",
"communication_channel": "email",
"communication_language": "it"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand Down Expand Up @@ -124,7 +128,9 @@
"$ref": "https://ils.rero.ch/api/patron_types/3"
},
"postal_code": "1950",
"street": "Rue du Nord 7"
"street": "Rue du Nord 7",
"communication_channel": "email",
"communication_language": "fr"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand All @@ -143,7 +149,9 @@
},
"phone": "+1408492280015",
"postal_code": "95054",
"street": "520 Scott Blvd"
"street": "520 Scott Blvd",
"communication_channel": "email",
"communication_language": "en"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand All @@ -162,7 +170,9 @@
},
"phone": "+41795762233",
"postal_code": "1892",
"street": "Route du Village 6"
"street": "Route du Village 6",
"communication_channel": "email",
"communication_language": "fr"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand All @@ -181,7 +191,9 @@
},
"phone": "+41918264239",
"postal_code": "6500",
"street": "Piazza Collegiata 12"
"street": "Piazza Collegiata 12",
"communication_channel": "email",
"communication_language": "it"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand All @@ -200,7 +212,9 @@
},
"phone": "+41792001020",
"postal_code": "1920",
"street": "Gare 45"
"street": "Gare 45",
"communication_channel": "email",
"communication_language": "en"
},
{
"$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json",
Expand All @@ -219,6 +233,8 @@
},
"phone": "+41792500512",
"postal_code": "1926",
"street": "Vignettes 25"
"street": "Vignettes 25",
"communication_channel": "email",
"communication_language": "de"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,39 @@
"remoteRecordType": "patrons"
}
]
},
{
"type": "flex",
"flex-flow": "row wrap",
"items": [
{
"key": "communication_channel",
"required": true,
"htmlClass": "px-2",
"titleMap": {
"email": "Email",
"mail": "Mail"
},
"condition": {
"functionBody": "{ return model.roles? model.roles.includes('patron'): false; }"
}
},
{
"key": "communication_language",
"required": true,
"htmlClass": "px-2",
"type": "select",
"titleMap": {
"en": "English",
"fr": "French",
"de": "German",
"it": "Italian"
},
"condition": {
"functionBody": "{ return model.roles? model.roles.includes('patron'): false; }"
}
}
]
}
]
}
Expand Down
18 changes: 18 additions & 0 deletions rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,24 @@
"patron"
]
}
},
"communication_channel": {
"title": "Communication channel",
"type": "string",
"enum": [
"email",
"mail"
]
},
"communication_language": {
"title": "Communication language",
"type": "string",
"enum": [
"de",
"en",
"fr",
"it"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@
},
"_updated": {
"type": "date"
},
"communication_channel": {
"type": "keyword"
},
"communication_language": {
"type": "keyword"
}
}
}
}
}
}

0 comments on commit 9c22dd4

Please sign in to comment.