Open agarciamontoro opened 4 years ago
Hi, Can I take this?
All yours, @akshitarora921, thanks for working on this :)
Hi @agarciamontorom,
I have a little doubt, According to my research the registry data is coming from {{<pluginjsdocs>}}
from line 81
from file /mattermost-developer-documentation/site/content/integrate/plugins/webapp
but to generate its data we need to run command make plugin-data
and generate json files and we are interested in PluginJSDocs.json
path site/data/PluginJSDocs.json
but I see that json file is also in .gitignore
file. So, where do I need to make the change? as json change will not reflect in the repo.
Go is quite new to me, please pardon me if I am wrong.
PluginJSDocs.json
ooh this is just an adventure through all the files. Correct me if I am wrong. when we run command it actually runs this
rm -rf scripts/mattermost-webapp
cd scripts && git clone https://github.com/mattermost/mattermost-webapp.git
cd scripts && npm install
mkdir -p site/data
node scripts/plugin-jsdocs.js > site/data/PluginJSDocs.json
and get data from this https://github.com/mattermost/mattermost-webapp/blob/master/plugins/registry.js
and spits out PluginJSDocs.json
which we are displaying.
we need to make change in file https://github.com/mattermost/mattermost-webapp/blob/master/plugins/registry.js
to be precise line 197
and whole snippet will look like
store.dispatch({
type: ActionTypes.RECEIVED_PLUGIN_POST_COMPONENT,
data: {
id,
pluginId: this.id,
type,
component,
showTitle
},
});
but then how showTitle
is coming now🤔
Great investigation, @akshitarora921! This is definitely a code maze.
I think the problem is not in the definition of the functions (mattermost-webapp/blob/master/plugins/registry.js
) but with how we retrieve the data from them in the little script in mattermost-developer-documentation/blob/master/scripts/plugin-jsdocs.js
. I believe that the problem may lay in this line: I guess that statement.value.params
contain only the non-optional parameters.
I would try to look into how this data is structured. We parse the file with espree at the beginning of the script, so I'd look into the espree API to see if we're missing something important there. Maybe espree simply does not parse optional parameters? I'm not sure :thinking:
@agarciamontoro this is getting more and more interesting, whenever I look into it. Kudos to the developers who wrote this. 🙌🏼
@akshitarora921 - Are you actively working on this ticket?
No
Thanks for the answer, @akshitarora921, and for all your work!
Feel free to get back at it if you want to, I'll mark the issue up for grabs again.
Whoops, I didn't mean to close the issue. Reopening :)
@agarciamontoro @cwarnermm I will try it. If I solve it, I will ask you to assign me again.
@akshitarora921 - Are you actively working on this ticket?
@cwarnermm No
See, for example, registerAdminConsoleCustomSetting, where
showTitle
is missing:This happens because the default parameters have a different structure in the AST returned by the parser.