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

Change barcode type label and icon to also mean QR code #2106

Merged
merged 2 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion jsapp/xlform/src/model.base.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ module.exports = do ->
# @_parent.trigger "change", @key, val, ctxt

# when attributes change, register changes with parent survey
if @key in ["name", "label", "hint", "required",
if @key in ["name", "label", "hint", "guidance_hint", "required",
"calculation", "default", "appearance",
"constraint_message", "tags"] or @key.match(/^.+::.+/)
@on "change", (changes)=>
Expand Down
16 changes: 14 additions & 2 deletions jsapp/xlform/src/model.configs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,17 @@ module.exports = do ->
label:
value: "Acknowledge"

configs.columns = ["type", "name", "label", "hint", "required", "relevant", "default", "constraint"]
configs.columns = [
"type",
"name",
"label",
"hint",
"guidance_hint",
"required",
"relevant",
"default",
"constraint"
]

configs.lookupRowType = do->
typeLabels = [
Expand All @@ -181,7 +191,7 @@ module.exports = do ->
["geotrace", "Geotrace (GPS)"], # Can use satelite GPS coordinates
["geoshape", "Geoshape (GPS)"], # Can use satelite GPS coordinates
["image", "Image", isMedia: true], # Can use phone camera, for example
["barcode", "Barcode"], # Can scan a barcode using the phone camera
["barcode", "Barcode / QR code"], # Can scan a barcode using the phone camera
["date", "Date"], #e.g. (4 July, 1776)
["time", "Time"], #e.g. (4 July, 1776)
["datetime", "Date and Time"], #e.g. (2012-Jan-4 3:04PM)
Expand Down Expand Up @@ -232,6 +242,8 @@ module.exports = do ->
hint:
value: ""
_hideUnlessChanged: true
guidance_hint:
value: ""
required:
value: false
_hideUnlessChanged: true
Expand Down
4 changes: 2 additions & 2 deletions jsapp/xlform/src/view.icons.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ module.exports = do ->
grouping: "r4"
id: "note"
,
label: _t("Barcode")
faClass: "barcode"
label: _t("Barcode / QR Code")
faClass: "qrcode"
grouping: "r4"
id: "barcode"
,
Expand Down
7 changes: 7 additions & 0 deletions jsapp/xlform/src/view.rowDetail.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ module.exports = do ->
afterRender: ->
@listenForInputChange()

viewRowDetail.DetailViewMixins.guidance_hint =
html: ->
@$el.addClass("card__settings__fields--active")
viewRowDetail.Templates.textbox @cid, @model.key, _t("Guidance hint"), 'text'
afterRender: ->
@listenForInputChange()

viewRowDetail.DetailViewMixins.constraint_message =
html: ->
@$el.addClass("card__settings__fields--active")
Expand Down