Skip to content

Commit

Permalink
Readding minting capabilities, but adding Power User as audience
Browse files Browse the repository at this point in the history
  • Loading branch information
megoth committed Sep 17, 2019
1 parent 65240e1 commit 647ac66
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions shortChatPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ module.exports = {

name: 'chat',

/*
* As part of the work on merging the existing chat views (aka panes) into one view
* https://github.com/solid/chat-pane/issues/17
* we want to dis-incentivize the use of Small Chat until we've gotten the work done
* by making it difficult to create new data resources that uses the Small Chat view
* but we still want existing resources to be viewed by the Small Chat view
*/
audience: [ns.solid('PowerUser')],

/* AN RRSAgent IRC log:
<irc://localhost:6667/&mit>
Expand Down Expand Up @@ -48,14 +57,37 @@ module.exports = {
return null // Suppress pane otherwise
},

/*
* As part of the work on merging the existing chat views (aka panes) into one view
* https://github.com/solid/chat-pane/issues/17
* we want to dis-incentivize the use of Small Chat until we've gotten the work done
* by making it difficult to create new data resources that uses the Small Chat view
* but we still want existing resources to be viewed by the Small Chat view
* hence we removed the properties mintClass and mintNew
*/
mintClass: ns.meeting('Chat'),

mintNew: function (newPaneOptions) {
var updater = kb.updater
if (newPaneOptions.me && !newPaneOptions.me.uri) throw new Error('chat mintNew: Invalid userid ' + newPaneOptions.me)

var newInstance = newPaneOptions.newInstance = newPaneOptions.newInstance || kb.sym(newPaneOptions.newBase + 'index.ttl#this')
var newChatDoc = newInstance.doc()

kb.add(newInstance, ns.rdf('type'), ns.meeting('Chat'), newChatDoc)
kb.add(newInstance, ns.dc('title'), 'Chat', newChatDoc)
kb.add(newInstance, ns.dc('created'), new Date(), newChatDoc)
if (newPaneOptions.me) {
kb.add(newInstance, ns.dc('author'), newPaneOptions.me, newChatDoc)
}

return new Promise(function (resolve, reject) {
updater.put(
newChatDoc,
kb.statementsMatching(undefined, undefined, undefined, newChatDoc),
'text/turtle',
function (uri2, ok, message) {
if (ok) {
resolve(newPaneOptions)
} else {
reject(new Error('FAILED to save new tool at: ' + uri2 + ' : ' +
message))
};
})
})
},

render: function (subject, dom) {
var complain = function complain (message, color) {
Expand Down

0 comments on commit 647ac66

Please sign in to comment.