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

Removing minting capabilities of Short Chat view #18

Merged
merged 3 commits into from
Sep 23, 2019
Merged
Changes from 2 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
39 changes: 8 additions & 31 deletions shortChatPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,14 @@ 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
* hence we removed the properties mintClass and mintNew
*/

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