Skip to content

Commit

Permalink
Merge pull request #353 from georgejecook/fix/mioc-issues
Browse files Browse the repository at this point in the history
Fix/mioc issues
  • Loading branch information
georgejecook authored Apr 24, 2023
2 parents 14c9841 + 3f27408 commit 09e793f
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 49 deletions.
3 changes: 3 additions & 0 deletions bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
{
"src": "**/rooibos-roku/**/*.*"
},
{
"src": "**/rooibos-roku/*.*"
},
1120,
1001,
1128,
Expand Down
73 changes: 43 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@rokucommunity/bslint": "^0.8.1",
"auto-changelog": "^2.2.1",
"brighterscript": "^0.61.3",
"brighterscript": "^0.64.0",
"fs-extra": "^7.0.1",
"maestro-roku-bsc-plugin": "^0.28.4",
"rimraf": "^3.0.2",
Expand Down
11 changes: 0 additions & 11 deletions src-ml-test-app/source/models/Item.bs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import "pkg:/source/core/Utils.bs"

namespace models
' /**
' * @module nba.content.models.Item
' * @description contains info pertinent to items, such as videos, etc.
' */
@node("Item", "ContentNode")
class Item

public json as mc.types.assocarray

' /**
' * @member type
' * @memberof module:nba.models.Item
' * @instance
' * @description Describes the type of the item:
' * types are (video|other|TBD)
' */
public version = 0
public type = ""
public isSerializable = true
Expand Down
2 changes: 1 addition & 1 deletion src/source/core/MIOC.bs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace mioc

function isValidType(instance as dynamic)
instanceType = type(instance)
if instanceType = "roSGNode" or instanceType = "roAssociativeArray" or instanceType = "String" or instanceType = "roArray" or instanceType = "Integer" or instanceType = "Float" or instance = invalid
if instanceType = "roSGNode" or instanceType = "roAssociativeArray" or instanceType = "String" or instanceType = "Integer" or instanceType = "Float" or instance = invalid or GetInterface(instance, "ifString") <> invalid or GetInterface(instance, "ifBoolean") <> invalid or GetInterface(instance, "ifInt") <> invalid or GetInterface(instance, "ifDouble") <> invalid or GetInterface(instance, "ifAssociativeArray") <> invalid or GetInterface(instance, "ifFloat") <> invalid or GetInterface(instance, "ifArray") <> invalid
return true
end if
return false
Expand Down
8 changes: 8 additions & 0 deletions src/source/core/MIOC.spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ namespace tests
m.assertEqual(mioc.getInstance("v2.sub.sub2", "b"), "b")
end function

@it("supports simple values")
function _()
m.assertTrue(mioc.setInstance("v1", "en"))
m.assertEqual(mioc.getInstance("v1"), "en")
m.assertEqual(mioc.getInstance("v1", invalid, ""), "en")
m.assertEqual(mioc.getInstance("v2", invalid, "b"), "b")
end function

end class

end namespace
7 changes: 7 additions & 0 deletions src/source/core/Selection.bs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,12 @@ namespace mc
result: result
})
end function

function setCompletionState(state as string)
if m.itemCompletionState = "pending"
m.itemCompletionState = state
end if
end function

end class
end namespace
8 changes: 4 additions & 4 deletions src/source/view/BaseView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ namespace mv
' for a field
' Views that create their child views from json, will automatically have a _dataMappedControlIds property, which tells this function which controls to apply the data source to.
' Alternately, a _controls_ array can be used to apply the datamap to the passed in array of controls
protected function applyDataMapToControls(dataSource = invalid as dynamic, controls = invalid as mc.types.array) as boolean
if controls <> invalid
for each control in controls
protected function applyDataMapToControls(dataSource = invalid as dynamic, targetControls = invalid as mc.types.array) as boolean
if targetControls <> invalid
for each control in targetControls
mv.applyDataMap(control, dataSource)
end for
return true
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace mv
timeNow = UpTime(0)
' ? "key " ; key ; " P " ; press ; " " ; abs(timeNow - m.lastPressTime)
' if abs(timeNow - m.lastPressTime) < 0.35 and press
' ? " skipping rapid key"
' ? " skipping rapid key"
' m.lastPressTime = timeNow
' return true
' end if
Expand Down
1 change: 0 additions & 1 deletion src/source/view/DialogUtils.bs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace mv
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

public dialog
' private date = new nba.models.Date()

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++ Private Fields
Expand Down
1 change: 0 additions & 1 deletion src/source/view/KeyboardDialogUtils.bs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace mv
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

public dialog
' private date = new nba.models.Date()

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++ Private Fields
Expand Down

0 comments on commit 09e793f

Please sign in to comment.