@syl, @Zahra just sent me this which sounds the same as the issue which caused @green-loutre troubles last week :
My understanding is that dcs client needs to be installed and then the plugin imported so it can be accessed by the relevant component first’
I thought that we removed the plugin from the React site and were using the Discourse plugin instead now. Is it possible that the confusion is because the guide they are following in your documentation is for sites which have Docuss installed directly into their React platform, which we moved away from for the Discourse 1st system you created? Or am I misinterpreting what’s catching everyone out? There seems to be something which isn’t intuitive from following the guide you linked.
There is no need to install anything, as everything is already set up:
The dcs-discourse-plugin is already installed in your Discourse instance
The dcs-client package is already added to your Meteor build
I think what remains to be done is only to find the right location and insert this code:
import { comToPlugin } from 'dcs-client'
// Get the routeMatcher declared in /imports/client/ui/app.js
const routeMatcher = ...
...
// Place in the code where an event has been successfully created
function onCreateEvent(eventId) {
// Get the page name from the app route. See the doc here:
// https://github.com/sylque/dcs-simple-route-matcher
const pageName = routeMatcher.getPageName('/page/' + eventId)
// Create the Discourse tags with notificationLevel=Watching. See doc here:
// https://github.com/sylque/dcs-client/blob/master/comToPlugin.md#create-docuss-tags-in-advance
comToPlugin.postCreateDcsTags({
pageName,
triggerIds: ['photos', 'videos', 'stories'],
notificationLevel: 3
})
}
The page name can also be retrieved like this: EDIT: NOPE, I DON’T THINK THIS CAN WORK
import websiteJSON from ‘…/…/…/public/dcs-website.json’
…
function onCreateEvent(eventId) {
const pageNamePrefix = websiteJSON.webApp.otherPagesPrefix
const pageName = pageNamePrefix + eventId
…
}
I have added the above code but it does not seem to have fixed the problem. What is the best way to debug this? Maybe the pagename is not being passed in correctly, what should it look like?
Did you make the commit to master, and also push to the deploy branches? If not then it could because I’ve not set up Discourse on the testing server yet
I have made the change to deploy-btm and now getting a console error when creating a new resource in btm: v.comToPlugin.postCreateDcsTags is not a function
my import looks like this:
import { comToPlugin } from ‘dcs-client’
@Zahra, in my previous post here, I suggested 2 options to build the Docuss page name corresponding to a newly created event. You chose to implement my second (and simplest) option. However, I’m now realizing this option doesn’t work (I’ve edited my previous post to remove it). So you need to use option 1. Sorry for the confusion.
P.S.: from what I see in your code, you got the event id right.
Hi guys, i have updated the code to use the route matcher to get the page name instead. It pulls the the page name successfully, the last one i created the page name was ‘m_1q’.
Passing this into postCreateDcsTags still doesnt seem to do the job though. I get a console error when opening the discussion pages:
Latest dcs-d - Docuss Error - Category “General Discussion” not found in Discourse
Is there a step missing from this? Does a particular category need to be sent with the request as well?