From b157c71f4c5f8ae565a61a68c18a3d4debb6fcf7 Mon Sep 17 00:00:00 2001 From: Arne Hassel Date: Mon, 16 Sep 2019 18:51:12 +0200 Subject: [PATCH 1/3] Removing minting capabilities of Short Chat view As part of https://github.com/solid/chat-pane/issues/17 Partial fix for https://github.com/solid/chat-pane/issues/16 --- shortChatPane.js | 69 ++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/shortChatPane.js b/shortChatPane.js index b9c8177..fa8708e 100644 --- a/shortChatPane.js +++ b/shortChatPane.js @@ -48,37 +48,44 @@ module.exports = { return null // Suppress pane otherwise }, - 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)) - }; - }) - }) - }, + /* + * 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 + */ + // 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) { From 65240e1147e238ee8957428443b7a3086776b12a Mon Sep 17 00:00:00 2001 From: Arne Hassel Date: Tue, 17 Sep 2019 10:56:04 +0200 Subject: [PATCH 2/3] Removed commented code - it resides in Git history --- shortChatPane.js | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/shortChatPane.js b/shortChatPane.js index fa8708e..7fef03d 100644 --- a/shortChatPane.js +++ b/shortChatPane.js @@ -54,38 +54,8 @@ module.exports = { * 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) { From 647ac66c413b7cab3a5742bd8e513374f6c642c0 Mon Sep 17 00:00:00 2001 From: Arne Hassel Date: Tue, 17 Sep 2019 12:15:24 +0200 Subject: [PATCH 3/3] Readding minting capabilities, but adding Power User as audience --- shortChatPane.js | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/shortChatPane.js b/shortChatPane.js index 7fef03d..924d433 100644 --- a/shortChatPane.js +++ b/shortChatPane.js @@ -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: @@ -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) {