Skip to content

Commit

Permalink
sketch subs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
b1conrad committed Jul 1, 2022
1 parent 8d8b163 commit 69fa6ec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions krl/byu.hr.core.krl
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ ruleset byu.hr.core {
list_subs = subs:established("Tx_role","participant list")
.reverse() // default to latest created
.head()
/*
list_host = list_subs{"Tx_host"} || meta:host
theURL = <<#{list_host}/c/#{list_subs{"Tx"}}/query/byu.hr.oit/index.html>>
fragment = position => "#" + position
| netid => "#" + netid
| ""
theURL.klog("the URL")+fragment
*/
list_eci = list_subs => list_subs{"Tx"} | wrangler:parent_eci()
ctx:query(
list_eci,
Expand All @@ -273,7 +281,7 @@ ruleset byu.hr.core {
thisPico = ctx:channels.any(function(c){c{"id"}==eci})
thisPico => "" | <<<p>
You have a request
from #{wrangler:picoQuery(eci,meta:rid,"displayName")}
from #{wrangler:picoQuery(eci,meta:rid,"displayName")} // ,_host=s{"Tx_host"}
to acknowledge a relationship as
#{s.get("Rx_role")} to
#{s.get("Tx_role")}, respectively.
Expand Down Expand Up @@ -417,7 +425,7 @@ Their role: <input name="Tx_role"> (e.x. virtual team lead)<br>
ls_len = list_subs.length()
getval = function(key){function(s){s{key}}}
list_ecis = ls_len => list_subs.map(getval("Tx"))
| [wrangler:parent_eci()]
| [wrangler:parent_eci()] // shouldn't happen
}
if list_ecis.length() then noop()
fired {
Expand Down

2 comments on commit 69fa6ec

@b1conrad
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new comments only, that sketch in what needs to be done in this ruleset for issue #82.

There should now be a participant subscription for every pico which has this ruleset installed, so we shouldn't need to check for it not being there.

Furthermore, we can no longer assume that all picos are hosted by the same pico engine, so we need to use the Tx_host which is part of subscriptions.

@b1conrad
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to resolve issue #83 before using code like this to get a URL for the list. When we are looking at a participant record, we do not want to show the ECI of its subscription with the list pico, as would happen (in line 252) if we used the new code. Instead we need to use the ECI to the list pico that was assigned to us at the time we logged in. Save this in our session? That is, as a cookie.

Please sign in to comment.